summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-16 23:41:18 (UTC)
committer zautrix <zautrix>2005-01-16 23:41:18 (UTC)
commit33c04477896c52e9cfea2a29facd959f82cbf17a (patch) (unidiff)
treed7e5a882604b3bfb64087738dd61d702d2d96a60
parent507b362d42d5eed6277ad17422b6ba61acca636e (diff)
downloadkdepimpi-33c04477896c52e9cfea2a29facd959f82cbf17a.zip
kdepimpi-33c04477896c52e9cfea2a29facd959f82cbf17a.tar.gz
kdepimpi-33c04477896c52e9cfea2a29facd959f82cbf17a.tar.bz2
several fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--kabc/addresseedialog.cpp2
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp12
-rw-r--r--kaddressbook/imagewidget.cpp28
-rw-r--r--kaddressbook/imagewidget.h2
5 files changed, 40 insertions, 7 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index d8f8323..e53127c 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,742 +1,745 @@
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.18 ************ 3********** VERSION 1.9.18 ************
4 4
5FYI: The VERSION 1.9.17 was a testing release only. 5FYI: The VERSION 1.9.17 was a testing release only.
6Please read the changelog of VERSION 1.9.17 as well. 6Please read the changelog of VERSION 1.9.17 as well.
7 7
8Cleaned up the syncing config dialog. 8Cleaned up the syncing config dialog.
9Added sync config options for date range for events. 9Added sync config options for date range for events.
10Added sync config options for filters on incoming data. 10Added sync config options for filters on incoming data.
11Added sync config options for filters on outgoing data. 11Added sync config options for filters on outgoing data.
12Please read the updated SyncHowTo about the new filter settings. 12Please read the updated SyncHowTo about the new filter settings.
13These filter settings make it now possible to sync with shared 13These filter settings make it now possible to sync with shared
14calendars without writing back private or confidential data 14calendars without writing back private or confidential data
15(via the outgoing filters). 15(via the outgoing filters).
16To sync only with particular parts of a shared calendar, 16To sync only with particular parts of a shared calendar,
17the incoming filter settings can be used. 17the incoming filter settings can be used.
18An example can be found in the SyncHowTo. 18An example can be found in the SyncHowTo.
19 19
20KO/Pi: 20KO/Pi:
21The timeedit input has a pulldown list for times. 21The timeedit input has a pulldown list for times.
22If opened, this pulldown list should now has the right time highlighted. 22If opened, this pulldown list should now has the right time highlighted.
23Added the possibility to exclude events/todos/journals in a filter. 23Added the possibility to exclude events/todos/journals in a filter.
24You should exclude journals, if you do not want them to sync with a public calendar. 24You should exclude journals, if you do not want them to sync with a public calendar.
25 25
26KA/Pi: 26KA/Pi:
27Added the possibility to in/exclude public/private/confidential contacts to a filter. 27Added the possibility to in/exclude public/private/confidential contacts to a filter.
28If 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 ... 28If 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 ...
29Added printing of card view and details view on desktop.
30Printing of list view is not working...
31Added button for removing pictures in contact editor.
29 32
30 33
31********** VERSION 1.9.17 ************ 34********** VERSION 1.9.17 ************
32 35
33KO/Pi: 36KO/Pi:
34Fixed that tooltips were not updated after moving an item in agenda view. 37Fixed that tooltips were not updated after moving an item in agenda view.
35Fixed a bug in sorting start date for recurring events in list view. 38Fixed a bug in sorting start date for recurring events in list view.
36Changed the left button in todo viewer from "Agenda" to "Set completed". 39Changed the left button in todo viewer from "Agenda" to "Set completed".
37This 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. 40This 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.
38Added more info in the todo viewer: Startdate, parent/sub todos. 41Added more info in the todo viewer: Startdate, parent/sub todos.
39 42
40 43
41KA/Pi: 44KA/Pi:
42All fields search does now actually search all the (possible) fields, 45All fields search does now actually search all the (possible) fields,
43not only those listed in the contact list. 46not only those listed in the contact list.
44Made is possible to inline a picture in a vcard on the Z. 47Made is possible to inline a picture in a vcard on the Z.
45This was only possible on the desktop, now is it possible on the Z as well. 48This was only possible on the desktop, now is it possible on the Z as well.
46Fixed of missing save settings after filter configuration. 49Fixed of missing save settings after filter configuration.
47Made saving of addressbook much faster. 50Made saving of addressbook much faster.
48Fixed extension widget layout problem. 51Fixed extension widget layout problem.
49Fixed saving of default formatted name settings. 52Fixed saving of default formatted name settings.
50Fixed formatted name handling in edit dialog. 53Fixed formatted name handling in edit dialog.
51Added an option for changing formatted names of many contacts 54Added an option for changing formatted names of many contacts
52(menu: File - Change - Set formatted name). 55(menu: File - Change - Set formatted name).
53 56
54QWhatsThis was not working on the Z ( only black rectangle was shown). 57QWhatsThis was not working on the Z ( only black rectangle was shown).
55This is Fixed. 58This is Fixed.
56 59
57KDE-Sync: 60KDE-Sync:
58Now readonly KDE resources are synced as well. 61Now readonly KDE resources are synced as well.
59(They are not changed in KDE itself, of course). 62(They are not changed in KDE itself, of course).
60 63
61 64
62 65
63********** VERSION 1.9.16 ************ 66********** VERSION 1.9.16 ************
64 67
65KO/Pi: 68KO/Pi:
66Fixed search dialog size on Z 6000 (480x640 display). 69Fixed search dialog size on Z 6000 (480x640 display).
67Added setting to hide/show time in agenda items. 70Added setting to hide/show time in agenda items.
68Added setting to hide not running todos in todo view. 71Added setting to hide not running todos in todo view.
69Added columns for start date/time in todo view. 72Added columns for start date/time in todo view.
70Replaced the solid half-hour lines in agenda view by dot lines. 73Replaced the solid half-hour lines in agenda view by dot lines.
71Added possibility of printing the What's Next View on the desktop 74Added possibility of printing the What's Next View on the desktop
72(i.e. Windows and Linux). 75(i.e. Windows and Linux).
73Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. 76Fixed a crash in KO/Pi when starting KO/Pi with What's Next view.
74Added tooltips in month view.(Tooltips only available on desktop) 77Added tooltips in month view.(Tooltips only available on desktop)
75 78
76Fixed a strange problem in KO/Pi alarm applet. 79Fixed a strange problem in KO/Pi alarm applet.
77Did not find the actual problem, 80Did not find the actual problem,
78such that now Qtopia reboots again if deinstalling the alarm applet. 81such that now Qtopia reboots again if deinstalling the alarm applet.
79But the alarm applet should work again. 82But the alarm applet should work again.
80 83
81KA/Pi: 84KA/Pi:
82Fixed the problem, that internal pictures were not saved. 85Fixed the problem, that internal pictures were not saved.
83 86
84Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. 87Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes.
85 88
86Fixed some minor problems. (Like word wrap in help text windows). 89Fixed some minor problems. (Like word wrap in help text windows).
87 90
88Fixed a compiling problem in microkde/kresources. 91Fixed a compiling problem in microkde/kresources.
89 92
90KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. 93KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM.
91This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) 94This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9)
92such that now syncing KO/Pi with Sharp DTM should work on the 95such that now syncing KO/Pi with Sharp DTM should work on the
93Zaurus C 3000 model. 96Zaurus C 3000 model.
94 97
95********** VERSION 1.9.15 ************ 98********** VERSION 1.9.15 ************
96 99
97Usebilty enhancements in KO/Pi: 100Usebilty enhancements in KO/Pi:
98When clicking on the date in a month view cell, the day view is shown. 101When clicking on the date in a month view cell, the day view is shown.
99Old behaviour was, that the "new event" dialog popped up. 102Old behaviour was, that the "new event" dialog popped up.
100 103
101Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). 104Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
102That means, you can restore the latest 105That means, you can restore the latest
103event/todo/journal you have deleted. 106event/todo/journal you have deleted.
104A journal is deleted, if you clear all the text of the journal. 107A journal is deleted, if you clear all the text of the journal.
105 108
106Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. 109Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14.
107 110
108KA/Pi starting in 480x640 resolution: 111KA/Pi starting in 480x640 resolution:
109Hide the filter action in toolbar 112Hide the filter action in toolbar
110and added icons for undo/delete/redo in toolbar. 113and added icons for undo/delete/redo in toolbar.
111 114
112Change in OM/Pi ViewMail dialog: 115Change in OM/Pi ViewMail dialog:
113When clicking on the "delete" icon the mail is deleted after confirmation as usual. 116When clicking on the "delete" icon the mail is deleted after confirmation as usual.
114But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). 117But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any).
115 118
116Fixed a crash when deleting mail-accounts in OM/Pi. 119Fixed a crash when deleting mail-accounts in OM/Pi.
117 120
118 121
119********** VERSION 1.9.14 ************ 122********** VERSION 1.9.14 ************
120 123
121Fixed some problems with the dialog sizes when switching 124Fixed some problems with the dialog sizes when switching
122portrait/landscape mode on 640x480 PDA display. 125portrait/landscape mode on 640x480 PDA display.
123 126
124Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. 127Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi.
125 128
126Fixed an ugly bug in KOpieMail: 129Fixed an ugly bug in KOpieMail:
127KOpieMail was not able to write files (mails) to MSDOS file system, 130KOpieMail was not able to write files (mails) to MSDOS file system,
128like on an usual preformatted SD card. That should work now. 131like on an usual preformatted SD card. That should work now.
129To save your mail data on the Sd card do the following: 132To save your mail data on the Sd card do the following:
130Create a dir on the SD card: 133Create a dir on the SD card:
131mkdir /mnt/card/localmail 134mkdir /mnt/card/localmail
132Go to your home dir: 135Go to your home dir:
133cd 136cd
134Go to kopiemail data storage dir: 137Go to kopiemail data storage dir:
135cd kdepim/apps/kopiemail 138cd kdepim/apps/kopiemail
136Create a symlink to the SD card: 139Create a symlink to the SD card:
137ls -s /mnt/card/localmail 140ls -s /mnt/card/localmail
138Now KOpieMail will store all mails on the SD card. 141Now KOpieMail will store all mails on the SD card.
139 142
140KO/Pi Monthview: 143KO/Pi Monthview:
141Now "Go to Today" selects the current month from day 1-end, 144Now "Go to Today" selects the current month from day 1-end,
142not the current date + some days. 145not the current date + some days.
143I.e. "Go to Today" shows now always 146I.e. "Go to Today" shows now always
144the current month with first day of month in the first row. 147the current month with first day of month in the first row.
145 148
146Added missing German translation. 149Added missing German translation.
147 150
148Fixed icons of executeable on Wintendo. 151Fixed icons of executeable on Wintendo.
149 152
150Added a "Show next Mail" button to the OM/Pi 153Added a "Show next Mail" button to the OM/Pi
151mail viewer such that the mail below the current mail 154mail viewer such that the mail below the current mail
152in the mail list view of the current folder 155in the mail list view of the current folder
153can be read with a single click. 156can be read with a single click.
154 157
155 158
156********** VERSION 1.9.13 ************ 159********** VERSION 1.9.13 ************
157 160
158Fixed nasty PwM/Pi file reading bug, when 161Fixed nasty PwM/Pi file reading bug, when
159the used hash algo of file is different then the global 162the used hash algo of file is different then the global
160hash algo. 163hash algo.
161 164
162Added KA/Pi support for opie mailit mailapplication. 165Added KA/Pi support for opie mailit mailapplication.
163 166
164Fixed some bugs in OM/Pi. 167Fixed some bugs in OM/Pi.
165Now character conversion tables are available for the Zaurus 168Now character conversion tables are available for the Zaurus
166to make OM/Pi working properly. 169to make OM/Pi working properly.
167To get the character conversion in OM/Pi working, please download 170To get the character conversion in OM/Pi working, please download
168at the sourceforge project site the package 171at the sourceforge project site the package
169sr-character-conversion_SharpROM_arm.ipk.zip 172sr-character-conversion_SharpROM_arm.ipk.zip
170(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) 173(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms)
171from the section "general files for KDE/Pim" 174from the section "general files for KDE/Pim"
172Instructions how to install this package are in a ReadMe in this file. 175Instructions how to install this package are in a ReadMe in this file.
173 176
174 177
175Fixed the orientation change problem in KA/Pi when switching 178Fixed the orientation change problem in KA/Pi when switching
176portrait/landscape mode. 179portrait/landscape mode.
177 180
178French translation available for KA/Pi and OM/Pi. 181French translation available for KA/Pi and OM/Pi.
179 182
180Fixed some problems with categories in KO/Pi in DTM sync. 183Fixed some problems with categories in KO/Pi in DTM sync.
181 184
182Added selection dialog for export to phone in KA/Pi. 185Added selection dialog for export to phone in KA/Pi.
183 186
184If in KO/Pi is an attendee selected to add to a meeting and this 187If in KO/Pi is an attendee selected to add to a meeting and this
185attendee is already in the list of attendees, this person is not added 188attendee is already in the list of attendees, this person is not added
186again. 189again.
187 190
188Some menu cleanup in KA/Pi. 191Some menu cleanup in KA/Pi.
189 192
190********** VERSION 1.9.12 ************ 193********** VERSION 1.9.12 ************
191 194
192Fix for the bug in KO/Pi What's Next view of version 1.9.11. 195Fix for the bug in KO/Pi What's Next view of version 1.9.11.
193 196
194Bugfix: Licence file is now shown again. 197Bugfix: Licence file is now shown again.
195 198
196OM/Pi now supports Unicode (utf8 charset). 199OM/Pi now supports Unicode (utf8 charset).
197Fixed some bugs in OM/Pi. 200Fixed some bugs in OM/Pi.
198 201
199KA/Pi has more German translation. 202KA/Pi has more German translation.
200 203
201 204
202********** VERSION 1.9.11 ************ 205********** VERSION 1.9.11 ************
203 206
204Fixed several problems in PWM/Pi, like 207Fixed several problems in PWM/Pi, like
205asking the user, if unsaved changed are pending 208asking the user, if unsaved changed are pending
206when closing the app. 209when closing the app.
207And PwM/Pi handles now different texts for the 210And PwM/Pi handles now different texts for the
208fields Description, Username, Password, configurable per category. 211fields Description, Username, Password, configurable per category.
209 212
210Fixed a crash in KO/Pi , when importing/loading vcs files 213Fixed a crash in KO/Pi , when importing/loading vcs files
211which have an entry with an attendee with state: 214which have an entry with an attendee with state:
212NEEDS ACTION 215NEEDS ACTION
213 216
214Fixed some problems in the German translation of OM/Pi, 217Fixed some problems in the German translation of OM/Pi,
215which makes some dialogs not fitting on the screen 218which makes some dialogs not fitting on the screen
216of the Z 5500. 219of the Z 5500.
217 220
218Fixed Qtopia crash, when disabling/deinstalling 221Fixed Qtopia crash, when disabling/deinstalling
219KO/Pi alarm applet. 222KO/Pi alarm applet.
220 223
221Implemented direct KDE<->KA/Pi sync for KA/Pi running 224Implemented direct KDE<->KA/Pi sync for KA/Pi running
222on Linux desktop. 225on Linux desktop.
223 226
224Added feature "remove sync info" to sync menu. 227Added feature "remove sync info" to sync menu.
225 228
226Tweaked the KO/Pi What's next view a bit, added 229Tweaked the KO/Pi What's next view a bit, added
227setting to hide events that are done. 230setting to hide events that are done.
228 231
229Disabled "beam receive enabled" on startup to 232Disabled "beam receive enabled" on startup to
230avoid problems if Fastload is enabled. 233avoid problems if Fastload is enabled.
231Please set "beam receive enabled", 234Please set "beam receive enabled",
232if you want to receive data via IR. 235if you want to receive data via IR.
233 236
234Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running 237Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running
235on Linux desktop. 238on Linux desktop.
236 239
237Made in KA/Pi scrolling possible, if details view is selected. 240Made in KA/Pi scrolling possible, if details view is selected.
238(The keyboard focus is set automatically to the search line) 241(The keyboard focus is set automatically to the search line)
239 242
240Fixed a bug in DMT sync, that a new entry in DTM was added 243Fixed a bug in DMT sync, that a new entry in DTM was added
241on every sync to Kx/Pi. 244on every sync to Kx/Pi.
242 245
243Fixed missing writing of KA/Pi categories to DMT entries when syncing. 246Fixed missing writing of KA/Pi categories to DMT entries when syncing.
244 247
245Fixed a bug in DMT sync with todos created in KO/Pi containing 248Fixed a bug in DMT sync with todos created in KO/Pi containing
246non-latin1 characters. 249non-latin1 characters.
247 250
248Rearranged package contents of Sharp-ipks and made all 251Rearranged package contents of Sharp-ipks and made all
249packages installable on SD again. 252packages installable on SD again.
250 253
251Fixed the writing of addressbook data in DTM sync. 254Fixed the writing of addressbook data in DTM sync.
252Empty fields in KA/Pi were not removed. 255Empty fields in KA/Pi were not removed.
253 256
254Added better category handling in KA/Pi: 257Added better category handling in KA/Pi:
255Added item 258Added item
256Edit Categories and 259Edit Categories and
257Manage new categories 260Manage new categories
258to the settings menu. 261to the settings menu.
259Possible to configure a view to display categories. 262Possible to configure a view to display categories.
260 263
261Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. 264Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu.
262 265
263Fixed displaying of "free" days and time in KO Monthview and Agendaview. 266Fixed displaying of "free" days and time in KO Monthview and Agendaview.
264 267
265... and many other bugfixes. 268... and many other bugfixes.
266 269
267********** VERSION 1.9.10 ************ 270********** VERSION 1.9.10 ************
268 271
269Many internal small bugfixes. 272Many internal small bugfixes.
270And fix of the "big" bug in KO/Pi, 273And fix of the "big" bug in KO/Pi,
271that after Syncing the appointments had an offset by several hours. 274that after Syncing the appointments had an offset by several hours.
272That was a problem with the internal timezone setting, 275That was a problem with the internal timezone setting,
273introduced by the changed timezone configuration settings. 276introduced by the changed timezone configuration settings.
274 277
275German translation for OM/Pi is now available. 278German translation for OM/Pi is now available.
276 279
277 280
278********** VERSION 1.9.9 ************ 281********** VERSION 1.9.9 ************
279 282
280KDE-Pim/Pi has a new Member! 283KDE-Pim/Pi has a new Member!
281It is called PWM/Pi (Passwordmanager/platform-independent) 284It is called PWM/Pi (Passwordmanager/platform-independent)
282and it is available for the Zaurus. 285and it is available for the Zaurus.
283It is planned, that it will be available later for Windows. 286It is planned, that it will be available later for Windows.
284(And for Linux, of course). 287(And for Linux, of course).
285It is a port of the Passwordmanager of KDE. 288It is a port of the Passwordmanager of KDE.
286It will need the MicroKDElibs to run. 289It will need the MicroKDElibs to run.
287 290
288Made loading of addressbooks in KA/Pi up to 7 times faster! 291Made loading of addressbooks in KA/Pi up to 7 times faster!
289The bigger your addressbook file, the more starting speed 292The bigger your addressbook file, the more starting speed
290will you gain. (relatively) 293will you gain. (relatively)
291 294
292The Qtopia addressbook connector is now platform independend 295The Qtopia addressbook connector is now platform independend
293as well and should work on any platform for importing/exporting 296as well and should work on any platform for importing/exporting
294Qtopia and Opie XML files. 297Qtopia and Opie XML files.
295 298
296Added a +30min feature to the timezone settings to make 299Added a +30min feature to the timezone settings to make
297KDE-Pim/Pi useable in Australia and other parts on the 300KDE-Pim/Pi useable in Australia and other parts on the
298world with strange timezones ;-) 301world with strange timezones ;-)
299 302
300German "Umlaute" should now be sorted correctly on the Z in KA/Pi. 303German "Umlaute" should now be sorted correctly on the Z in KA/Pi.
301 304
302It is now possible to disable the 305It is now possible to disable the
303"receive data via infrared" feature, such that syncing with 306"receive data via infrared" feature, such that syncing with
304Outlook is now possible again with Kx/Pi runing. 307Outlook is now possible again with Kx/Pi runing.
305Please disable it, before syncing Sharp DTM with Outlook. 308Please disable it, before syncing Sharp DTM with Outlook.
306For your convenience, the "receive data via infrared" feature 309For your convenience, the "receive data via infrared" feature
307is disabled automatically, if you sync Kx/Pi with DTM. 310is disabled automatically, if you sync Kx/Pi with DTM.
308You have to enable it again manually after syncing. 311You have to enable it again manually after syncing.
309Enabling this feature makes it impossible to start the 312Enabling this feature makes it impossible to start the
310Sharp DTM apps. If this feature is enabled, you will only get the 313Sharp DTM apps. If this feature is enabled, you will only get the
311alarm notification from KO/Pi and not from the Sharp calendar. 314alarm notification from KO/Pi and not from the Sharp calendar.
312This is very useful if you sync KO/Pi with Sharp DTM, 315This is very useful if you sync KO/Pi with Sharp DTM,
313because after syncing you usually would get notified about 316because after syncing you usually would get notified about
314an alarm by KO/Pi and the Sharp Calendar. 317an alarm by KO/Pi and the Sharp Calendar.
315 318
316Together with the Linux desktop version of KO/Pi 319Together with the Linux desktop version of KO/Pi
317it is now possible to sync KO/Pi on the Zaurus 320it is now possible to sync KO/Pi on the Zaurus
318with the complete KDE-desktop (3.3 or later) 321with the complete KDE-desktop (3.3 or later)
319calendar data easily. 322calendar data easily.
320That makes it possible to sync the Z with one 323That makes it possible to sync the Z with one
321click of a mouse with the KDE-Desktop. 324click of a mouse with the KDE-Desktop.
322This feature it available for all Zaurus platforms KO/Pi 325This feature it available for all Zaurus platforms KO/Pi
323is running on. 326is running on.
324The only thing needed is a running KO/Pi on Linux and 327The only thing needed is a running KO/Pi on Linux and
325a compiled version of the small 328a compiled version of the small
326KDE-Pim/Pi<->KDE-Desktop access command line program, 329KDE-Pim/Pi<->KDE-Desktop access command line program,
327which is in the KDE-Pim/Pi sources available. 330which is in the KDE-Pim/Pi sources available.
328 331
329The "KDE-desktop" syncing feature for KA/Pi will follow 332The "KDE-desktop" syncing feature for KA/Pi will follow
330in the next releases. 333in the next releases.
331 334
332Fixed the vcard export bug, which had the version 1.9.8. 335Fixed the vcard export bug, which had the version 1.9.8.
333 336
334Added missing GERMAN translation to KO/Pi. 337Added missing GERMAN translation to KO/Pi.
335Hi PsionX, could you add the missing french translation?Thx! 338Hi PsionX, could you add the missing french translation?Thx!
336 339
337Translation files for KA/Pi are available as well. 340Translation files for KA/Pi are available as well.
338GERMAN translation will be available in the next release. 341GERMAN translation will be available in the next release.
339PsionX ( yres, you again ;-) ), could you start translating 342PsionX ( yres, you again ;-) ), could you start translating
340KA/Pi? Thx! 343KA/Pi? Thx!
341 344
342You can download the version 1.9.9 at 345You can download the version 1.9.9 at
343 346
344http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 347http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604
345 348
346Note: 349Note:
347To run the mail program OM/Pi you need libopenssl. 350To run the mail program OM/Pi you need libopenssl.
348A link to a download loaction is available at 351A link to a download loaction is available at
349ZSI at www.killefiz.de 352ZSI at www.killefiz.de
350 353
351 354
352********** VERSION 1.9.8 ************ 355********** VERSION 1.9.8 ************
353 356
354Fixed character decoding in OM/Pi. 357Fixed character decoding in OM/Pi.
355(e.g. German "Umlaute" were not displayed properly.) 358(e.g. German "Umlaute" were not displayed properly.)
356 359
357Made is possible to reparent todos in KO/Pi. 360Made is possible to reparent todos in KO/Pi.
358Use contextmenu or keys (look at Help-Keys + Colors) for that. 361Use contextmenu or keys (look at Help-Keys + Colors) for that.
359 362
360Added the missing Sync-Howto and WhatsNew to the packages. 363Added the missing Sync-Howto and WhatsNew to the packages.
361 364
362KO/Pi on Linux desktop can now sync with KDE desktop. 365KO/Pi on Linux desktop can now sync with KDE desktop.
363That means: When using KO/Pi on Linux desktop for syncing with 366That means: When using KO/Pi on Linux desktop for syncing with
364KDE desktop and the Zaurus, the Zaurus can be synced now 367KDE desktop and the Zaurus, the Zaurus can be synced now
365with all KDE-Calendar resources, not only with one local file. 368with all KDE-Calendar resources, not only with one local file.
366(That makes it possible to sync the Zaurus with the 369(That makes it possible to sync the Zaurus with the
367calendar data on a Kolab server) 370calendar data on a Kolab server)
368 371
369KA/Pi syncing with KDE desktop will be available in the next version. 372KA/Pi syncing with KDE desktop will be available in the next version.
370 373
371 374
372********** VERSION 1.9.7 ************ 375********** VERSION 1.9.7 ************
373 376
374KO/Pi - KA/Pi on Windows: 377KO/Pi - KA/Pi on Windows:
375Now a directory can be defined by the user, where the 378Now a directory can be defined by the user, where the
376application/config data should be saved. 379application/config data should be saved.
377 Define your desired path in the evironment variable 380 Define your desired path in the evironment variable
378 MICROKDEHOME 381 MICROKDEHOME
379 before starting KO/Pi or KA/Pi. 382 before starting KO/Pi or KA/Pi.
380 383
381An easy Kx/Pi to Kx/Pi syncing is now possible 384An easy Kx/Pi to Kx/Pi syncing is now possible
382(it is called Pi-Sync) via network. 385(it is called Pi-Sync) via network.
383Please look at the Sync Howto. 386Please look at the Sync Howto.
384 387
385Exporting of calendar data and contacts to mobile phones is now possible. 388Exporting of calendar data and contacts to mobile phones is now possible.
386The SyncHowto is updated with information howto 389The SyncHowto is updated with information howto
387access/sync mobile phones. 390access/sync mobile phones.
388Please look at the Sync Howto. 391Please look at the Sync Howto.
389 392
390Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. 393Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly.
391Please disable Fastload for the original contact/calendar applications 394Please disable Fastload for the original contact/calendar applications
392and close them. 395and close them.
393KO/Pi and KA/Pi must be running in order to receive the data. 396KO/Pi and KA/Pi must be running in order to receive the data.
394(KO/Pi and KA/Pi are always running if Fastload for them is enabled!) 397(KO/Pi and KA/Pi are always running if Fastload for them is enabled!)
395 398
396In the KA/Pi details view are now the preferred tel. numbers displayed on top 399In the KA/Pi details view are now the preferred tel. numbers displayed on top
397of the other data ( emails/tel.numbers/addresses) 400of the other data ( emails/tel.numbers/addresses)
398 401
399Fixed some syncing problems in KA/Pi. 402Fixed some syncing problems in KA/Pi.
400 403
401Added font settings for the KA/Pi details view. 404Added font settings for the KA/Pi details view.
402Added fields "children's name" and "gender" to KA/Pi. 405Added fields "children's name" and "gender" to KA/Pi.
403 406
404Made searching in KA/Pi better: 407Made searching in KA/Pi better:
405Now the first item in a view is selected after a search automatically and 408Now the first item in a view is selected after a search automatically and
406the views can be scrolled up/down when the search input field has the keyboard focus. 409the views can be scrolled up/down when the search input field has the keyboard focus.
407 410
408And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. 411And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi.
409 412
410 413
411********** VERSION 1.9.6 ************ 414********** VERSION 1.9.6 ************
412 415
413Changes in the external application communication on the Zaurus 416Changes in the external application communication on the Zaurus
414in order to use less RAM when the apps are running. 417in order to use less RAM when the apps are running.
415First syncing of addressbooks (KA/Pi) is possible. 418First syncing of addressbooks (KA/Pi) is possible.
416 419
417 420
418********** VERSION 1.9.5a ************ 421********** VERSION 1.9.5a ************
419 422
420Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. 423Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5.
421Fixed some small bugs. 424Fixed some small bugs.
422KA/Pi shows now the birthday in summary view. 425KA/Pi shows now the birthday in summary view.
423Now OM/Pi and KA/Pi are using the date format defined in KO/Pi 426Now OM/Pi and KA/Pi are using the date format defined in KO/Pi
424for displaying dates. 427for displaying dates.
425 428
426 429
427********** VERSION 1.9.5 ************ 430********** VERSION 1.9.5 ************
428 431
429There is still no Addressbook syncing! 432There is still no Addressbook syncing!
430 433
431New in 1.9.5: 434New in 1.9.5:
432 435
433Many bugfixes. 436Many bugfixes.
434Better searching in KA/Pi. 437Better searching in KA/Pi.
435You can configure in KA/Pi if you want to search only after 438You can configure in KA/Pi if you want to search only after
436<return> key pressed. 439<return> key pressed.
437 440
438Better mail downloading in OM/Pi. 441Better mail downloading in OM/Pi.
439 442
440First experimental alpha version of sync of KO/Pi with mobile phones. 443First experimental alpha version of sync of KO/Pi with mobile phones.
441See gammu documentation for supported phones. 444See gammu documentation for supported phones.
442You 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. 445You 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.
443Quick hint how to use: 446Quick hint how to use:
444NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! 447NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL!
445Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. 448Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp.
446Create syncprofile - mobile device 449Create syncprofile - mobile device
447Remove entry for model. (Leave empty ). 450Remove entry for model. (Leave empty ).
448Enable infrared on Zaurus and your Phone. 451Enable infrared on Zaurus and your Phone.
449Sync. 452Sync.
450To get a more detailed log, start kopi from konsole. 453To get a more detailed log, start kopi from konsole.
451 454
452********** VERSION 1.9.4 ************ 455********** VERSION 1.9.4 ************
453 456
454This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. 457This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus.
455 458
456WARNING: 459WARNING:
457PLEASE BACKUP ALL YOUR DATA! 460PLEASE BACKUP ALL YOUR DATA!
458We have changed a lot and maybe there are some unknown problems. 461We have changed a lot and maybe there are some unknown problems.
459 462
460SYNC HANDLING HAS CHANGED! 463SYNC HANDLING HAS CHANGED!
461Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 464Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
462(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 465(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
463 466
464You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. 467You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs.
465If 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. 468If 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.
466 469
467As programs are available: 470As programs are available:
468KO/Pi (korganizer ipk) - a calendar program. 471KO/Pi (korganizer ipk) - a calendar program.
469KA/Pi (kaddressbook ipk ) - an addressbook 472KA/Pi (kaddressbook ipk ) - an addressbook
470OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. 473OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support.
471 474
472An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. 475An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode.
473(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) 476(If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia)
474 477
475All the applications are installed in a "Pim" TAB. 478All the applications are installed in a "Pim" TAB.
476If 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 479If 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
477 480
478All the application are integrated. 481All the application are integrated.
479Such 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. 482Such 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.
480 483
481HINT: 484HINT:
482If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. 485If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number.
483 486
484What's new? 487What's new?
485 488
486SYNC HANDLING HAS CHANGED! 489SYNC HANDLING HAS CHANGED!
487Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. 490Such that, if you sync now with an already synded device, you will duplicated entries after the first sync.
488(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). 491(This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks).
489 492
490New in OM/Pi: 493New in OM/Pi:
491When 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. 494When 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.
492 495
493New in KO/Pi: 496New in KO/Pi:
494French is now available for KO/Pi. 497French is now available for KO/Pi.
495Choose menu:Actions - Configure:TAB locale 498Choose menu:Actions - Configure:TAB locale
496Syncing has changed. 499Syncing has changed.
497Phone sync available soon. 500Phone sync available soon.
498Not much changes, I cannot remember them ... 501Not much changes, I cannot remember them ...
499 502
500New in KA/Pi: 503New in KA/Pi:
501Beaming possible. 504Beaming possible.
502Sharp DTM readonly access possible( create a new DTM resource ); 505Sharp DTM readonly access possible( create a new DTM resource );
503Better searching possible. 506Better searching possible.
504Search is performed only after pressing the return key. 507Search is performed only after pressing the return key.
505Use wildcard * to specify parts of a name. 508Use wildcard * to specify parts of a name.
506 509
507Better 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 * . 510Better 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 * .
508 511
509A big improvement is the new management of the contact access. 512A big improvement is the new management of the contact access.
510In version 1.9.3, every application was using their own addressbook access data. 513In version 1.9.3, every application was using their own addressbook access data.
511That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. 514That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi.
512That was wasting of memory, if you had several hundreds of contacts. 515That was wasting of memory, if you had several hundreds of contacts.
513 516
514Now only KA/Pi accesses the addressbook. 517Now only KA/Pi accesses the addressbook.
515If 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. 518If 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.
516If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. 519If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly.
517That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. 520That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first.
518 521
519New in the KO/Pi alarm applet: 522New in the KO/Pi alarm applet:
520Configure your own timer popup menu! 523Configure your own timer popup menu!
521(Text and minutes for timer countdown) 524(Text and minutes for timer countdown)
522Just edit the file 525Just edit the file
523(yourhomedir)/.kopialarmtimerrc 526(yourhomedir)/.kopialarmtimerrc
524and start/stop a timer to get a new menu with the data of this file. 527and start/stop a timer to get a new menu with the data of this file.
525 528
526********** VERSION 1.9.3 ************ 529********** VERSION 1.9.3 ************
5271) 5301)
528Now KO/Pi on Windows imports directly the calendar data of 531Now KO/Pi on Windows imports directly the calendar data of
529an installed Outlook. Should work with OL version >= 2000. 532an installed Outlook. Should work with OL version >= 2000.
530 533
531********** VERSION 1.9.2 ************ 534********** VERSION 1.9.2 ************
5321) 5351)
533KDE-Pim/Pi has got a new member: 536KDE-Pim/Pi has got a new member:
534KmicroMail (KM/Pi) is a mail program, 537KmicroMail (KM/Pi) is a mail program,
535which can handle IMAP and POP mail access. 538which can handle IMAP and POP mail access.
536It is based on Opie-Mail v3. 539It is based on Opie-Mail v3.
537All dependencies to the Opie libraries ar removed, 540All dependencies to the Opie libraries ar removed,
538such that no additional Opie lib is needed. 541such that no additional Opie lib is needed.
539It is already integrated in KO/Pi and KA/Pi. 542It is already integrated in KO/Pi and KA/Pi.
540It it now available for the Zaurus,probably it 543It it now available for the Zaurus,probably it
541will be available for other platforms later. 544will be available for other platforms later.
542Hint: 545Hint:
543Create your own contact (name + email) 546Create your own contact (name + email)
544in KA/Pi, select this contact and choose menu: 547in KA/Pi, select this contact and choose menu:
545Settings - Set Who Am I. 548Settings - Set Who Am I.
546Now the settings of this contact are used as 549Now the settings of this contact are used as
547the sender data in KM/Pi. 550the sender data in KM/Pi.
5482) 5512)
549KDE-Pim/Pi is split up in five different 552KDE-Pim/Pi is split up in five different
550packages now precompiled for Sharp Zaurus: 553packages now precompiled for Sharp Zaurus:
551--kmicrokdelibs_1.9.2_arm.ipk 554--kmicrokdelibs_1.9.2_arm.ipk
552The libs are needed for any 555The libs are needed for any
553of the following programs: 556of the following programs:
554--kaddressbook_1.9.2_arm.ipk 557--kaddressbook_1.9.2_arm.ipk
555--kmicromail_1.9.2_arm.ipk 558--kmicromail_1.9.2_arm.ipk
556--korganizer_1.9.2_arm.ipk 559--korganizer_1.9.2_arm.ipk
557Independ from that, there is the alarm applet 560Independ from that, there is the alarm applet
558available for KO/Pi, which also offers 561available for KO/Pi, which also offers
559quick access for a new mail or 562quick access for a new mail or
560showing the addressbook.: 563showing the addressbook.:
561--korganizer-alarm_1.9.2_arm.ipk 564--korganizer-alarm_1.9.2_arm.ipk
562Independend means, that the alarm applet 565Independend means, that the alarm applet
563does not need any of the libs or programs above to run. 566does not need any of the libs or programs above to run.
564But it would be quite useless without these programs. 567But it would be quite useless without these programs.
565NOTE: 568NOTE:
566If you get a 569If you get a
567"This application depends on other programs" 570"This application depends on other programs"
568during installation of 571during installation of
569--kmicrokdelibs_1.9.2_arm.ipk 572--kmicrokdelibs_1.9.2_arm.ipk
570you probably do not have to care about that. 573you probably do not have to care about that.
571kmicrokdelibs_1.9.2 will come with some 574kmicrokdelibs_1.9.2 will come with some
572resource plugins, which needs additional libraries. 575resource plugins, which needs additional libraries.
573(E.g. libopie1, if you want to use the 576(E.g. libopie1, if you want to use the
574opie resource connector in KA/Pi). 577opie resource connector in KA/Pi).
575If you do not have this libraries installed, 578If you do not have this libraries installed,
576you simply cannot use the resource. 579you simply cannot use the resource.
577To make it clear: 580To make it clear:
578If the libraries are missing, the applications 581If the libraries are missing, the applications
579using kmicrokdelibs will start, 582using kmicrokdelibs will start,
580because the resources are plugins. 583because the resources are plugins.
5813) 5843)
582KO/Pi and friends are now installable on SD-Card! 585KO/Pi and friends are now installable on SD-Card!
583It is recommended to install all libs and apps 586It is recommended to install all libs and apps
584on the SD card or all in the internal storage. 587on the SD card or all in the internal storage.
585There may be problems, if this is mixed. 588There may be problems, if this is mixed.
5864) 5894)
587Fixed two bugs in the alarm notification on Windows. 590Fixed two bugs in the alarm notification on Windows.
5885) 5915)
589Great improvement! 592Great improvement!
590KO/Pi uses now the latest version of libical. 593KO/Pi uses now the latest version of libical.
591Libical is the library which actually reads 594Libical is the library which actually reads
592the calendar files and extract the data from it. 595the calendar files and extract the data from it.
593With the old version, there were problems 596With the old version, there were problems
594(crashes or program hangs) when licical did read 597(crashes or program hangs) when licical did read
595files, which were not stored from KO/Pi. 598files, which were not stored from KO/Pi.
596I do not know, if the new libical works perfect, 599I do not know, if the new libical works perfect,
597but actually it works much better than 600but actually it works much better than
598the old version. 601the old version.
599There are no problems with compatibility with 602There are no problems with compatibility with
600old calendar files of KO/Pi, of course! 603old calendar files of KO/Pi, of course!
6016) 6046)
602New in KA/Pi: 605New in KA/Pi:
603Opie addressbook resource connector available! 606Opie addressbook resource connector available!
604You will need libopie1 and the opie addressbook, 607You will need libopie1 and the opie addressbook,
605of course. 608of course.
606With the Opie addressbook resource connector, 609With the Opie addressbook resource connector,
607you can access the Opie addressbook readonly in KA/Pi. 610you can access the Opie addressbook readonly in KA/Pi.
608If you want to edit or import the data into KA/Pi, 611If you want to edit or import the data into KA/Pi,
609do this: 612do this:
610a) Create an Opie resource. 613a) Create an Opie resource.
611 (Menu: Settings-Configure Resources). 614 (Menu: Settings-Configure Resources).
612After configuration and restarting KA/Pi you should see 615After configuration and restarting KA/Pi you should see
613the Opie contacts in KA/Pi. 616the Opie contacts in KA/Pi.
614b) Select some or all Opie contacts. 617b) Select some or all Opie contacts.
615(NOTE: +++++ 618(NOTE: +++++
616To know exactly, what contacts are Opie contacts, 619To know exactly, what contacts are Opie contacts,
617do this: Choose menu: 620do this: Choose menu:
618View-Modify View - TAB Fields. 621View-Modify View - TAB Fields.
619Select in the above list "Resource" and click 622Select in the above list "Resource" and click
620down arrow to add it to the "Selected fields". 623down arrow to add it to the "Selected fields".
621Click OK. 624Click OK.
622Now you have a new column "Resource" in your list, 625Now you have a new column "Resource" in your list,
623where you can see, what an Opie resource is. 626where you can see, what an Opie resource is.
624++++ NOTE end.) 627++++ NOTE end.)
625Ok, we do have now some Opie contacts seleted. 628Ok, we do have now some Opie contacts seleted.
626(Use SHIFT or CTRL key in order to multiple select). 629(Use SHIFT or CTRL key in order to multiple select).
627c) Choose menu: Edit-Copy. 630c) Choose menu: Edit-Copy.
628d) Choose menu: Edit-Paste. 631d) Choose menu: Edit-Paste.
629e) Select the resource, you want to add the contacts to. 632e) Select the resource, you want to add the contacts to.
630Congrats! Now you have read/write access to the copied 633Congrats! Now you have read/write access to the copied
631opie contacts as "real" KA/Pi contacts. 634opie contacts as "real" KA/Pi contacts.
632 635
633 636
634********** VERSION 1.9.1 ************ 637********** VERSION 1.9.1 ************
6351) 6381)
636 +++ IMPORTANT 1 +++ 639 +++ IMPORTANT 1 +++
637 640
638The storing place of the default calendar 641The storing place of the default calendar
639file has changed! 642file has changed!
640The default calendar file was 643The default calendar file was
641Applications/korganizer/mycalendar.ics 644Applications/korganizer/mycalendar.ics
642on Zaurus and 645on Zaurus and
643(yourHomeDir)/korganizer/mycalendar.ics 646(yourHomeDir)/korganizer/mycalendar.ics
644on Windows/Linux desktop. Now it is 647on Windows/Linux desktop. Now it is
645(yourHomeDir)/kdepim/korganizer/mycalendar.ics 648(yourHomeDir)/kdepim/korganizer/mycalendar.ics
646on Zaurus, Windows and Linux. 649on Zaurus, Windows and Linux.
647To load the old file, choose menu 650To load the old file, choose menu
648File-Load calendar backup. 651File-Load calendar backup.
649(It should be loaded automatically 652(It should be loaded automatically
650at startup with a warning message displayed). 653at startup with a warning message displayed).
651The place of the configuration file has changed too. 654The place of the configuration file has changed too.
652If you want to use your old KO/Pi config, 655If you want to use your old KO/Pi config,
653copy it to 656copy it to
654(yourHomeDir)/kdepim/config/korganizerrc 657(yourHomeDir)/kdepim/config/korganizerrc
655Please read VERSION 1.9.0 - topic 3) as well! 658Please read VERSION 1.9.0 - topic 3) as well!
656 659
657 +++ IMPORTANT 2 +++ 660 +++ IMPORTANT 2 +++
658 661
659Because of the new paths, you will need 662Because of the new paths, you will need
660a new version of the KO/Pi alarm applet 663a new version of the KO/Pi alarm applet
661for Zaurus. 664for Zaurus.
662Use version >= 1.9.1 665Use version >= 1.9.1
663 666
6642) 6672)
665Now the QWhat'sThis Icon works for items 668Now the QWhat'sThis Icon works for items
666in the month view as well. 669in the month view as well.
667(See VERSION 1.7.8 Topic 1) ). 670(See VERSION 1.7.8 Topic 1) ).
6683) 6713)
669You can import birtsdays/anniversaries 672You can import birtsdays/anniversaries
670from KA/Pi into KO/Pi. 673from KA/Pi into KO/Pi.
671Choose menu File-Import birthdays. 674Choose menu File-Import birthdays.
672If you import twice, already imported items 675If you import twice, already imported items
673will not be imported again, if they 676will not be imported again, if they
674have not been changed in KO/Pi. 677have not been changed in KO/Pi.
6754) 6784)
676When syncing with sharp DTM, now a progress 679When syncing with sharp DTM, now a progress
677is shown, when the data is written back. 680is shown, when the data is written back.
678If there is much data in KO/Pi and no data 681If there is much data in KO/Pi and no data
679in DTM, that can take a long time. 682in DTM, that can take a long time.
680(But only for the first time ). 683(But only for the first time ).
6815) 6845)
682In the search dialog, you can search 685In the search dialog, you can search
683now for the name/email of an attendee 686now for the name/email of an attendee
684of an event/todo. 687of an event/todo.
685To get more space for displaying 688To get more space for displaying
686search results, the buttons 689search results, the buttons
687for "search" and "close" on the 690for "search" and "close" on the
688bottom are removed in the PDA version. 691bottom are removed in the PDA version.
689You have to click OK in the top right 692You have to click OK in the top right
690corner to do a search. 693corner to do a search.
6916) 6946)
692Now it is possible to disable the displaying 695Now it is possible to disable the displaying
693of todo items in the Allday part of the Agenda. 696of todo items in the Allday part of the Agenda.
694Choose Menu Action-Configure, 697Choose Menu Action-Configure,
695TAB Todo View, checkbox 698TAB Todo View, checkbox
696"Allday Agenda view shows todos" 699"Allday Agenda view shows todos"
6977) 7007)
698If FastLoad is enabled, now the settings and the 701If FastLoad is enabled, now the settings and the
699calendar data are saved, when KO/Pi is closed. 702calendar data are saved, when KO/Pi is closed.
700(If no Fastload is enabled, KO/Pi saves 703(If no Fastload is enabled, KO/Pi saves
701the data as well, of course) 704the data as well, of course)
7028) 7058)
703The Agenda View has a minimize-splitter now, 706The Agenda View has a minimize-splitter now,
704such that the height of the allday part can be 707such that the height of the allday part can be
705changed quickly. 708changed quickly.
706 709
707********** VERSION 1.9.0 ************ 710********** VERSION 1.9.0 ************
7081) 7111)
709KO/Pi is now merged with the new microKDE from KA/Pi. 712KO/Pi is now merged with the new microKDE from KA/Pi.
710KO/Pi accesses now KA/Pi as the addressbook. 713KO/Pi accesses now KA/Pi as the addressbook.
711The other ddressbook-plugins are not working any longer. 714The other ddressbook-plugins are not working any longer.
712(It is planned, that later KA/Pi itself uses these plugins) 715(It is planned, that later KA/Pi itself uses these plugins)
713New versions of KO/Pi are only available 716New versions of KO/Pi are only available
714together with KA/Pi as the KDE-Pim/Pi package. 717together with KA/Pi as the KDE-Pim/Pi package.
7152) 7182)
716If you click on an attendee of a meeting in the 719If you click on an attendee of a meeting in the
717event viewer, a detailed summary of the 720event viewer, a detailed summary of the
718attendee is shown. 721attendee is shown.
7193) 7223)
720The place of the configuration file has changed. 723The place of the configuration file has changed.
721If you want to use your old KO/Pi config, copy 724If you want to use your old KO/Pi config, copy
722Applications/korganizer/config_korganizerrc 725Applications/korganizer/config_korganizerrc
723to 726to
724Applications/korganizer/config/korganizerrc 727Applications/korganizer/config/korganizerrc
725 728
726********** VERSION 1.7.8 ************ 729********** VERSION 1.7.8 ************
7271) 7301)
728Now the QWhat'sThis ist working. 731Now the QWhat'sThis ist working.
729Enable the QWhat'sThis icon in the toolbar. 732Enable the QWhat'sThis icon in the toolbar.
730(You have to restart to reload the changed toolbar config). 733(You have to restart to reload the changed toolbar config).
731Now click on the QWhat'sThis Icon 734Now click on the QWhat'sThis Icon
732in the top right corner of KO/Pi. 735in the top right corner of KO/Pi.
733Then click on an item in the Agenda View: 736Then click on an item in the Agenda View:
734You will get a detailed display of the items content. 737You will get a detailed display of the items content.
7352) 7382)
736Some other very minor changes. 739Some other very minor changes.
737But I have forgotten the details ... 740But I have forgotten the details ...
738For that reason I start this log here: 741For that reason I start this log here:
739To document my changes, when I am doing it. 742To document my changes, when I am doing it.
740 743
741********** VERSION 1.7.7 ************ 744********** VERSION 1.7.7 ************
742Stable Version of KO/Pi 745Stable Version of KO/Pi
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp
index ae67968..9ea9d04 100644
--- a/kabc/addresseedialog.cpp
+++ b/kabc/addresseedialog.cpp
@@ -1,293 +1,293 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <qlayout.h> 21#include <qlayout.h>
22#include <qpushbutton.h> 22#include <qpushbutton.h>
23#include <qgroupbox.h> 23#include <qgroupbox.h>
24#include <qapplication.h> 24#include <qapplication.h>
25#include <qregexp.h> 25#include <qregexp.h>
26 26
27#include <klocale.h> 27#include <klocale.h>
28#include <kdebug.h> 28#include <kdebug.h>
29#include <kglobalsettings.h> 29#include <kglobalsettings.h>
30 30
31#include "stdaddressbook.h" 31#include "stdaddressbook.h"
32 32
33#include "addresseedialog.h" 33#include "addresseedialog.h"
34//#include "addresseedialog.moc" 34//#include "addresseedialog.moc"
35 35
36using namespace KABC; 36using namespace KABC;
37 37
38AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : 38AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) :
39 QListViewItem( parent ), 39 QListViewItem( parent ),
40 mAddressee( addressee ) 40 mAddressee( addressee )
41{ 41{
42 QString name = addressee.familyName()+", "+ addressee.givenName(); 42 QString name = addressee.familyName()+", "+ addressee.givenName();
43 if ( name.length() == 2 ) 43 if ( name.length() == 2 )
44 name = addressee.realName(); 44 name = addressee.organization();
45 setText( Name,name); 45 setText( Name,name);
46 setText( Email, addressee.preferredEmail() ); 46 setText( Email, addressee.preferredEmail() );
47} 47}
48 48
49QString AddresseeItem::key( int column, bool ) const 49QString AddresseeItem::key( int column, bool ) const
50{ 50{
51 51
52 if (column == Email) { 52 if (column == Email) {
53 QString value = text(Email); 53 QString value = text(Email);
54 int val = value.findRev("@"); 54 int val = value.findRev("@");
55 return value.mid( val) + value.left( val ); 55 return value.mid( val) + value.left( val );
56 } 56 }
57 return text(column).lower(); 57 return text(column).lower();
58} 58}
59 59
60AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : 60AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) :
61 KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), 61 KDialogBase( KDialogBase::Plain, i18n("Select Addressee"),
62 Ok|Cancel, Ok, parent ), mMultiple( multiple ) 62 Ok|Cancel, Ok, parent ), mMultiple( multiple )
63{ 63{
64 QWidget *topWidget = plainPage(); 64 QWidget *topWidget = plainPage();
65 65
66 QBoxLayout *topLayout = new QHBoxLayout( topWidget ); 66 QBoxLayout *topLayout = new QHBoxLayout( topWidget );
67 QBoxLayout *listLayout = new QVBoxLayout; 67 QBoxLayout *listLayout = new QVBoxLayout;
68 topLayout->addLayout( listLayout ); 68 topLayout->addLayout( listLayout );
69 69
70 mAddresseeList = new KListView( topWidget ); 70 mAddresseeList = new KListView( topWidget );
71 mAddresseeList->addColumn( i18n("Name") ); 71 mAddresseeList->addColumn( i18n("Name") );
72 mAddresseeList->addColumn( i18n("Email") ); 72 mAddresseeList->addColumn( i18n("Email") );
73 mAddresseeList->setAllColumnsShowFocus( true ); 73 mAddresseeList->setAllColumnsShowFocus( true );
74 mAddresseeList->setFullWidth( true ); 74 mAddresseeList->setFullWidth( true );
75 listLayout->addWidget( mAddresseeList ); 75 listLayout->addWidget( mAddresseeList );
76 connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), 76 connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ),
77 SLOT( slotOk() ) ); 77 SLOT( slotOk() ) );
78 78
79 mAddresseeEdit = new QLineEdit( topWidget ); 79 mAddresseeEdit = new QLineEdit( topWidget );
80 connect( mAddresseeEdit, SIGNAL( returnPressed() ), 80 connect( mAddresseeEdit, SIGNAL( returnPressed() ),
81 SLOT( loadAddressBook() ) ); 81 SLOT( loadAddressBook() ) );
82 mAddresseeEdit->setFocus(); 82 mAddresseeEdit->setFocus();
83 83
84 listLayout->addWidget( mAddresseeEdit ); 84 listLayout->addWidget( mAddresseeEdit );
85 85
86 if ( mMultiple ) { 86 if ( mMultiple ) {
87 QBoxLayout *selectedLayout = new QVBoxLayout; 87 QBoxLayout *selectedLayout = new QVBoxLayout;
88 topLayout->addLayout( selectedLayout ); 88 topLayout->addLayout( selectedLayout );
89 topLayout->setSpacing( spacingHint() ); 89 topLayout->setSpacing( spacingHint() );
90 90
91 QGroupBox *selectedGroup = new QGroupBox( 1, Horizontal, i18n("Selected"), 91 QGroupBox *selectedGroup = new QGroupBox( 1, Horizontal, i18n("Selected"),
92 topWidget ); 92 topWidget );
93 selectedLayout->addWidget( selectedGroup ); 93 selectedLayout->addWidget( selectedGroup );
94 94
95 mSelectedList = new KListView( selectedGroup ); 95 mSelectedList = new KListView( selectedGroup );
96 mSelectedList->addColumn( i18n("Name") ); 96 mSelectedList->addColumn( i18n("Name") );
97 mSelectedList->addColumn( i18n("Email") ); 97 mSelectedList->addColumn( i18n("Email") );
98 mSelectedList->setAllColumnsShowFocus( true ); 98 mSelectedList->setAllColumnsShowFocus( true );
99 mSelectedList->setFullWidth( true ); 99 mSelectedList->setFullWidth( true );
100 connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), 100 connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ),
101 SLOT( removeSelected() ) ); 101 SLOT( removeSelected() ) );
102 102
103 QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); 103 QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup );
104 connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); 104 connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) );
105 105
106 connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), 106 connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ),
107 SLOT( addSelected( QListViewItem * ) ) ); 107 SLOT( addSelected( QListViewItem * ) ) );
108 connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), 108 connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ),
109 SLOT( selectNextItem( QListViewItem * ) ) ); 109 SLOT( selectNextItem( QListViewItem * ) ) );
110 110
111 } 111 }
112 112
113 mAddressBook = StdAddressBook::self( true ); 113 mAddressBook = StdAddressBook::self( true );
114 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), 114 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ),
115 SLOT( addressBookChanged() ) ); 115 SLOT( addressBookChanged() ) );
116 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), 116 connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ),
117 SLOT( addressBookChanged() ) ); 117 SLOT( addressBookChanged() ) );
118 118
119 loadAddressBook(); 119 loadAddressBook();
120} 120}
121 121
122AddresseeDialog::~AddresseeDialog() 122AddresseeDialog::~AddresseeDialog()
123{ 123{
124} 124}
125 125
126void AddresseeDialog::loadAddressBook() 126void AddresseeDialog::loadAddressBook()
127{ 127{
128 mAddresseeList->clear(); 128 mAddresseeList->clear();
129 mItemDict.clear(); 129 mItemDict.clear();
130 if ( mAddresseeEdit->text().isEmpty() ) { 130 if ( mAddresseeEdit->text().isEmpty() ) {
131 AddressBook::Iterator it; 131 AddressBook::Iterator it;
132 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 132 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
133 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 133 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
134 continue; 134 continue;
135 new AddresseeItem( mAddresseeList, (*it) ); 135 new AddresseeItem( mAddresseeList, (*it) );
136 } 136 }
137 return; 137 return;
138 } 138 }
139 //mAddresseeEdit->completionObject()->clear(); 139 //mAddresseeEdit->completionObject()->clear();
140 QRegExp re; 140 QRegExp re;
141 re.setWildcard(true); // most people understand these better. 141 re.setWildcard(true); // most people understand these better.
142 re.setCaseSensitive(false); 142 re.setCaseSensitive(false);
143 re.setPattern( "*"+ mAddresseeEdit->text() + "*"); 143 re.setPattern( "*"+ mAddresseeEdit->text() + "*");
144 144
145 AddressBook::Iterator it; 145 AddressBook::Iterator it;
146 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 146 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
147 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 147 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
148 continue; 148 continue;
149 QString name = (*it).familyName()+", "+ (*it).givenName(); 149 QString name = (*it).familyName()+", "+ (*it).givenName();
150 if ( name.length() == 2 ) 150 if ( name.length() == 2 )
151 name = (*it).realName(); 151 name = (*it).realName();
152 name += (*it).preferredEmail(); 152 name += (*it).preferredEmail();
153#if QT_VERSION >= 300 153#if QT_VERSION >= 300
154 if (re.search(name) != -1) 154 if (re.search(name) != -1)
155#else 155#else
156 if (re.match(name) != -1) 156 if (re.match(name) != -1)
157#endif 157#endif
158 AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); 158 AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) );
159 } 159 }
160} 160}
161 161
162void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item ) 162void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item )
163{ 163{
164 if ( str.isEmpty() ) return; 164 if ( str.isEmpty() ) return;
165 165
166 mItemDict.insert( str, item ); 166 mItemDict.insert( str, item );
167 //mAddresseeEdit->completionObject()->addItem( str ); 167 //mAddresseeEdit->completionObject()->addItem( str );
168} 168}
169 169
170void AddresseeDialog::selectItem( const QString &str ) 170void AddresseeDialog::selectItem( const QString &str )
171{ 171{
172 if ( str.isEmpty() ) return; 172 if ( str.isEmpty() ) return;
173 173
174 QListViewItem *item = mItemDict.find( str ); 174 QListViewItem *item = mItemDict.find( str );
175 if ( item ) { 175 if ( item ) {
176 mAddresseeList->blockSignals( true ); 176 mAddresseeList->blockSignals( true );
177 mAddresseeList->setSelected( item, true ); 177 mAddresseeList->setSelected( item, true );
178 mAddresseeList->ensureItemVisible( item ); 178 mAddresseeList->ensureItemVisible( item );
179 mAddresseeList->blockSignals( false ); 179 mAddresseeList->blockSignals( false );
180 } 180 }
181} 181}
182 182
183void AddresseeDialog::updateEdit( QListViewItem *item ) 183void AddresseeDialog::updateEdit( QListViewItem *item )
184{ 184{
185 mAddresseeEdit->setText( item->text( 0 ) ); 185 mAddresseeEdit->setText( item->text( 0 ) );
186 mAddresseeEdit->setSelection( 0, item->text( 0 ).length() ); 186 mAddresseeEdit->setSelection( 0, item->text( 0 ).length() );
187} 187}
188 188
189void AddresseeDialog::selectNextItem( QListViewItem *item ) 189void AddresseeDialog::selectNextItem( QListViewItem *item )
190{ 190{
191 addSelected( item ); 191 addSelected( item );
192 QListViewItem *next = item->nextSibling(); 192 QListViewItem *next = item->nextSibling();
193 if ( next ) { 193 if ( next ) {
194 next->setSelected( true ); 194 next->setSelected( true );
195 item->setSelected( false ); 195 item->setSelected( false );
196 mAddresseeList->setCurrentItem( next ); 196 mAddresseeList->setCurrentItem( next );
197 } 197 }
198} 198}
199void AddresseeDialog::addSelected( QListViewItem *item ) 199void AddresseeDialog::addSelected( QListViewItem *item )
200{ 200{
201 AddresseeItem *addrItem = (AddresseeItem *)( item ); 201 AddresseeItem *addrItem = (AddresseeItem *)( item );
202 if ( !addrItem ) return; 202 if ( !addrItem ) return;
203 203
204 Addressee a = addrItem->addressee(); 204 Addressee a = addrItem->addressee();
205 205
206 QListViewItem *selectedItem = mSelectedDict.find( a.uid() ); 206 QListViewItem *selectedItem = mSelectedDict.find( a.uid() );
207 if ( !selectedItem ) { 207 if ( !selectedItem ) {
208 selectedItem = new AddresseeItem( mSelectedList, a ); 208 selectedItem = new AddresseeItem( mSelectedList, a );
209 mSelectedDict.insert( a.uid(), selectedItem ); 209 mSelectedDict.insert( a.uid(), selectedItem );
210 } 210 }
211 211
212} 212}
213 213
214void AddresseeDialog::removeSelected() 214void AddresseeDialog::removeSelected()
215{ 215{
216 QListViewItem *item = mSelectedList->selectedItem(); 216 QListViewItem *item = mSelectedList->selectedItem();
217 AddresseeItem *addrItem = (AddresseeItem *)( item ); 217 AddresseeItem *addrItem = (AddresseeItem *)( item );
218 if ( !addrItem ) return; 218 if ( !addrItem ) return;
219 QListViewItem *next = item->nextSibling(); 219 QListViewItem *next = item->nextSibling();
220 mSelectedDict.remove( addrItem->addressee().uid() ); 220 mSelectedDict.remove( addrItem->addressee().uid() );
221 delete addrItem; 221 delete addrItem;
222 if ( next ) 222 if ( next )
223 next->setSelected( true ); 223 next->setSelected( true );
224} 224}
225 225
226Addressee AddresseeDialog::addressee() 226Addressee AddresseeDialog::addressee()
227{ 227{
228 AddresseeItem *aItem = 0; 228 AddresseeItem *aItem = 0;
229 229
230 if ( mMultiple ) 230 if ( mMultiple )
231 aItem = (AddresseeItem *)( mSelectedList->firstChild() ); 231 aItem = (AddresseeItem *)( mSelectedList->firstChild() );
232 else 232 else
233 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); 233 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() );
234 234
235 if (aItem) return aItem->addressee(); 235 if (aItem) return aItem->addressee();
236 return Addressee(); 236 return Addressee();
237} 237}
238 238
239Addressee::List AddresseeDialog::addressees() 239Addressee::List AddresseeDialog::addressees()
240{ 240{
241 Addressee::List al; 241 Addressee::List al;
242 AddresseeItem *aItem = 0; 242 AddresseeItem *aItem = 0;
243 243
244 if ( mMultiple ) { 244 if ( mMultiple ) {
245 QListViewItem *item = mSelectedList->firstChild(); 245 QListViewItem *item = mSelectedList->firstChild();
246 while( item ) { 246 while( item ) {
247 aItem = (AddresseeItem *)( item ); 247 aItem = (AddresseeItem *)( item );
248 if ( aItem ) al.append( aItem->addressee() ); 248 if ( aItem ) al.append( aItem->addressee() );
249 item = item->nextSibling(); 249 item = item->nextSibling();
250 } 250 }
251 } 251 }
252 else 252 else
253 { 253 {
254 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); 254 aItem = (AddresseeItem *)( mAddresseeList->selectedItem() );
255 if (aItem) al.append( aItem->addressee() ); 255 if (aItem) al.append( aItem->addressee() );
256 } 256 }
257 257
258 return al; 258 return al;
259} 259}
260 260
261Addressee AddresseeDialog::getAddressee( QWidget *parent ) 261Addressee AddresseeDialog::getAddressee( QWidget *parent )
262{ 262{
263 AddresseeDialog *dlg = new AddresseeDialog( parent ); 263 AddresseeDialog *dlg = new AddresseeDialog( parent );
264 Addressee addressee; 264 Addressee addressee;
265 int result = dlg->exec(); 265 int result = dlg->exec();
266 266
267 if ( result == QDialog::Accepted ) { 267 if ( result == QDialog::Accepted ) {
268 addressee = dlg->addressee(); 268 addressee = dlg->addressee();
269 } 269 }
270 270
271 delete dlg; 271 delete dlg;
272 return addressee; 272 return addressee;
273} 273}
274 274
275Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) 275Addressee::List AddresseeDialog::getAddressees( QWidget *parent )
276{ 276{
277 AddresseeDialog *dlg = new AddresseeDialog( parent, true ); 277 AddresseeDialog *dlg = new AddresseeDialog( parent, true );
278 Addressee::List addressees; 278 Addressee::List addressees;
279 if ( QApplication::desktop()->width() <= 640 ) 279 if ( QApplication::desktop()->width() <= 640 )
280 dlg->showMaximized(); 280 dlg->showMaximized();
281 int result = dlg->exec(); 281 int result = dlg->exec();
282 if ( result == QDialog::Accepted ) { 282 if ( result == QDialog::Accepted ) {
283 addressees = dlg->addressees(); 283 addressees = dlg->addressees();
284 } 284 }
285 285
286 delete dlg; 286 delete dlg;
287 return addressees; 287 return addressees;
288} 288}
289 289
290void AddresseeDialog::addressBookChanged() 290void AddresseeDialog::addressBookChanged()
291{ 291{
292 loadAddressBook(); 292 loadAddressBook();
293} 293}
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index c6993e9..bd32859 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -1,1348 +1,1358 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
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 <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qhbox.h> 25#include <qhbox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlistbox.h> 28#include <qlistbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qtabwidget.h> 30#include <qtabwidget.h>
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#ifndef KAB_EMBEDDED 33#ifndef KAB_EMBEDDED
34#include <qtextedit.h> 34#include <qtextedit.h>
35 35
36#include <kaccelmanager.h> 36#include <kaccelmanager.h>
37#include "keywidget.h" 37#include "keywidget.h"
38#include "soundwidget.h" 38#include "soundwidget.h"
39 39
40#else //KAB_EMBEDDED 40#else //KAB_EMBEDDED
41#include <qmultilineedit.h> 41#include <qmultilineedit.h>
42#endif //KAB_EMBEDDED 42#endif //KAB_EMBEDDED
43 43
44 44
45#include "keywidget.h" 45#include "keywidget.h"
46#include "geowidget.h" 46#include "geowidget.h"
47#include "imagewidget.h" 47#include "imagewidget.h"
48#include "nameeditdialog.h" 48#include "nameeditdialog.h"
49#include "phoneeditwidget.h" 49#include "phoneeditwidget.h"
50#include "secrecywidget.h" 50#include "secrecywidget.h"
51 51
52 52
53#include <qtoolbutton.h> 53#include <qtoolbutton.h>
54#include <qtooltip.h> 54#include <qtooltip.h>
55 55
56#include <kapplication.h> 56#include <kapplication.h>
57#include <kconfig.h> 57#include <kconfig.h>
58#include <kcombobox.h> 58#include <kcombobox.h>
59#include <kdebug.h> 59#include <kdebug.h>
60#include <kdialogbase.h> 60#include <kdialogbase.h>
61#include <kglobal.h> 61#include <kglobal.h>
62#include <kiconloader.h> 62#include <kiconloader.h>
63#include <klineedit.h> 63#include <klineedit.h>
64#include <klocale.h> 64#include <klocale.h>
65#include <kmessagebox.h> 65#include <kmessagebox.h>
66#include <kseparator.h> 66#include <kseparator.h>
67#include <ksqueezedtextlabel.h> 67#include <ksqueezedtextlabel.h>
68 68
69#include <libkdepim/categoryeditdialog.h> 69#include <libkdepim/categoryeditdialog.h>
70#include <libkdepim/categoryselectdialog.h> 70#include <libkdepim/categoryselectdialog.h>
71 71
72#include <libkdepim/kdateedit.h> 72#include <libkdepim/kdateedit.h>
73 73
74#include "addresseditwidget.h" 74#include "addresseditwidget.h"
75#include "emaileditwidget.h" 75#include "emaileditwidget.h"
76#include "kabcore.h" 76#include "kabcore.h"
77#include "kabprefs.h" 77#include "kabprefs.h"
78 78
79#include "addresseeeditorwidget.h" 79#include "addresseeeditorwidget.h"
80 80
81 81
82 82
83AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension, 83AddresseeEditorWidget::AddresseeEditorWidget( KABCore *core, bool isExtension,
84 QWidget *parent, const char *name ) 84 QWidget *parent, const char *name )
85 : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ), 85 : ExtensionWidget( core, parent, name ), mIsExtension( isExtension ),
86 mBlockSignals( false ) 86 mBlockSignals( false )
87{ 87{
88 88
89 mAConfig = AddresseeConfig::instance(); 89 mAConfig = AddresseeConfig::instance();
90 90
91 mFormattedNameType = NameEditDialog::CustomName; 91 mFormattedNameType = NameEditDialog::CustomName;
92 initGUI(); 92 initGUI();
93 mCategoryDialog = 0; 93 mCategoryDialog = 0;
94 mCategoryEditDialog = 0; 94 mCategoryEditDialog = 0;
95 95
96 // Load the empty addressee as defaults 96 // Load the empty addressee as defaults
97 load(); 97 load();
98 98
99 mDirty = false; 99 mDirty = false;
100} 100}
101 101
102AddresseeEditorWidget::~AddresseeEditorWidget() 102AddresseeEditorWidget::~AddresseeEditorWidget()
103{ 103{
104 kdDebug(5720) << "~AddresseeEditorWidget()" << endl; 104 kdDebug(5720) << "~AddresseeEditorWidget()" << endl;
105} 105}
106 106
107void AddresseeEditorWidget::contactsSelectionChanged() 107void AddresseeEditorWidget::contactsSelectionChanged()
108{ 108{
109 KABC::Addressee::List list = selectedContacts(); 109 KABC::Addressee::List list = selectedContacts();
110 110
111 mAddressee = list[ 0 ]; 111 mAddressee = list[ 0 ];
112 load(); 112 load();
113} 113}
114 114
115void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) 115void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr )
116{ 116{
117 mAddressee = addr; 117 mAddressee = addr;
118 load(); 118 load();
119} 119}
120 120
121const KABC::Addressee &AddresseeEditorWidget::addressee() 121const KABC::Addressee &AddresseeEditorWidget::addressee()
122{ 122{
123 return mAddressee; 123 return mAddressee;
124} 124}
125 125
126void AddresseeEditorWidget::textChanged( const QString& ) 126void AddresseeEditorWidget::textChanged( const QString& )
127{ 127{
128 emitModified(); 128 emitModified();
129} 129}
130 130
131void AddresseeEditorWidget::initGUI() 131void AddresseeEditorWidget::initGUI()
132{ 132{
133 QVBoxLayout *layout = new QVBoxLayout( this ); 133 QVBoxLayout *layout = new QVBoxLayout( this );
134 134
135 mTabWidget = new QTabWidget( this ); 135 mTabWidget = new QTabWidget( this );
136 layout->addWidget( mTabWidget ); 136 layout->addWidget( mTabWidget );
137 137
138 setupTab1(); 138 setupTab1();
139 setupTab1_1(); 139 setupTab1_1();
140 setupTab2(); 140 setupTab2();
141 setupTab2_1(); 141 setupTab2_1();
142 setupTab3(); 142 setupTab3();
143 setupTab3_1(); 143 setupTab3_1();
144 144
145 mNameEdit->setFocus(); 145 mNameEdit->setFocus();
146 146
147 connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ), 147 connect( mTabWidget, SIGNAL( currentChanged(QWidget*) ),
148 SLOT( pageChanged(QWidget*) ) ); 148 SLOT( pageChanged(QWidget*) ) );
149} 149}
150 150
151void AddresseeEditorWidget::setupTab1() 151void AddresseeEditorWidget::setupTab1()
152{ 152{
153 // This is the General tab 153 // This is the General tab
154 QWidget *tab1 = new QWidget( mTabWidget ); 154 QWidget *tab1 = new QWidget( mTabWidget );
155 155
156//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 ); 156//US QGridLayout *layout = new QGridLayout( tab1, 11, 7 );
157 QGridLayout *layout = new QGridLayout( tab1, 7, 1 ); 157 QGridLayout *layout = new QGridLayout( tab1, 7, 1 );
158 layout->setMargin( KDialogBase::marginHintSmall() ); 158 layout->setMargin( KDialogBase::marginHintSmall() );
159 layout->setSpacing( KDialogBase::spacingHintSmall() ); 159 layout->setSpacing( KDialogBase::spacingHintSmall() );
160 160
161 QLabel *label; 161 QLabel *label;
162 KSeparator* bar; 162 KSeparator* bar;
163 QPushButton *button; 163 QPushButton *button;
164 164
165 ////////////////////////////////// 165 //////////////////////////////////
166 // Upper left group (person info) 166 // Upper left group (person info)
167 167
168 // Person icon 168 // Person icon
169 /* LR 169 /* LR
170 label = new QLabel( tab1 ); 170 label = new QLabel( tab1 );
171//US ambiguous call. Add one more parameter 171//US ambiguous call. Add one more parameter
172//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 172//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
173 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 173 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
174 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 174 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
175 */ 175 */
176 // First name 176 // First name
177 button = new QPushButton( i18n( "Name..." ), tab1 ); 177 button = new QPushButton( i18n( "Name..." ), tab1 );
178//US QToolTip::add( button, i18n( "Edit the contact's name" ) ); 178//US QToolTip::add( button, i18n( "Edit the contact's name" ) );
179 mNameEdit = new KLineEdit( tab1, "mNameEdit" ); 179 mNameEdit = new KLineEdit( tab1, "mNameEdit" );
180 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), 180 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ),
181 SLOT( nameTextChanged( const QString& ) ) ); 181 SLOT( nameTextChanged( const QString& ) ) );
182 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); 182 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) );
183 183
184 mNameLabel = new KSqueezedTextLabel( tab1 ); 184 mNameLabel = new KSqueezedTextLabel( tab1 );
185 mNameLabel->hide(); 185 mNameLabel->hide();
186 186
187 layout->addWidget( button, 0, 0 ); 187 layout->addWidget( button, 0, 0 );
188 layout->addWidget( mNameEdit, 0, 1 ); 188 layout->addWidget( mNameEdit, 0, 1 );
189 layout->addWidget( mNameLabel, 0, 1 ); 189 layout->addWidget( mNameLabel, 0, 1 );
190 190
191 label = new QLabel( i18n( "Role:" ), tab1 ); 191 label = new QLabel( i18n( "Role:" ), tab1 );
192 mRoleEdit = new KLineEdit( tab1 ); 192 mRoleEdit = new KLineEdit( tab1 );
193 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), 193 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ),
194 SLOT( textChanged( const QString& ) ) ); 194 SLOT( textChanged( const QString& ) ) );
195 label->setBuddy( mRoleEdit ); 195 label->setBuddy( mRoleEdit );
196 layout->addWidget( label, 1, 0 ); 196 layout->addWidget( label, 1, 0 );
197 layout->addWidget( mRoleEdit, 1, 1 ); 197 layout->addWidget( mRoleEdit, 1, 1 );
198 198
199 // Organization 199 // Organization
200 label = new QLabel( i18n( "Organization:" ), tab1 ); 200 label = new QLabel( i18n( "Organization:" ), tab1 );
201 mOrgEdit = new KLineEdit( tab1 ); 201 mOrgEdit = new KLineEdit( tab1 );
202 label->setBuddy( mOrgEdit ); 202 label->setBuddy( mOrgEdit );
203 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), 203 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ),
204 SLOT( textChanged( const QString& ) ) ); 204 SLOT( textChanged( const QString& ) ) );
205 layout->addWidget( label, 2, 0 ); 205 layout->addWidget( label, 2, 0 );
206 layout->addWidget( mOrgEdit, 2, 1 ); 206 layout->addWidget( mOrgEdit, 2, 1 );
207 207
208 // File as (formatted name) 208 // File as (formatted name)
209 label = new QLabel( i18n( "Formatted name:" ), tab1 ); 209 label = new QLabel( i18n( "Formatted name:" ), tab1 );
210 mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); 210 mFormattedNameLabel = new KSqueezedTextLabel( tab1 );
211 layout->addWidget( label, 3, 0 ); 211 layout->addWidget( label, 3, 0 );
212 layout->addWidget( mFormattedNameLabel, 3, 1 ); 212 layout->addWidget( mFormattedNameLabel, 3, 1 );
213 /* LR 213 /* LR
214 // Left hand separator. This separator doesn't go all the way 214 // Left hand separator. This separator doesn't go all the way
215 // across so the dialog still flows from top to bottom 215 // across so the dialog still flows from top to bottom
216 bar = new KSeparator( KSeparator::HLine, tab1 ); 216 bar = new KSeparator( KSeparator::HLine, tab1 );
217 layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); 217 layout->addMultiCellWidget( bar, 4, 4, 0, 2 );
218 */ 218 */
219 ////////////////////////////////////// 219 //////////////////////////////////////
220 220
221 /* LR 221 /* LR
222 // Phone numbers (upper right) 222 // Phone numbers (upper right)
223 label = new QLabel( tab1 ); 223 label = new QLabel( tab1 );
224//US loadIcon call is ambiguous. Add one more parameter 224//US loadIcon call is ambiguous. Add one more parameter
225//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); 225//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) );
226 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); 226 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
227//US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); 227//US layout->addMultiCellWidget( label, 0, 1, 3, 3 );
228 layout->addMultiCellWidget( label, 5, 6, 0, 0 ); 228 layout->addMultiCellWidget( label, 5, 6, 0, 0 );
229 */ 229 */
230 mPhoneEditWidget = new PhoneEditWidget( tab1 ); 230 mPhoneEditWidget = new PhoneEditWidget( tab1 );
231 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 231 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
232//US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); 232//US layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 );
233 int iii; 233 int iii;
234#ifndef DESKTOP_VERSION 234#ifndef DESKTOP_VERSION
235 iii = 7; 235 iii = 7;
236#else 236#else
237 iii = 8; 237 iii = 8;
238#endif 238#endif
239 layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 ); 239 layout->addMultiCellWidget( mPhoneEditWidget, 4, iii, 0, 1 );
240 ++iii; 240 ++iii;
241 /* LR 241 /* LR
242 bar = new KSeparator( KSeparator::HLine, tab1 ); 242 bar = new KSeparator( KSeparator::HLine, tab1 );
243//US layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); 243//US layout->addMultiCellWidget( bar, 4, 4, 3, 6 );
244 layout->addMultiCellWidget( bar, 9, 9, 0, 2 ); 244 layout->addMultiCellWidget( bar, 9, 9, 0, 2 );
245 */ 245 */
246/*US 246/*US
247 ////////////////////////////////////// 247 //////////////////////////////////////
248 // Addresses (lower left) 248 // Addresses (lower left)
249 label = new QLabel( tab1 ); 249 label = new QLabel( tab1 );
250//US loadIcon call is ambiguous. Add one more parameter 250//US loadIcon call is ambiguous. Add one more parameter
251//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); 251//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) );
252 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); 252 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) );
253 layout->addMultiCellWidget( label, 5, 6, 0, 0 ); 253 layout->addMultiCellWidget( label, 5, 6, 0, 0 );
254 254
255 mAddressEditWidget = new AddressEditWidget( tab1 ); 255 mAddressEditWidget = new AddressEditWidget( tab1 );
256 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 256 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
257 layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); 257 layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 );
258 258
259 ////////////////////////////////////// 259 //////////////////////////////////////
260 // Email / Web (lower right) 260 // Email / Web (lower right)
261 label = new QLabel( tab1 ); 261 label = new QLabel( tab1 );
262//US loadIcon call is ambiguous. Add one more parameter 262//US loadIcon call is ambiguous. Add one more parameter
263//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); 263//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) );
264 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); 264 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) );
265 layout->addMultiCellWidget( label, 5, 6, 3, 3 ); 265 layout->addMultiCellWidget( label, 5, 6, 3, 3 );
266 266
267 mEmailWidget = new EmailEditWidget( tab1 ); 267 mEmailWidget = new EmailEditWidget( tab1 );
268 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 268 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
269 layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); 269 layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 );
270 270
271 // add the separator 271 // add the separator
272 bar = new KSeparator( KSeparator::HLine, tab1 ); 272 bar = new KSeparator( KSeparator::HLine, tab1 );
273 layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); 273 layout->addMultiCellWidget( bar, 7, 7, 3, 6 );
274 274
275 label = new QLabel( tab1 ); 275 label = new QLabel( tab1 );
276//US loadIcon call is ambiguous. Add one more parameter 276//US loadIcon call is ambiguous. Add one more parameter
277//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); 277//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) );
278 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); 278 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) );
279 layout->addMultiCellWidget( label, 8, 9, 3, 3 ); 279 layout->addMultiCellWidget( label, 8, 9, 3, 3 );
280 280
281 label = new QLabel( i18n( "URL:" ), tab1 ); 281 label = new QLabel( i18n( "URL:" ), tab1 );
282 mURLEdit = new KLineEdit( tab1 ); 282 mURLEdit = new KLineEdit( tab1 );
283 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), 283 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ),
284 SLOT( textChanged( const QString& ) ) ); 284 SLOT( textChanged( const QString& ) ) );
285 label->setBuddy( mURLEdit ); 285 label->setBuddy( mURLEdit );
286 layout->addWidget( label, 8, 4 ); 286 layout->addWidget( label, 8, 4 );
287 layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); 287 layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 );
288 288
289 label = new QLabel( i18n( "&IM address:" ), tab1 ); 289 label = new QLabel( i18n( "&IM address:" ), tab1 );
290 mIMAddressEdit = new KLineEdit( tab1 ); 290 mIMAddressEdit = new KLineEdit( tab1 );
291 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), 291 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ),
292 SLOT( textChanged( const QString& ) ) ); 292 SLOT( textChanged( const QString& ) ) );
293 label->setBuddy( mIMAddressEdit ); 293 label->setBuddy( mIMAddressEdit );
294 layout->addWidget( label, 9, 4 ); 294 layout->addWidget( label, 9, 4 );
295 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); 295 layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 );
296 296
297 layout->addColSpacing( 6, 50 ); 297 layout->addColSpacing( 6, 50 );
298 298
299 bar = new KSeparator( KSeparator::HLine, tab1 ); 299 bar = new KSeparator( KSeparator::HLine, tab1 );
300 layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 300 layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
301*/ 301*/
302 /////////////////////////////////////// 302 ///////////////////////////////////////
303 QHBox *categoryBox = new QHBox( tab1 ,"cato"); 303 QHBox *categoryBox = new QHBox( tab1 ,"cato");
304 categoryBox->setSpacing( KDialogBase::spacingHint() ); 304 categoryBox->setSpacing( KDialogBase::spacingHint() );
305 categoryBox->setMargin( KDialogBase::marginHintSmall() ); 305 categoryBox->setMargin( KDialogBase::marginHintSmall() );
306 306
307 // Categories 307 // Categories
308 button = new QPushButton( i18n( "Categories" ), categoryBox ); 308 button = new QPushButton( i18n( "Categories" ), categoryBox );
309 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 309 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
310 310
311 mCategoryEdit = new KLineEdit( categoryBox ); 311 mCategoryEdit = new KLineEdit( categoryBox );
312 mCategoryEdit->setReadOnly( true ); 312 mCategoryEdit->setReadOnly( true );
313 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 313 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
314 SLOT( textChanged( const QString& ) ) ); 314 SLOT( textChanged( const QString& ) ) );
315 315
316 mSecrecyWidget = new SecrecyWidget( categoryBox ); 316 mSecrecyWidget = new SecrecyWidget( categoryBox );
317 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 317 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
318 318
319//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 319//US layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
320 layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 ); 320 layout->addMultiCellWidget( categoryBox, iii, iii, 0, 1 );
321 321
322 // Build the layout and add to the tab widget 322 // Build the layout and add to the tab widget
323 layout->activate(); // required 323 layout->activate(); // required
324 324
325 mTabWidget->addTab( tab1, i18n( "&General" ) ); 325 mTabWidget->addTab( tab1, i18n( "&General" ) );
326} 326}
327 327
328 328
329void AddresseeEditorWidget::setupTab1_1() 329void AddresseeEditorWidget::setupTab1_1()
330{ 330{
331 // This is the Address tab 331 // This is the Address tab
332 QWidget *tab1_1 = new QWidget( mTabWidget ); 332 QWidget *tab1_1 = new QWidget( mTabWidget );
333 333
334//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); 334//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 );
335 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); 335 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 );
336 layout->setMargin( KDialogBase::marginHintSmall() ); 336 layout->setMargin( KDialogBase::marginHintSmall() );
337 layout->setSpacing( KDialogBase::spacingHintSmall() ); 337 layout->setSpacing( KDialogBase::spacingHintSmall() );
338 338
339 QLabel *label; 339 QLabel *label;
340 KSeparator* bar; 340 KSeparator* bar;
341 QPushButton *button; 341 QPushButton *button;
342 342
343/*US 343/*US
344 ////////////////////////////////// 344 //////////////////////////////////
345 // Upper left group (person info) 345 // Upper left group (person info)
346 346
347 // Person icon 347 // Person icon
348 label = new QLabel( tab1 ); 348 label = new QLabel( tab1 );
349//US ambiguous call. Add one more parameter 349//US ambiguous call. Add one more parameter
350//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 350//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
351 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 351 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
352 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 352 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
353 353
354 // First name 354 // First name
355 button = new QPushButton( i18n( "Name..." ), tab1 ); 355 button = new QPushButton( i18n( "Name..." ), tab1 );
356 QToolTip::add( button, i18n( "Edit the contact's name" ) ); 356 QToolTip::add( button, i18n( "Edit the contact's name" ) );
357 mNameEdit = new KLineEdit( tab1, "mNameEdit" ); 357 mNameEdit = new KLineEdit( tab1, "mNameEdit" );
358 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), 358 connect( mNameEdit, SIGNAL( textChanged( const QString& ) ),
359 SLOT( nameTextChanged( const QString& ) ) ); 359 SLOT( nameTextChanged( const QString& ) ) );
360 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) ); 360 connect( button, SIGNAL( clicked() ), SLOT( nameButtonClicked() ) );
361 361
362#ifndef KAB_EMBEDDED 362#ifndef KAB_EMBEDDED
363 mNameLabel = new KSqueezedTextLabel( tab1 ); 363 mNameLabel = new KSqueezedTextLabel( tab1 );
364 mNameLabel->hide(); 364 mNameLabel->hide();
365#else //KAB_EMBEDDED 365#else //KAB_EMBEDDED
366qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 366qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
367#endif //KAB_EMBEDDED 367#endif //KAB_EMBEDDED
368 368
369 layout->addWidget( button, 0, 1 ); 369 layout->addWidget( button, 0, 1 );
370 layout->addWidget( mNameEdit, 0, 2 ); 370 layout->addWidget( mNameEdit, 0, 2 );
371 371
372#ifndef KAB_EMBEDDED 372#ifndef KAB_EMBEDDED
373 layout->addWidget( mNameLabel, 0, 2 ); 373 layout->addWidget( mNameLabel, 0, 2 );
374#else //KAB_EMBEDDED 374#else //KAB_EMBEDDED
375qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 375qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
376#endif //KAB_EMBEDDED 376#endif //KAB_EMBEDDED
377 377
378 label = new QLabel( i18n( "Role:" ), tab1 ); 378 label = new QLabel( i18n( "Role:" ), tab1 );
379 mRoleEdit = new KLineEdit( tab1 ); 379 mRoleEdit = new KLineEdit( tab1 );
380 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ), 380 connect( mRoleEdit, SIGNAL( textChanged( const QString& ) ),
381 SLOT( textChanged( const QString& ) ) ); 381 SLOT( textChanged( const QString& ) ) );
382 label->setBuddy( mRoleEdit ); 382 label->setBuddy( mRoleEdit );
383 layout->addWidget( label, 1, 1 ); 383 layout->addWidget( label, 1, 1 );
384 layout->addWidget( mRoleEdit, 1, 2 ); 384 layout->addWidget( mRoleEdit, 1, 2 );
385 385
386 // Organization 386 // Organization
387 label = new QLabel( i18n( "Organization:" ), tab1 ); 387 label = new QLabel( i18n( "Organization:" ), tab1 );
388 mOrgEdit = new KLineEdit( tab1 ); 388 mOrgEdit = new KLineEdit( tab1 );
389 label->setBuddy( mOrgEdit ); 389 label->setBuddy( mOrgEdit );
390 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ), 390 connect( mOrgEdit, SIGNAL( textChanged( const QString& ) ),
391 SLOT( textChanged( const QString& ) ) ); 391 SLOT( textChanged( const QString& ) ) );
392 layout->addWidget( label, 2, 1 ); 392 layout->addWidget( label, 2, 1 );
393 layout->addWidget( mOrgEdit, 2, 2 ); 393 layout->addWidget( mOrgEdit, 2, 2 );
394 394
395 // File as (formatted name) 395 // File as (formatted name)
396 label = new QLabel( i18n( "Formatted name:" ), tab1 ); 396 label = new QLabel( i18n( "Formatted name:" ), tab1 );
397#ifndef KAB_EMBEDDED 397#ifndef KAB_EMBEDDED
398 mFormattedNameLabel = new KSqueezedTextLabel( tab1 ); 398 mFormattedNameLabel = new KSqueezedTextLabel( tab1 );
399#else //KAB_EMBEDDED 399#else //KAB_EMBEDDED
400qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 400qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
401#endif //KAB_EMBEDDED 401#endif //KAB_EMBEDDED
402 layout->addWidget( label, 3, 1 ); 402 layout->addWidget( label, 3, 1 );
403#ifndef KAB_EMBEDDED 403#ifndef KAB_EMBEDDED
404 layout->addWidget( mFormattedNameLabel, 3, 2 ); 404 layout->addWidget( mFormattedNameLabel, 3, 2 );
405#else //KAB_EMBEDDED 405#else //KAB_EMBEDDED
406qDebug("AddresseeEditorWidget::setupTab1 has to be changed"); 406qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
407#endif //KAB_EMBEDDED 407#endif //KAB_EMBEDDED
408 408
409 // Left hand separator. This separator doesn't go all the way 409 // Left hand separator. This separator doesn't go all the way
410 // across so the dialog still flows from top to bottom 410 // across so the dialog still flows from top to bottom
411 bar = new KSeparator( KSeparator::HLine, tab1 ); 411 bar = new KSeparator( KSeparator::HLine, tab1 );
412 layout->addMultiCellWidget( bar, 4, 4, 0, 2 ); 412 layout->addMultiCellWidget( bar, 4, 4, 0, 2 );
413 413
414 ////////////////////////////////////// 414 //////////////////////////////////////
415 // Phone numbers (upper right) 415 // Phone numbers (upper right)
416 label = new QLabel( tab1 ); 416 label = new QLabel( tab1 );
417//US loadIcon call is ambiguous. Add one more parameter 417//US loadIcon call is ambiguous. Add one more parameter
418//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); 418//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) );
419 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); 419 label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) );
420 layout->addMultiCellWidget( label, 0, 1, 3, 3 ); 420 layout->addMultiCellWidget( label, 0, 1, 3, 3 );
421 421
422 mPhoneEditWidget = new PhoneEditWidget( tab1 ); 422 mPhoneEditWidget = new PhoneEditWidget( tab1 );
423 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 423 connect( mPhoneEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
424 layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 ); 424 layout->addMultiCellWidget( mPhoneEditWidget, 0, 3, 4, 6 );
425 425
426 bar = new KSeparator( KSeparator::HLine, tab1 ); 426 bar = new KSeparator( KSeparator::HLine, tab1 );
427 layout->addMultiCellWidget( bar, 4, 4, 3, 6 ); 427 layout->addMultiCellWidget( bar, 4, 4, 3, 6 );
428*/ 428*/
429 ////////////////////////////////////// 429 //////////////////////////////////////
430 // Addresses (lower left) 430 // Addresses (lower left)
431 /* LR 431 /* LR
432 label = new QLabel( tab1_1 ); 432 label = new QLabel( tab1_1 );
433//US loadIcon call is ambiguous. Add one more parameter 433//US loadIcon call is ambiguous. Add one more parameter
434//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) ); 434//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop ) );
435 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); 435 label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) );
436//US layout->addMultiCellWidget( label, 5, 6, 0, 0 ); 436//US layout->addMultiCellWidget( label, 5, 6, 0, 0 );
437 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 437 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
438 */ 438 */
439 439
440 mAddressEditWidget = new AddressEditWidget( tab1_1 ); 440 mAddressEditWidget = new AddressEditWidget( tab1_1 );
441 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 441 connect( mAddressEditWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
442//US layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 ); 442//US layout->addMultiCellWidget( mAddressEditWidget, 5, 9, 1, 2 );
443 layout->addMultiCellWidget( mAddressEditWidget, 0, 4, 0, 1 ); 443 layout->addMultiCellWidget( mAddressEditWidget, 0, 4, 0, 1 );
444 444
445//US 445//US
446/* LR 446/* LR
447 bar = new KSeparator( KSeparator::HLine, tab1_1 ); 447 bar = new KSeparator( KSeparator::HLine, tab1_1 );
448 layout->addMultiCellWidget( bar, 5, 5, 0, 3 ); 448 layout->addMultiCellWidget( bar, 5, 5, 0, 3 );
449*/ 449*/
450 450
451 ////////////////////////////////////// 451 //////////////////////////////////////
452 // Email / Web (lower right) 452 // Email / Web (lower right)
453 /* LR 453 /* LR
454 label = new QLabel( tab1_1 ); 454 label = new QLabel( tab1_1 );
455//US loadIcon call is ambiguous. Add one more parameter 455//US loadIcon call is ambiguous. Add one more parameter
456//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) ); 456//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop) );
457 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) ); 457 label->setPixmap( KGlobal::iconLoader()->loadIcon( "email", KIcon::Desktop, 0) );
458//US layout->addMultiCellWidget( label, 5, 6, 3, 3 ); 458//US layout->addMultiCellWidget( label, 5, 6, 3, 3 );
459 layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 459 layout->addMultiCellWidget( label, 6, 7, 0, 0 );
460 */ 460 */
461 mEmailWidget = new EmailEditWidget( tab1_1 ); 461 mEmailWidget = new EmailEditWidget( tab1_1 );
462 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) ); 462 connect( mEmailWidget, SIGNAL( modified() ), SLOT( emitModified() ) );
463//US layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 ); 463//US layout->addMultiCellWidget( mEmailWidget, 5, 6, 4, 6 );
464 layout->addMultiCellWidget( mEmailWidget, 5, 6, 0, 1 ); 464 layout->addMultiCellWidget( mEmailWidget, 5, 6, 0, 1 );
465 465
466 /* LR 466 /* LR
467 // add the separator 467 // add the separator
468 bar = new KSeparator( KSeparator::HLine, tab1_1 ); 468 bar = new KSeparator( KSeparator::HLine, tab1_1 );
469//US layout->addMultiCellWidget( bar, 7, 7, 3, 6 ); 469//US layout->addMultiCellWidget( bar, 7, 7, 3, 6 );
470 layout->addMultiCellWidget( bar, 8, 8, 0, 3 ); 470 layout->addMultiCellWidget( bar, 8, 8, 0, 3 );
471 471
472 label = new QLabel( tab1_1 ); 472 label = new QLabel( tab1_1 );
473//US loadIcon call is ambiguous. Add one more parameter 473//US loadIcon call is ambiguous. Add one more parameter
474//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) ); 474//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop) );
475 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) ); 475 label->setPixmap( KGlobal::iconLoader()->loadIcon( "homepage", KIcon::Desktop, 0) );
476//US layout->addMultiCellWidget( label, 8, 9, 3, 3 ); 476//US layout->addMultiCellWidget( label, 8, 9, 3, 3 );
477 layout->addMultiCellWidget( label, 9, 10, 0, 0 ); 477 layout->addMultiCellWidget( label, 9, 10, 0, 0 );
478 */ 478 */
479 label = new QLabel( i18n( "URL:" ), tab1_1 ); 479 label = new QLabel( i18n( "URL:" ), tab1_1 );
480 mURLEdit = new KLineEdit( tab1_1 ); 480 mURLEdit = new KLineEdit( tab1_1 );
481 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ), 481 connect( mURLEdit, SIGNAL( textChanged( const QString& ) ),
482 SLOT( textChanged( const QString& ) ) ); 482 SLOT( textChanged( const QString& ) ) );
483 label->setBuddy( mURLEdit ); 483 label->setBuddy( mURLEdit );
484//US layout->addWidget( label, 8, 4 ); 484//US layout->addWidget( label, 8, 4 );
485 layout->addWidget( label, 7,0 ); 485 layout->addWidget( label, 7,0 );
486//US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 ); 486//US layout->addMultiCellWidget( mURLEdit, 8, 8, 5, 6 );
487 layout->addWidget( mURLEdit, 7, 1); 487 layout->addWidget( mURLEdit, 7, 1);
488 488
489 label = new QLabel( i18n( "&IM address:" ), tab1_1 ); 489 label = new QLabel( i18n( "&IM address:" ), tab1_1 );
490 mIMAddressEdit = new KLineEdit( tab1_1 ); 490 mIMAddressEdit = new KLineEdit( tab1_1 );
491 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ), 491 connect( mIMAddressEdit, SIGNAL( textChanged( const QString& ) ),
492 SLOT( textChanged( const QString& ) ) ); 492 SLOT( textChanged( const QString& ) ) );
493 label->setBuddy( mIMAddressEdit ); 493 label->setBuddy( mIMAddressEdit );
494//US layout->addWidget( label, 9, 4 ); 494//US layout->addWidget( label, 9, 4 );
495 layout->addWidget( label, 8, 0 ); 495 layout->addWidget( label, 8, 0 );
496//US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 ); 496//US layout->addMultiCellWidget( mIMAddressEdit, 9, 9, 5, 6 );
497 layout->addWidget( mIMAddressEdit, 8,1 ); 497 layout->addWidget( mIMAddressEdit, 8,1 );
498 498
499//US layout->addColSpacing( 6, 50 ); 499//US layout->addColSpacing( 6, 50 );
500 500
501//US bar = new KSeparator( KSeparator::HLine, tab1_1 ); 501//US bar = new KSeparator( KSeparator::HLine, tab1_1 );
502//US layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 502//US layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
503 503
504/*US 504/*US
505 /////////////////////////////////////// 505 ///////////////////////////////////////
506 QHBox *categoryBox = new QHBox( tab1 ); 506 QHBox *categoryBox = new QHBox( tab1 );
507 categoryBox->setSpacing( KDialogBase::spacingHintSmall() ); 507 categoryBox->setSpacing( KDialogBase::spacingHintSmall() );
508 508
509 // Categories 509 // Categories
510 button = new QPushButton( i18n( "Categories" ), categoryBox ); 510 button = new QPushButton( i18n( "Categories" ), categoryBox );
511 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 511 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
512 512
513 mCategoryEdit = new KLineEdit( categoryBox ); 513 mCategoryEdit = new KLineEdit( categoryBox );
514 mCategoryEdit->setReadOnly( true ); 514 mCategoryEdit->setReadOnly( true );
515 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 515 connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
516 SLOT( textChanged( const QString& ) ) ); 516 SLOT( textChanged( const QString& ) ) );
517 517
518 mSecrecyWidget = new SecrecyWidget( categoryBox ); 518 mSecrecyWidget = new SecrecyWidget( categoryBox );
519 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 519 connect( mSecrecyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
520 520
521 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 ); 521 layout->addMultiCellWidget( categoryBox, 11, 11, 0, 6 );
522*/ 522*/
523 // Build the layout and add to the tab widget 523 // Build the layout and add to the tab widget
524 layout->activate(); // required 524 layout->activate(); // required
525 525
526 mTabWidget->addTab( tab1_1, i18n( "&Address" ) ); 526 mTabWidget->addTab( tab1_1, i18n( "&Address" ) );
527} 527}
528 528
529 529
530 530
531void AddresseeEditorWidget::setupTab2() 531void AddresseeEditorWidget::setupTab2()
532{ 532{
533 // This is the Details tab 533 // This is the Details tab
534 QWidget *tab2 = new QWidget( mTabWidget ); 534 QWidget *tab2 = new QWidget( mTabWidget );
535 535
536 QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); 536 QGridLayout *layout = new QGridLayout( tab2, 8, 3 );
537 layout->setMargin( KDialogBase::marginHintSmall() ); 537 layout->setMargin( KDialogBase::marginHintSmall() );
538 layout->setSpacing( KDialogBase::spacingHintSmall() ); 538 layout->setSpacing( KDialogBase::spacingHintSmall() );
539 539
540 QLabel *label; 540 QLabel *label;
541 KSeparator* bar; 541 KSeparator* bar;
542 542
543 /////////////////////// 543 ///////////////////////
544 // Office info 544 // Office info
545 545
546 // Department 546 // Department
547 label = new QLabel( tab2 ); 547 label = new QLabel( tab2 );
548//US loadIcon call is ambiguous. Add one more parameter 548//US loadIcon call is ambiguous. Add one more parameter
549//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 549//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
550 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 550 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
551 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 551 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
552 552
553 label = new QLabel( i18n( "Department:" ), tab2 ); 553 label = new QLabel( i18n( "Department:" ), tab2 );
554 layout->addWidget( label, 0, 1 ); 554 layout->addWidget( label, 0, 1 );
555 mDepartmentEdit = new KLineEdit( tab2 ); 555 mDepartmentEdit = new KLineEdit( tab2 );
556 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 556 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
557 SLOT( textChanged( const QString& ) ) ); 557 SLOT( textChanged( const QString& ) ) );
558 label->setBuddy( mDepartmentEdit ); 558 label->setBuddy( mDepartmentEdit );
559 layout->addWidget( mDepartmentEdit, 0, 2 ); 559 layout->addWidget( mDepartmentEdit, 0, 2 );
560 560
561 label = new QLabel( i18n( "Office:" ), tab2 ); 561 label = new QLabel( i18n( "Office:" ), tab2 );
562 layout->addWidget( label, 1, 1 ); 562 layout->addWidget( label, 1, 1 );
563 mOfficeEdit = new KLineEdit( tab2 ); 563 mOfficeEdit = new KLineEdit( tab2 );
564 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 564 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
565 SLOT( textChanged( const QString& ) ) ); 565 SLOT( textChanged( const QString& ) ) );
566 label->setBuddy( mOfficeEdit ); 566 label->setBuddy( mOfficeEdit );
567 layout->addWidget( mOfficeEdit, 1, 2 ); 567 layout->addWidget( mOfficeEdit, 1, 2 );
568 568
569 label = new QLabel( i18n( "Profession:" ), tab2 ); 569 label = new QLabel( i18n( "Profession:" ), tab2 );
570 layout->addWidget( label, 2, 1 ); 570 layout->addWidget( label, 2, 1 );
571 mProfessionEdit = new KLineEdit( tab2 ); 571 mProfessionEdit = new KLineEdit( tab2 );
572 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), 572 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ),
573 SLOT( textChanged( const QString& ) ) ); 573 SLOT( textChanged( const QString& ) ) );
574 label->setBuddy( mProfessionEdit ); 574 label->setBuddy( mProfessionEdit );
575 layout->addWidget( mProfessionEdit, 2, 2 ); 575 layout->addWidget( mProfessionEdit, 2, 2 );
576 576
577 label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); 577 label = new QLabel( i18n( "Manager\'s name:" ), tab2 );
578//US layout->addWidget( label, 0, 3 ); 578//US layout->addWidget( label, 0, 3 );
579 layout->addWidget( label, 3, 1 ); 579 layout->addWidget( label, 3, 1 );
580 mManagerEdit = new KLineEdit( tab2 ); 580 mManagerEdit = new KLineEdit( tab2 );
581 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), 581 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ),
582 SLOT( textChanged( const QString& ) ) ); 582 SLOT( textChanged( const QString& ) ) );
583 label->setBuddy( mManagerEdit ); 583 label->setBuddy( mManagerEdit );
584//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); 584//US layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 );
585 layout->addWidget( mManagerEdit, 3, 2 ); 585 layout->addWidget( mManagerEdit, 3, 2 );
586 586
587 label = new QLabel( i18n( "Assistant's name:" ), tab2 ); 587 label = new QLabel( i18n( "Assistant's name:" ), tab2 );
588//US layout->addWidget( label, 1, 3 ); 588//US layout->addWidget( label, 1, 3 );
589 layout->addWidget( label, 4, 1 ); 589 layout->addWidget( label, 4, 1 );
590 mAssistantEdit = new KLineEdit( tab2 ); 590 mAssistantEdit = new KLineEdit( tab2 );
591 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), 591 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ),
592 SLOT( textChanged( const QString& ) ) ); 592 SLOT( textChanged( const QString& ) ) );
593 label->setBuddy( mAssistantEdit ); 593 label->setBuddy( mAssistantEdit );
594//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); 594//US layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 );
595 layout->addWidget( mAssistantEdit, 4, 2 ); 595 layout->addWidget( mAssistantEdit, 4, 2 );
596 596
597 bar = new KSeparator( KSeparator::HLine, tab2 ); 597 bar = new KSeparator( KSeparator::HLine, tab2 );
598//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); 598//US layout->addMultiCellWidget( bar, 3, 3, 0, 5 );
599 layout->addMultiCellWidget( bar, 5, 5, 0, 2 ); 599 layout->addMultiCellWidget( bar, 5, 5, 0, 2 );
600 600
601 ///////////////////////////////////////////////// 601 /////////////////////////////////////////////////
602 // Personal info 602 // Personal info
603 603
604 //label = new QLabel( tab2 ); 604 //label = new QLabel( tab2 );
605//US loadIcon call is ambiguous. Add one more parameter 605//US loadIcon call is ambiguous. Add one more parameter
606//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 606//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
607 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 607 //label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
608//US layout->addMultiCellWidget( label, 4, 5, 0, 0 ); 608//US layout->addMultiCellWidget( label, 4, 5, 0, 0 );
609 //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 609 //layout->addMultiCellWidget( label, 6, 7, 0, 0 );
610 610
611 611
612 int iii = 6; 612 int iii = 6;
613 613
614 if ( QApplication::desktop()->width() == 640 ) { 614 if ( QApplication::desktop()->width() == 640 ) {
615 QHBox * nbox = new QHBox ( tab2 ); 615 QHBox * nbox = new QHBox ( tab2 );
616 label = new QLabel( i18n( "Nick name:" )+" ", nbox ); 616 label = new QLabel( i18n( "Nick name:" )+" ", nbox );
617 mNicknameEdit = new KLineEdit( nbox ); 617 mNicknameEdit = new KLineEdit( nbox );
618 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 618 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
619 SLOT( textChanged( const QString& ) ) ); 619 SLOT( textChanged( const QString& ) ) );
620 label->setBuddy( mNicknameEdit ); 620 label->setBuddy( mNicknameEdit );
621 621
622 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox ); 622 label = new QLabel( " "+i18n( "Spouse's name:" )+" ", nbox );
623 mSpouseEdit = new KLineEdit( nbox ); 623 mSpouseEdit = new KLineEdit( nbox );
624 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 624 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
625 SLOT( textChanged( const QString& ) ) ); 625 SLOT( textChanged( const QString& ) ) );
626 label->setBuddy( mSpouseEdit ); 626 label->setBuddy( mSpouseEdit );
627 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 627 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
628 ++iii; 628 ++iii;
629 629
630 } else { 630 } else {
631 label = new QLabel( i18n( "Nick name:" ), tab2 ); 631 label = new QLabel( i18n( "Nick name:" ), tab2 );
632 layout->addWidget( label, iii, 1 ); 632 layout->addWidget( label, iii, 1 );
633 mNicknameEdit = new KLineEdit( tab2 ); 633 mNicknameEdit = new KLineEdit( tab2 );
634 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 634 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
635 SLOT( textChanged( const QString& ) ) ); 635 SLOT( textChanged( const QString& ) ) );
636 label->setBuddy( mNicknameEdit ); 636 label->setBuddy( mNicknameEdit );
637 layout->addWidget( mNicknameEdit, iii, 2 ); 637 layout->addWidget( mNicknameEdit, iii, 2 );
638 ++iii; 638 ++iii;
639 639
640 label = new QLabel( i18n( "Spouse's name:" ), tab2 ); 640 label = new QLabel( i18n( "Spouse's name:" ), tab2 );
641 layout->addWidget( label, iii, 1 ); 641 layout->addWidget( label, iii, 1 );
642 mSpouseEdit = new KLineEdit( tab2 ); 642 mSpouseEdit = new KLineEdit( tab2 );
643 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 643 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
644 SLOT( textChanged( const QString& ) ) ); 644 SLOT( textChanged( const QString& ) ) );
645 label->setBuddy( mSpouseEdit ); 645 label->setBuddy( mSpouseEdit );
646 layout->addWidget( mSpouseEdit, iii, 2 ); 646 layout->addWidget( mSpouseEdit, iii, 2 );
647 ++iii; 647 ++iii;
648 } 648 }
649 649
650 label = new QLabel( i18n( "Children's names:" ), tab2 ); 650 label = new QLabel( i18n( "Children's names:" ), tab2 );
651 layout->addWidget( label, iii, 1 ); 651 layout->addWidget( label, iii, 1 );
652 mChildEdit = new KLineEdit( tab2 ); 652 mChildEdit = new KLineEdit( tab2 );
653 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), 653 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
654 SLOT( textChanged( const QString& ) ) ); 654 SLOT( textChanged( const QString& ) ) );
655 label->setBuddy( mChildEdit ); 655 label->setBuddy( mChildEdit );
656 layout->addWidget( mChildEdit, iii, 2 ); 656 layout->addWidget( mChildEdit, iii, 2 );
657 ++iii; 657 ++iii;
658 if ( QApplication::desktop()->width() == 640 ) { 658 if ( QApplication::desktop()->width() == 640 ) {
659 QHBox * nbox = new QHBox ( tab2 ); 659 QHBox * nbox = new QHBox ( tab2 );
660 label = new QLabel( i18n( "Birthday:" )+" ", nbox ); 660 label = new QLabel( i18n( "Birthday:" )+" ", nbox );
661 mBirthdayPicker = new KDateEdit( nbox ); 661 mBirthdayPicker = new KDateEdit( nbox );
662 mBirthdayPicker->toggleDateFormat(); 662 mBirthdayPicker->toggleDateFormat();
663 mBirthdayPicker->setHandleInvalid( true ); 663 mBirthdayPicker->setHandleInvalid( true );
664 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 664 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
665 SLOT( dateChanged( QDate ) ) ); 665 SLOT( dateChanged( QDate ) ) );
666 666
667 label->setBuddy( mBirthdayPicker ); 667 label->setBuddy( mBirthdayPicker );
668 668
669 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox ); 669 label = new QLabel( " "+i18n( "Anniversary:" )+" ", nbox );
670 mAnniversaryPicker = new KDateEdit( nbox ); 670 mAnniversaryPicker = new KDateEdit( nbox );
671 mAnniversaryPicker->setHandleInvalid( true ); 671 mAnniversaryPicker->setHandleInvalid( true );
672 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 672 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
673 SLOT( dateChanged( QDate ) ) ); 673 SLOT( dateChanged( QDate ) ) );
674 674
675 label->setBuddy( mAnniversaryPicker ); 675 label->setBuddy( mAnniversaryPicker );
676 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 ); 676 layout->addMultiCellWidget( nbox, iii, iii, 1, 2 );
677 ++iii; 677 ++iii;
678 678
679 } else { 679 } else {
680 680
681 label = new QLabel( i18n( "Birthday:" ), tab2 ); 681 label = new QLabel( i18n( "Birthday:" ), tab2 );
682 layout->addWidget( label, iii, 1 ); 682 layout->addWidget( label, iii, 1 );
683 mBirthdayPicker = new KDateEdit( tab2 ); 683 mBirthdayPicker = new KDateEdit( tab2 );
684 mBirthdayPicker->toggleDateFormat(); 684 mBirthdayPicker->toggleDateFormat();
685 mBirthdayPicker->setHandleInvalid( true ); 685 mBirthdayPicker->setHandleInvalid( true );
686 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 686 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
687 SLOT( dateChanged( QDate ) ) ); 687 SLOT( dateChanged( QDate ) ) );
688 688
689 label->setBuddy( mBirthdayPicker ); 689 label->setBuddy( mBirthdayPicker );
690 layout->addWidget( mBirthdayPicker, iii, 2 ); 690 layout->addWidget( mBirthdayPicker, iii, 2 );
691 ++iii; 691 ++iii;
692 692
693 label = new QLabel( i18n( "Anniversary:" ), tab2 ); 693 label = new QLabel( i18n( "Anniversary:" ), tab2 );
694 layout->addWidget( label, iii, 1 ); 694 layout->addWidget( label, iii, 1 );
695 mAnniversaryPicker = new KDateEdit( tab2 ); 695 mAnniversaryPicker = new KDateEdit( tab2 );
696 mAnniversaryPicker->setHandleInvalid( true ); 696 mAnniversaryPicker->setHandleInvalid( true );
697 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 697 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
698 SLOT( dateChanged( QDate ) ) ); 698 SLOT( dateChanged( QDate ) ) );
699 699
700 label->setBuddy( mAnniversaryPicker ); 700 label->setBuddy( mAnniversaryPicker );
701 layout->addWidget( mAnniversaryPicker, iii, 2 ); 701 layout->addWidget( mAnniversaryPicker, iii, 2 );
702 ++iii; 702 ++iii;
703 703
704 } 704 }
705 705
706 label = new QLabel( i18n( "Gender:" ), tab2 ); 706 label = new QLabel( i18n( "Gender:" ), tab2 );
707 layout->addWidget( label, iii, 1 ); 707 layout->addWidget( label, iii, 1 );
708 mGenderBox = new QComboBox ( tab2 ); 708 mGenderBox = new QComboBox ( tab2 );
709 mGenderBox->insertItem ( i18n( "ALIEN (gender undefined)" )); 709 mGenderBox->insertItem ( i18n( "ALIEN (gender undefined)" ));
710 mGenderBox->insertItem ( i18n( "female" )); 710 mGenderBox->insertItem ( i18n( "female" ));
711 mGenderBox->insertItem ( i18n( "male" )); 711 mGenderBox->insertItem ( i18n( "male" ));
712 connect( mGenderBox, SIGNAL( activated ( const QString & ) ), 712 connect( mGenderBox, SIGNAL( activated ( const QString & ) ),
713 SLOT( textChanged( const QString& ) ) ); 713 SLOT( textChanged( const QString& ) ) );
714 label->setBuddy( mGenderBox ); 714 label->setBuddy( mGenderBox );
715 layout->addWidget( mGenderBox, iii, 2 ); 715 layout->addWidget( mGenderBox, iii, 2 );
716 ++iii; 716 ++iii;
717 // Build the layout and add to the tab widget 717 // Build the layout and add to the tab widget
718 layout->activate(); // required 718 layout->activate(); // required
719 719
720 mTabWidget->addTab( tab2, i18n( "&Details" ) ); 720 mTabWidget->addTab( tab2, i18n( "&Details" ) );
721} 721}
722 722
723void AddresseeEditorWidget::setupTab2_1() 723void AddresseeEditorWidget::setupTab2_1()
724{ 724{
725 // This is the Details tab 725 // This is the Details tab
726 QWidget *tab2_2 = new QWidget( mTabWidget ); 726 QWidget *tab2_2 = new QWidget( mTabWidget );
727 727
728 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); 728 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 );
729 layout->setMargin( KDialogBase::marginHintSmall() ); 729 layout->setMargin( KDialogBase::marginHintSmall() );
730 layout->setSpacing( KDialogBase::spacingHintSmall() ); 730 layout->setSpacing( KDialogBase::spacingHintSmall() );
731 731
732 QLabel *label; 732 QLabel *label;
733 KSeparator* bar; 733 KSeparator* bar;
734 734
735/*US 735/*US
736 /////////////////////// 736 ///////////////////////
737 // Office info 737 // Office info
738 738
739 // Department 739 // Department
740 label = new QLabel( tab2 ); 740 label = new QLabel( tab2 );
741//US loadIcon call is ambiguous. Add one more parameter 741//US loadIcon call is ambiguous. Add one more parameter
742//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) ); 742//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop ) );
743 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) ); 743 label->setPixmap( KGlobal::iconLoader()->loadIcon( "folder", KIcon::Desktop, 0 ) );
744 layout->addMultiCellWidget( label, 0, 1, 0, 0 ); 744 layout->addMultiCellWidget( label, 0, 1, 0, 0 );
745 745
746 label = new QLabel( i18n( "Department:" ), tab2 ); 746 label = new QLabel( i18n( "Department:" ), tab2 );
747 layout->addWidget( label, 0, 1 ); 747 layout->addWidget( label, 0, 1 );
748 mDepartmentEdit = new KLineEdit( tab2 ); 748 mDepartmentEdit = new KLineEdit( tab2 );
749 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ), 749 connect( mDepartmentEdit, SIGNAL( textChanged( const QString& ) ),
750 SLOT( textChanged( const QString& ) ) ); 750 SLOT( textChanged( const QString& ) ) );
751 label->setBuddy( mDepartmentEdit ); 751 label->setBuddy( mDepartmentEdit );
752 layout->addWidget( mDepartmentEdit, 0, 2 ); 752 layout->addWidget( mDepartmentEdit, 0, 2 );
753 753
754 label = new QLabel( i18n( "Office:" ), tab2 ); 754 label = new QLabel( i18n( "Office:" ), tab2 );
755 layout->addWidget( label, 1, 1 ); 755 layout->addWidget( label, 1, 1 );
756 mOfficeEdit = new KLineEdit( tab2 ); 756 mOfficeEdit = new KLineEdit( tab2 );
757 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ), 757 connect( mOfficeEdit, SIGNAL( textChanged( const QString& ) ),
758 SLOT( textChanged( const QString& ) ) ); 758 SLOT( textChanged( const QString& ) ) );
759 label->setBuddy( mOfficeEdit ); 759 label->setBuddy( mOfficeEdit );
760 layout->addWidget( mOfficeEdit, 1, 2 ); 760 layout->addWidget( mOfficeEdit, 1, 2 );
761 761
762 label = new QLabel( i18n( "Profession:" ), tab2 ); 762 label = new QLabel( i18n( "Profession:" ), tab2 );
763 layout->addWidget( label, 2, 1 ); 763 layout->addWidget( label, 2, 1 );
764 mProfessionEdit = new KLineEdit( tab2 ); 764 mProfessionEdit = new KLineEdit( tab2 );
765 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ), 765 connect( mProfessionEdit, SIGNAL( textChanged( const QString& ) ),
766 SLOT( textChanged( const QString& ) ) ); 766 SLOT( textChanged( const QString& ) ) );
767 label->setBuddy( mProfessionEdit ); 767 label->setBuddy( mProfessionEdit );
768 layout->addWidget( mProfessionEdit, 2, 2 ); 768 layout->addWidget( mProfessionEdit, 2, 2 );
769 769
770 label = new QLabel( i18n( "Manager\'s name:" ), tab2 ); 770 label = new QLabel( i18n( "Manager\'s name:" ), tab2 );
771 layout->addWidget( label, 0, 3 ); 771 layout->addWidget( label, 0, 3 );
772 mManagerEdit = new KLineEdit( tab2 ); 772 mManagerEdit = new KLineEdit( tab2 );
773 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ), 773 connect( mManagerEdit, SIGNAL( textChanged( const QString& ) ),
774 SLOT( textChanged( const QString& ) ) ); 774 SLOT( textChanged( const QString& ) ) );
775 label->setBuddy( mManagerEdit ); 775 label->setBuddy( mManagerEdit );
776 layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 ); 776 layout->addMultiCellWidget( mManagerEdit, 0, 0, 4, 5 );
777 777
778 label = new QLabel( i18n( "Assistant's name:" ), tab2 ); 778 label = new QLabel( i18n( "Assistant's name:" ), tab2 );
779 layout->addWidget( label, 1, 3 ); 779 layout->addWidget( label, 1, 3 );
780 mAssistantEdit = new KLineEdit( tab2 ); 780 mAssistantEdit = new KLineEdit( tab2 );
781 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ), 781 connect( mAssistantEdit, SIGNAL( textChanged( const QString& ) ),
782 SLOT( textChanged( const QString& ) ) ); 782 SLOT( textChanged( const QString& ) ) );
783 label->setBuddy( mAssistantEdit ); 783 label->setBuddy( mAssistantEdit );
784 layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 ); 784 layout->addMultiCellWidget( mAssistantEdit, 1, 1, 4, 5 );
785 785
786 bar = new KSeparator( KSeparator::HLine, tab2 ); 786 bar = new KSeparator( KSeparator::HLine, tab2 );
787 layout->addMultiCellWidget( bar, 3, 3, 0, 5 ); 787 layout->addMultiCellWidget( bar, 3, 3, 0, 5 );
788 788
789 ///////////////////////////////////////////////// 789 /////////////////////////////////////////////////
790 // Personal info 790 // Personal info
791 791
792 label = new QLabel( tab2 ); 792 label = new QLabel( tab2 );
793//US loadIcon call is ambiguous. Add one more parameter 793//US loadIcon call is ambiguous. Add one more parameter
794//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) ); 794//US label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop ) );
795 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) ); 795 label->setPixmap( KGlobal::iconLoader()->loadIcon( "personal", KIcon::Desktop, 0 ) );
796 layout->addMultiCellWidget( label, 4, 5, 0, 0 ); 796 layout->addMultiCellWidget( label, 4, 5, 0, 0 );
797 797
798 label = new QLabel( i18n( "Nick name:" ), tab2 ); 798 label = new QLabel( i18n( "Nick name:" ), tab2 );
799 layout->addWidget( label, 4, 1 ); 799 layout->addWidget( label, 4, 1 );
800 mNicknameEdit = new KLineEdit( tab2 ); 800 mNicknameEdit = new KLineEdit( tab2 );
801 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 801 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
802 SLOT( textChanged( const QString& ) ) ); 802 SLOT( textChanged( const QString& ) ) );
803 label->setBuddy( mNicknameEdit ); 803 label->setBuddy( mNicknameEdit );
804 layout->addWidget( mNicknameEdit, 4, 2 ); 804 layout->addWidget( mNicknameEdit, 4, 2 );
805 805
806 label = new QLabel( i18n( "Spouse's name:" ), tab2 ); 806 label = new QLabel( i18n( "Spouse's name:" ), tab2 );
807 layout->addWidget( label, 5, 1 ); 807 layout->addWidget( label, 5, 1 );
808 mSpouseEdit = new KLineEdit( tab2 ); 808 mSpouseEdit = new KLineEdit( tab2 );
809 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ), 809 connect( mSpouseEdit, SIGNAL( textChanged( const QString& ) ),
810 SLOT( textChanged( const QString& ) ) ); 810 SLOT( textChanged( const QString& ) ) );
811 label->setBuddy( mSpouseEdit ); 811 label->setBuddy( mSpouseEdit );
812 layout->addWidget( mSpouseEdit, 5, 2 ); 812 layout->addWidget( mSpouseEdit, 5, 2 );
813 813
814 label = new QLabel( i18n( "Birthday:" ), tab2 ); 814 label = new QLabel( i18n( "Birthday:" ), tab2 );
815 layout->addWidget( label, 4, 3 ); 815 layout->addWidget( label, 4, 3 );
816 mBirthdayPicker = new KDateEdit( tab2 ); 816 mBirthdayPicker = new KDateEdit( tab2 );
817 mBirthdayPicker->setHandleInvalid( true ); 817 mBirthdayPicker->setHandleInvalid( true );
818 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 818 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
819 SLOT( dateChanged( QDate ) ) ); 819 SLOT( dateChanged( QDate ) ) );
820 connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ), 820 connect( mBirthdayPicker, SIGNAL( invalidDateEntered() ),
821 SLOT( invalidDate() ) ); 821 SLOT( invalidDate() ) );
822 connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ), 822 connect( mBirthdayPicker, SIGNAL( textChanged( const QString& ) ),
823 SLOT( emitModified() ) ); 823 SLOT( emitModified() ) );
824 label->setBuddy( mBirthdayPicker ); 824 label->setBuddy( mBirthdayPicker );
825 layout->addWidget( mBirthdayPicker, 4, 4 ); 825 layout->addWidget( mBirthdayPicker, 4, 4 );
826 826
827 label = new QLabel( i18n( "Anniversary:" ), tab2 ); 827 label = new QLabel( i18n( "Anniversary:" ), tab2 );
828 layout->addWidget( label, 5, 3 ); 828 layout->addWidget( label, 5, 3 );
829 mAnniversaryPicker = new KDateEdit( tab2 ); 829 mAnniversaryPicker = new KDateEdit( tab2 );
830 mAnniversaryPicker->setHandleInvalid( true ); 830 mAnniversaryPicker->setHandleInvalid( true );
831 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ), 831 connect( mAnniversaryPicker, SIGNAL( dateChanged( QDate ) ),
832 SLOT( dateChanged( QDate ) ) ); 832 SLOT( dateChanged( QDate ) ) );
833 connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ), 833 connect( mAnniversaryPicker, SIGNAL( invalidDateEntered() ),
834 SLOT( invalidDate() ) ); 834 SLOT( invalidDate() ) );
835 connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ), 835 connect( mAnniversaryPicker, SIGNAL( textChanged( const QString& ) ),
836 SLOT( emitModified() ) ); 836 SLOT( emitModified() ) );
837 label->setBuddy( mAnniversaryPicker ); 837 label->setBuddy( mAnniversaryPicker );
838 layout->addWidget( mAnniversaryPicker, 5, 4 ); 838 layout->addWidget( mAnniversaryPicker, 5, 4 );
839 839
840 bar = new KSeparator( KSeparator::HLine, tab2 ); 840 bar = new KSeparator( KSeparator::HLine, tab2 );
841 layout->addMultiCellWidget( bar, 6, 6, 0, 5 ); 841 layout->addMultiCellWidget( bar, 6, 6, 0, 5 );
842*/ 842*/
843 ////////////////////////////////////// 843 //////////////////////////////////////
844 // Notes 844 // Notes
845 label = new QLabel( i18n( "Note:" ), tab2_2 ); 845 label = new QLabel( i18n( "Note:" ), tab2_2 );
846 label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); 846 label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
847//US layout->addWidget( label, 7, 0 ); 847//US layout->addWidget( label, 7, 0 );
848 layout->addWidget( label, 0, 0 ); 848 layout->addWidget( label, 0, 0 );
849#ifndef KAB_EMBEDDED 849#ifndef KAB_EMBEDDED
850 mNoteEdit = new QTextEdit( tab2_2 ); 850 mNoteEdit = new QTextEdit( tab2_2 );
851 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); 851 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth );
852 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 852 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
853#else //KAB_EMBEDDED 853#else //KAB_EMBEDDED
854 mNoteEdit = new QMultiLineEdit( tab2_2 ); 854 mNoteEdit = new QMultiLineEdit( tab2_2 );
855 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); 855 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth );
856 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 856 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
857#endif //KAB_EMBEDDED 857#endif //KAB_EMBEDDED
858 858
859 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); 859 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) );
860 label->setBuddy( mNoteEdit ); 860 label->setBuddy( mNoteEdit );
861//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); 861//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 );
862 layout->addWidget( mNoteEdit, 1, 0); 862 layout->addWidget( mNoteEdit, 1, 0);
863 863
864 // Build the layout and add to the tab widget 864 // Build the layout and add to the tab widget
865 layout->activate(); // required 865 layout->activate(); // required
866 866
867 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) ); 867 mTabWidget->addTab( tab2_2, i18n( "&Notes" ) );
868} 868}
869 869
870 870
871 871
872void AddresseeEditorWidget::setupTab3() 872void AddresseeEditorWidget::setupTab3()
873{ 873{
874 // This is the Misc tab 874 // This is the Misc tab
875 QWidget *tab3 = new QWidget( mTabWidget ); 875 QWidget *tab3 = new QWidget( mTabWidget );
876 876
877 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 877 QGridLayout *layout = new QGridLayout( tab3, 1, 1 );
878 layout->setMargin( KDialogBase::marginHintSmall() ); 878 layout->setMargin( KDialogBase::marginHintSmall() );
879 layout->setSpacing( KDialogBase::spacingHintSmall() ); 879 layout->setSpacing( KDialogBase::spacingHintSmall() );
880//US layout->setColStretch( 2, 1 ); 880//US layout->setColStretch( 2, 1 );
881 881
882 ////////////////////////////////////// 882 //////////////////////////////////////
883 // Geo 883 // Geo
884 mGeoWidget = new GeoWidget( tab3 ); 884 mGeoWidget = new GeoWidget( tab3 );
885 // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); 885 // mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
886 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 886 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
887 layout->addWidget( mGeoWidget, 0, 0 ); 887 layout->addWidget( mGeoWidget, 0, 0 );
888/*US 888/*US
889 ////////////////////////////////////// 889 //////////////////////////////////////
890 // Sound 890 // Sound
891#ifndef KAB_EMBEDDED 891#ifndef KAB_EMBEDDED
892 mSoundWidget = new SoundWidget( tab3 ); 892 mSoundWidget = new SoundWidget( tab3 );
893 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); 893 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() );
894 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 894 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
895 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); 895 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop );
896#else //KAB_EMBEDDED 896#else //KAB_EMBEDDED
897qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); 897qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed");
898#endif //KAB_EMBEDDED 898#endif //KAB_EMBEDDED
899 899
900 ////////////////////////////////////// 900 //////////////////////////////////////
901 // Images 901 // Images
902 mImageWidget = new ImageWidget( tab3 ); 902 mImageWidget = new ImageWidget( tab3 );
903 mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); 903 mImageWidget->setMinimumSize( mImageWidget->sizeHint() );
904 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 904 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
905 layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop ); 905 layout->addWidget( mImageWidget, 1, 0, Qt::AlignTop );
906*/ 906*/
907//US 907//US
908/* 908/*
909 KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 ); 909 KSeparator* bar = new KSeparator( KSeparator::HLine, tab3 );
910 layout->addMultiCellWidget( bar, 1, 1, 0, 0 ); 910 layout->addMultiCellWidget( bar, 1, 1, 0, 0 );
911*/ 911*/
912 ////////////////////////////////////// 912 //////////////////////////////////////
913 // Keys 913 // Keys
914 mKeyWidget = new KeyWidget( tab3 ); 914 mKeyWidget = new KeyWidget( tab3 );
915 //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); 915 //mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() );
916 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 916 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
917//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); 917//US layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
918 layout->addWidget( mKeyWidget, 1, 0 ); 918 layout->addWidget( mKeyWidget, 1, 0 );
919 919
920 mTabWidget->addTab( tab3, i18n( "&Misc" ) ); 920 mTabWidget->addTab( tab3, i18n( "&Misc" ) );
921} 921}
922 922
923void AddresseeEditorWidget::setupTab3_1() 923void AddresseeEditorWidget::setupTab3_1()
924{ 924{
925 // This is the Misc tab 925 // This is the Misc tab
926 QWidget *tab3 = new QWidget( mTabWidget ); 926 QWidget *tab3 = new QWidget( mTabWidget );
927 927
928//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); 928//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 );
929 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 929 QGridLayout *layout = new QGridLayout( tab3, 1, 1 );
930 layout->setMargin( KDialogBase::marginHint() ); 930 layout->setMargin( KDialogBase::marginHint() );
931 layout->setSpacing( KDialogBase::spacingHint() ); 931 layout->setSpacing( KDialogBase::spacingHint() );
932//US layout->setColStretch( 2, 1 ); 932//US layout->setColStretch( 2, 1 );
933 933
934/*US 934/*US
935 ////////////////////////////////////// 935 //////////////////////////////////////
936 // Geo 936 // Geo
937 mGeoWidget = new GeoWidget( tab3 ); 937 mGeoWidget = new GeoWidget( tab3 );
938 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() ); 938 mGeoWidget->setMinimumSize( mGeoWidget->sizeHint() );
939 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 939 connect( mGeoWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
940 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop ); 940 layout->addWidget( mGeoWidget, 0, 0, Qt::AlignTop );
941*/ 941*/
942 ////////////////////////////////////// 942 //////////////////////////////////////
943 // Sound 943 // Sound
944#ifndef KAB_EMBEDDED 944#ifndef KAB_EMBEDDED
945 mSoundWidget = new SoundWidget( tab3 ); 945 mSoundWidget = new SoundWidget( tab3 );
946 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() ); 946 mSoundWidget->setMinimumSize( mSoundWidget->sizeHint() );
947 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 947 connect( mSoundWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
948 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop ); 948 layout->addWidget( mSoundWidget, 0, 1, Qt::AlignTop );
949#else //KAB_EMBEDDED 949#else //KAB_EMBEDDED
950//US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed"); 950//US qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be changed");
951#endif //KAB_EMBEDDED 951#endif //KAB_EMBEDDED
952 952
953 ////////////////////////////////////// 953 //////////////////////////////////////
954 // Images 954 // Images
955 mImageWidget = new ImageWidget( tab3 ); 955 mImageWidget = new ImageWidget( tab3 );
956 mImageWidget->setMinimumSize( mImageWidget->sizeHint() ); 956 mImageWidget->setMinimumSize( mImageWidget->sizeHint() );
957 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 957 connect( mImageWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
958 layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop ); 958 layout->addWidget( mImageWidget, 0, 0, Qt::AlignTop );
959/*US 959/*US
960 ////////////////////////////////////// 960 //////////////////////////////////////
961 // Keys 961 // Keys
962 mKeyWidget = new KeyWidget( tab3 ); 962 mKeyWidget = new KeyWidget( tab3 );
963 mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() ); 963 mKeyWidget->setMinimumSize( mKeyWidget->sizeHint() );
964 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) ); 964 connect( mKeyWidget, SIGNAL( changed() ), SLOT( emitModified() ) );
965 layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop ); 965 layout->addWidget( mKeyWidget, 1, 1, Qt::AlignTop );
966*/ 966*/
967 mTabWidget->addTab( tab3, i18n( "&Images" ) ); 967 mTabWidget->addTab( tab3, i18n( "&Images" ) );
968} 968}
969 969
970 970
971void AddresseeEditorWidget::load() 971void AddresseeEditorWidget::load()
972{ 972{
973 973
974 // Block signals in case anything tries to emit modified 974 // Block signals in case anything tries to emit modified
975 // CS: This doesn't seem to work. 975 // CS: This doesn't seem to work.
976 bool block = signalsBlocked(); 976 bool block = signalsBlocked();
977 blockSignals( true ); 977 blockSignals( true );
978 mBlockSignals = true; // used for internal signal blocking 978 mBlockSignals = true; // used for internal signal blocking
979 979
980 mNameEdit->setText( mAddressee.assembledName() ); 980 mNameEdit->setText( mAddressee.assembledName() );
981 981
982 if ( mAddressee.formattedName().isEmpty() ) { 982 if ( mAddressee.formattedName().isEmpty() ) {
983//US KConfig config( "kaddressbookrc" ); 983//US KConfig config( "kaddressbookrc" );
984 KConfig config( locateLocal("config", "kabcrc") ); 984 KConfig config( locateLocal("config", "kabcrc") );
985 config.setGroup( "General" ); 985 config.setGroup( "General" );
986 mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 ); 986 mFormattedNameType = config.readNumEntry( "FormattedNameType", 1 );
987 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); 987 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
988 } else {; 988 } else {;
989 if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) ) 989 if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::SimpleName ) )
990 mFormattedNameType = NameEditDialog::SimpleName; 990 mFormattedNameType = NameEditDialog::SimpleName;
991 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) ) 991 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::FullName ) )
992 mFormattedNameType = NameEditDialog::FullName; 992 mFormattedNameType = NameEditDialog::FullName;
993 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) ) 993 else if ( mAddressee.formattedName() == NameEditDialog::formattedName( mAddressee, NameEditDialog::ReverseName ) )
994 mFormattedNameType = NameEditDialog::ReverseName; 994 mFormattedNameType = NameEditDialog::ReverseName;
995 else 995 else
996 mFormattedNameType = NameEditDialog::CustomName; 996 mFormattedNameType = NameEditDialog::CustomName;
997 } 997 }
998 998
999 mFormattedNameLabel->setText( mAddressee.formattedName() ); 999 mFormattedNameLabel->setText( mAddressee.formattedName() );
1000 1000
1001 mAConfig->setUid( mAddressee.uid() );
1002 if ( mAConfig->automaticNameParsing() ) {
1003 mNameLabel->hide();
1004 mNameEdit->show();
1005 } else {
1006 mNameEdit->hide();
1007 mNameLabel->setText( mNameEdit->text() );
1008 mNameLabel->show();
1009 }
1010
1001 mRoleEdit->setText( mAddressee.role() ); 1011 mRoleEdit->setText( mAddressee.role() );
1002 mOrgEdit->setText( mAddressee.organization() ); 1012 mOrgEdit->setText( mAddressee.organization() );
1003 1013
1004//US mURLEdit->setURL( mAddressee.url().url() ); 1014//US mURLEdit->setURL( mAddressee.url().url() );
1005 mURLEdit->setText( mAddressee.url().prettyURL() ); 1015 mURLEdit->setText( mAddressee.url().prettyURL() );
1006//US?? mURLEdit->home( false ); 1016//US?? mURLEdit->home( false );
1007 1017
1008 // mNoteEdit->setText( mAddressee.note() ); 1018 // mNoteEdit->setText( mAddressee.note() );
1009 mNoteEdit->setText( mAddressee.note() ); 1019 mNoteEdit->setText( mAddressee.note() );
1010 mEmailWidget->setEmails( mAddressee.emails() ); 1020 mEmailWidget->setEmails( mAddressee.emails() );
1011 mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() ); 1021 mPhoneEditWidget->setPhoneNumbers( mAddressee.phoneNumbers() );
1012 mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() ); 1022 mAddressEditWidget->setAddresses( mAddressee, mAddressee.addresses() );
1013 mBirthdayPicker->setDate( mAddressee.birthday().date() ); 1023 mBirthdayPicker->setDate( mAddressee.birthday().date() );
1014 1024
1015//US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom( 1025//US mAnniversaryPicker->setDate( QDate::fromString( mAddressee.custom(
1016//US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) ); 1026//US "KADDRESSBOOK", "X-Anniversary" ), Qt::ISODate) );
1017 QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), 1027 QDate dt = KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ),
1018 "%Y-%m-%d"); // = Qt::ISODate 1028 "%Y-%m-%d"); // = Qt::ISODate
1019 mAnniversaryPicker->setDate( dt ); 1029 mAnniversaryPicker->setDate( dt );
1020 1030
1021 1031
1022 mNicknameEdit->setText( mAddressee.nickName() ); 1032 mNicknameEdit->setText( mAddressee.nickName() );
1023 mCategoryEdit->setText( mAddressee.categories().join( "," ) ); 1033 mCategoryEdit->setText( mAddressee.categories().join( "," ) );
1024 1034
1025 mGeoWidget->setGeo( mAddressee.geo() ); 1035 mGeoWidget->setGeo( mAddressee.geo() );
1026 mImageWidget->setPhoto( mAddressee.photo() ); 1036 mImageWidget->setPhoto( mAddressee.photo() );
1027 mImageWidget->setLogo( mAddressee.logo() ); 1037 mImageWidget->setLogo( mAddressee.logo() );
1028 mKeyWidget->setKeys( mAddressee.keys() ); 1038 mKeyWidget->setKeys( mAddressee.keys() );
1029 mSecrecyWidget->setSecrecy( mAddressee.secrecy() ); 1039 mSecrecyWidget->setSecrecy( mAddressee.secrecy() );
1030#ifndef KAB_EMBEDDED 1040#ifndef KAB_EMBEDDED
1031 mSoundWidget->setSound( mAddressee.sound() ); 1041 mSoundWidget->setSound( mAddressee.sound() );
1032#else //KAB_EMBEDDED 1042#else //KAB_EMBEDDED
1033//US qDebug("AddresseeEditorWidget::load has to be changed 2"); 1043//US qDebug("AddresseeEditorWidget::load has to be changed 2");
1034#endif //KAB_EMBEDDED 1044#endif //KAB_EMBEDDED
1035 1045
1036 // Load customs 1046 // Load customs
1037 mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) ); 1047 mIMAddressEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ) );
1038 mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) ); 1048 mSpouseEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ) );
1039 mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) ); 1049 mChildEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Children" ) );
1040 mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) ); 1050 mManagerEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-ManagersName" ) );
1041 mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) ); 1051 mAssistantEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-AssistantsName" ) );
1042 mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) ); 1052 mDepartmentEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Department" ) );
1043 mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) ); 1053 mOfficeEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Office" ) );
1044 mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) ); 1054 mProfessionEdit->setText( mAddressee.custom( "KADDRESSBOOK", "X-Profession" ) );
1045 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); 1055 QString gen = mAddressee.custom( "KADDRESSBOOK", "X-Gender" );
1046 if ( gen == "female" ) 1056 if ( gen == "female" )
1047 mGenderBox->setCurrentItem ( 1 ); 1057 mGenderBox->setCurrentItem ( 1 );
1048 else if ( gen == "male" ) 1058 else if ( gen == "male" )
1049 mGenderBox->setCurrentItem ( 2 ); 1059 mGenderBox->setCurrentItem ( 2 );
1050 else 1060 else
1051 mGenderBox->setCurrentItem ( 0 ); 1061 mGenderBox->setCurrentItem ( 0 );
1052 blockSignals( block ); 1062 blockSignals( block );
1053 mBlockSignals = false; 1063 mBlockSignals = false;
1054 1064
1055 mDirty = false; 1065 mDirty = false;
1056} 1066}
1057 1067
1058void AddresseeEditorWidget::save() 1068void AddresseeEditorWidget::save()
1059{ 1069{
1060 if ( !dirty() ) { 1070 if ( !dirty() ) {
1061 return; 1071 return;
1062 } 1072 }
1063 1073
1064 mAddressee.setRevision( QDateTime::currentDateTime() ); 1074 mAddressee.setRevision( QDateTime::currentDateTime() );
1065 1075
1066 mAddressee.setRole( mRoleEdit->text() ); 1076 mAddressee.setRole( mRoleEdit->text() );
1067 mAddressee.setOrganization( mOrgEdit->text() ); 1077 mAddressee.setOrganization( mOrgEdit->text() );
1068 mAddressee.setUrl( KURL( mURLEdit->text() ) ); 1078 mAddressee.setUrl( KURL( mURLEdit->text() ) );
1069 mAddressee.setNote( mNoteEdit->text() ); 1079 mAddressee.setNote( mNoteEdit->text() );
1070 if ( mBirthdayPicker->inputIsValid() ) { 1080 if ( mBirthdayPicker->inputIsValid() ) {
1071 QDate da = mBirthdayPicker->date(); 1081 QDate da = mBirthdayPicker->date();
1072 if ( da > QDate::currentDate() ) 1082 if ( da > QDate::currentDate() )
1073 da.setYMD(da.year()-100, da.month(), da.day() ); 1083 da.setYMD(da.year()-100, da.month(), da.day() );
1074 mAddressee.setBirthday( QDateTime( da ) ); 1084 mAddressee.setBirthday( QDateTime( da ) );
1075 //qDebug("bday %s ",da.toString().latin1()); 1085 //qDebug("bday %s ",da.toString().latin1());
1076 } 1086 }
1077 else { 1087 else {
1078 mAddressee.setBirthday( QDateTime() ); 1088 mAddressee.setBirthday( QDateTime() );
1079 mBirthdayPicker->clear(); 1089 mBirthdayPicker->clear();
1080 } 1090 }
1081 mAddressee.setNickName( mNicknameEdit->text() ); 1091 mAddressee.setNickName( mNicknameEdit->text() );
1082 mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) ); 1092 mAddressee.setCategories( QStringList::split( ",", mCategoryEdit->text() ) );
1083 1093
1084 mAddressee.setGeo( mGeoWidget->geo() ); 1094 mAddressee.setGeo( mGeoWidget->geo() );
1085 mAddressee.setPhoto( mImageWidget->photo() ); 1095 mAddressee.setPhoto( mImageWidget->photo() );
1086 mAddressee.setLogo( mImageWidget->logo() ); 1096 mAddressee.setLogo( mImageWidget->logo() );
1087 mAddressee.setKeys( mKeyWidget->keys() ); 1097 mAddressee.setKeys( mKeyWidget->keys() );
1088#ifndef KAB_EMBEDDED 1098#ifndef KAB_EMBEDDED
1089 mAddressee.setSound( mSoundWidget->sound() ); 1099 mAddressee.setSound( mSoundWidget->sound() );
1090#else //KAB_EMBEDDED 1100#else //KAB_EMBEDDED
1091//US qDebug("AddresseeEditorWidget::save sound not supported"); 1101//US qDebug("AddresseeEditorWidget::save sound not supported");
1092#endif //KAB_EMBEDDED 1102#endif //KAB_EMBEDDED
1093 mAddressee.setSecrecy( mSecrecyWidget->secrecy() ); 1103 mAddressee.setSecrecy( mSecrecyWidget->secrecy() );
1094 1104
1095 // save custom fields 1105 // save custom fields
1096 mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() ); 1106 mAddressee.insertCustom( "KADDRESSBOOK", "X-IMAddress", mIMAddressEdit->text() );
1097 mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() ); 1107 mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() );
1098 mAddressee.insertCustom( "KADDRESSBOOK", "X-Children", mChildEdit->text() ); 1108 mAddressee.insertCustom( "KADDRESSBOOK", "X-Children", mChildEdit->text() );
1099 mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() ); 1109 mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() );
1100 mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() ); 1110 mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() );
1101 mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() ); 1111 mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() );
1102 mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() ); 1112 mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() );
1103 mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() ); 1113 mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() );
1104 if ( mAnniversaryPicker->inputIsValid() ) { 1114 if ( mAnniversaryPicker->inputIsValid() ) {
1105 QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate); 1115 QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate);
1106 mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); 1116 mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
1107 } 1117 }
1108 else { 1118 else {
1109 mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" ); 1119 mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" );
1110 mAnniversaryPicker->clear(); 1120 mAnniversaryPicker->clear();
1111 } 1121 }
1112 int gen = mGenderBox->currentItem (); 1122 int gen = mGenderBox->currentItem ();
1113 if ( gen == 1 ) 1123 if ( gen == 1 )
1114 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female"); 1124 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female");
1115 else if ( gen == 2 ) 1125 else if ( gen == 2 )
1116 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male"); 1126 mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male");
1117 else 1127 else
1118 mAddressee.removeCustom( "KADDRESSBOOK", "X-Gender" ); 1128 mAddressee.removeCustom( "KADDRESSBOOK", "X-Gender" );
1119 1129
1120 // Save the email addresses 1130 // Save the email addresses
1121 QStringList emails = mAddressee.emails(); 1131 QStringList emails = mAddressee.emails();
1122 QStringList::Iterator iter; 1132 QStringList::Iterator iter;
1123 for ( iter = emails.begin(); iter != emails.end(); ++iter ) 1133 for ( iter = emails.begin(); iter != emails.end(); ++iter )
1124 mAddressee.removeEmail( *iter ); 1134 mAddressee.removeEmail( *iter );
1125 1135
1126 emails = mEmailWidget->emails(); 1136 emails = mEmailWidget->emails();
1127 bool first = true; 1137 bool first = true;
1128 for ( iter = emails.begin(); iter != emails.end(); ++iter ) { 1138 for ( iter = emails.begin(); iter != emails.end(); ++iter ) {
1129 mAddressee.insertEmail( *iter, first ); 1139 mAddressee.insertEmail( *iter, first );
1130 first = false; 1140 first = false;
1131 } 1141 }
1132 1142
1133 // Save the phone numbers 1143 // Save the phone numbers
1134 KABC::PhoneNumber::List phoneNumbers; 1144 KABC::PhoneNumber::List phoneNumbers;
1135 KABC::PhoneNumber::List::Iterator phoneIter; 1145 KABC::PhoneNumber::List::Iterator phoneIter;
1136 phoneNumbers = mAddressee.phoneNumbers(); 1146 phoneNumbers = mAddressee.phoneNumbers();
1137 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); 1147 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end();
1138 ++phoneIter ) 1148 ++phoneIter )
1139 mAddressee.removePhoneNumber( *phoneIter ); 1149 mAddressee.removePhoneNumber( *phoneIter );
1140 1150
1141 phoneNumbers = mPhoneEditWidget->phoneNumbers(); 1151 phoneNumbers = mPhoneEditWidget->phoneNumbers();
1142 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end(); 1152 for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end();
1143 ++phoneIter ) 1153 ++phoneIter )
1144 mAddressee.insertPhoneNumber( *phoneIter ); 1154 mAddressee.insertPhoneNumber( *phoneIter );
1145 1155
1146 // Save the addresses 1156 // Save the addresses
1147 KABC::Address::List addresses; 1157 KABC::Address::List addresses;
1148 KABC::Address::List::Iterator addressIter; 1158 KABC::Address::List::Iterator addressIter;
1149 addresses = mAddressee.addresses(); 1159 addresses = mAddressee.addresses();
1150 for ( addressIter = addresses.begin(); addressIter != addresses.end(); 1160 for ( addressIter = addresses.begin(); addressIter != addresses.end();
1151 ++addressIter ) 1161 ++addressIter )
1152 mAddressee.removeAddress( *addressIter ); 1162 mAddressee.removeAddress( *addressIter );
1153 1163
1154 addresses = mAddressEditWidget->addresses(); 1164 addresses = mAddressEditWidget->addresses();
1155 for ( addressIter = addresses.begin(); addressIter != addresses.end(); 1165 for ( addressIter = addresses.begin(); addressIter != addresses.end();
1156 ++addressIter ) 1166 ++addressIter )
1157 mAddressee.insertAddress( *addressIter ); 1167 mAddressee.insertAddress( *addressIter );
1158 mDirty = false; 1168 mDirty = false;
1159} 1169}
1160 1170
1161bool AddresseeEditorWidget::dirty() 1171bool AddresseeEditorWidget::dirty()
1162{ 1172{
1163 1173
1164 if ( ! mDirty ) { 1174 if ( ! mDirty ) {
1165 if ( mBirthdayPicker->inputIsValid() ) { 1175 if ( mBirthdayPicker->inputIsValid() ) {
1166 QDate da = mBirthdayPicker->date(); 1176 QDate da = mBirthdayPicker->date();
1167 if ( !(da == mAddressee.birthday().date())) 1177 if ( !(da == mAddressee.birthday().date()))
1168 mDirty = true; 1178 mDirty = true;
1169 } 1179 }
1170 else { 1180 else {
1171 mBirthdayPicker->clear(); 1181 mBirthdayPicker->clear();
1172 } 1182 }
1173 if ( mAnniversaryPicker->inputIsValid() ) { 1183 if ( mAnniversaryPicker->inputIsValid() ) {
1174 QDate da = mAnniversaryPicker->date(); 1184 QDate da = mAnniversaryPicker->date();
1175 if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ), 1185 if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ),
1176 "%Y-%m-%d")) 1186 "%Y-%m-%d"))
1177 mDirty = true; 1187 mDirty = true;
1178 } 1188 }
1179 else { 1189 else {
1180 mAnniversaryPicker->clear(); 1190 mAnniversaryPicker->clear();
1181 } 1191 }
1182 } 1192 }
1183 return mDirty; 1193 return mDirty;
1184} 1194}
1185 1195
1186void AddresseeEditorWidget::nameTextChanged( const QString &text ) 1196void AddresseeEditorWidget::nameTextChanged( const QString &text )
1187{ 1197{
1188 if ( mBlockSignals ) 1198 if ( mBlockSignals )
1189 return; 1199 return;
1190 // use the addressee class to parse the name for us 1200 // use the addressee class to parse the name for us
1191 mAConfig->setUid( mAddressee.uid() ); 1201 mAConfig->setUid( mAddressee.uid() );
1192 if ( mAConfig->automaticNameParsing() ) { 1202 if ( mAConfig->automaticNameParsing() ) {
1193 if ( !mAddressee.formattedName().isEmpty() ) { 1203 if ( !mAddressee.formattedName().isEmpty() ) {
1194 QString fn = mAddressee.formattedName(); 1204 QString fn = mAddressee.formattedName();
1195 mAddressee.setNameFromString( text ); 1205 mAddressee.setNameFromString( text );
1196 mAddressee.setFormattedName( fn ); 1206 mAddressee.setFormattedName( fn );
1197 } else { 1207 } else {
1198 // use extra addressee to avoid a formatted name assignment 1208 // use extra addressee to avoid a formatted name assignment
1199 Addressee addr; 1209 Addressee addr;
1200 addr.setNameFromString( text ); 1210 addr.setNameFromString( text );
1201 mAddressee.setPrefix( addr.prefix() ); 1211 mAddressee.setPrefix( addr.prefix() );
1202 mAddressee.setGivenName( addr.givenName() ); 1212 mAddressee.setGivenName( addr.givenName() );
1203 mAddressee.setAdditionalName( addr.additionalName() ); 1213 mAddressee.setAdditionalName( addr.additionalName() );
1204 mAddressee.setFamilyName( addr.familyName() ); 1214 mAddressee.setFamilyName( addr.familyName() );
1205 mAddressee.setSuffix( addr.suffix() ); 1215 mAddressee.setSuffix( addr.suffix() );
1206 } 1216 }
1207 } 1217 }
1208
1209 nameBoxChanged(); 1218 nameBoxChanged();
1210 1219
1220
1211 emitModified(); 1221 emitModified();
1212} 1222}
1213 1223
1214void AddresseeEditorWidget::nameBoxChanged() 1224void AddresseeEditorWidget::nameBoxChanged()
1215{ 1225{
1216 KABC::Addressee addr; 1226 KABC::Addressee addr;
1217 mAConfig->setUid( mAddressee.uid() ); 1227 mAConfig->setUid( mAddressee.uid() );
1218 if ( mAConfig->automaticNameParsing() ) { 1228 if ( mAConfig->automaticNameParsing() ) {
1219 addr.setNameFromString( mNameEdit->text() ); 1229 addr.setNameFromString( mNameEdit->text() );
1220 mNameLabel->hide(); 1230 mNameLabel->hide();
1221 mNameEdit->show(); 1231 mNameEdit->show();
1222 } else { 1232 } else {
1223 addr = mAddressee; 1233 addr = mAddressee;
1224 mNameEdit->hide(); 1234 mNameEdit->hide();
1225 mNameLabel->setText( mNameEdit->text() ); 1235 mNameLabel->setText( mNameEdit->text() );
1226 mNameLabel->show(); 1236 mNameLabel->show();
1227 } 1237 }
1228 1238
1229 if ( mFormattedNameType != NameEditDialog::CustomName ) { 1239 if ( mFormattedNameType != NameEditDialog::CustomName ) {
1230 mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); 1240 mFormattedNameLabel->setText( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
1231 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) ); 1241 mAddressee.setFormattedName( NameEditDialog::formattedName( mAddressee, mFormattedNameType ) );
1232 } 1242 }
1233} 1243}
1234 1244
1235void AddresseeEditorWidget::nameButtonClicked() 1245void AddresseeEditorWidget::nameButtonClicked()
1236{ 1246{
1237 // show the name dialog. 1247 // show the name dialog.
1238 NameEditDialog dialog( mAddressee, mFormattedNameType, this ); 1248 NameEditDialog dialog( mAddressee, mFormattedNameType, this );
1239 1249
1240 if ( KApplication::execDialog( &dialog) ) { 1250 if ( KApplication::execDialog( &dialog) ) {
1241 if ( dialog.changed() ) { 1251 if ( dialog.changed() ) {
1242 mAddressee.setFamilyName( dialog.familyName() ); 1252 mAddressee.setFamilyName( dialog.familyName() );
1243 mAddressee.setGivenName( dialog.givenName() ); 1253 mAddressee.setGivenName( dialog.givenName() );
1244 mAddressee.setPrefix( dialog.prefix() ); 1254 mAddressee.setPrefix( dialog.prefix() );
1245 mAddressee.setSuffix( dialog.suffix() ); 1255 mAddressee.setSuffix( dialog.suffix() );
1246 mAddressee.setAdditionalName( dialog.additionalName() ); 1256 mAddressee.setAdditionalName( dialog.additionalName() );
1247 mFormattedNameType = dialog.formattedNameType(); 1257 mFormattedNameType = dialog.formattedNameType();
1248 if ( mFormattedNameType == NameEditDialog::CustomName ) { 1258 if ( mFormattedNameType == NameEditDialog::CustomName ) {
1249 mFormattedNameLabel->setText( dialog.customFormattedName() ); 1259 mFormattedNameLabel->setText( dialog.customFormattedName() );
1250 mAddressee.setFormattedName( dialog.customFormattedName() ); 1260 mAddressee.setFormattedName( dialog.customFormattedName() );
1251 } 1261 }
1252 // Update the name edit. 1262 // Update the name edit.
1253 bool block = mNameEdit->signalsBlocked(); 1263 bool block = mNameEdit->signalsBlocked();
1254 mNameEdit->blockSignals( true ); 1264 mNameEdit->blockSignals( true );
1255 mNameEdit->setText( mAddressee.assembledName() ); 1265 mNameEdit->setText( mAddressee.assembledName() );
1256 mNameEdit->blockSignals( block ); 1266 mNameEdit->blockSignals( block );
1257 1267
1258 // Update the combo box. 1268 // Update the combo box.
1259 nameBoxChanged(); 1269 nameBoxChanged();
1260 1270
1261 emitModified(); 1271 emitModified();
1262 } 1272 }
1263 } 1273 }
1264} 1274}
1265 1275
1266void AddresseeEditorWidget::categoryButtonClicked() 1276void AddresseeEditorWidget::categoryButtonClicked()
1267{ 1277{
1268 // Show the category dialog 1278 // Show the category dialog
1269 if ( mCategoryDialog == 0 ) { 1279 if ( mCategoryDialog == 0 ) {
1270 mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this ); 1280 mCategoryDialog = new KPIM::CategorySelectDialog( KABPrefs::instance(), this );
1271 connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ), 1281 connect( mCategoryDialog, SIGNAL( categoriesSelected( const QStringList& ) ),
1272 SLOT(categoriesSelected( const QStringList& ) ) ); 1282 SLOT(categoriesSelected( const QStringList& ) ) );
1273 connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) ); 1283 connect( mCategoryDialog, SIGNAL( editCategories() ), SLOT( editCategories() ) );
1274 } 1284 }
1275 1285
1276 mCategoryDialog->setCategories(); 1286 mCategoryDialog->setCategories();
1277 mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) ); 1287 mCategoryDialog->setSelected( QStringList::split( ",", mCategoryEdit->text() ) );
1278 mCategoryDialog->show(); 1288 mCategoryDialog->show();
1279 mCategoryDialog->raise(); 1289 mCategoryDialog->raise();
1280} 1290}
1281 1291
1282void AddresseeEditorWidget::categoriesSelected( const QStringList &list ) 1292void AddresseeEditorWidget::categoriesSelected( const QStringList &list )
1283{ 1293{
1284 mCategoryEdit->setText( list.join( "," ) ); 1294 mCategoryEdit->setText( list.join( "," ) );
1285} 1295}
1286 1296
1287void AddresseeEditorWidget::editCategories() 1297void AddresseeEditorWidget::editCategories()
1288{ 1298{
1289 if ( mCategoryEditDialog == 0 ) { 1299 if ( mCategoryEditDialog == 0 ) {
1290 mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this ); 1300 mCategoryEditDialog = new KPIM::CategoryEditDialog( KABPrefs::instance(), this );
1291 connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ), 1301 connect( mCategoryEditDialog, SIGNAL( categoryConfigChanged() ),
1292 SLOT( categoryButtonClicked() ) ); 1302 SLOT( categoryButtonClicked() ) );
1293 } 1303 }
1294 1304
1295 mCategoryEditDialog->show(); 1305 mCategoryEditDialog->show();
1296 mCategoryEditDialog->raise(); 1306 mCategoryEditDialog->raise();
1297} 1307}
1298 1308
1299void AddresseeEditorWidget::emitModified() 1309void AddresseeEditorWidget::emitModified()
1300{ 1310{
1301 mDirty = true; 1311 mDirty = true;
1302 1312
1303 KABC::Addressee::List list; 1313 KABC::Addressee::List list;
1304 1314
1305 if ( mIsExtension && !mBlockSignals ) { 1315 if ( mIsExtension && !mBlockSignals ) {
1306 save(); 1316 save();
1307 list.append( mAddressee ); 1317 list.append( mAddressee );
1308 } 1318 }
1309 1319
1310 emit modified( list ); 1320 emit modified( list );
1311} 1321}
1312 1322
1313void AddresseeEditorWidget::dateChanged( QDate ) 1323void AddresseeEditorWidget::dateChanged( QDate )
1314{ 1324{
1315 emitModified(); 1325 emitModified();
1316} 1326}
1317 1327
1318//US invalid dates are handdled by the KDateEdit widget itself 1328//US invalid dates are handdled by the KDateEdit widget itself
1319void AddresseeEditorWidget::invalidDate() 1329void AddresseeEditorWidget::invalidDate()
1320{ 1330{
1321 KMessageBox::sorry( this, i18n( "You must specify a valid date" ) ); 1331 KMessageBox::sorry( this, i18n( "You must specify a valid date" ) );
1322} 1332}
1323 1333
1324 1334
1325void AddresseeEditorWidget::pageChanged( QWidget *wdg ) 1335void AddresseeEditorWidget::pageChanged( QWidget *wdg )
1326{ 1336{
1327#ifndef KAB_EMBEDDED 1337#ifndef KAB_EMBEDDED
1328 if ( wdg ) 1338 if ( wdg )
1329 KAcceleratorManager::manage( wdg ); 1339 KAcceleratorManager::manage( wdg );
1330#else //KAB_EMBEDDED 1340#else //KAB_EMBEDDED
1331//US 1341//US
1332#endif //KAB_EMBEDDED 1342#endif //KAB_EMBEDDED
1333 1343
1334} 1344}
1335 1345
1336QString AddresseeEditorWidget::title() const 1346QString AddresseeEditorWidget::title() const
1337{ 1347{
1338 return i18n( "Contact Editor" ); 1348 return i18n( "Contact Editor" );
1339} 1349}
1340 1350
1341QString AddresseeEditorWidget::identifier() const 1351QString AddresseeEditorWidget::identifier() const
1342{ 1352{
1343 return i18n( "contact_editor" ); 1353 return i18n( "contact_editor" );
1344} 1354}
1345 1355
1346#ifndef KAB_EMBEDDED 1356#ifndef KAB_EMBEDDED
1347#include "addresseeeditorwidget.moc" 1357#include "addresseeeditorwidget.moc"
1348#endif //KAB_EMBEDDED 1358#endif //KAB_EMBEDDED
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp
index 48370e3..9ee4eac 100644
--- a/kaddressbook/imagewidget.cpp
+++ b/kaddressbook/imagewidget.cpp
@@ -1,294 +1,312 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@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 <kabc/picture.h> 24#include <kabc/picture.h>
25 25
26#ifndef KAB_EMBEDDED 26#ifndef KAB_EMBEDDED
27#include <kaccelmanager.h> 27#include <kaccelmanager.h>
28#include <kio/netaccess.h> 28#include <kio/netaccess.h>
29#include <kimageio.h> 29#include <kimageio.h>
30#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
31 31
32#include <kdebug.h> 32#include <kdebug.h>
33#include <kdialog.h> 33#include <kdialog.h>
34#include <kiconloader.h> 34#include <kiconloader.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kurlrequester.h> 36#include <kurlrequester.h>
37#include <kurl.h> 37#include <kurl.h>
38 38
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qgroupbox.h> 40#include <qgroupbox.h>
41#include <qlabel.h> 41#include <qlabel.h>
42#include <qlayout.h> 42#include <qlayout.h>
43#include <qpixmap.h> 43#include <qpixmap.h>
44#include <qpushbutton.h>
44#include <qapplication.h> 45#include <qapplication.h>
45 46
46#include "imagewidget.h" 47#include "imagewidget.h"
47 48
48ImageWidget::ImageWidget( QWidget *parent, const char *name ) 49ImageWidget::ImageWidget( QWidget *parent, const char *name )
49 : QWidget( parent, name ) 50 : QWidget( parent, name )
50{ 51{
51 QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(), 52 QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(),
52 KDialog::spacingHint() ); 53 KDialog::spacingHint() );
53 54
54 QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); 55 QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this );
55 QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 3, 2, 56 QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 4, 2,
56 KDialog::spacingHint() ); 57 KDialog::spacingHint() );
57 boxLayout->setRowStretch( 2, 1 ); 58 boxLayout->setRowStretch( 2, 1 );
58 59
59 mPhotoLabel = new QLabel( photoBox ); 60 mPhotoLabel = new QLabel( photoBox );
60 int fac = 9; 61 int fac = 9;
61 if ( QApplication::desktop()->width() > 320 ) 62 if ( QApplication::desktop()->width() > 320 )
62 fac = 6; 63 fac = 6;
63 mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac ); 64 mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac );
64 mPhotoLabel->setScaledContents( true ); 65 mPhotoLabel->setScaledContents( true );
65 mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 66 mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
66 boxLayout->addMultiCellWidget( mPhotoLabel, 0, 2, 0, 0 ); 67 boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 );
67 68
68 mPhotoUrl = new KURLRequester( photoBox ); 69 mPhotoUrl = new KURLRequester( photoBox );
69#ifndef KAB_EMBEDDED 70#ifndef KAB_EMBEDDED
70 mPhotoUrl->setFilter( KImageIO::pattern() ); 71 mPhotoUrl->setFilter( KImageIO::pattern() );
71#else //KAB_EMBEDDED 72#else //KAB_EMBEDDED
72//US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???"); 73//US qDebug("ImageWidget::ImageWidget KImageIO not defined. Does this harm ???");
73#endif //KAB_EMBEDDED 74#endif //KAB_EMBEDDED
74 75
75 76
76 boxLayout->addWidget( mPhotoUrl, 0, 1 ); 77 boxLayout->addWidget( mPhotoUrl, 0, 1 );
77 78
78 mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), photoBox ); 79 mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), photoBox );
79 mUsePhotoUrl->setEnabled( false ); 80 mUsePhotoUrl->setEnabled( false );
80 boxLayout->addWidget( mUsePhotoUrl, 1, 1 ); 81 boxLayout->addWidget( mUsePhotoUrl, 1, 1 );
81 82
83 QPushButton * pb = new QPushButton( i18n( "Remove" ), photoBox );
84 connect( pb, SIGNAL( clicked() ),this, SLOT( removePhoto() ) );
85 boxLayout->addWidget( pb, 2, 1 );
86 boxLayout->addWidget( new QLabel( photoBox ), 3, 1 );
87
82 topLayout->addWidget( photoBox, 0, 0 ); 88 topLayout->addWidget( photoBox, 0, 0 );
83 89
84 QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); 90 QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this );
85 boxLayout = new QGridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); 91 boxLayout = new QGridLayout( logoBox->layout(), 4, 2, KDialog::spacingHint() );
86 boxLayout->setRowStretch( 2, 1 ); 92 boxLayout->setRowStretch( 2, 1 );
87 93
88 mLogoLabel = new QLabel( logoBox ); 94 mLogoLabel = new QLabel( logoBox );
89 mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac ); 95 mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac );
90 mLogoLabel->setScaledContents( true ); 96 mLogoLabel->setScaledContents( true );
91 mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 97 mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken );
92 boxLayout->addMultiCellWidget( mLogoLabel, 0, 2, 0, 0 ); 98 boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 );
93 99
94 mLogoUrl = new KURLRequester( logoBox ); 100 mLogoUrl = new KURLRequester( logoBox );
95#ifndef KAB_EMBEDDED 101#ifndef KAB_EMBEDDED
96 mLogoUrl->setFilter( KImageIO::pattern() ); 102 mLogoUrl->setFilter( KImageIO::pattern() );
97#else //KAB_EMBEDDED 103#else //KAB_EMBEDDED
98//US qDebug("ImageWidget::ImageWidget KImageIO not defined 2"); 104//US qDebug("ImageWidget::ImageWidget KImageIO not defined 2");
99#endif //KAB_EMBEDDED 105#endif //KAB_EMBEDDED
100 boxLayout->addWidget( mLogoUrl, 0, 1 ); 106 boxLayout->addWidget( mLogoUrl, 0, 1 );
101 107
102 mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), logoBox ); 108 mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), logoBox );
103 mUseLogoUrl->setEnabled( false ); 109 mUseLogoUrl->setEnabled( false );
104 boxLayout->addWidget( mUseLogoUrl, 1, 1 ); 110 boxLayout->addWidget( mUseLogoUrl, 1, 1 );
105 111
112 pb = new QPushButton( i18n( "Remove" ), logoBox );
113 connect( pb, SIGNAL( clicked() ),this, SLOT( removeLogo() ) );
114 boxLayout->addWidget( pb, 2, 1 );
115 boxLayout->addWidget( new QLabel( logoBox ), 3, 1 );
106 topLayout->addWidget( logoBox, 1, 0 ); 116 topLayout->addWidget( logoBox, 1, 0 );
107 117
108 connect( mPhotoUrl, SIGNAL( textChanged( const QString& ) ), 118 connect( mPhotoUrl, SIGNAL( textChanged( const QString& ) ),
109 SIGNAL( changed() ) ); 119 SIGNAL( changed() ) );
110 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), 120 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
111 SLOT( loadPhoto() ) ); 121 SLOT( loadPhoto() ) );
112 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), 122 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
113 SIGNAL( changed() ) ); 123 SIGNAL( changed() ) );
114 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ), 124 connect( mPhotoUrl, SIGNAL( urlSelected( const QString& ) ),
115 SLOT( updateGUI() ) ); 125 SLOT( updateGUI() ) );
116 connect( mUsePhotoUrl, SIGNAL( toggled( bool ) ), 126 connect( mUsePhotoUrl, SIGNAL( toggled( bool ) ),
117 SIGNAL( changed() ) ); 127 SIGNAL( changed() ) );
118 128
119 connect( mLogoUrl, SIGNAL( textChanged( const QString& ) ), 129 connect( mLogoUrl, SIGNAL( textChanged( const QString& ) ),
120 SIGNAL( changed() ) ); 130 SIGNAL( changed() ) );
121 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), 131 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ),
122 SLOT( loadLogo() ) ); 132 SLOT( loadLogo() ) );
123 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), 133 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ),
124 SIGNAL( changed() ) ); 134 SIGNAL( changed() ) );
125 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ), 135 connect( mLogoUrl, SIGNAL( urlSelected( const QString& ) ),
126 SLOT( updateGUI() ) ); 136 SLOT( updateGUI() ) );
127 connect( mUseLogoUrl, SIGNAL( toggled( bool ) ), 137 connect( mUseLogoUrl, SIGNAL( toggled( bool ) ),
128 SIGNAL( changed() ) ); 138 SIGNAL( changed() ) );
129 139
130#ifndef KAB_EMBEDDED 140#ifndef KAB_EMBEDDED
131 KAcceleratorManager::manage( this ); 141 KAcceleratorManager::manage( this );
132#endif //KAB_EMBEDDED 142#endif //KAB_EMBEDDED
133 143
134} 144}
135 145
136ImageWidget::~ImageWidget() 146ImageWidget::~ImageWidget()
137{ 147{
138} 148}
139 149
140void ImageWidget::setPhoto( const KABC::Picture &photo ) 150void ImageWidget::setPhoto( const KABC::Picture &photo )
141{ 151{
142 bool blocked = signalsBlocked(); 152 bool blocked = signalsBlocked();
143 blockSignals( true ); 153 blockSignals( true );
144 154
145 if ( photo.isIntern() ) { 155 if ( photo.isIntern() ) {
146//US 156//US
147//US mPhotoLabel->setPixmap( photo.data() ); 157//US mPhotoLabel->setPixmap( photo.data() );
148 if (photo.data().isNull() != true) 158 if (photo.data().isNull() != true)
149 { 159 {
150 QPixmap pm; 160 QPixmap pm;
151 pm.convertFromImage(photo.data()); 161 pm.convertFromImage(photo.data());
152 162
153 mPhotoLabel->setPixmap( pm ); 163 mPhotoLabel->setPixmap( pm );
154 } 164 }
155 165
156 mUsePhotoUrl->setChecked( false ); 166 mUsePhotoUrl->setChecked( false );
157 } else { 167 } else {
158 mPhotoUrl->setURL( photo.url() ); 168 mPhotoUrl->setURL( photo.url() );
159 if ( !photo.url().isEmpty() ) 169 if ( !photo.url().isEmpty() )
160 mUsePhotoUrl->setChecked( true ); 170 mUsePhotoUrl->setChecked( true );
161 loadPhoto(); 171 loadPhoto();
162 } 172 }
163 173
164 blockSignals( blocked ); 174 blockSignals( blocked );
165} 175}
166 176
167KABC::Picture ImageWidget::photo() const 177KABC::Picture ImageWidget::photo() const
168{ 178{
169 KABC::Picture photo; 179 KABC::Picture photo;
170 180
171 if ( mUsePhotoUrl->isChecked() ) 181 if ( mUsePhotoUrl->isChecked() )
172 photo.setUrl( mPhotoUrl->url() ); 182 photo.setUrl( mPhotoUrl->url() );
173 else { 183 else {
174 QPixmap *px = mPhotoLabel->pixmap(); 184 QPixmap *px = mPhotoLabel->pixmap();
175 if ( px ) { 185 if ( px ) {
176#ifndef KAB_EMBEDDED 186#ifndef KAB_EMBEDDED
177 if ( px->height() > px->width() ) 187 if ( px->height() > px->width() )
178 photo.setData( px->convertToImage().scaleHeight( 140 ) ); 188 photo.setData( px->convertToImage().scaleHeight( 140 ) );
179 else 189 else
180 photo.setData( px->convertToImage().scaleWidth( 100 ) ); 190 photo.setData( px->convertToImage().scaleWidth( 100 ) );
181#else //KAB_EMBEDDED 191#else //KAB_EMBEDDED
182//US add teh nullcheck 192//US add teh nullcheck
183 if (px->isNull() != true ) 193 if (px->isNull() != true )
184 photo.setData( px->convertToImage() ); 194 photo.setData( px->convertToImage() );
185#endif //KAB_EMBEDDED 195#endif //KAB_EMBEDDED
186 196
187 photo.setType( "PNG" ); 197 photo.setType( "PNG" );
188 } 198 }
189 } 199 }
190 200
191 return photo; 201 return photo;
192} 202}
193 203
194void ImageWidget::setLogo( const KABC::Picture &logo ) 204void ImageWidget::setLogo( const KABC::Picture &logo )
195{ 205{
196 bool blocked = signalsBlocked(); 206 bool blocked = signalsBlocked();
197 blockSignals( true ); 207 blockSignals( true );
198 208
199 if ( logo.isIntern() ) { 209 if ( logo.isIntern() ) {
200//US 210//US
201//US mLogoLabel->setPixmap( logo.data() ); 211//US mLogoLabel->setPixmap( logo.data() );
202 if (logo.data().isNull() != true) 212 if (logo.data().isNull() != true)
203 { 213 {
204 QPixmap pm; 214 QPixmap pm;
205 pm.convertFromImage(logo.data()); 215 pm.convertFromImage(logo.data());
206 mLogoLabel->setPixmap( pm ); 216 mLogoLabel->setPixmap( pm );
207 } 217 }
208 mUseLogoUrl->setChecked( false ); 218 mUseLogoUrl->setChecked( false );
209 } else { 219 } else {
210 mLogoUrl->setURL( logo.url() ); 220 mLogoUrl->setURL( logo.url() );
211 if ( !logo.url().isEmpty() ) 221 if ( !logo.url().isEmpty() )
212 mUseLogoUrl->setChecked( true ); 222 mUseLogoUrl->setChecked( true );
213 loadLogo(); 223 loadLogo();
214 } 224 }
215 225
216 blockSignals( blocked ); 226 blockSignals( blocked );
217} 227}
218 228
219KABC::Picture ImageWidget::logo() const 229KABC::Picture ImageWidget::logo() const
220{ 230{
221 KABC::Picture logo; 231 KABC::Picture logo;
222 232
223 if ( mUseLogoUrl->isChecked() ) 233 if ( mUseLogoUrl->isChecked() )
224 logo.setUrl( mLogoUrl->url() ); 234 logo.setUrl( mLogoUrl->url() );
225 else { 235 else {
226 QPixmap *px = mLogoLabel->pixmap(); 236 QPixmap *px = mLogoLabel->pixmap();
227 if ( px ) { 237 if ( px ) {
228#ifndef KAB_EMBEDDED 238#ifndef KAB_EMBEDDED
229 if ( px->height() > px->width() ) 239 if ( px->height() > px->width() )
230 logo.setData( px->convertToImage().scaleHeight( 140 ) ); 240 logo.setData( px->convertToImage().scaleHeight( 140 ) );
231 else 241 else
232 logo.setData( px->convertToImage().scaleWidth( 100 ) ); 242 logo.setData( px->convertToImage().scaleWidth( 100 ) );
233#else //KAB_EMBEDDED 243#else //KAB_EMBEDDED
234 logo.setData( px->convertToImage() ); 244 logo.setData( px->convertToImage() );
235#endif //KAB_EMBEDDED 245#endif //KAB_EMBEDDED
236 246
237 logo.setType( "PNG" ); 247 logo.setType( "PNG" );
238 248
239 } 249 }
240 } 250 }
241
242 return logo; 251 return logo;
243} 252}
253void ImageWidget::removePhoto()
254{
255 setPhoto(KABC::Picture() );
256}
257
258void ImageWidget::removeLogo()
259{
260 setLogo(KABC::Picture() );
261}
244 262
245void ImageWidget::loadPhoto() 263void ImageWidget::loadPhoto()
246{ 264{
247 mPhotoLabel->setPixmap( loadPixmap( mPhotoUrl->url() ) ); 265 mPhotoLabel->setPixmap( loadPixmap( mPhotoUrl->url() ) );
248} 266}
249 267
250void ImageWidget::loadLogo() 268void ImageWidget::loadLogo()
251{ 269{
252 mLogoLabel->setPixmap( loadPixmap( mLogoUrl->url() ) ); 270 mLogoLabel->setPixmap( loadPixmap( mLogoUrl->url() ) );
253} 271}
254 272
255void ImageWidget::updateGUI() 273void ImageWidget::updateGUI()
256{ 274{
257 KURLRequester *ptr = (KURLRequester*)sender(); 275 KURLRequester *ptr = (KURLRequester*)sender();
258 276
259 277
260 if ( ptr == mPhotoUrl ) 278 if ( ptr == mPhotoUrl )
261 mUsePhotoUrl->setEnabled( true ); 279 mUsePhotoUrl->setEnabled( true );
262 else if ( ptr == mLogoUrl ) 280 else if ( ptr == mLogoUrl )
263 mUseLogoUrl->setEnabled( true ); 281 mUseLogoUrl->setEnabled( true );
264} 282}
265 283
266QPixmap ImageWidget::loadPixmap( const KURL &url ) 284QPixmap ImageWidget::loadPixmap( const KURL &url )
267{ 285{
268 QString tempFile; 286 QString tempFile;
269 QPixmap pixmap; 287 QPixmap pixmap;
270 288
271 if ( url.isEmpty() ) 289 if ( url.isEmpty() )
272 return pixmap; 290 return pixmap;
273 291
274 if ( url.isLocalFile() ) 292 if ( url.isLocalFile() )
275 pixmap = QPixmap( url.path() ); 293 pixmap = QPixmap( url.path() );
276 else 294 else
277 { 295 {
278#ifndef KAB_EMBEDDED 296#ifndef KAB_EMBEDDED
279 if ( KIO::NetAccess::download( url, tempFile ) ) { 297 if ( KIO::NetAccess::download( url, tempFile ) ) {
280 pixmap = QPixmap( tempFile ); 298 pixmap = QPixmap( tempFile );
281 KIO::NetAccess::removeTempFile( tempFile ); 299 KIO::NetAccess::removeTempFile( tempFile );
282 } 300 }
283#else //KAB_EMBEDDED 301#else //KAB_EMBEDDED
284 qDebug("ImageWidget::loadPixmap : only local pixmaps are allowed"); 302 qDebug("ImageWidget::loadPixmap : only local pixmaps are allowed");
285#endif //KAB_EMBEDDED 303#endif //KAB_EMBEDDED
286 304
287 } 305 }
288 306
289 return pixmap; 307 return pixmap;
290} 308}
291 309
292#ifndef KAB_EMBEDDED 310#ifndef KAB_EMBEDDED
293#include "imagewidget.moc" 311#include "imagewidget.moc"
294#endif //KAB_EMBEDDED 312#endif //KAB_EMBEDDED
diff --git a/kaddressbook/imagewidget.h b/kaddressbook/imagewidget.h
index b3ca0bd..afb9aa7 100644
--- a/kaddressbook/imagewidget.h
+++ b/kaddressbook/imagewidget.h
@@ -1,86 +1,88 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@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#ifndef IMAGEWIDGET_H 24#ifndef IMAGEWIDGET_H
25#define IMAGEWIDGET_H 25#define IMAGEWIDGET_H
26 26
27#include <qwidget.h> 27#include <qwidget.h>
28 28
29#include <kabc/picture.h> 29#include <kabc/picture.h>
30#include <kdialogbase.h> 30#include <kdialogbase.h>
31 31
32class KURL; 32class KURL;
33class KURLRequester; 33class KURLRequester;
34 34
35class QCheckBox; 35class QCheckBox;
36class QLabel; 36class QLabel;
37 37
38class ImageWidget : public QWidget 38class ImageWidget : public QWidget
39{ 39{
40 Q_OBJECT 40 Q_OBJECT
41 41
42 public: 42 public:
43 ImageWidget( QWidget *parent, const char *name = 0 ); 43 ImageWidget( QWidget *parent, const char *name = 0 );
44 ~ImageWidget(); 44 ~ImageWidget();
45 45
46 /** 46 /**
47 Sets the photo object. 47 Sets the photo object.
48 */ 48 */
49 void setPhoto( const KABC::Picture &photo ); 49 void setPhoto( const KABC::Picture &photo );
50 50
51 /** 51 /**
52 Returns a photo object. 52 Returns a photo object.
53 */ 53 */
54 KABC::Picture photo() const; 54 KABC::Picture photo() const;
55 55
56 /** 56 /**
57 Sets the logo object. 57 Sets the logo object.
58 */ 58 */
59 void setLogo( const KABC::Picture &photo ); 59 void setLogo( const KABC::Picture &photo );
60 60
61 /** 61 /**
62 Returns a logo object. 62 Returns a logo object.
63 */ 63 */
64 KABC::Picture logo() const; 64 KABC::Picture logo() const;
65 65
66 signals: 66 signals:
67 void changed(); 67 void changed();
68 68
69 private slots: 69 private slots:
70 void loadPhoto(); 70 void loadPhoto();
71 void loadLogo(); 71 void loadLogo();
72 void removePhoto();
73 void removeLogo();
72 void updateGUI(); 74 void updateGUI();
73 75
74 private: 76 private:
75 QPixmap loadPixmap( const KURL &url ); 77 QPixmap loadPixmap( const KURL &url );
76 78
77 KURLRequester *mPhotoUrl; 79 KURLRequester *mPhotoUrl;
78 KURLRequester *mLogoUrl; 80 KURLRequester *mLogoUrl;
79 81
80 QCheckBox *mUsePhotoUrl; 82 QCheckBox *mUsePhotoUrl;
81 QCheckBox *mUseLogoUrl; 83 QCheckBox *mUseLogoUrl;
82 QLabel *mPhotoLabel; 84 QLabel *mPhotoLabel;
83 QLabel *mLogoLabel; 85 QLabel *mLogoLabel;
84}; 86};
85 87
86#endif 88#endif