-rw-r--r-- | bin/kdepim/WhatsNew.txt | 4 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 41b3e45..c61a322 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,516 +1,520 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 1.9.11 ************ | 3 | ********** VERSION 1.9.11 ************ |
4 | 4 | ||
5 | Fixed several problems in PWM/Pi, like | 5 | Fixed several problems in PWM/Pi, like |
6 | asking the user, if unsaved changed are pending | 6 | asking the user, if unsaved changed are pending |
7 | when closing the app. | 7 | when closing the app. |
8 | 8 | ||
9 | Fixed a crash in KO/Pi , when importing/loading vcs files | 9 | Fixed a crash in KO/Pi , when importing/loading vcs files |
10 | which have an entry with an attendee with state: | 10 | which have an entry with an attendee with state: |
11 | NEEDS ACTION | 11 | NEEDS ACTION |
12 | 12 | ||
13 | Fixed some problems in the German translation of OM/Pi, | 13 | Fixed some problems in the German translation of OM/Pi, |
14 | which makes some dialogs not fitting on the screen | 14 | which makes some dialogs not fitting on the screen |
15 | of the Z 5500. | 15 | of the Z 5500. |
16 | 16 | ||
17 | Fixed Qtopia crash, when disabling/deinstalling | 17 | Fixed Qtopia crash, when disabling/deinstalling |
18 | KO/Pi alarm applet. | 18 | KO/Pi alarm applet. |
19 | 19 | ||
20 | Implemented direct KDE<->KA/Pi sync for KA/Pi running | 20 | Implemented direct KDE<->KA/Pi sync for KA/Pi running |
21 | on Linux desktop. | 21 | on Linux desktop. |
22 | 22 | ||
23 | Added "remove sync info" to sync menu. | 23 | Added "remove sync info" to sync menu. |
24 | 24 | ||
25 | Tweaked the KO/Pi What's next view a bit, added | 25 | Tweaked the KO/Pi What's next view a bit, added |
26 | setting to hide events that are done. | 26 | setting to hide events that are done. |
27 | 27 | ||
28 | Disabled "beam receive enabled" on startup to | 28 | Disabled "beam receive enabled" on startup to |
29 | avoid problems if Fastload is enabled. | 29 | avoid problems if Fastload is enabled. |
30 | Please set "beam receive enabled", | 30 | Please set "beam receive enabled", |
31 | if you want to receive data via IR. | 31 | if you want to receive data via IR. |
32 | 32 | ||
33 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running | 33 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running |
34 | on Linux desktop. | 34 | on Linux desktop. |
35 | 35 | ||
36 | Made in KA/Pi scrolling possible, if details view is selected. | 36 | Made in KA/Pi scrolling possible, if details view is selected. |
37 | (The keyboard focus is set automatically to the search line) | ||
38 | |||
39 | Fixed a bug in DMT sync, that a new entry in DTM was added | ||
40 | on every sync to Kx/Pi. | ||
37 | 41 | ||
38 | 42 | ||
39 | 43 | ||
40 | 44 | ||
41 | ********** VERSION 1.9.10 ************ | 45 | ********** VERSION 1.9.10 ************ |
42 | 46 | ||
43 | Many internal small bugfixes. | 47 | Many internal small bugfixes. |
44 | And fix of the "big" bug in KO/Pi, | 48 | And fix of the "big" bug in KO/Pi, |
45 | that after Syncing the appointments had an offset by several hours. | 49 | that after Syncing the appointments had an offset by several hours. |
46 | That was a problem with the internal timezone setting, | 50 | That was a problem with the internal timezone setting, |
47 | introduced by the changed timezone configuration settings. | 51 | introduced by the changed timezone configuration settings. |
48 | 52 | ||
49 | German translation for OM/Pi is now available. | 53 | German translation for OM/Pi is now available. |
50 | 54 | ||
51 | 55 | ||
52 | ********** VERSION 1.9.9 ************ | 56 | ********** VERSION 1.9.9 ************ |
53 | 57 | ||
54 | KDE-Pim/Pi has a new Member! | 58 | KDE-Pim/Pi has a new Member! |
55 | It is called PWM/Pi (Passwordmanager/platform-independent) | 59 | It is called PWM/Pi (Passwordmanager/platform-independent) |
56 | and it is available for the Zaurus. | 60 | and it is available for the Zaurus. |
57 | It is planned, that it will be available later for Windows. | 61 | It is planned, that it will be available later for Windows. |
58 | (And for Linux, of course). | 62 | (And for Linux, of course). |
59 | It is a port of the Passwordmanager of KDE. | 63 | It is a port of the Passwordmanager of KDE. |
60 | It will need the MicroKDElibs to run. | 64 | It will need the MicroKDElibs to run. |
61 | 65 | ||
62 | Made loading of addressbooks in KA/Pi up to 7 times faster! | 66 | Made loading of addressbooks in KA/Pi up to 7 times faster! |
63 | The bigger your addressbook file, the more starting speed | 67 | The bigger your addressbook file, the more starting speed |
64 | will you gain. (relatively) | 68 | will you gain. (relatively) |
65 | 69 | ||
66 | The Qtopia addressbook connector is now platform independend | 70 | The Qtopia addressbook connector is now platform independend |
67 | as well and should work on any platform for importing/exporting | 71 | as well and should work on any platform for importing/exporting |
68 | Qtopia and Opie XML files. | 72 | Qtopia and Opie XML files. |
69 | 73 | ||
70 | Added a +30min feature to the timezone settings to make | 74 | Added a +30min feature to the timezone settings to make |
71 | KDE-Pim/Pi useable in Australia and other parts on the | 75 | KDE-Pim/Pi useable in Australia and other parts on the |
72 | world with strange timezones ;-) | 76 | world with strange timezones ;-) |
73 | 77 | ||
74 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. | 78 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. |
75 | 79 | ||
76 | It is now possible to disable the | 80 | It is now possible to disable the |
77 | "receive data via infrared" feature, such that syncing with | 81 | "receive data via infrared" feature, such that syncing with |
78 | Outlook is now possible again with Kx/Pi runing. | 82 | Outlook is now possible again with Kx/Pi runing. |
79 | Please disable it, before syncing Sharp DTM with Outlook. | 83 | Please disable it, before syncing Sharp DTM with Outlook. |
80 | For your convenience, the "receive data via infrared" feature | 84 | For your convenience, the "receive data via infrared" feature |
81 | is disabled automatically, if you sync Kx/Pi with DTM. | 85 | is disabled automatically, if you sync Kx/Pi with DTM. |
82 | You have to enable it again manually after syncing. | 86 | You have to enable it again manually after syncing. |
83 | Enabling this feature makes it impossible to start the | 87 | Enabling this feature makes it impossible to start the |
84 | Sharp DTM apps. If this feature is enabled, you will only get the | 88 | Sharp DTM apps. If this feature is enabled, you will only get the |
85 | alarm notification from KO/Pi and not from the Sharp calendar. | 89 | alarm notification from KO/Pi and not from the Sharp calendar. |
86 | This is very useful if you sync KO/Pi with Sharp DTM, | 90 | This is very useful if you sync KO/Pi with Sharp DTM, |
87 | because after syncing you usually would get notified about | 91 | because after syncing you usually would get notified about |
88 | an alarm by KO/Pi and the Sharp Calendar. | 92 | an alarm by KO/Pi and the Sharp Calendar. |
89 | 93 | ||
90 | Together with the Linux desktop version of KO/Pi | 94 | Together with the Linux desktop version of KO/Pi |
91 | it is now possible to sync KO/Pi on the Zaurus | 95 | it is now possible to sync KO/Pi on the Zaurus |
92 | with the complete KDE-desktop (3.3 or later) | 96 | with the complete KDE-desktop (3.3 or later) |
93 | calendar data easily. | 97 | calendar data easily. |
94 | That makes it possible to sync the Z with one | 98 | That makes it possible to sync the Z with one |
95 | click of a mouse with the KDE-Desktop. | 99 | click of a mouse with the KDE-Desktop. |
96 | This feature it available for all Zaurus platforms KO/Pi | 100 | This feature it available for all Zaurus platforms KO/Pi |
97 | is running on. | 101 | is running on. |
98 | The only thing needed is a running KO/Pi on Linux and | 102 | The only thing needed is a running KO/Pi on Linux and |
99 | a compiled version of the small | 103 | a compiled version of the small |
100 | KDE-Pim/Pi<->KDE-Desktop access command line program, | 104 | KDE-Pim/Pi<->KDE-Desktop access command line program, |
101 | which is in the KDE-Pim/Pi sources available. | 105 | which is in the KDE-Pim/Pi sources available. |
102 | 106 | ||
103 | The "KDE-desktop" syncing feature for KA/Pi will follow | 107 | The "KDE-desktop" syncing feature for KA/Pi will follow |
104 | in the next releases. | 108 | in the next releases. |
105 | 109 | ||
106 | Fixed the vcard export bug, which had the version 1.9.8. | 110 | Fixed the vcard export bug, which had the version 1.9.8. |
107 | 111 | ||
108 | Added missing GERMAN translation to KO/Pi. | 112 | Added missing GERMAN translation to KO/Pi. |
109 | Hi PsionX, could you add the missing french translation?Thx! | 113 | Hi PsionX, could you add the missing french translation?Thx! |
110 | 114 | ||
111 | Translation files for KA/Pi are available as well. | 115 | Translation files for KA/Pi are available as well. |
112 | GERMAN translation will be available in the next release. | 116 | GERMAN translation will be available in the next release. |
113 | PsionX ( yres, you again ;-) ), could you start translating | 117 | PsionX ( yres, you again ;-) ), could you start translating |
114 | KA/Pi? Thx! | 118 | KA/Pi? Thx! |
115 | 119 | ||
116 | You can download the version 1.9.9 at | 120 | You can download the version 1.9.9 at |
117 | 121 | ||
118 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 | 122 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 |
119 | 123 | ||
120 | Note: | 124 | Note: |
121 | To run the mail program OM/Pi you need libopenssl. | 125 | To run the mail program OM/Pi you need libopenssl. |
122 | A link to a download loaction is available at | 126 | A link to a download loaction is available at |
123 | ZSI at www.killefiz.de | 127 | ZSI at www.killefiz.de |
124 | 128 | ||
125 | 129 | ||
126 | ********** VERSION 1.9.8 ************ | 130 | ********** VERSION 1.9.8 ************ |
127 | 131 | ||
128 | Fixed character decoding in OM/Pi. | 132 | Fixed character decoding in OM/Pi. |
129 | (e.g. German "Umlaute" were not displayed properly.) | 133 | (e.g. German "Umlaute" were not displayed properly.) |
130 | 134 | ||
131 | Made is possible to reparent todos in KO/Pi. | 135 | Made is possible to reparent todos in KO/Pi. |
132 | Use contextmenu or keys (look at Help-Keys + Colors) for that. | 136 | Use contextmenu or keys (look at Help-Keys + Colors) for that. |
133 | 137 | ||
134 | Added the missing Sync-Howto and WhatsNew to the packages. | 138 | Added the missing Sync-Howto and WhatsNew to the packages. |
135 | 139 | ||
136 | KO/Pi on Linux desktop can now sync with KDE desktop. | 140 | KO/Pi on Linux desktop can now sync with KDE desktop. |
137 | That means: When using KO/Pi on Linux desktop for syncing with | 141 | That means: When using KO/Pi on Linux desktop for syncing with |
138 | KDE desktop and the Zaurus, the Zaurus can be synced now | 142 | KDE desktop and the Zaurus, the Zaurus can be synced now |
139 | with all KDE-Calendar resources, not only with one local file. | 143 | with all KDE-Calendar resources, not only with one local file. |
140 | (That makes it possible to sync the Zaurus with the | 144 | (That makes it possible to sync the Zaurus with the |
141 | calendar data on a Kolab server) | 145 | calendar data on a Kolab server) |
142 | 146 | ||
143 | KA/Pi syncing with KDE desktop will be available in the next version. | 147 | KA/Pi syncing with KDE desktop will be available in the next version. |
144 | 148 | ||
145 | 149 | ||
146 | ********** VERSION 1.9.7 ************ | 150 | ********** VERSION 1.9.7 ************ |
147 | 151 | ||
148 | KO/Pi - KA/Pi on Windows: | 152 | KO/Pi - KA/Pi on Windows: |
149 | Now a directory can be defined by the user, where the | 153 | Now a directory can be defined by the user, where the |
150 | application/config data should be saved. | 154 | application/config data should be saved. |
151 | Define your desired path in the evironment variable | 155 | Define your desired path in the evironment variable |
152 | MICROKDEHOME | 156 | MICROKDEHOME |
153 | before starting KO/Pi or KA/Pi. | 157 | before starting KO/Pi or KA/Pi. |
154 | 158 | ||
155 | An easy Kx/Pi to Kx/Pi syncing is now possible | 159 | An easy Kx/Pi to Kx/Pi syncing is now possible |
156 | (it is called Pi-Sync) via network. | 160 | (it is called Pi-Sync) via network. |
157 | Please look at the Sync Howto. | 161 | Please look at the Sync Howto. |
158 | 162 | ||
159 | Exporting of calendar data and contacts to mobile phones is now possible. | 163 | Exporting of calendar data and contacts to mobile phones is now possible. |
160 | The SyncHowto is updated with information howto | 164 | The SyncHowto is updated with information howto |
161 | access/sync mobile phones. | 165 | access/sync mobile phones. |
162 | Please look at the Sync Howto. | 166 | Please look at the Sync Howto. |
163 | 167 | ||
164 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. | 168 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. |
165 | Please disable Fastload for the original contact/calendar applications | 169 | Please disable Fastload for the original contact/calendar applications |
166 | and close them. | 170 | and close them. |
167 | KO/Pi and KA/Pi must be running in order to receive the data. | 171 | KO/Pi and KA/Pi must be running in order to receive the data. |
168 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) | 172 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) |
169 | 173 | ||
170 | In the KA/Pi details view are now the preferred tel. numbers displayed on top | 174 | In the KA/Pi details view are now the preferred tel. numbers displayed on top |
171 | of the other data ( emails/tel.numbers/addresses) | 175 | of the other data ( emails/tel.numbers/addresses) |
172 | 176 | ||
173 | Fixed some syncing problems in KA/Pi. | 177 | Fixed some syncing problems in KA/Pi. |
174 | 178 | ||
175 | Added font settings for the KA/Pi details view. | 179 | Added font settings for the KA/Pi details view. |
176 | Added fields "children's name" and "gender" to KA/Pi. | 180 | Added fields "children's name" and "gender" to KA/Pi. |
177 | 181 | ||
178 | Made searching in KA/Pi better: | 182 | Made searching in KA/Pi better: |
179 | Now the first item in a view is selected after a search automatically and | 183 | Now the first item in a view is selected after a search automatically and |
180 | the views can be scrolled up/down when the search input field has the keyboard focus. | 184 | the views can be scrolled up/down when the search input field has the keyboard focus. |
181 | 185 | ||
182 | And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. | 186 | And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. |
183 | 187 | ||
184 | 188 | ||
185 | ********** VERSION 1.9.6 ************ | 189 | ********** VERSION 1.9.6 ************ |
186 | 190 | ||
187 | Changes in the external application communication on the Zaurus | 191 | Changes in the external application communication on the Zaurus |
188 | in order to use less RAM when the apps are running. | 192 | in order to use less RAM when the apps are running. |
189 | First syncing of addressbooks (KA/Pi) is possible. | 193 | First syncing of addressbooks (KA/Pi) is possible. |
190 | 194 | ||
191 | 195 | ||
192 | ********** VERSION 1.9.5a ************ | 196 | ********** VERSION 1.9.5a ************ |
193 | 197 | ||
194 | Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. | 198 | Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. |
195 | Fixed some small bugs. | 199 | Fixed some small bugs. |
196 | KA/Pi shows now the birthday in summary view. | 200 | KA/Pi shows now the birthday in summary view. |
197 | Now OM/Pi and KA/Pi are using the date format defined in KO/Pi | 201 | Now OM/Pi and KA/Pi are using the date format defined in KO/Pi |
198 | for displaying dates. | 202 | for displaying dates. |
199 | 203 | ||
200 | 204 | ||
201 | ********** VERSION 1.9.5 ************ | 205 | ********** VERSION 1.9.5 ************ |
202 | 206 | ||
203 | There is still no Addressbook syncing! | 207 | There is still no Addressbook syncing! |
204 | 208 | ||
205 | New in 1.9.5: | 209 | New in 1.9.5: |
206 | 210 | ||
207 | Many bugfixes. | 211 | Many bugfixes. |
208 | Better searching in KA/Pi. | 212 | Better searching in KA/Pi. |
209 | You can configure in KA/Pi if you want to search only after | 213 | You can configure in KA/Pi if you want to search only after |
210 | <return> key pressed. | 214 | <return> key pressed. |
211 | 215 | ||
212 | Better mail downloading in OM/Pi. | 216 | Better mail downloading in OM/Pi. |
213 | 217 | ||
214 | First experimental alpha version of sync of KO/Pi with mobile phones. | 218 | First experimental alpha version of sync of KO/Pi with mobile phones. |
215 | See gammu documentation for supported phones. | 219 | See gammu documentation for supported phones. |
216 | You 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. | 220 | You 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. |
217 | Quick hint how to use: | 221 | Quick hint how to use: |
218 | NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! | 222 | NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! |
219 | Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. | 223 | Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. |
220 | Create syncprofile - mobile device | 224 | Create syncprofile - mobile device |
221 | Remove entry for model. (Leave empty ). | 225 | Remove entry for model. (Leave empty ). |
222 | Enable infrared on Zaurus and your Phone. | 226 | Enable infrared on Zaurus and your Phone. |
223 | Sync. | 227 | Sync. |
224 | To get a more detailed log, start kopi from konsole. | 228 | To get a more detailed log, start kopi from konsole. |
225 | 229 | ||
226 | ********** VERSION 1.9.4 ************ | 230 | ********** VERSION 1.9.4 ************ |
227 | 231 | ||
228 | This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. | 232 | This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. |
229 | 233 | ||
230 | WARNING: | 234 | WARNING: |
231 | PLEASE BACKUP ALL YOUR DATA! | 235 | PLEASE BACKUP ALL YOUR DATA! |
232 | We have changed a lot and maybe there are some unknown problems. | 236 | We have changed a lot and maybe there are some unknown problems. |
233 | 237 | ||
234 | SYNC HANDLING HAS CHANGED! | 238 | SYNC HANDLING HAS CHANGED! |
235 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. | 239 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. |
236 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). | 240 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). |
237 | 241 | ||
238 | You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. | 242 | You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. |
239 | If 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. | 243 | If 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. |
240 | 244 | ||
241 | As programs are available: | 245 | As programs are available: |
242 | KO/Pi (korganizer ipk) - a calendar program. | 246 | KO/Pi (korganizer ipk) - a calendar program. |
243 | KA/Pi (kaddressbook ipk ) - an addressbook | 247 | KA/Pi (kaddressbook ipk ) - an addressbook |
244 | OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. | 248 | OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. |
245 | 249 | ||
246 | An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. | 250 | An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. |
247 | (If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) | 251 | (If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) |
248 | 252 | ||
249 | All the applications are installed in a "Pim" TAB. | 253 | All the applications are installed in a "Pim" TAB. |
250 | If 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 | 254 | If 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 |
251 | 255 | ||
252 | All the application are integrated. | 256 | All the application are integrated. |
253 | Such 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. | 257 | Such 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. |
254 | 258 | ||
255 | HINT: | 259 | HINT: |
256 | If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. | 260 | If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. |
257 | 261 | ||
258 | What's new? | 262 | What's new? |
259 | 263 | ||
260 | SYNC HANDLING HAS CHANGED! | 264 | SYNC HANDLING HAS CHANGED! |
261 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. | 265 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. |
262 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). | 266 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). |
263 | 267 | ||
264 | New in OM/Pi: | 268 | New in OM/Pi: |
265 | When 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. | 269 | When 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. |
266 | 270 | ||
267 | New in KO/Pi: | 271 | New in KO/Pi: |
268 | French is now available for KO/Pi. | 272 | French is now available for KO/Pi. |
269 | Choose menu:Actions - Configure:TAB locale | 273 | Choose menu:Actions - Configure:TAB locale |
270 | Syncing has changed. | 274 | Syncing has changed. |
271 | Phone sync available soon. | 275 | Phone sync available soon. |
272 | Not much changes, I cannot remember them ... | 276 | Not much changes, I cannot remember them ... |
273 | 277 | ||
274 | New in KA/Pi: | 278 | New in KA/Pi: |
275 | Beaming possible. | 279 | Beaming possible. |
276 | Sharp DTM readonly access possible( create a new DTM resource ); | 280 | Sharp DTM readonly access possible( create a new DTM resource ); |
277 | Better searching possible. | 281 | Better searching possible. |
278 | Search is performed only after pressing the return key. | 282 | Search is performed only after pressing the return key. |
279 | Use wildcard * to specify parts of a name. | 283 | Use wildcard * to specify parts of a name. |
280 | 284 | ||
281 | Better 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 * . | 285 | Better 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 * . |
282 | 286 | ||
283 | A big improvement is the new management of the contact access. | 287 | A big improvement is the new management of the contact access. |
284 | In version 1.9.3, every application was using their own addressbook access data. | 288 | In version 1.9.3, every application was using their own addressbook access data. |
285 | That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. | 289 | That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. |
286 | That was wasting of memory, if you had several hundreds of contacts. | 290 | That was wasting of memory, if you had several hundreds of contacts. |
287 | 291 | ||
288 | Now only KA/Pi accesses the addressbook. | 292 | Now only KA/Pi accesses the addressbook. |
289 | If 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. | 293 | If 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. |
290 | If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. | 294 | If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. |
291 | That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. | 295 | That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. |
292 | 296 | ||
293 | New in the KO/Pi alarm applet: | 297 | New in the KO/Pi alarm applet: |
294 | Configure your own timer popup menu! | 298 | Configure your own timer popup menu! |
295 | (Text and minutes for timer countdown) | 299 | (Text and minutes for timer countdown) |
296 | Just edit the file | 300 | Just edit the file |
297 | (yourhomedir)/.kopialarmtimerrc | 301 | (yourhomedir)/.kopialarmtimerrc |
298 | and start/stop a timer to get a new menu with the data of this file. | 302 | and start/stop a timer to get a new menu with the data of this file. |
299 | 303 | ||
300 | ********** VERSION 1.9.3 ************ | 304 | ********** VERSION 1.9.3 ************ |
301 | 1) | 305 | 1) |
302 | Now KO/Pi on Windows imports directly the calendar data of | 306 | Now KO/Pi on Windows imports directly the calendar data of |
303 | an installed Outlook. Should work with OL version >= 2000. | 307 | an installed Outlook. Should work with OL version >= 2000. |
304 | 308 | ||
305 | ********** VERSION 1.9.2 ************ | 309 | ********** VERSION 1.9.2 ************ |
306 | 1) | 310 | 1) |
307 | KDE-Pim/Pi has got a new member: | 311 | KDE-Pim/Pi has got a new member: |
308 | KmicroMail (KM/Pi) is a mail program, | 312 | KmicroMail (KM/Pi) is a mail program, |
309 | which can handle IMAP and POP mail access. | 313 | which can handle IMAP and POP mail access. |
310 | It is based on Opie-Mail v3. | 314 | It is based on Opie-Mail v3. |
311 | All dependencies to the Opie libraries ar removed, | 315 | All dependencies to the Opie libraries ar removed, |
312 | such that no additional Opie lib is needed. | 316 | such that no additional Opie lib is needed. |
313 | It is already integrated in KO/Pi and KA/Pi. | 317 | It is already integrated in KO/Pi and KA/Pi. |
314 | It it now available for the Zaurus,probably it | 318 | It it now available for the Zaurus,probably it |
315 | will be available for other platforms later. | 319 | will be available for other platforms later. |
316 | Hint: | 320 | Hint: |
317 | Create your own contact (name + email) | 321 | Create your own contact (name + email) |
318 | in KA/Pi, select this contact and choose menu: | 322 | in KA/Pi, select this contact and choose menu: |
319 | Settings - Set Who Am I. | 323 | Settings - Set Who Am I. |
320 | Now the settings of this contact are used as | 324 | Now the settings of this contact are used as |
321 | the sender data in KM/Pi. | 325 | the sender data in KM/Pi. |
322 | 2) | 326 | 2) |
323 | KDE-Pim/Pi is split up in five different | 327 | KDE-Pim/Pi is split up in five different |
324 | packages now precompiled for Sharp Zaurus: | 328 | packages now precompiled for Sharp Zaurus: |
325 | --kmicrokdelibs_1.9.2_arm.ipk | 329 | --kmicrokdelibs_1.9.2_arm.ipk |
326 | The libs are needed for any | 330 | The libs are needed for any |
327 | of the following programs: | 331 | of the following programs: |
328 | --kaddressbook_1.9.2_arm.ipk | 332 | --kaddressbook_1.9.2_arm.ipk |
329 | --kmicromail_1.9.2_arm.ipk | 333 | --kmicromail_1.9.2_arm.ipk |
330 | --korganizer_1.9.2_arm.ipk | 334 | --korganizer_1.9.2_arm.ipk |
331 | Independ from that, there is the alarm applet | 335 | Independ from that, there is the alarm applet |
332 | available for KO/Pi, which also offers | 336 | available for KO/Pi, which also offers |
333 | quick access for a new mail or | 337 | quick access for a new mail or |
334 | showing the addressbook.: | 338 | showing the addressbook.: |
335 | --korganizer-alarm_1.9.2_arm.ipk | 339 | --korganizer-alarm_1.9.2_arm.ipk |
336 | Independend means, that the alarm applet | 340 | Independend means, that the alarm applet |
337 | does not need any of the libs or programs above to run. | 341 | does not need any of the libs or programs above to run. |
338 | But it would be quite useless without these programs. | 342 | But it would be quite useless without these programs. |
339 | NOTE: | 343 | NOTE: |
340 | If you get a | 344 | If you get a |
341 | "This application depends on other programs" | 345 | "This application depends on other programs" |
342 | during installation of | 346 | during installation of |
343 | --kmicrokdelibs_1.9.2_arm.ipk | 347 | --kmicrokdelibs_1.9.2_arm.ipk |
344 | you probably do not have to care about that. | 348 | you probably do not have to care about that. |
345 | kmicrokdelibs_1.9.2 will come with some | 349 | kmicrokdelibs_1.9.2 will come with some |
346 | resource plugins, which needs additional libraries. | 350 | resource plugins, which needs additional libraries. |
347 | (E.g. libopie1, if you want to use the | 351 | (E.g. libopie1, if you want to use the |
348 | opie resource connector in KA/Pi). | 352 | opie resource connector in KA/Pi). |
349 | If you do not have this libraries installed, | 353 | If you do not have this libraries installed, |
350 | you simply cannot use the resource. | 354 | you simply cannot use the resource. |
351 | To make it clear: | 355 | To make it clear: |
352 | If the libraries are missing, the applications | 356 | If the libraries are missing, the applications |
353 | using kmicrokdelibs will start, | 357 | using kmicrokdelibs will start, |
354 | because the resources are plugins. | 358 | because the resources are plugins. |
355 | 3) | 359 | 3) |
356 | KO/Pi and friends are now installable on SD-Card! | 360 | KO/Pi and friends are now installable on SD-Card! |
357 | It is recommended to install all libs and apps | 361 | It is recommended to install all libs and apps |
358 | on the SD card or all in the internal storage. | 362 | on the SD card or all in the internal storage. |
359 | There may be problems, if this is mixed. | 363 | There may be problems, if this is mixed. |
360 | 4) | 364 | 4) |
361 | Fixed two bugs in the alarm notification on Windows. | 365 | Fixed two bugs in the alarm notification on Windows. |
362 | 5) | 366 | 5) |
363 | Great improvement! | 367 | Great improvement! |
364 | KO/Pi uses now the latest version of libical. | 368 | KO/Pi uses now the latest version of libical. |
365 | Libical is the library which actually reads | 369 | Libical is the library which actually reads |
366 | the calendar files and extract the data from it. | 370 | the calendar files and extract the data from it. |
367 | With the old version, there were problems | 371 | With the old version, there were problems |
368 | (crashes or program hangs) when licical did read | 372 | (crashes or program hangs) when licical did read |
369 | files, which were not stored from KO/Pi. | 373 | files, which were not stored from KO/Pi. |
370 | I do not know, if the new libical works perfect, | 374 | I do not know, if the new libical works perfect, |
371 | but actually it works much better than | 375 | but actually it works much better than |
372 | the old version. | 376 | the old version. |
373 | There are no problems with compatibility with | 377 | There are no problems with compatibility with |
374 | old calendar files of KO/Pi, of course! | 378 | old calendar files of KO/Pi, of course! |
375 | 6) | 379 | 6) |
376 | New in KA/Pi: | 380 | New in KA/Pi: |
377 | Opie addressbook resource connector available! | 381 | Opie addressbook resource connector available! |
378 | You will need libopie1 and the opie addressbook, | 382 | You will need libopie1 and the opie addressbook, |
379 | of course. | 383 | of course. |
380 | With the Opie addressbook resource connector, | 384 | With the Opie addressbook resource connector, |
381 | you can access the Opie addressbook readonly in KA/Pi. | 385 | you can access the Opie addressbook readonly in KA/Pi. |
382 | If you want to edit or import the data into KA/Pi, | 386 | If you want to edit or import the data into KA/Pi, |
383 | do this: | 387 | do this: |
384 | a) Create an Opie resource. | 388 | a) Create an Opie resource. |
385 | (Menu: Settings-Configure Resources). | 389 | (Menu: Settings-Configure Resources). |
386 | After configuration and restarting KA/Pi you should see | 390 | After configuration and restarting KA/Pi you should see |
387 | the Opie contacts in KA/Pi. | 391 | the Opie contacts in KA/Pi. |
388 | b) Select some or all Opie contacts. | 392 | b) Select some or all Opie contacts. |
389 | (NOTE: +++++ | 393 | (NOTE: +++++ |
390 | To know exactly, what contacts are Opie contacts, | 394 | To know exactly, what contacts are Opie contacts, |
391 | do this: Choose menu: | 395 | do this: Choose menu: |
392 | View-Modify View - TAB Fields. | 396 | View-Modify View - TAB Fields. |
393 | Select in the above list "Resource" and click | 397 | Select in the above list "Resource" and click |
394 | down arrow to add it to the "Selected fields". | 398 | down arrow to add it to the "Selected fields". |
395 | Click OK. | 399 | Click OK. |
396 | Now you have a new column "Resource" in your list, | 400 | Now you have a new column "Resource" in your list, |
397 | where you can see, what an Opie resource is. | 401 | where you can see, what an Opie resource is. |
398 | ++++ NOTE end.) | 402 | ++++ NOTE end.) |
399 | Ok, we do have now some Opie contacts seleted. | 403 | Ok, we do have now some Opie contacts seleted. |
400 | (Use SHIFT or CTRL key in order to multiple select). | 404 | (Use SHIFT or CTRL key in order to multiple select). |
401 | c) Choose menu: Edit-Copy. | 405 | c) Choose menu: Edit-Copy. |
402 | d) Choose menu: Edit-Paste. | 406 | d) Choose menu: Edit-Paste. |
403 | e) Select the resource, you want to add the contacts to. | 407 | e) Select the resource, you want to add the contacts to. |
404 | Congrats! Now you have read/write access to the copied | 408 | Congrats! Now you have read/write access to the copied |
405 | opie contacts as "real" KA/Pi contacts. | 409 | opie contacts as "real" KA/Pi contacts. |
406 | 410 | ||
407 | 411 | ||
408 | ********** VERSION 1.9.1 ************ | 412 | ********** VERSION 1.9.1 ************ |
409 | 1) | 413 | 1) |
410 | +++ IMPORTANT 1 +++ | 414 | +++ IMPORTANT 1 +++ |
411 | 415 | ||
412 | The storing place of the default calendar | 416 | The storing place of the default calendar |
413 | file has changed! | 417 | file has changed! |
414 | The default calendar file was | 418 | The default calendar file was |
415 | Applications/korganizer/mycalendar.ics | 419 | Applications/korganizer/mycalendar.ics |
416 | on Zaurus and | 420 | on Zaurus and |
417 | (yourHomeDir)/korganizer/mycalendar.ics | 421 | (yourHomeDir)/korganizer/mycalendar.ics |
418 | on Windows/Linux desktop. Now it is | 422 | on Windows/Linux desktop. Now it is |
419 | (yourHomeDir)/kdepim/korganizer/mycalendar.ics | 423 | (yourHomeDir)/kdepim/korganizer/mycalendar.ics |
420 | on Zaurus, Windows and Linux. | 424 | on Zaurus, Windows and Linux. |
421 | To load the old file, choose menu | 425 | To load the old file, choose menu |
422 | File-Load calendar backup. | 426 | File-Load calendar backup. |
423 | (It should be loaded automatically | 427 | (It should be loaded automatically |
424 | at startup with a warning message displayed). | 428 | at startup with a warning message displayed). |
425 | The place of the configuration file has changed too. | 429 | The place of the configuration file has changed too. |
426 | If you want to use your old KO/Pi config, | 430 | If you want to use your old KO/Pi config, |
427 | copy it to | 431 | copy it to |
428 | (yourHomeDir)/kdepim/config/korganizerrc | 432 | (yourHomeDir)/kdepim/config/korganizerrc |
429 | Please read VERSION 1.9.0 - topic 3) as well! | 433 | Please read VERSION 1.9.0 - topic 3) as well! |
430 | 434 | ||
431 | +++ IMPORTANT 2 +++ | 435 | +++ IMPORTANT 2 +++ |
432 | 436 | ||
433 | Because of the new paths, you will need | 437 | Because of the new paths, you will need |
434 | a new version of the KO/Pi alarm applet | 438 | a new version of the KO/Pi alarm applet |
435 | for Zaurus. | 439 | for Zaurus. |
436 | Use version >= 1.9.1 | 440 | Use version >= 1.9.1 |
437 | 441 | ||
438 | 2) | 442 | 2) |
439 | Now the QWhat'sThis Icon works for items | 443 | Now the QWhat'sThis Icon works for items |
440 | in the month view as well. | 444 | in the month view as well. |
441 | (See VERSION 1.7.8 Topic 1) ). | 445 | (See VERSION 1.7.8 Topic 1) ). |
442 | 3) | 446 | 3) |
443 | You can import birtsdays/anniversaries | 447 | You can import birtsdays/anniversaries |
444 | from KA/Pi into KO/Pi. | 448 | from KA/Pi into KO/Pi. |
445 | Choose menu File-Import birthdays. | 449 | Choose menu File-Import birthdays. |
446 | If you import twice, already imported items | 450 | If you import twice, already imported items |
447 | will not be imported again, if they | 451 | will not be imported again, if they |
448 | have not been changed in KO/Pi. | 452 | have not been changed in KO/Pi. |
449 | 4) | 453 | 4) |
450 | When syncing with sharp DTM, now a progress | 454 | When syncing with sharp DTM, now a progress |
451 | is shown, when the data is written back. | 455 | is shown, when the data is written back. |
452 | If there is much data in KO/Pi and no data | 456 | If there is much data in KO/Pi and no data |
453 | in DTM, that can take a long time. | 457 | in DTM, that can take a long time. |
454 | (But only for the first time ). | 458 | (But only for the first time ). |
455 | 5) | 459 | 5) |
456 | In the search dialog, you can search | 460 | In the search dialog, you can search |
457 | now for the name/email of an attendee | 461 | now for the name/email of an attendee |
458 | of an event/todo. | 462 | of an event/todo. |
459 | To get more space for displaying | 463 | To get more space for displaying |
460 | search results, the buttons | 464 | search results, the buttons |
461 | for "search" and "close" on the | 465 | for "search" and "close" on the |
462 | bottom are removed in the PDA version. | 466 | bottom are removed in the PDA version. |
463 | You have to click OK in the top right | 467 | You have to click OK in the top right |
464 | corner to do a search. | 468 | corner to do a search. |
465 | 6) | 469 | 6) |
466 | Now it is possible to disable the displaying | 470 | Now it is possible to disable the displaying |
467 | of todo items in the Allday part of the Agenda. | 471 | of todo items in the Allday part of the Agenda. |
468 | Choose Menu Action-Configure, | 472 | Choose Menu Action-Configure, |
469 | TAB Todo View, checkbox | 473 | TAB Todo View, checkbox |
470 | "Allday Agenda view shows todos" | 474 | "Allday Agenda view shows todos" |
471 | 7) | 475 | 7) |
472 | If FastLoad is enabled, now the settings and the | 476 | If FastLoad is enabled, now the settings and the |
473 | calendar data are saved, when KO/Pi is closed. | 477 | calendar data are saved, when KO/Pi is closed. |
474 | (If no Fastload is enabled, KO/Pi saves | 478 | (If no Fastload is enabled, KO/Pi saves |
475 | the data as well, of course) | 479 | the data as well, of course) |
476 | 8) | 480 | 8) |
477 | The Agenda View has a minimize-splitter now, | 481 | The Agenda View has a minimize-splitter now, |
478 | such that the height of the allday part can be | 482 | such that the height of the allday part can be |
479 | changed quickly. | 483 | changed quickly. |
480 | 484 | ||
481 | ********** VERSION 1.9.0 ************ | 485 | ********** VERSION 1.9.0 ************ |
482 | 1) | 486 | 1) |
483 | KO/Pi is now merged with the new microKDE from KA/Pi. | 487 | KO/Pi is now merged with the new microKDE from KA/Pi. |
484 | KO/Pi accesses now KA/Pi as the addressbook. | 488 | KO/Pi accesses now KA/Pi as the addressbook. |
485 | The other ddressbook-plugins are not working any longer. | 489 | The other ddressbook-plugins are not working any longer. |
486 | (It is planned, that later KA/Pi itself uses these plugins) | 490 | (It is planned, that later KA/Pi itself uses these plugins) |
487 | New versions of KO/Pi are only available | 491 | New versions of KO/Pi are only available |
488 | together with KA/Pi as the KDE-Pim/Pi package. | 492 | together with KA/Pi as the KDE-Pim/Pi package. |
489 | 2) | 493 | 2) |
490 | If you click on an attendee of a meeting in the | 494 | If you click on an attendee of a meeting in the |
491 | event viewer, a detailed summary of the | 495 | event viewer, a detailed summary of the |
492 | attendee is shown. | 496 | attendee is shown. |
493 | 3) | 497 | 3) |
494 | The place of the configuration file has changed. | 498 | The place of the configuration file has changed. |
495 | If you want to use your old KO/Pi config, copy | 499 | If you want to use your old KO/Pi config, copy |
496 | Applications/korganizer/config_korganizerrc | 500 | Applications/korganizer/config_korganizerrc |
497 | to | 501 | to |
498 | Applications/korganizer/config/korganizerrc | 502 | Applications/korganizer/config/korganizerrc |
499 | 503 | ||
500 | ********** VERSION 1.7.8 ************ | 504 | ********** VERSION 1.7.8 ************ |
501 | 1) | 505 | 1) |
502 | Now the QWhat'sThis ist working. | 506 | Now the QWhat'sThis ist working. |
503 | Enable the QWhat'sThis icon in the toolbar. | 507 | Enable the QWhat'sThis icon in the toolbar. |
504 | (You have to restart to reload the changed toolbar config). | 508 | (You have to restart to reload the changed toolbar config). |
505 | Now click on the QWhat'sThis Icon | 509 | Now click on the QWhat'sThis Icon |
506 | in the top right corner of KO/Pi. | 510 | in the top right corner of KO/Pi. |
507 | Then click on an item in the Agenda View: | 511 | Then click on an item in the Agenda View: |
508 | You will get a detailed display of the items content. | 512 | You will get a detailed display of the items content. |
509 | 2) | 513 | 2) |
510 | Some other very minor changes. | 514 | Some other very minor changes. |
511 | But I have forgotten the details ... | 515 | But I have forgotten the details ... |
512 | For that reason I start this log here: | 516 | For that reason I start this log here: |
513 | To document my changes, when I am doing it. | 517 | To document my changes, when I am doing it. |
514 | 518 | ||
515 | ********** VERSION 1.7.7 ************ | 519 | ********** VERSION 1.7.7 ************ |
516 | Stable Version of KO/Pi \ No newline at end of file | 520 | Stable Version of KO/Pi \ No newline at end of file |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index c75b4bc..9ef97c9 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1,2979 +1,2979 @@ | |||
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 | /*s | 24 | /*s |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "kabcore.h" | 31 | #include "kabcore.h" |
32 | 32 | ||
33 | #include <stdaddressbook.h> | 33 | #include <stdaddressbook.h> |
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | #include <kfiledialog.h> | 35 | #include <kfiledialog.h> |
36 | #include <qtimer.h> | 36 | #include <qtimer.h> |
37 | #include <qlabel.h> | 37 | #include <qlabel.h> |
38 | #include <qregexp.h> | 38 | #include <qregexp.h> |
39 | #include <qlineedit.h> | 39 | #include <qlineedit.h> |
40 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qprogressbar.h> | 42 | #include <qprogressbar.h> |
43 | #include <libkdepim/phoneaccess.h> | 43 | #include <libkdepim/phoneaccess.h> |
44 | 44 | ||
45 | #ifndef KAB_EMBEDDED | 45 | #ifndef KAB_EMBEDDED |
46 | #include <qclipboard.h> | 46 | #include <qclipboard.h> |
47 | #include <qdir.h> | 47 | #include <qdir.h> |
48 | #include <qfile.h> | 48 | #include <qfile.h> |
49 | #include <qapplicaton.h> | 49 | #include <qapplicaton.h> |
50 | #include <qprogressbar.h> | 50 | #include <qprogressbar.h> |
51 | #include <qlayout.h> | 51 | #include <qlayout.h> |
52 | #include <qregexp.h> | 52 | #include <qregexp.h> |
53 | #include <qvbox.h> | 53 | #include <qvbox.h> |
54 | #include <kabc/addresseelist.h> | 54 | #include <kabc/addresseelist.h> |
55 | #include <kabc/errorhandler.h> | 55 | #include <kabc/errorhandler.h> |
56 | #include <kabc/resource.h> | 56 | #include <kabc/resource.h> |
57 | #include <kabc/vcardconverter.h> | 57 | #include <kabc/vcardconverter.h> |
58 | #include <kapplication.h> | 58 | #include <kapplication.h> |
59 | #include <kactionclasses.h> | 59 | #include <kactionclasses.h> |
60 | #include <kcmultidialog.h> | 60 | #include <kcmultidialog.h> |
61 | #include <kdebug.h> | 61 | #include <kdebug.h> |
62 | #include <kdeversion.h> | 62 | #include <kdeversion.h> |
63 | #include <kkeydialog.h> | 63 | #include <kkeydialog.h> |
64 | #include <kmessagebox.h> | 64 | #include <kmessagebox.h> |
65 | #include <kprinter.h> | 65 | #include <kprinter.h> |
66 | #include <kprotocolinfo.h> | 66 | #include <kprotocolinfo.h> |
67 | #include <kresources/selectdialog.h> | 67 | #include <kresources/selectdialog.h> |
68 | #include <kstandarddirs.h> | 68 | #include <kstandarddirs.h> |
69 | #include <ktempfile.h> | 69 | #include <ktempfile.h> |
70 | #include <kxmlguiclient.h> | 70 | #include <kxmlguiclient.h> |
71 | #include <kaboutdata.h> | 71 | #include <kaboutdata.h> |
72 | #include <libkdepim/categoryselectdialog.h> | 72 | #include <libkdepim/categoryselectdialog.h> |
73 | 73 | ||
74 | #include "addresseeutil.h" | 74 | #include "addresseeutil.h" |
75 | #include "addresseeeditordialog.h" | 75 | #include "addresseeeditordialog.h" |
76 | #include "extensionmanager.h" | 76 | #include "extensionmanager.h" |
77 | #include "kstdaction.h" | 77 | #include "kstdaction.h" |
78 | #include "kaddressbookservice.h" | 78 | #include "kaddressbookservice.h" |
79 | #include "ldapsearchdialog.h" | 79 | #include "ldapsearchdialog.h" |
80 | #include "printing/printingwizard.h" | 80 | #include "printing/printingwizard.h" |
81 | #else // KAB_EMBEDDED | 81 | #else // KAB_EMBEDDED |
82 | 82 | ||
83 | #include <kapplication.h> | 83 | #include <kapplication.h> |
84 | #include "KDGanttMinimizeSplitter.h" | 84 | #include "KDGanttMinimizeSplitter.h" |
85 | #include "kaddressbookmain.h" | 85 | #include "kaddressbookmain.h" |
86 | #include "kactioncollection.h" | 86 | #include "kactioncollection.h" |
87 | #include "addresseedialog.h" | 87 | #include "addresseedialog.h" |
88 | //US | 88 | //US |
89 | #include <addresseeview.h> | 89 | #include <addresseeview.h> |
90 | 90 | ||
91 | #include <qapp.h> | 91 | #include <qapp.h> |
92 | #include <qmenubar.h> | 92 | #include <qmenubar.h> |
93 | //#include <qtoolbar.h> | 93 | //#include <qtoolbar.h> |
94 | #include <qmessagebox.h> | 94 | #include <qmessagebox.h> |
95 | #include <kdebug.h> | 95 | #include <kdebug.h> |
96 | #include <kiconloader.h> // needed for SmallIcon | 96 | #include <kiconloader.h> // needed for SmallIcon |
97 | #include <kresources/kcmkresources.h> | 97 | #include <kresources/kcmkresources.h> |
98 | #include <ktoolbar.h> | 98 | #include <ktoolbar.h> |
99 | 99 | ||
100 | 100 | ||
101 | //#include <qlabel.h> | 101 | //#include <qlabel.h> |
102 | 102 | ||
103 | 103 | ||
104 | #ifndef DESKTOP_VERSION | 104 | #ifndef DESKTOP_VERSION |
105 | #include <qpe/ir.h> | 105 | #include <qpe/ir.h> |
106 | #include <qpe/qpemenubar.h> | 106 | #include <qpe/qpemenubar.h> |
107 | #include <qtopia/qcopenvelope_qws.h> | 107 | #include <qtopia/qcopenvelope_qws.h> |
108 | #else | 108 | #else |
109 | 109 | ||
110 | #include <qmenubar.h> | 110 | #include <qmenubar.h> |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | #endif // KAB_EMBEDDED | 113 | #endif // KAB_EMBEDDED |
114 | #include "kcmconfigs/kcmkabconfig.h" | 114 | #include "kcmconfigs/kcmkabconfig.h" |
115 | #include "kcmconfigs/kcmkdepimconfig.h" | 115 | #include "kcmconfigs/kcmkdepimconfig.h" |
116 | #include "kpimglobalprefs.h" | 116 | #include "kpimglobalprefs.h" |
117 | #include "externalapphandler.h" | 117 | #include "externalapphandler.h" |
118 | 118 | ||
119 | 119 | ||
120 | #include <kresources/selectdialog.h> | 120 | #include <kresources/selectdialog.h> |
121 | #include <kmessagebox.h> | 121 | #include <kmessagebox.h> |
122 | 122 | ||
123 | #include <picture.h> | 123 | #include <picture.h> |
124 | #include <resource.h> | 124 | #include <resource.h> |
125 | 125 | ||
126 | //US#include <qsplitter.h> | 126 | //US#include <qsplitter.h> |
127 | #include <qmap.h> | 127 | #include <qmap.h> |
128 | #include <qdir.h> | 128 | #include <qdir.h> |
129 | #include <qfile.h> | 129 | #include <qfile.h> |
130 | #include <qvbox.h> | 130 | #include <qvbox.h> |
131 | #include <qlayout.h> | 131 | #include <qlayout.h> |
132 | #include <qclipboard.h> | 132 | #include <qclipboard.h> |
133 | #include <qtextstream.h> | 133 | #include <qtextstream.h> |
134 | 134 | ||
135 | #include <libkdepim/categoryselectdialog.h> | 135 | #include <libkdepim/categoryselectdialog.h> |
136 | #include <kabc/vcardconverter.h> | 136 | #include <kabc/vcardconverter.h> |
137 | 137 | ||
138 | 138 | ||
139 | #include "addresseeutil.h" | 139 | #include "addresseeutil.h" |
140 | #include "undocmds.h" | 140 | #include "undocmds.h" |
141 | #include "addresseeeditordialog.h" | 141 | #include "addresseeeditordialog.h" |
142 | #include "viewmanager.h" | 142 | #include "viewmanager.h" |
143 | #include "details/detailsviewcontainer.h" | 143 | #include "details/detailsviewcontainer.h" |
144 | #include "kabprefs.h" | 144 | #include "kabprefs.h" |
145 | #include "xxportmanager.h" | 145 | #include "xxportmanager.h" |
146 | #include "incsearchwidget.h" | 146 | #include "incsearchwidget.h" |
147 | #include "jumpbuttonbar.h" | 147 | #include "jumpbuttonbar.h" |
148 | #include "extensionmanager.h" | 148 | #include "extensionmanager.h" |
149 | #include "addresseeconfig.h" | 149 | #include "addresseeconfig.h" |
150 | #include <kcmultidialog.h> | 150 | #include <kcmultidialog.h> |
151 | 151 | ||
152 | #ifdef _WIN32_ | 152 | #ifdef _WIN32_ |
153 | 153 | ||
154 | #include "kaimportoldialog.h" | 154 | #include "kaimportoldialog.h" |
155 | #else | 155 | #else |
156 | #include <unistd.h> | 156 | #include <unistd.h> |
157 | #endif | 157 | #endif |
158 | // sync includes | 158 | // sync includes |
159 | #include <libkdepim/ksyncprofile.h> | 159 | #include <libkdepim/ksyncprofile.h> |
160 | #include <libkdepim/ksyncprefsdialog.h> | 160 | #include <libkdepim/ksyncprefsdialog.h> |
161 | 161 | ||
162 | class KAex2phonePrefs : public QDialog | 162 | class KAex2phonePrefs : public QDialog |
163 | { | 163 | { |
164 | public: | 164 | public: |
165 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 165 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
166 | QDialog( parent, name, true ) | 166 | QDialog( parent, name, true ) |
167 | { | 167 | { |
168 | setCaption( i18n("Export to phone options") ); | 168 | setCaption( i18n("Export to phone options") ); |
169 | QVBoxLayout* lay = new QVBoxLayout( this ); | 169 | QVBoxLayout* lay = new QVBoxLayout( this ); |
170 | lay->setSpacing( 3 ); | 170 | lay->setSpacing( 3 ); |
171 | lay->setMargin( 3 ); | 171 | lay->setMargin( 3 ); |
172 | QLabel *lab; | 172 | QLabel *lab; |
173 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 173 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
174 | lab->setAlignment (AlignHCenter ); | 174 | lab->setAlignment (AlignHCenter ); |
175 | QHBox* temphb; | 175 | QHBox* temphb; |
176 | temphb = new QHBox( this ); | 176 | temphb = new QHBox( this ); |
177 | new QLabel( i18n("I/O device: "), temphb ); | 177 | new QLabel( i18n("I/O device: "), temphb ); |
178 | mPhoneDevice = new QLineEdit( temphb); | 178 | mPhoneDevice = new QLineEdit( temphb); |
179 | lay->addWidget( temphb ); | 179 | lay->addWidget( temphb ); |
180 | temphb = new QHBox( this ); | 180 | temphb = new QHBox( this ); |
181 | new QLabel( i18n("Connection: "), temphb ); | 181 | new QLabel( i18n("Connection: "), temphb ); |
182 | mPhoneConnection = new QLineEdit( temphb); | 182 | mPhoneConnection = new QLineEdit( temphb); |
183 | lay->addWidget( temphb ); | 183 | lay->addWidget( temphb ); |
184 | temphb = new QHBox( this ); | 184 | temphb = new QHBox( this ); |
185 | new QLabel( i18n("Model(opt.): "), temphb ); | 185 | new QLabel( i18n("Model(opt.): "), temphb ); |
186 | mPhoneModel = new QLineEdit( temphb); | 186 | mPhoneModel = new QLineEdit( temphb); |
187 | lay->addWidget( temphb ); | 187 | lay->addWidget( temphb ); |
188 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); | 188 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); |
189 | // lay->addWidget( mWriteToSim ); | 189 | // lay->addWidget( mWriteToSim ); |
190 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); | 190 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); |
191 | lab->setAlignment (AlignHCenter ); | 191 | lab->setAlignment (AlignHCenter ); |
192 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 192 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
193 | lay->addWidget( ok ); | 193 | lay->addWidget( ok ); |
194 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 194 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
195 | lay->addWidget( cancel ); | 195 | lay->addWidget( cancel ); |
196 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 196 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
197 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 197 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
198 | resize( 220, 240 ); | 198 | resize( 220, 240 ); |
199 | 199 | ||
200 | } | 200 | } |
201 | 201 | ||
202 | public: | 202 | public: |
203 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 203 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
204 | QCheckBox* mWriteToSim; | 204 | QCheckBox* mWriteToSim; |
205 | }; | 205 | }; |
206 | 206 | ||
207 | 207 | ||
208 | bool pasteWithNewUid = true; | 208 | bool pasteWithNewUid = true; |
209 | 209 | ||
210 | #ifdef KAB_EMBEDDED | 210 | #ifdef KAB_EMBEDDED |
211 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) | 211 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) |
212 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), | 212 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), |
213 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ | 213 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ |
214 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) | 214 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) |
215 | #else //KAB_EMBEDDED | 215 | #else //KAB_EMBEDDED |
216 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) | 216 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) |
217 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), | 217 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), |
218 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), | 218 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), |
219 | mReadWrite( readWrite ), mModified( false ) | 219 | mReadWrite( readWrite ), mModified( false ) |
220 | #endif //KAB_EMBEDDED | 220 | #endif //KAB_EMBEDDED |
221 | { | 221 | { |
222 | // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); | 222 | // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); |
223 | // syncManager->setBlockSave(false); | 223 | // syncManager->setBlockSave(false); |
224 | mExtensionBarSplitter = 0; | 224 | mExtensionBarSplitter = 0; |
225 | mIsPart = !parent->inherits( "KAddressBookMain" ); | 225 | mIsPart = !parent->inherits( "KAddressBookMain" ); |
226 | mAddressBook = KABC::StdAddressBook::self(); | 226 | mAddressBook = KABC::StdAddressBook::self(); |
227 | KABC::StdAddressBook::setAutomaticSave( false ); | 227 | KABC::StdAddressBook::setAutomaticSave( false ); |
228 | 228 | ||
229 | #ifndef KAB_EMBEDDED | 229 | #ifndef KAB_EMBEDDED |
230 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); | 230 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); |
231 | #endif //KAB_EMBEDDED | 231 | #endif //KAB_EMBEDDED |
232 | 232 | ||
233 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), | 233 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), |
234 | SLOT( addressBookChanged() ) ); | 234 | SLOT( addressBookChanged() ) ); |
235 | 235 | ||
236 | #if 0 | 236 | #if 0 |
237 | // LP moved to addressbook init method | 237 | // LP moved to addressbook init method |
238 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, | 238 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, |
239 | "X-Department", "KADDRESSBOOK" ); | 239 | "X-Department", "KADDRESSBOOK" ); |
240 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, | 240 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, |
241 | "X-Profession", "KADDRESSBOOK" ); | 241 | "X-Profession", "KADDRESSBOOK" ); |
242 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, | 242 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, |
243 | "X-AssistantsName", "KADDRESSBOOK" ); | 243 | "X-AssistantsName", "KADDRESSBOOK" ); |
244 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, | 244 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, |
245 | "X-ManagersName", "KADDRESSBOOK" ); | 245 | "X-ManagersName", "KADDRESSBOOK" ); |
246 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, | 246 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, |
247 | "X-SpousesName", "KADDRESSBOOK" ); | 247 | "X-SpousesName", "KADDRESSBOOK" ); |
248 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, | 248 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, |
249 | "X-Office", "KADDRESSBOOK" ); | 249 | "X-Office", "KADDRESSBOOK" ); |
250 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, | 250 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, |
251 | "X-IMAddress", "KADDRESSBOOK" ); | 251 | "X-IMAddress", "KADDRESSBOOK" ); |
252 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, | 252 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, |
253 | "X-Anniversary", "KADDRESSBOOK" ); | 253 | "X-Anniversary", "KADDRESSBOOK" ); |
254 | 254 | ||
255 | //US added this field to become compatible with Opie/qtopia addressbook | 255 | //US added this field to become compatible with Opie/qtopia addressbook |
256 | // values can be "female" or "male" or "". An empty field represents undefined. | 256 | // values can be "female" or "male" or "". An empty field represents undefined. |
257 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, | 257 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, |
258 | "X-Gender", "KADDRESSBOOK" ); | 258 | "X-Gender", "KADDRESSBOOK" ); |
259 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, | 259 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, |
260 | "X-Children", "KADDRESSBOOK" ); | 260 | "X-Children", "KADDRESSBOOK" ); |
261 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, | 261 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, |
262 | "X-FreeBusyUrl", "KADDRESSBOOK" ); | 262 | "X-FreeBusyUrl", "KADDRESSBOOK" ); |
263 | #endif | 263 | #endif |
264 | initGUI(); | 264 | initGUI(); |
265 | 265 | ||
266 | mIncSearchWidget->setFocus(); | 266 | mIncSearchWidget->setFocus(); |
267 | 267 | ||
268 | 268 | ||
269 | connect( mViewManager, SIGNAL( selected( const QString& ) ), | 269 | connect( mViewManager, SIGNAL( selected( const QString& ) ), |
270 | SLOT( setContactSelected( const QString& ) ) ); | 270 | SLOT( setContactSelected( const QString& ) ) ); |
271 | connect( mViewManager, SIGNAL( executed( const QString& ) ), | 271 | connect( mViewManager, SIGNAL( executed( const QString& ) ), |
272 | SLOT( executeContact( const QString& ) ) ); | 272 | SLOT( executeContact( const QString& ) ) ); |
273 | 273 | ||
274 | connect( mViewManager, SIGNAL( deleteRequest( ) ), | 274 | connect( mViewManager, SIGNAL( deleteRequest( ) ), |
275 | SLOT( deleteContacts( ) ) ); | 275 | SLOT( deleteContacts( ) ) ); |
276 | connect( mViewManager, SIGNAL( modified() ), | 276 | connect( mViewManager, SIGNAL( modified() ), |
277 | SLOT( setModified() ) ); | 277 | SLOT( setModified() ) ); |
278 | 278 | ||
279 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); | 279 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); |
280 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); | 280 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); |
281 | 281 | ||
282 | connect( mXXPortManager, SIGNAL( modified() ), | 282 | connect( mXXPortManager, SIGNAL( modified() ), |
283 | SLOT( setModified() ) ); | 283 | SLOT( setModified() ) ); |
284 | 284 | ||
285 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), | 285 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), |
286 | SLOT( incrementalSearch( const QString& ) ) ); | 286 | SLOT( incrementalSearch( const QString& ) ) ); |
287 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), | 287 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), |
288 | mJumpButtonBar, SLOT( recreateButtons() ) ); | 288 | mJumpButtonBar, SLOT( recreateButtons() ) ); |
289 | 289 | ||
290 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 290 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
291 | SLOT( sendMail( const QString& ) ) ); | 291 | SLOT( sendMail( const QString& ) ) ); |
292 | 292 | ||
293 | 293 | ||
294 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); | 294 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
295 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | 295 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); |
296 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); | 296 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); |
297 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); | 297 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); |
298 | 298 | ||
299 | 299 | ||
300 | #ifndef KAB_EMBEDDED | 300 | #ifndef KAB_EMBEDDED |
301 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 301 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
302 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 302 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
303 | 303 | ||
304 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 304 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
305 | SLOT( browse( const QString& ) ) ); | 305 | SLOT( browse( const QString& ) ) ); |
306 | 306 | ||
307 | 307 | ||
308 | mAddressBookService = new KAddressBookService( this ); | 308 | mAddressBookService = new KAddressBookService( this ); |
309 | 309 | ||
310 | #endif //KAB_EMBEDDED | 310 | #endif //KAB_EMBEDDED |
311 | 311 | ||
312 | mMessageTimer = new QTimer( this ); | 312 | mMessageTimer = new QTimer( this ); |
313 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); | 313 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); |
314 | mEditorDialog = 0; | 314 | mEditorDialog = 0; |
315 | createAddresseeEditorDialog( this ); | 315 | createAddresseeEditorDialog( this ); |
316 | setModified( false ); | 316 | setModified( false ); |
317 | mBRdisabled = false; | 317 | mBRdisabled = false; |
318 | #ifndef DESKTOP_VERSION | 318 | #ifndef DESKTOP_VERSION |
319 | infrared = 0; | 319 | infrared = 0; |
320 | #endif | 320 | #endif |
321 | //toggleBeamReceive( ); | 321 | //toggleBeamReceive( ); |
322 | } | 322 | } |
323 | 323 | ||
324 | KABCore::~KABCore() | 324 | KABCore::~KABCore() |
325 | { | 325 | { |
326 | // save(); | 326 | // save(); |
327 | //saveSettings(); | 327 | //saveSettings(); |
328 | //KABPrefs::instance()->writeConfig(); | 328 | //KABPrefs::instance()->writeConfig(); |
329 | delete AddresseeConfig::instance(); | 329 | delete AddresseeConfig::instance(); |
330 | mAddressBook = 0; | 330 | mAddressBook = 0; |
331 | KABC::StdAddressBook::close(); | 331 | KABC::StdAddressBook::close(); |
332 | 332 | ||
333 | delete syncManager; | 333 | delete syncManager; |
334 | #ifndef DESKTOP_VERSION | 334 | #ifndef DESKTOP_VERSION |
335 | if ( infrared ) | 335 | if ( infrared ) |
336 | delete infrared; | 336 | delete infrared; |
337 | #endif | 337 | #endif |
338 | } | 338 | } |
339 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 339 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) |
340 | { | 340 | { |
341 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); | 341 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); |
342 | if ( cmsg == "setDocument(QString)" ) { | 342 | if ( cmsg == "setDocument(QString)" ) { |
343 | QDataStream stream( data, IO_ReadOnly ); | 343 | QDataStream stream( data, IO_ReadOnly ); |
344 | QString fileName; | 344 | QString fileName; |
345 | stream >> fileName; | 345 | stream >> fileName; |
346 | recieve( fileName ); | 346 | recieve( fileName ); |
347 | return; | 347 | return; |
348 | } | 348 | } |
349 | else if ( cmsg == "nextView()" ) | 349 | else if ( cmsg == "nextView()" ) |
350 | { | 350 | { |
351 | //toggle between details/ no details | 351 | //toggle between details/ no details |
352 | bool b = !mActionDetails->isChecked(); | 352 | bool b = !mActionDetails->isChecked(); |
353 | setDetailsVisible( b ); | 353 | setDetailsVisible( b ); |
354 | mActionDetails->setChecked( b ); | 354 | mActionDetails->setChecked( b ); |
355 | } | 355 | } |
356 | 356 | ||
357 | 357 | ||
358 | } | 358 | } |
359 | void KABCore::toggleBeamReceive( ) | 359 | void KABCore::toggleBeamReceive( ) |
360 | { | 360 | { |
361 | if ( mBRdisabled ) | 361 | if ( mBRdisabled ) |
362 | return; | 362 | return; |
363 | #ifndef DESKTOP_VERSION | 363 | #ifndef DESKTOP_VERSION |
364 | if ( infrared ) { | 364 | if ( infrared ) { |
365 | qDebug("AB disable BeamReceive "); | 365 | qDebug("AB disable BeamReceive "); |
366 | delete infrared; | 366 | delete infrared; |
367 | infrared = 0; | 367 | infrared = 0; |
368 | mActionBR->setChecked(false); | 368 | mActionBR->setChecked(false); |
369 | return; | 369 | return; |
370 | } | 370 | } |
371 | qDebug("AB enable BeamReceive "); | 371 | qDebug("AB enable BeamReceive "); |
372 | mActionBR->setChecked(true); | 372 | mActionBR->setChecked(true); |
373 | 373 | ||
374 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 374 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
375 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); | 375 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); |
376 | #endif | 376 | #endif |
377 | } | 377 | } |
378 | 378 | ||
379 | 379 | ||
380 | void KABCore::disableBR(bool b) | 380 | void KABCore::disableBR(bool b) |
381 | { | 381 | { |
382 | #ifndef DESKTOP_VERSION | 382 | #ifndef DESKTOP_VERSION |
383 | if ( b ) { | 383 | if ( b ) { |
384 | if ( infrared ) { | 384 | if ( infrared ) { |
385 | toggleBeamReceive( ); | 385 | toggleBeamReceive( ); |
386 | } | 386 | } |
387 | mBRdisabled = true; | 387 | mBRdisabled = true; |
388 | } else { | 388 | } else { |
389 | if ( mBRdisabled ) { | 389 | if ( mBRdisabled ) { |
390 | mBRdisabled = false; | 390 | mBRdisabled = false; |
391 | //toggleBeamReceive( ); | 391 | //toggleBeamReceive( ); |
392 | } | 392 | } |
393 | } | 393 | } |
394 | #endif | 394 | #endif |
395 | 395 | ||
396 | } | 396 | } |
397 | void KABCore::recieve( QString fn ) | 397 | void KABCore::recieve( QString fn ) |
398 | { | 398 | { |
399 | //qDebug("KABCore::recieve "); | 399 | //qDebug("KABCore::recieve "); |
400 | int count = mAddressBook->importFromFile( fn, true ); | 400 | int count = mAddressBook->importFromFile( fn, true ); |
401 | if ( count ) | 401 | if ( count ) |
402 | setModified( true ); | 402 | setModified( true ); |
403 | mViewManager->refreshView(); | 403 | mViewManager->refreshView(); |
404 | message(i18n("%1 contact(s) received!").arg( count )); | 404 | message(i18n("%1 contact(s) received!").arg( count )); |
405 | topLevelWidget()->showMaximized(); | 405 | topLevelWidget()->showMaximized(); |
406 | topLevelWidget()->raise(); | 406 | topLevelWidget()->raise(); |
407 | } | 407 | } |
408 | void KABCore::restoreSettings() | 408 | void KABCore::restoreSettings() |
409 | { | 409 | { |
410 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 410 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
411 | 411 | ||
412 | bool state; | 412 | bool state; |
413 | 413 | ||
414 | if (mMultipleViewsAtOnce) | 414 | if (mMultipleViewsAtOnce) |
415 | state = KABPrefs::instance()->mDetailsPageVisible; | 415 | state = KABPrefs::instance()->mDetailsPageVisible; |
416 | else | 416 | else |
417 | state = false; | 417 | state = false; |
418 | 418 | ||
419 | mActionDetails->setChecked( state ); | 419 | mActionDetails->setChecked( state ); |
420 | setDetailsVisible( state ); | 420 | setDetailsVisible( state ); |
421 | 421 | ||
422 | state = KABPrefs::instance()->mJumpButtonBarVisible; | 422 | state = KABPrefs::instance()->mJumpButtonBarVisible; |
423 | 423 | ||
424 | mActionJumpBar->setChecked( state ); | 424 | mActionJumpBar->setChecked( state ); |
425 | setJumpButtonBarVisible( state ); | 425 | setJumpButtonBarVisible( state ); |
426 | /*US | 426 | /*US |
427 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 427 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
428 | if ( splitterSize.count() == 0 ) { | 428 | if ( splitterSize.count() == 0 ) { |
429 | splitterSize.append( width() / 2 ); | 429 | splitterSize.append( width() / 2 ); |
430 | splitterSize.append( width() / 2 ); | 430 | splitterSize.append( width() / 2 ); |
431 | } | 431 | } |
432 | mMiniSplitter->setSizes( splitterSize ); | 432 | mMiniSplitter->setSizes( splitterSize ); |
433 | if ( mExtensionBarSplitter ) { | 433 | if ( mExtensionBarSplitter ) { |
434 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 434 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
435 | if ( splitterSize.count() == 0 ) { | 435 | if ( splitterSize.count() == 0 ) { |
436 | splitterSize.append( width() / 2 ); | 436 | splitterSize.append( width() / 2 ); |
437 | splitterSize.append( width() / 2 ); | 437 | splitterSize.append( width() / 2 ); |
438 | } | 438 | } |
439 | mExtensionBarSplitter->setSizes( splitterSize ); | 439 | mExtensionBarSplitter->setSizes( splitterSize ); |
440 | 440 | ||
441 | } | 441 | } |
442 | */ | 442 | */ |
443 | mViewManager->restoreSettings(); | 443 | mViewManager->restoreSettings(); |
444 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 444 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
445 | mExtensionManager->restoreSettings(); | 445 | mExtensionManager->restoreSettings(); |
446 | #ifdef DESKTOP_VERSION | 446 | #ifdef DESKTOP_VERSION |
447 | int wid = width(); | 447 | int wid = width(); |
448 | if ( wid < 10 ) | 448 | if ( wid < 10 ) |
449 | wid = 400; | 449 | wid = 400; |
450 | #else | 450 | #else |
451 | int wid = QApplication::desktop()->width(); | 451 | int wid = QApplication::desktop()->width(); |
452 | if ( wid < 640 ) | 452 | if ( wid < 640 ) |
453 | wid = QApplication::desktop()->height(); | 453 | wid = QApplication::desktop()->height(); |
454 | #endif | 454 | #endif |
455 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; | 455 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; |
456 | if ( true /*splitterSize.count() == 0*/ ) { | 456 | if ( true /*splitterSize.count() == 0*/ ) { |
457 | splitterSize.append( wid / 2 ); | 457 | splitterSize.append( wid / 2 ); |
458 | splitterSize.append( wid / 2 ); | 458 | splitterSize.append( wid / 2 ); |
459 | } | 459 | } |
460 | mMiniSplitter->setSizes( splitterSize ); | 460 | mMiniSplitter->setSizes( splitterSize ); |
461 | if ( mExtensionBarSplitter ) { | 461 | if ( mExtensionBarSplitter ) { |
462 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 462 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
463 | if ( true /*splitterSize.count() == 0*/ ) { | 463 | if ( true /*splitterSize.count() == 0*/ ) { |
464 | splitterSize.append( wid / 2 ); | 464 | splitterSize.append( wid / 2 ); |
465 | splitterSize.append( wid / 2 ); | 465 | splitterSize.append( wid / 2 ); |
466 | } | 466 | } |
467 | mExtensionBarSplitter->setSizes( splitterSize ); | 467 | mExtensionBarSplitter->setSizes( splitterSize ); |
468 | 468 | ||
469 | } | 469 | } |
470 | 470 | ||
471 | 471 | ||
472 | } | 472 | } |
473 | 473 | ||
474 | void KABCore::saveSettings() | 474 | void KABCore::saveSettings() |
475 | { | 475 | { |
476 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); | 476 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); |
477 | if ( mExtensionBarSplitter ) | 477 | if ( mExtensionBarSplitter ) |
478 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 478 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
479 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); | 479 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); |
480 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); | 480 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); |
481 | #ifndef KAB_EMBEDDED | 481 | #ifndef KAB_EMBEDDED |
482 | 482 | ||
483 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 483 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
484 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 484 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
485 | #endif //KAB_EMBEDDED | 485 | #endif //KAB_EMBEDDED |
486 | mExtensionManager->saveSettings(); | 486 | mExtensionManager->saveSettings(); |
487 | mViewManager->saveSettings(); | 487 | mViewManager->saveSettings(); |
488 | 488 | ||
489 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 489 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
490 | } | 490 | } |
491 | 491 | ||
492 | KABC::AddressBook *KABCore::addressBook() const | 492 | KABC::AddressBook *KABCore::addressBook() const |
493 | { | 493 | { |
494 | return mAddressBook; | 494 | return mAddressBook; |
495 | } | 495 | } |
496 | 496 | ||
497 | KConfig *KABCore::config() | 497 | KConfig *KABCore::config() |
498 | { | 498 | { |
499 | #ifndef KAB_EMBEDDED | 499 | #ifndef KAB_EMBEDDED |
500 | return KABPrefs::instance()->config(); | 500 | return KABPrefs::instance()->config(); |
501 | #else //KAB_EMBEDDED | 501 | #else //KAB_EMBEDDED |
502 | return KABPrefs::instance()->getConfig(); | 502 | return KABPrefs::instance()->getConfig(); |
503 | #endif //KAB_EMBEDDED | 503 | #endif //KAB_EMBEDDED |
504 | } | 504 | } |
505 | 505 | ||
506 | KActionCollection *KABCore::actionCollection() const | 506 | KActionCollection *KABCore::actionCollection() const |
507 | { | 507 | { |
508 | return mGUIClient->actionCollection(); | 508 | return mGUIClient->actionCollection(); |
509 | } | 509 | } |
510 | 510 | ||
511 | KABC::Field *KABCore::currentSearchField() const | 511 | KABC::Field *KABCore::currentSearchField() const |
512 | { | 512 | { |
513 | if (mIncSearchWidget) | 513 | if (mIncSearchWidget) |
514 | return mIncSearchWidget->currentField(); | 514 | return mIncSearchWidget->currentField(); |
515 | else | 515 | else |
516 | return 0; | 516 | return 0; |
517 | } | 517 | } |
518 | 518 | ||
519 | QStringList KABCore::selectedUIDs() const | 519 | QStringList KABCore::selectedUIDs() const |
520 | { | 520 | { |
521 | return mViewManager->selectedUids(); | 521 | return mViewManager->selectedUids(); |
522 | } | 522 | } |
523 | 523 | ||
524 | KABC::Resource *KABCore::requestResource( QWidget *parent ) | 524 | KABC::Resource *KABCore::requestResource( QWidget *parent ) |
525 | { | 525 | { |
526 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); | 526 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); |
527 | 527 | ||
528 | QPtrList<KRES::Resource> kresResources; | 528 | QPtrList<KRES::Resource> kresResources; |
529 | QPtrListIterator<KABC::Resource> resIt( kabcResources ); | 529 | QPtrListIterator<KABC::Resource> resIt( kabcResources ); |
530 | KABC::Resource *resource; | 530 | KABC::Resource *resource; |
531 | while ( ( resource = resIt.current() ) != 0 ) { | 531 | while ( ( resource = resIt.current() ) != 0 ) { |
532 | ++resIt; | 532 | ++resIt; |
533 | if ( !resource->readOnly() ) { | 533 | if ( !resource->readOnly() ) { |
534 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); | 534 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); |
535 | if ( res ) | 535 | if ( res ) |
536 | kresResources.append( res ); | 536 | kresResources.append( res ); |
537 | } | 537 | } |
538 | } | 538 | } |
539 | 539 | ||
540 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); | 540 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); |
541 | return static_cast<KABC::Resource*>( res ); | 541 | return static_cast<KABC::Resource*>( res ); |
542 | } | 542 | } |
543 | 543 | ||
544 | #ifndef KAB_EMBEDDED | 544 | #ifndef KAB_EMBEDDED |
545 | KAboutData *KABCore::createAboutData() | 545 | KAboutData *KABCore::createAboutData() |
546 | #else //KAB_EMBEDDED | 546 | #else //KAB_EMBEDDED |
547 | void KABCore::createAboutData() | 547 | void KABCore::createAboutData() |
548 | #endif //KAB_EMBEDDED | 548 | #endif //KAB_EMBEDDED |
549 | { | 549 | { |
550 | #ifndef KAB_EMBEDDED | 550 | #ifndef KAB_EMBEDDED |
551 | KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), | 551 | KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), |
552 | "3.1", I18N_NOOP( "The KDE Address Book" ), | 552 | "3.1", I18N_NOOP( "The KDE Address Book" ), |
553 | KAboutData::License_GPL_V2, | 553 | KAboutData::License_GPL_V2, |
554 | I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); | 554 | I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); |
555 | about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); | 555 | about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); |
556 | about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); | 556 | about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); |
557 | about->addAuthor( "Cornelius Schumacher", | 557 | about->addAuthor( "Cornelius Schumacher", |
558 | I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), | 558 | I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), |
559 | "schumacher@kde.org" ); | 559 | "schumacher@kde.org" ); |
560 | about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), | 560 | about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), |
561 | "mpilone@slac.com" ); | 561 | "mpilone@slac.com" ); |
562 | about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); | 562 | about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); |
563 | about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); | 563 | about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); |
564 | about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), | 564 | about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), |
565 | "michel@klaralvdalens-datakonsult.se" ); | 565 | "michel@klaralvdalens-datakonsult.se" ); |
566 | about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), | 566 | about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), |
567 | "hansen@kde.org" ); | 567 | "hansen@kde.org" ); |
568 | 568 | ||
569 | return about; | 569 | return about; |
570 | #endif //KAB_EMBEDDED | 570 | #endif //KAB_EMBEDDED |
571 | 571 | ||
572 | QString version; | 572 | QString version; |
573 | #include <../version> | 573 | #include <../version> |
574 | QMessageBox::about( this, "About KAddressbook/Pi", | 574 | QMessageBox::about( this, "About KAddressbook/Pi", |
575 | "KAddressbook/Platform-independent\n" | 575 | "KAddressbook/Platform-independent\n" |
576 | "(KA/Pi) " +version + " - " + | 576 | "(KA/Pi) " +version + " - " + |
577 | #ifdef DESKTOP_VERSION | 577 | #ifdef DESKTOP_VERSION |
578 | "Desktop Edition\n" | 578 | "Desktop Edition\n" |
579 | #else | 579 | #else |
580 | "PDA-Edition\n" | 580 | "PDA-Edition\n" |
581 | "for: Zaurus 5500 / 7x0 / 8x0\n" | 581 | "for: Zaurus 5500 / 7x0 / 8x0\n" |
582 | #endif | 582 | #endif |
583 | 583 | ||
584 | "(c) 2004 Ulf Schenk\n" | 584 | "(c) 2004 Ulf Schenk\n" |
585 | "(c) 2004 Lutz Rogowski\n" | 585 | "(c) 2004 Lutz Rogowski\n" |
586 | "(c) 1997-2003, The KDE PIM Team\n" | 586 | "(c) 1997-2003, The KDE PIM Team\n" |
587 | "Tobias Koenig Current maintainer\ntokoe@kde.org\n" | 587 | "Tobias Koenig Current maintainer\ntokoe@kde.org\n" |
588 | "Don Sanders Original author\n" | 588 | "Don Sanders Original author\n" |
589 | "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" | 589 | "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" |
590 | "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" | 590 | "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" |
591 | "Greg Stern DCOP interface\n" | 591 | "Greg Stern DCOP interface\n" |
592 | "Mark Westcot Contact pinning\n" | 592 | "Mark Westcot Contact pinning\n" |
593 | "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" | 593 | "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" |
594 | "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" | 594 | "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" |
595 | #ifdef _WIN32_ | 595 | #ifdef _WIN32_ |
596 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" | 596 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" |
597 | #endif | 597 | #endif |
598 | ); | 598 | ); |
599 | } | 599 | } |
600 | 600 | ||
601 | void KABCore::setContactSelected( const QString &uid ) | 601 | void KABCore::setContactSelected( const QString &uid ) |
602 | { | 602 | { |
603 | KABC::Addressee addr = mAddressBook->findByUid( uid ); | 603 | KABC::Addressee addr = mAddressBook->findByUid( uid ); |
604 | if ( !mDetails->isHidden() ) | 604 | if ( !mDetails->isHidden() ) |
605 | mDetails->setAddressee( addr ); | 605 | mDetails->setAddressee( addr ); |
606 | 606 | ||
607 | if ( !addr.isEmpty() ) { | 607 | if ( !addr.isEmpty() ) { |
608 | emit contactSelected( addr.formattedName() ); | 608 | emit contactSelected( addr.formattedName() ); |
609 | KABC::Picture pic = addr.photo(); | 609 | KABC::Picture pic = addr.photo(); |
610 | if ( pic.isIntern() ) { | 610 | if ( pic.isIntern() ) { |
611 | //US emit contactSelected( pic.data() ); | 611 | //US emit contactSelected( pic.data() ); |
612 | //US instead use: | 612 | //US instead use: |
613 | QPixmap px; | 613 | QPixmap px; |
614 | if (pic.data().isNull() != true) | 614 | if (pic.data().isNull() != true) |
615 | { | 615 | { |
616 | px.convertFromImage(pic.data()); | 616 | px.convertFromImage(pic.data()); |
617 | } | 617 | } |
618 | 618 | ||
619 | emit contactSelected( px ); | 619 | emit contactSelected( px ); |
620 | } | 620 | } |
621 | } | 621 | } |
622 | 622 | ||
623 | 623 | ||
624 | mExtensionManager->setSelectionChanged(); | 624 | mExtensionManager->setSelectionChanged(); |
625 | 625 | ||
626 | // update the actions | 626 | // update the actions |
627 | bool selected = !uid.isEmpty(); | 627 | bool selected = !uid.isEmpty(); |
628 | 628 | ||
629 | if ( mReadWrite ) { | 629 | if ( mReadWrite ) { |
630 | mActionCut->setEnabled( selected ); | 630 | mActionCut->setEnabled( selected ); |
631 | mActionPaste->setEnabled( selected ); | 631 | mActionPaste->setEnabled( selected ); |
632 | } | 632 | } |
633 | 633 | ||
634 | mActionCopy->setEnabled( selected ); | 634 | mActionCopy->setEnabled( selected ); |
635 | mActionDelete->setEnabled( selected ); | 635 | mActionDelete->setEnabled( selected ); |
636 | mActionEditAddressee->setEnabled( selected ); | 636 | mActionEditAddressee->setEnabled( selected ); |
637 | mActionMail->setEnabled( selected ); | 637 | mActionMail->setEnabled( selected ); |
638 | mActionMailVCard->setEnabled( selected ); | 638 | mActionMailVCard->setEnabled( selected ); |
639 | //if (mActionBeam) | 639 | //if (mActionBeam) |
640 | //mActionBeam->setEnabled( selected ); | 640 | //mActionBeam->setEnabled( selected ); |
641 | 641 | ||
642 | if (mActionBeamVCard) | 642 | if (mActionBeamVCard) |
643 | mActionBeamVCard->setEnabled( selected ); | 643 | mActionBeamVCard->setEnabled( selected ); |
644 | 644 | ||
645 | mActionExport2phone->setEnabled( selected ); | 645 | mActionExport2phone->setEnabled( selected ); |
646 | mActionWhoAmI->setEnabled( selected ); | 646 | mActionWhoAmI->setEnabled( selected ); |
647 | mActionCategories->setEnabled( selected ); | 647 | mActionCategories->setEnabled( selected ); |
648 | } | 648 | } |
649 | 649 | ||
650 | void KABCore::sendMail() | 650 | void KABCore::sendMail() |
651 | { | 651 | { |
652 | sendMail( mViewManager->selectedEmails().join( ", " ) ); | 652 | sendMail( mViewManager->selectedEmails().join( ", " ) ); |
653 | } | 653 | } |
654 | 654 | ||
655 | void KABCore::sendMail( const QString& emaillist ) | 655 | void KABCore::sendMail( const QString& emaillist ) |
656 | { | 656 | { |
657 | // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " | 657 | // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " |
658 | if (emaillist.contains(",") > 0) | 658 | if (emaillist.contains(",") > 0) |
659 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); | 659 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); |
660 | else | 660 | else |
661 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); | 661 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); |
662 | } | 662 | } |
663 | 663 | ||
664 | 664 | ||
665 | 665 | ||
666 | void KABCore::mailVCard() | 666 | void KABCore::mailVCard() |
667 | { | 667 | { |
668 | QStringList uids = mViewManager->selectedUids(); | 668 | QStringList uids = mViewManager->selectedUids(); |
669 | if ( !uids.isEmpty() ) | 669 | if ( !uids.isEmpty() ) |
670 | mailVCard( uids ); | 670 | mailVCard( uids ); |
671 | } | 671 | } |
672 | 672 | ||
673 | void KABCore::mailVCard( const QStringList& uids ) | 673 | void KABCore::mailVCard( const QStringList& uids ) |
674 | { | 674 | { |
675 | QStringList urls; | 675 | QStringList urls; |
676 | 676 | ||
677 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); | 677 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); |
678 | 678 | ||
679 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); | 679 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); |
680 | 680 | ||
681 | 681 | ||
682 | 682 | ||
683 | QDir().mkdir( dirName, true ); | 683 | QDir().mkdir( dirName, true ); |
684 | 684 | ||
685 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 685 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
686 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 686 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
687 | 687 | ||
688 | if ( a.isEmpty() ) | 688 | if ( a.isEmpty() ) |
689 | continue; | 689 | continue; |
690 | 690 | ||
691 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; | 691 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; |
692 | 692 | ||
693 | QString fileName = dirName + "/" + name; | 693 | QString fileName = dirName + "/" + name; |
694 | 694 | ||
695 | QFile outFile(fileName); | 695 | QFile outFile(fileName); |
696 | 696 | ||
697 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully | 697 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully |
698 | KABC::VCardConverter converter; | 698 | KABC::VCardConverter converter; |
699 | QString vcard; | 699 | QString vcard; |
700 | 700 | ||
701 | converter.addresseeToVCard( a, vcard ); | 701 | converter.addresseeToVCard( a, vcard ); |
702 | 702 | ||
703 | QTextStream t( &outFile ); // use a text stream | 703 | QTextStream t( &outFile ); // use a text stream |
704 | t.setEncoding( QTextStream::UnicodeUTF8 ); | 704 | t.setEncoding( QTextStream::UnicodeUTF8 ); |
705 | t << vcard; | 705 | t << vcard; |
706 | 706 | ||
707 | outFile.close(); | 707 | outFile.close(); |
708 | 708 | ||
709 | urls.append( fileName ); | 709 | urls.append( fileName ); |
710 | } | 710 | } |
711 | } | 711 | } |
712 | 712 | ||
713 | bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); | 713 | bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); |
714 | 714 | ||
715 | 715 | ||
716 | /*US | 716 | /*US |
717 | kapp->invokeMailer( QString::null, QString::null, QString::null, | 717 | kapp->invokeMailer( QString::null, QString::null, QString::null, |
718 | QString::null, // subject | 718 | QString::null, // subject |
719 | QString::null, // body | 719 | QString::null, // body |
720 | QString::null, | 720 | QString::null, |
721 | urls ); // attachments | 721 | urls ); // attachments |
722 | */ | 722 | */ |
723 | 723 | ||
724 | } | 724 | } |
725 | 725 | ||
726 | /** | 726 | /** |
727 | Beams the "WhoAmI contact. | 727 | Beams the "WhoAmI contact. |
728 | */ | 728 | */ |
729 | void KABCore::beamMySelf() | 729 | void KABCore::beamMySelf() |
730 | { | 730 | { |
731 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); | 731 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); |
732 | if (!a.isEmpty()) | 732 | if (!a.isEmpty()) |
733 | { | 733 | { |
734 | QStringList uids; | 734 | QStringList uids; |
735 | uids << a.uid(); | 735 | uids << a.uid(); |
736 | 736 | ||
737 | beamVCard(uids); | 737 | beamVCard(uids); |
738 | } else { | 738 | } else { |
739 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); | 739 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); |
740 | 740 | ||
741 | 741 | ||
742 | } | 742 | } |
743 | } | 743 | } |
744 | 744 | ||
745 | void KABCore::export2phone() | 745 | void KABCore::export2phone() |
746 | { | 746 | { |
747 | 747 | ||
748 | KAex2phonePrefs ex2phone; | 748 | KAex2phonePrefs ex2phone; |
749 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 749 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
750 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 750 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
751 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 751 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
752 | 752 | ||
753 | if ( !ex2phone.exec() ) { | 753 | if ( !ex2phone.exec() ) { |
754 | return; | 754 | return; |
755 | } | 755 | } |
756 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 756 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
757 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 757 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
758 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 758 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
759 | 759 | ||
760 | 760 | ||
761 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 761 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
762 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 762 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
763 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 763 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
764 | 764 | ||
765 | QStringList uids = mViewManager->selectedUids(); | 765 | QStringList uids = mViewManager->selectedUids(); |
766 | if ( uids.isEmpty() ) | 766 | if ( uids.isEmpty() ) |
767 | return; | 767 | return; |
768 | 768 | ||
769 | QString fileName = getPhoneFile(); | 769 | QString fileName = getPhoneFile(); |
770 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) | 770 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) |
771 | return; | 771 | return; |
772 | 772 | ||
773 | message(i18n("Exporting to phone...")); | 773 | message(i18n("Exporting to phone...")); |
774 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); | 774 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); |
775 | 775 | ||
776 | } | 776 | } |
777 | QString KABCore::getPhoneFile() | 777 | QString KABCore::getPhoneFile() |
778 | { | 778 | { |
779 | #ifdef DESKTOP_VERSION | 779 | #ifdef DESKTOP_VERSION |
780 | return locateLocal("tmp", "phonefile.vcf"); | 780 | return locateLocal("tmp", "phonefile.vcf"); |
781 | #else | 781 | #else |
782 | return "/tmp/phonefile.vcf"; | 782 | return "/tmp/phonefile.vcf"; |
783 | #endif | 783 | #endif |
784 | 784 | ||
785 | } | 785 | } |
786 | void KABCore::writeToPhone( ) | 786 | void KABCore::writeToPhone( ) |
787 | { | 787 | { |
788 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) | 788 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) |
789 | message(i18n("Export to phone finished!")); | 789 | message(i18n("Export to phone finished!")); |
790 | else | 790 | else |
791 | qDebug(i18n("Error exporting to phone")); | 791 | qDebug(i18n("Error exporting to phone")); |
792 | } | 792 | } |
793 | void KABCore::beamVCard() | 793 | void KABCore::beamVCard() |
794 | { | 794 | { |
795 | QStringList uids = mViewManager->selectedUids(); | 795 | QStringList uids = mViewManager->selectedUids(); |
796 | if ( !uids.isEmpty() ) | 796 | if ( !uids.isEmpty() ) |
797 | beamVCard( uids ); | 797 | beamVCard( uids ); |
798 | } | 798 | } |
799 | 799 | ||
800 | 800 | ||
801 | void KABCore::beamVCard(const QStringList& uids) | 801 | void KABCore::beamVCard(const QStringList& uids) |
802 | { | 802 | { |
803 | 803 | ||
804 | // LR: we should use the /tmp dir on the Zaurus, | 804 | // LR: we should use the /tmp dir on the Zaurus, |
805 | // because: /tmp = RAM, (HOME)/kdepim = flash memory | 805 | // because: /tmp = RAM, (HOME)/kdepim = flash memory |
806 | 806 | ||
807 | #ifdef DESKTOP_VERSION | 807 | #ifdef DESKTOP_VERSION |
808 | QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); | 808 | QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); |
809 | #else | 809 | #else |
810 | QString fileName = "/tmp/kapibeamfile.vcf"; | 810 | QString fileName = "/tmp/kapibeamfile.vcf"; |
811 | #endif | 811 | #endif |
812 | 812 | ||
813 | KABC::VCardConverter converter; | 813 | KABC::VCardConverter converter; |
814 | QString description; | 814 | QString description; |
815 | QString datastream; | 815 | QString datastream; |
816 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 816 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
817 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 817 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
818 | 818 | ||
819 | if ( a.isEmpty() ) | 819 | if ( a.isEmpty() ) |
820 | continue; | 820 | continue; |
821 | 821 | ||
822 | if (description.isEmpty()) | 822 | if (description.isEmpty()) |
823 | description = a.formattedName(); | 823 | description = a.formattedName(); |
824 | 824 | ||
825 | QString vcard; | 825 | QString vcard; |
826 | converter.addresseeToVCard( a, vcard ); | 826 | converter.addresseeToVCard( a, vcard ); |
827 | int start = 0; | 827 | int start = 0; |
828 | int next; | 828 | int next; |
829 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { | 829 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { |
830 | int semi = vcard.find(";", next); | 830 | int semi = vcard.find(";", next); |
831 | int dopp = vcard.find(":", next); | 831 | int dopp = vcard.find(":", next); |
832 | int sep; | 832 | int sep; |
833 | if ( semi < dopp && semi >= 0 ) | 833 | if ( semi < dopp && semi >= 0 ) |
834 | sep = semi ; | 834 | sep = semi ; |
835 | else | 835 | else |
836 | sep = dopp; | 836 | sep = dopp; |
837 | datastream +=vcard.mid( start, next - start); | 837 | datastream +=vcard.mid( start, next - start); |
838 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); | 838 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); |
839 | start = sep; | 839 | start = sep; |
840 | } | 840 | } |
841 | datastream += vcard.mid( start,vcard.length() ); | 841 | datastream += vcard.mid( start,vcard.length() ); |
842 | } | 842 | } |
843 | #ifndef DESKTOP_VERSION | 843 | #ifndef DESKTOP_VERSION |
844 | QFile outFile(fileName); | 844 | QFile outFile(fileName); |
845 | if ( outFile.open(IO_WriteOnly) ) { | 845 | if ( outFile.open(IO_WriteOnly) ) { |
846 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); | 846 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); |
847 | QTextStream t( &outFile ); // use a text stream | 847 | QTextStream t( &outFile ); // use a text stream |
848 | //t.setEncoding( QTextStream::UnicodeUTF8 ); | 848 | //t.setEncoding( QTextStream::UnicodeUTF8 ); |
849 | t.setEncoding( QTextStream::Latin1 ); | 849 | t.setEncoding( QTextStream::Latin1 ); |
850 | t <<datastream.latin1(); | 850 | t <<datastream.latin1(); |
851 | outFile.close(); | 851 | outFile.close(); |
852 | Ir *ir = new Ir( this ); | 852 | Ir *ir = new Ir( this ); |
853 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); | 853 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); |
854 | ir->send( fileName, description, "text/x-vCard" ); | 854 | ir->send( fileName, description, "text/x-vCard" ); |
855 | } else { | 855 | } else { |
856 | qDebug("Error open temp beam file "); | 856 | qDebug("Error open temp beam file "); |
857 | return; | 857 | return; |
858 | } | 858 | } |
859 | #endif | 859 | #endif |
860 | 860 | ||
861 | } | 861 | } |
862 | 862 | ||
863 | void KABCore::beamDone( Ir *ir ) | 863 | void KABCore::beamDone( Ir *ir ) |
864 | { | 864 | { |
865 | #ifndef DESKTOP_VERSION | 865 | #ifndef DESKTOP_VERSION |
866 | delete ir; | 866 | delete ir; |
867 | #endif | 867 | #endif |
868 | topLevelWidget()->raise(); | 868 | topLevelWidget()->raise(); |
869 | message( i18n("Beaming finished!") ); | 869 | message( i18n("Beaming finished!") ); |
870 | } | 870 | } |
871 | 871 | ||
872 | 872 | ||
873 | void KABCore::browse( const QString& url ) | 873 | void KABCore::browse( const QString& url ) |
874 | { | 874 | { |
875 | #ifndef KAB_EMBEDDED | 875 | #ifndef KAB_EMBEDDED |
876 | kapp->invokeBrowser( url ); | 876 | kapp->invokeBrowser( url ); |
877 | #else //KAB_EMBEDDED | 877 | #else //KAB_EMBEDDED |
878 | qDebug("KABCore::browse must be fixed"); | 878 | qDebug("KABCore::browse must be fixed"); |
879 | #endif //KAB_EMBEDDED | 879 | #endif //KAB_EMBEDDED |
880 | } | 880 | } |
881 | 881 | ||
882 | void KABCore::selectAllContacts() | 882 | void KABCore::selectAllContacts() |
883 | { | 883 | { |
884 | mViewManager->setSelected( QString::null, true ); | 884 | mViewManager->setSelected( QString::null, true ); |
885 | } | 885 | } |
886 | 886 | ||
887 | void KABCore::deleteContacts() | 887 | void KABCore::deleteContacts() |
888 | { | 888 | { |
889 | QStringList uidList = mViewManager->selectedUids(); | 889 | QStringList uidList = mViewManager->selectedUids(); |
890 | deleteContacts( uidList ); | 890 | deleteContacts( uidList ); |
891 | } | 891 | } |
892 | 892 | ||
893 | void KABCore::deleteContacts( const QStringList &uids ) | 893 | void KABCore::deleteContacts( const QStringList &uids ) |
894 | { | 894 | { |
895 | if ( uids.count() > 0 ) { | 895 | if ( uids.count() > 0 ) { |
896 | PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); | 896 | PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); |
897 | UndoStack::instance()->push( command ); | 897 | UndoStack::instance()->push( command ); |
898 | RedoStack::instance()->clear(); | 898 | RedoStack::instance()->clear(); |
899 | 899 | ||
900 | // now if we deleted anything, refresh | 900 | // now if we deleted anything, refresh |
901 | setContactSelected( QString::null ); | 901 | setContactSelected( QString::null ); |
902 | setModified( true ); | 902 | setModified( true ); |
903 | } | 903 | } |
904 | } | 904 | } |
905 | 905 | ||
906 | void KABCore::copyContacts() | 906 | void KABCore::copyContacts() |
907 | { | 907 | { |
908 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); | 908 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); |
909 | 909 | ||
910 | QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); | 910 | QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); |
911 | 911 | ||
912 | kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; | 912 | kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; |
913 | 913 | ||
914 | QClipboard *cb = QApplication::clipboard(); | 914 | QClipboard *cb = QApplication::clipboard(); |
915 | cb->setText( clipText ); | 915 | cb->setText( clipText ); |
916 | } | 916 | } |
917 | 917 | ||
918 | void KABCore::cutContacts() | 918 | void KABCore::cutContacts() |
919 | { | 919 | { |
920 | QStringList uidList = mViewManager->selectedUids(); | 920 | QStringList uidList = mViewManager->selectedUids(); |
921 | 921 | ||
922 | //US if ( uidList.size() > 0 ) { | 922 | //US if ( uidList.size() > 0 ) { |
923 | if ( uidList.count() > 0 ) { | 923 | if ( uidList.count() > 0 ) { |
924 | PwCutCommand *command = new PwCutCommand( mAddressBook, uidList ); | 924 | PwCutCommand *command = new PwCutCommand( mAddressBook, uidList ); |
925 | UndoStack::instance()->push( command ); | 925 | UndoStack::instance()->push( command ); |
926 | RedoStack::instance()->clear(); | 926 | RedoStack::instance()->clear(); |
927 | 927 | ||
928 | setModified( true ); | 928 | setModified( true ); |
929 | } | 929 | } |
930 | } | 930 | } |
931 | 931 | ||
932 | void KABCore::pasteContacts() | 932 | void KABCore::pasteContacts() |
933 | { | 933 | { |
934 | QClipboard *cb = QApplication::clipboard(); | 934 | QClipboard *cb = QApplication::clipboard(); |
935 | 935 | ||
936 | KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); | 936 | KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); |
937 | 937 | ||
938 | pasteContacts( list ); | 938 | pasteContacts( list ); |
939 | } | 939 | } |
940 | 940 | ||
941 | void KABCore::pasteContacts( KABC::Addressee::List &list ) | 941 | void KABCore::pasteContacts( KABC::Addressee::List &list ) |
942 | { | 942 | { |
943 | KABC::Resource *resource = requestResource( this ); | 943 | KABC::Resource *resource = requestResource( this ); |
944 | KABC::Addressee::List::Iterator it; | 944 | KABC::Addressee::List::Iterator it; |
945 | for ( it = list.begin(); it != list.end(); ++it ) | 945 | for ( it = list.begin(); it != list.end(); ++it ) |
946 | (*it).setResource( resource ); | 946 | (*it).setResource( resource ); |
947 | 947 | ||
948 | PwPasteCommand *command = new PwPasteCommand( this, list ); | 948 | PwPasteCommand *command = new PwPasteCommand( this, list ); |
949 | UndoStack::instance()->push( command ); | 949 | UndoStack::instance()->push( command ); |
950 | RedoStack::instance()->clear(); | 950 | RedoStack::instance()->clear(); |
951 | 951 | ||
952 | setModified( true ); | 952 | setModified( true ); |
953 | } | 953 | } |
954 | 954 | ||
955 | void KABCore::setWhoAmI() | 955 | void KABCore::setWhoAmI() |
956 | { | 956 | { |
957 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); | 957 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); |
958 | 958 | ||
959 | if ( addrList.count() > 1 ) { | 959 | if ( addrList.count() > 1 ) { |
960 | KMessageBox::sorry( this, i18n( "Please select only one contact." ) ); | 960 | KMessageBox::sorry( this, i18n( "Please select only one contact." ) ); |
961 | return; | 961 | return; |
962 | } | 962 | } |
963 | 963 | ||
964 | QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) ); | 964 | QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) ); |
965 | if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes ) | 965 | if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes ) |
966 | static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); | 966 | static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); |
967 | } | 967 | } |
968 | 968 | ||
969 | void KABCore::setCategories() | 969 | void KABCore::setCategories() |
970 | { | 970 | { |
971 | KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); | 971 | KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); |
972 | if ( !dlg.exec() ) | 972 | if ( !dlg.exec() ) |
973 | return; | 973 | return; |
974 | 974 | ||
975 | bool merge = false; | 975 | bool merge = false; |
976 | QString msg = i18n( "Merge with existing categories?" ); | 976 | QString msg = i18n( "Merge with existing categories?" ); |
977 | if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) | 977 | if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) |
978 | merge = true; | 978 | merge = true; |
979 | 979 | ||
980 | QStringList categories = dlg.selectedCategories(); | 980 | QStringList categories = dlg.selectedCategories(); |
981 | 981 | ||
982 | QStringList uids = mViewManager->selectedUids(); | 982 | QStringList uids = mViewManager->selectedUids(); |
983 | QStringList::Iterator it; | 983 | QStringList::Iterator it; |
984 | for ( it = uids.begin(); it != uids.end(); ++it ) { | 984 | for ( it = uids.begin(); it != uids.end(); ++it ) { |
985 | KABC::Addressee addr = mAddressBook->findByUid( *it ); | 985 | KABC::Addressee addr = mAddressBook->findByUid( *it ); |
986 | if ( !addr.isEmpty() ) { | 986 | if ( !addr.isEmpty() ) { |
987 | if ( !merge ) | 987 | if ( !merge ) |
988 | addr.setCategories( categories ); | 988 | addr.setCategories( categories ); |
989 | else { | 989 | else { |
990 | QStringList addrCategories = addr.categories(); | 990 | QStringList addrCategories = addr.categories(); |
991 | QStringList::Iterator catIt; | 991 | QStringList::Iterator catIt; |
992 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { | 992 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { |
993 | if ( !addrCategories.contains( *catIt ) ) | 993 | if ( !addrCategories.contains( *catIt ) ) |
994 | addrCategories.append( *catIt ); | 994 | addrCategories.append( *catIt ); |
995 | } | 995 | } |
996 | addr.setCategories( addrCategories ); | 996 | addr.setCategories( addrCategories ); |
997 | } | 997 | } |
998 | 998 | ||
999 | mAddressBook->insertAddressee( addr ); | 999 | mAddressBook->insertAddressee( addr ); |
1000 | } | 1000 | } |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | if ( uids.count() > 0 ) | 1003 | if ( uids.count() > 0 ) |
1004 | setModified( true ); | 1004 | setModified( true ); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | void KABCore::setSearchFields( const KABC::Field::List &fields ) | 1007 | void KABCore::setSearchFields( const KABC::Field::List &fields ) |
1008 | { | 1008 | { |
1009 | mIncSearchWidget->setFields( fields ); | 1009 | mIncSearchWidget->setFields( fields ); |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | void KABCore::incrementalSearch( const QString& text ) | 1012 | void KABCore::incrementalSearch( const QString& text ) |
1013 | { | 1013 | { |
1014 | mViewManager->doSearch( text, mIncSearchWidget->currentField() ); | 1014 | mViewManager->doSearch( text, mIncSearchWidget->currentField() ); |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | void KABCore::setModified() | 1017 | void KABCore::setModified() |
1018 | { | 1018 | { |
1019 | setModified( true ); | 1019 | setModified( true ); |
1020 | } | 1020 | } |
1021 | 1021 | ||
1022 | void KABCore::setModifiedWOrefresh() | 1022 | void KABCore::setModifiedWOrefresh() |
1023 | { | 1023 | { |
1024 | // qDebug("KABCore::setModifiedWOrefresh() "); | 1024 | // qDebug("KABCore::setModifiedWOrefresh() "); |
1025 | mModified = true; | 1025 | mModified = true; |
1026 | mActionSave->setEnabled( mModified ); | 1026 | mActionSave->setEnabled( mModified ); |
1027 | #ifdef DESKTOP_VERSION | 1027 | #ifdef DESKTOP_VERSION |
1028 | mDetails->refreshView(); | 1028 | mDetails->refreshView(); |
1029 | #endif | 1029 | #endif |
1030 | 1030 | ||
1031 | } | 1031 | } |
1032 | void KABCore::setModified( bool modified ) | 1032 | void KABCore::setModified( bool modified ) |
1033 | { | 1033 | { |
1034 | mModified = modified; | 1034 | mModified = modified; |
1035 | mActionSave->setEnabled( mModified ); | 1035 | mActionSave->setEnabled( mModified ); |
1036 | 1036 | ||
1037 | if ( modified ) | 1037 | if ( modified ) |
1038 | mJumpButtonBar->recreateButtons(); | 1038 | mJumpButtonBar->recreateButtons(); |
1039 | 1039 | ||
1040 | mViewManager->refreshView(); | 1040 | mViewManager->refreshView(); |
1041 | mDetails->refreshView(); | 1041 | mDetails->refreshView(); |
1042 | 1042 | ||
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | bool KABCore::modified() const | 1045 | bool KABCore::modified() const |
1046 | { | 1046 | { |
1047 | return mModified; | 1047 | return mModified; |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | void KABCore::contactModified( const KABC::Addressee &addr ) | 1050 | void KABCore::contactModified( const KABC::Addressee &addr ) |
1051 | { | 1051 | { |
1052 | 1052 | ||
1053 | Command *command = 0; | 1053 | Command *command = 0; |
1054 | QString uid; | 1054 | QString uid; |
1055 | 1055 | ||
1056 | // check if it exists already | 1056 | // check if it exists already |
1057 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); | 1057 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); |
1058 | if ( origAddr.isEmpty() ) | 1058 | if ( origAddr.isEmpty() ) |
1059 | command = new PwNewCommand( mAddressBook, addr ); | 1059 | command = new PwNewCommand( mAddressBook, addr ); |
1060 | else { | 1060 | else { |
1061 | command = new PwEditCommand( mAddressBook, origAddr, addr ); | 1061 | command = new PwEditCommand( mAddressBook, origAddr, addr ); |
1062 | uid = addr.uid(); | 1062 | uid = addr.uid(); |
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | UndoStack::instance()->push( command ); | 1065 | UndoStack::instance()->push( command ); |
1066 | RedoStack::instance()->clear(); | 1066 | RedoStack::instance()->clear(); |
1067 | 1067 | ||
1068 | setModified( true ); | 1068 | setModified( true ); |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | void KABCore::newContact() | 1071 | void KABCore::newContact() |
1072 | { | 1072 | { |
1073 | 1073 | ||
1074 | 1074 | ||
1075 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); | 1075 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); |
1076 | 1076 | ||
1077 | QPtrList<KRES::Resource> kresResources; | 1077 | QPtrList<KRES::Resource> kresResources; |
1078 | QPtrListIterator<KABC::Resource> it( kabcResources ); | 1078 | QPtrListIterator<KABC::Resource> it( kabcResources ); |
1079 | KABC::Resource *resource; | 1079 | KABC::Resource *resource; |
1080 | while ( ( resource = it.current() ) != 0 ) { | 1080 | while ( ( resource = it.current() ) != 0 ) { |
1081 | ++it; | 1081 | ++it; |
1082 | if ( !resource->readOnly() ) { | 1082 | if ( !resource->readOnly() ) { |
1083 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); | 1083 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); |
1084 | if ( res ) | 1084 | if ( res ) |
1085 | kresResources.append( res ); | 1085 | kresResources.append( res ); |
1086 | } | 1086 | } |
1087 | } | 1087 | } |
1088 | 1088 | ||
1089 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); | 1089 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); |
1090 | resource = static_cast<KABC::Resource*>( res ); | 1090 | resource = static_cast<KABC::Resource*>( res ); |
1091 | 1091 | ||
1092 | if ( resource ) { | 1092 | if ( resource ) { |
1093 | KABC::Addressee addr; | 1093 | KABC::Addressee addr; |
1094 | addr.setResource( resource ); | 1094 | addr.setResource( resource ); |
1095 | mEditorDialog->setAddressee( addr ); | 1095 | mEditorDialog->setAddressee( addr ); |
1096 | KApplication::execDialog ( mEditorDialog ); | 1096 | KApplication::execDialog ( mEditorDialog ); |
1097 | 1097 | ||
1098 | } else | 1098 | } else |
1099 | return; | 1099 | return; |
1100 | 1100 | ||
1101 | // mEditorDict.insert( dialog->addressee().uid(), dialog ); | 1101 | // mEditorDict.insert( dialog->addressee().uid(), dialog ); |
1102 | 1102 | ||
1103 | 1103 | ||
1104 | } | 1104 | } |
1105 | 1105 | ||
1106 | void KABCore::addEmail( QString aStr ) | 1106 | void KABCore::addEmail( QString aStr ) |
1107 | { | 1107 | { |
1108 | #ifndef KAB_EMBEDDED | 1108 | #ifndef KAB_EMBEDDED |
1109 | QString fullName, email; | 1109 | QString fullName, email; |
1110 | 1110 | ||
1111 | KABC::Addressee::parseEmailAddress( aStr, fullName, email ); | 1111 | KABC::Addressee::parseEmailAddress( aStr, fullName, email ); |
1112 | 1112 | ||
1113 | // Try to lookup the addressee matching the email address | 1113 | // Try to lookup the addressee matching the email address |
1114 | bool found = false; | 1114 | bool found = false; |
1115 | QStringList emailList; | 1115 | QStringList emailList; |
1116 | KABC::AddressBook::Iterator it; | 1116 | KABC::AddressBook::Iterator it; |
1117 | for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) { | 1117 | for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) { |
1118 | emailList = (*it).emails(); | 1118 | emailList = (*it).emails(); |
1119 | if ( emailList.contains( email ) > 0 ) { | 1119 | if ( emailList.contains( email ) > 0 ) { |
1120 | found = true; | 1120 | found = true; |
1121 | (*it).setNameFromString( fullName ); | 1121 | (*it).setNameFromString( fullName ); |
1122 | editContact( (*it).uid() ); | 1122 | editContact( (*it).uid() ); |
1123 | } | 1123 | } |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | if ( !found ) { | 1126 | if ( !found ) { |
1127 | KABC::Addressee addr; | 1127 | KABC::Addressee addr; |
1128 | addr.setNameFromString( fullName ); | 1128 | addr.setNameFromString( fullName ); |
1129 | addr.insertEmail( email, true ); | 1129 | addr.insertEmail( email, true ); |
1130 | 1130 | ||
1131 | mAddressBook->insertAddressee( addr ); | 1131 | mAddressBook->insertAddressee( addr ); |
1132 | mViewManager->refreshView( addr.uid() ); | 1132 | mViewManager->refreshView( addr.uid() ); |
1133 | editContact( addr.uid() ); | 1133 | editContact( addr.uid() ); |
1134 | } | 1134 | } |
1135 | #else //KAB_EMBEDDED | 1135 | #else //KAB_EMBEDDED |
1136 | qDebug("KABCore::addEmail finsih method"); | 1136 | qDebug("KABCore::addEmail finsih method"); |
1137 | #endif //KAB_EMBEDDED | 1137 | #endif //KAB_EMBEDDED |
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | void KABCore::importVCard( const KURL &url, bool showPreview ) | 1140 | void KABCore::importVCard( const KURL &url, bool showPreview ) |
1141 | { | 1141 | { |
1142 | mXXPortManager->importVCard( url, showPreview ); | 1142 | mXXPortManager->importVCard( url, showPreview ); |
1143 | } | 1143 | } |
1144 | void KABCore::importFromOL() | 1144 | void KABCore::importFromOL() |
1145 | { | 1145 | { |
1146 | #ifdef _WIN32_ | 1146 | #ifdef _WIN32_ |
1147 | KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this ); | 1147 | KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this ); |
1148 | idgl->exec(); | 1148 | idgl->exec(); |
1149 | KABC::Addressee::List list = idgl->getAddressList(); | 1149 | KABC::Addressee::List list = idgl->getAddressList(); |
1150 | if ( list.count() > 0 ) { | 1150 | if ( list.count() > 0 ) { |
1151 | KABC::Addressee::List listNew; | 1151 | KABC::Addressee::List listNew; |
1152 | KABC::Addressee::List listExisting; | 1152 | KABC::Addressee::List listExisting; |
1153 | KABC::Addressee::List::Iterator it; | 1153 | KABC::Addressee::List::Iterator it; |
1154 | KABC::AddressBook::Iterator iter; | 1154 | KABC::AddressBook::Iterator iter; |
1155 | for ( it = list.begin(); it != list.end(); ++it ) { | 1155 | for ( it = list.begin(); it != list.end(); ++it ) { |
1156 | if ( mAddressBook->findByUid((*it).uid() ).isEmpty()) | 1156 | if ( mAddressBook->findByUid((*it).uid() ).isEmpty()) |
1157 | listNew.append( (*it) ); | 1157 | listNew.append( (*it) ); |
1158 | else | 1158 | else |
1159 | listExisting.append( (*it) ); | 1159 | listExisting.append( (*it) ); |
1160 | } | 1160 | } |
1161 | if ( listExisting.count() > 0 ) | 1161 | if ( listExisting.count() > 0 ) |
1162 | KMessageBox::information( this, i18n("%1 contacts not added to addressbook\nbecause they were already in the addressbook!").arg( listExisting.count() )); | 1162 | KMessageBox::information( this, i18n("%1 contacts not added to addressbook\nbecause they were already in the addressbook!").arg( listExisting.count() )); |
1163 | if ( listNew.count() > 0 ) { | 1163 | if ( listNew.count() > 0 ) { |
1164 | pasteWithNewUid = false; | 1164 | pasteWithNewUid = false; |
1165 | pasteContacts( listNew ); | 1165 | pasteContacts( listNew ); |
1166 | pasteWithNewUid = true; | 1166 | pasteWithNewUid = true; |
1167 | } | 1167 | } |
1168 | } | 1168 | } |
1169 | delete idgl; | 1169 | delete idgl; |
1170 | #endif | 1170 | #endif |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | void KABCore::importVCard( const QString &vCard, bool showPreview ) | 1173 | void KABCore::importVCard( const QString &vCard, bool showPreview ) |
1174 | { | 1174 | { |
1175 | mXXPortManager->importVCard( vCard, showPreview ); | 1175 | mXXPortManager->importVCard( vCard, showPreview ); |
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | //US added a second method without defaultparameter | 1178 | //US added a second method without defaultparameter |
1179 | void KABCore::editContact2() { | 1179 | void KABCore::editContact2() { |
1180 | editContact( QString::null ); | 1180 | editContact( QString::null ); |
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | void KABCore::editContact( const QString &uid ) | 1183 | void KABCore::editContact( const QString &uid ) |
1184 | { | 1184 | { |
1185 | 1185 | ||
1186 | if ( mExtensionManager->isQuickEditVisible() ) | 1186 | if ( mExtensionManager->isQuickEditVisible() ) |
1187 | return; | 1187 | return; |
1188 | 1188 | ||
1189 | // First, locate the contact entry | 1189 | // First, locate the contact entry |
1190 | QString localUID = uid; | 1190 | QString localUID = uid; |
1191 | if ( localUID.isNull() ) { | 1191 | if ( localUID.isNull() ) { |
1192 | QStringList uidList = mViewManager->selectedUids(); | 1192 | QStringList uidList = mViewManager->selectedUids(); |
1193 | if ( uidList.count() > 0 ) | 1193 | if ( uidList.count() > 0 ) |
1194 | localUID = *( uidList.at( 0 ) ); | 1194 | localUID = *( uidList.at( 0 ) ); |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | KABC::Addressee addr = mAddressBook->findByUid( localUID ); | 1197 | KABC::Addressee addr = mAddressBook->findByUid( localUID ); |
1198 | if ( !addr.isEmpty() ) { | 1198 | if ( !addr.isEmpty() ) { |
1199 | mEditorDialog->setAddressee( addr ); | 1199 | mEditorDialog->setAddressee( addr ); |
1200 | KApplication::execDialog ( mEditorDialog ); | 1200 | KApplication::execDialog ( mEditorDialog ); |
1201 | } | 1201 | } |
1202 | } | 1202 | } |
1203 | 1203 | ||
1204 | /** | 1204 | /** |
1205 | Shows or edits the detail view for the given uid. If the uid is QString::null, | 1205 | Shows or edits the detail view for the given uid. If the uid is QString::null, |
1206 | the method will try to find a selected addressee in the view. | 1206 | the method will try to find a selected addressee in the view. |
1207 | */ | 1207 | */ |
1208 | void KABCore::executeContact( const QString &uid /*US = QString::null*/ ) | 1208 | void KABCore::executeContact( const QString &uid /*US = QString::null*/ ) |
1209 | { | 1209 | { |
1210 | if ( mMultipleViewsAtOnce ) | 1210 | if ( mMultipleViewsAtOnce ) |
1211 | { | 1211 | { |
1212 | editContact( uid ); | 1212 | editContact( uid ); |
1213 | } | 1213 | } |
1214 | else | 1214 | else |
1215 | { | 1215 | { |
1216 | setDetailsVisible( true ); | 1216 | setDetailsVisible( true ); |
1217 | mActionDetails->setChecked(true); | 1217 | mActionDetails->setChecked(true); |
1218 | } | 1218 | } |
1219 | 1219 | ||
1220 | } | 1220 | } |
1221 | 1221 | ||
1222 | void KABCore::save() | 1222 | void KABCore::save() |
1223 | { | 1223 | { |
1224 | if (syncManager->blockSave()) | 1224 | if (syncManager->blockSave()) |
1225 | return; | 1225 | return; |
1226 | if ( !mModified ) | 1226 | if ( !mModified ) |
1227 | return; | 1227 | return; |
1228 | 1228 | ||
1229 | syncManager->setBlockSave(true); | 1229 | syncManager->setBlockSave(true); |
1230 | QString text = i18n( "There was an error while attempting to save\n the " | 1230 | QString text = i18n( "There was an error while attempting to save\n the " |
1231 | "address book. Please check that some \nother application is " | 1231 | "address book. Please check that some \nother application is " |
1232 | "not using it. " ); | 1232 | "not using it. " ); |
1233 | message(i18n("Saving addressbook ... ")); | 1233 | message(i18n("Saving addressbook ... ")); |
1234 | #ifndef KAB_EMBEDDED | 1234 | #ifndef KAB_EMBEDDED |
1235 | KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); | 1235 | KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); |
1236 | if ( !b || !b->save() ) { | 1236 | if ( !b || !b->save() ) { |
1237 | KMessageBox::error( this, text, i18n( "Unable to Save" ) ); | 1237 | KMessageBox::error( this, text, i18n( "Unable to Save" ) ); |
1238 | } | 1238 | } |
1239 | #else //KAB_EMBEDDED | 1239 | #else //KAB_EMBEDDED |
1240 | KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook ); | 1240 | KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook ); |
1241 | if ( !b || !b->save() ) { | 1241 | if ( !b || !b->save() ) { |
1242 | QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok")); | 1242 | QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok")); |
1243 | } | 1243 | } |
1244 | #endif //KAB_EMBEDDED | 1244 | #endif //KAB_EMBEDDED |
1245 | 1245 | ||
1246 | message(i18n("Addressbook saved!")); | 1246 | message(i18n("Addressbook saved!")); |
1247 | setModified( false ); | 1247 | setModified( false ); |
1248 | syncManager->setBlockSave(false); | 1248 | syncManager->setBlockSave(false); |
1249 | } | 1249 | } |
1250 | 1250 | ||
1251 | 1251 | ||
1252 | void KABCore::undo() | 1252 | void KABCore::undo() |
1253 | { | 1253 | { |
1254 | UndoStack::instance()->undo(); | 1254 | UndoStack::instance()->undo(); |
1255 | 1255 | ||
1256 | // Refresh the view | 1256 | // Refresh the view |
1257 | mViewManager->refreshView(); | 1257 | mViewManager->refreshView(); |
1258 | } | 1258 | } |
1259 | 1259 | ||
1260 | void KABCore::redo() | 1260 | void KABCore::redo() |
1261 | { | 1261 | { |
1262 | RedoStack::instance()->redo(); | 1262 | RedoStack::instance()->redo(); |
1263 | 1263 | ||
1264 | // Refresh the view | 1264 | // Refresh the view |
1265 | mViewManager->refreshView(); | 1265 | mViewManager->refreshView(); |
1266 | } | 1266 | } |
1267 | 1267 | ||
1268 | void KABCore::setJumpButtonBarVisible( bool visible ) | 1268 | void KABCore::setJumpButtonBarVisible( bool visible ) |
1269 | { | 1269 | { |
1270 | if (mMultipleViewsAtOnce) | 1270 | if (mMultipleViewsAtOnce) |
1271 | { | 1271 | { |
1272 | if ( visible ) | 1272 | if ( visible ) |
1273 | mJumpButtonBar->show(); | 1273 | mJumpButtonBar->show(); |
1274 | else | 1274 | else |
1275 | mJumpButtonBar->hide(); | 1275 | mJumpButtonBar->hide(); |
1276 | } | 1276 | } |
1277 | else | 1277 | else |
1278 | { | 1278 | { |
1279 | // show the jumpbar only if "the details are hidden" == "viewmanager are shown" | 1279 | // show the jumpbar only if "the details are hidden" == "viewmanager are shown" |
1280 | if (mViewManager->isVisible()) | 1280 | if (mViewManager->isVisible()) |
1281 | { | 1281 | { |
1282 | if ( visible ) | 1282 | if ( visible ) |
1283 | mJumpButtonBar->show(); | 1283 | mJumpButtonBar->show(); |
1284 | else | 1284 | else |
1285 | mJumpButtonBar->hide(); | 1285 | mJumpButtonBar->hide(); |
1286 | } | 1286 | } |
1287 | else | 1287 | else |
1288 | { | 1288 | { |
1289 | mJumpButtonBar->hide(); | 1289 | mJumpButtonBar->hide(); |
1290 | } | 1290 | } |
1291 | } | 1291 | } |
1292 | } | 1292 | } |
1293 | 1293 | ||
1294 | 1294 | ||
1295 | void KABCore::setDetailsToState() | 1295 | void KABCore::setDetailsToState() |
1296 | { | 1296 | { |
1297 | setDetailsVisible( mActionDetails->isChecked() ); | 1297 | setDetailsVisible( mActionDetails->isChecked() ); |
1298 | } | 1298 | } |
1299 | void KABCore::setDetailsToggle() | 1299 | void KABCore::setDetailsToggle() |
1300 | { | 1300 | { |
1301 | mActionDetails->setChecked( !mActionDetails->isChecked() ); | 1301 | mActionDetails->setChecked( !mActionDetails->isChecked() ); |
1302 | setDetailsToState(); | 1302 | setDetailsToState(); |
1303 | } | 1303 | } |
1304 | 1304 | ||
1305 | 1305 | ||
1306 | 1306 | ||
1307 | void KABCore::setDetailsVisible( bool visible ) | 1307 | void KABCore::setDetailsVisible( bool visible ) |
1308 | { | 1308 | { |
1309 | if (visible && mDetails->isHidden()) | 1309 | if (visible && mDetails->isHidden()) |
1310 | { | 1310 | { |
1311 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); | 1311 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); |
1312 | if ( addrList.count() > 0 ) | 1312 | if ( addrList.count() > 0 ) |
1313 | mDetails->setAddressee( addrList[ 0 ] ); | 1313 | mDetails->setAddressee( addrList[ 0 ] ); |
1314 | } | 1314 | } |
1315 | 1315 | ||
1316 | // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between | 1316 | // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between |
1317 | // the listview and the detailview. We do that by changing the splitbar size. | 1317 | // the listview and the detailview. We do that by changing the splitbar size. |
1318 | if (mMultipleViewsAtOnce) | 1318 | if (mMultipleViewsAtOnce) |
1319 | { | 1319 | { |
1320 | if ( visible ) | 1320 | if ( visible ) |
1321 | mDetails->show(); | 1321 | mDetails->show(); |
1322 | else | 1322 | else |
1323 | mDetails->hide(); | 1323 | mDetails->hide(); |
1324 | } | 1324 | } |
1325 | else | 1325 | else |
1326 | { | 1326 | { |
1327 | if ( visible ) { | 1327 | if ( visible ) { |
1328 | mViewManager->hide(); | 1328 | mViewManager->hide(); |
1329 | mDetails->show(); | 1329 | mDetails->show(); |
1330 | mIncSearchWidget->setFocus(); | 1330 | mIncSearchWidget->setFocus(); |
1331 | } | 1331 | } |
1332 | else { | 1332 | else { |
1333 | mViewManager->show(); | 1333 | mViewManager->show(); |
1334 | mDetails->hide(); | 1334 | mDetails->hide(); |
1335 | mViewManager->setFocusAV(); | 1335 | mViewManager->setFocusAV(); |
1336 | } | 1336 | } |
1337 | setJumpButtonBarVisible( !visible ); | 1337 | setJumpButtonBarVisible( !visible ); |
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | } | 1340 | } |
1341 | 1341 | ||
1342 | void KABCore::extensionChanged( int id ) | 1342 | void KABCore::extensionChanged( int id ) |
1343 | { | 1343 | { |
1344 | //change the details view only for non desktop systems | 1344 | //change the details view only for non desktop systems |
1345 | #ifndef DESKTOP_VERSION | 1345 | #ifndef DESKTOP_VERSION |
1346 | 1346 | ||
1347 | if (id == 0) | 1347 | if (id == 0) |
1348 | { | 1348 | { |
1349 | //the user disabled the extension. | 1349 | //the user disabled the extension. |
1350 | 1350 | ||
1351 | if (mMultipleViewsAtOnce) | 1351 | if (mMultipleViewsAtOnce) |
1352 | { // enable detailsview again | 1352 | { // enable detailsview again |
1353 | setDetailsVisible( true ); | 1353 | setDetailsVisible( true ); |
1354 | mActionDetails->setChecked( true ); | 1354 | mActionDetails->setChecked( true ); |
1355 | } | 1355 | } |
1356 | else | 1356 | else |
1357 | { //go back to the listview | 1357 | { //go back to the listview |
1358 | setDetailsVisible( false ); | 1358 | setDetailsVisible( false ); |
1359 | mActionDetails->setChecked( false ); | 1359 | mActionDetails->setChecked( false ); |
1360 | mActionDetails->setEnabled(true); | 1360 | mActionDetails->setEnabled(true); |
1361 | } | 1361 | } |
1362 | 1362 | ||
1363 | } | 1363 | } |
1364 | else | 1364 | else |
1365 | { | 1365 | { |
1366 | //the user enabled the extension. | 1366 | //the user enabled the extension. |
1367 | setDetailsVisible( false ); | 1367 | setDetailsVisible( false ); |
1368 | mActionDetails->setChecked( false ); | 1368 | mActionDetails->setChecked( false ); |
1369 | 1369 | ||
1370 | if (!mMultipleViewsAtOnce) | 1370 | if (!mMultipleViewsAtOnce) |
1371 | { | 1371 | { |
1372 | mActionDetails->setEnabled(false); | 1372 | mActionDetails->setEnabled(false); |
1373 | } | 1373 | } |
1374 | 1374 | ||
1375 | mExtensionManager->setSelectionChanged(); | 1375 | mExtensionManager->setSelectionChanged(); |
1376 | 1376 | ||
1377 | } | 1377 | } |
1378 | 1378 | ||
1379 | #endif// DESKTOP_VERSION | 1379 | #endif// DESKTOP_VERSION |
1380 | 1380 | ||
1381 | } | 1381 | } |
1382 | 1382 | ||
1383 | 1383 | ||
1384 | void KABCore::extensionModified( const KABC::Addressee::List &list ) | 1384 | void KABCore::extensionModified( const KABC::Addressee::List &list ) |
1385 | { | 1385 | { |
1386 | 1386 | ||
1387 | if ( list.count() != 0 ) { | 1387 | if ( list.count() != 0 ) { |
1388 | KABC::Addressee::List::ConstIterator it; | 1388 | KABC::Addressee::List::ConstIterator it; |
1389 | for ( it = list.begin(); it != list.end(); ++it ) | 1389 | for ( it = list.begin(); it != list.end(); ++it ) |
1390 | mAddressBook->insertAddressee( *it ); | 1390 | mAddressBook->insertAddressee( *it ); |
1391 | if ( list.count() > 1 ) | 1391 | if ( list.count() > 1 ) |
1392 | setModified(); | 1392 | setModified(); |
1393 | else | 1393 | else |
1394 | setModifiedWOrefresh(); | 1394 | setModifiedWOrefresh(); |
1395 | } | 1395 | } |
1396 | if ( list.count() == 0 ) | 1396 | if ( list.count() == 0 ) |
1397 | mViewManager->refreshView(); | 1397 | mViewManager->refreshView(); |
1398 | else | 1398 | else |
1399 | mViewManager->refreshView( list[ 0 ].uid() ); | 1399 | mViewManager->refreshView( list[ 0 ].uid() ); |
1400 | 1400 | ||
1401 | 1401 | ||
1402 | 1402 | ||
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | QString KABCore::getNameByPhone( const QString &phone ) | 1405 | QString KABCore::getNameByPhone( const QString &phone ) |
1406 | { | 1406 | { |
1407 | #ifndef KAB_EMBEDDED | 1407 | #ifndef KAB_EMBEDDED |
1408 | QRegExp r( "[/*/-/ ]" ); | 1408 | QRegExp r( "[/*/-/ ]" ); |
1409 | QString localPhone( phone ); | 1409 | QString localPhone( phone ); |
1410 | 1410 | ||
1411 | bool found = false; | 1411 | bool found = false; |
1412 | QString ownerName = ""; | 1412 | QString ownerName = ""; |
1413 | KABC::AddressBook::Iterator iter; | 1413 | KABC::AddressBook::Iterator iter; |
1414 | KABC::PhoneNumber::List::Iterator phoneIter; | 1414 | KABC::PhoneNumber::List::Iterator phoneIter; |
1415 | KABC::PhoneNumber::List phoneList; | 1415 | KABC::PhoneNumber::List phoneList; |
1416 | for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { | 1416 | for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { |
1417 | phoneList = (*iter).phoneNumbers(); | 1417 | phoneList = (*iter).phoneNumbers(); |
1418 | for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); | 1418 | for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); |
1419 | ++phoneIter) { | 1419 | ++phoneIter) { |
1420 | // Get rid of separator chars so just the numbers are compared. | 1420 | // Get rid of separator chars so just the numbers are compared. |
1421 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { | 1421 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { |
1422 | ownerName = (*iter).formattedName(); | 1422 | ownerName = (*iter).formattedName(); |
1423 | found = true; | 1423 | found = true; |
1424 | } | 1424 | } |
1425 | } | 1425 | } |
1426 | } | 1426 | } |
1427 | 1427 | ||
1428 | return ownerName; | 1428 | return ownerName; |
1429 | #else //KAB_EMBEDDED | 1429 | #else //KAB_EMBEDDED |
1430 | qDebug("KABCore::getNameByPhone finsih method"); | 1430 | qDebug("KABCore::getNameByPhone finsih method"); |
1431 | return ""; | 1431 | return ""; |
1432 | #endif //KAB_EMBEDDED | 1432 | #endif //KAB_EMBEDDED |
1433 | 1433 | ||
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | void KABCore::openConfigDialog() | 1436 | void KABCore::openConfigDialog() |
1437 | { | 1437 | { |
1438 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); | 1438 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); |
1439 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); | 1439 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); |
1440 | ConfigureDialog->addModule(kabcfg ); | 1440 | ConfigureDialog->addModule(kabcfg ); |
1441 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); | 1441 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); |
1442 | ConfigureDialog->addModule(kdelibcfg ); | 1442 | ConfigureDialog->addModule(kdelibcfg ); |
1443 | 1443 | ||
1444 | connect( ConfigureDialog, SIGNAL( applyClicked() ), | 1444 | connect( ConfigureDialog, SIGNAL( applyClicked() ), |
1445 | this, SLOT( configurationChanged() ) ); | 1445 | this, SLOT( configurationChanged() ) ); |
1446 | connect( ConfigureDialog, SIGNAL( okClicked() ), | 1446 | connect( ConfigureDialog, SIGNAL( okClicked() ), |
1447 | this, SLOT( configurationChanged() ) ); | 1447 | this, SLOT( configurationChanged() ) ); |
1448 | saveSettings(); | 1448 | saveSettings(); |
1449 | #ifndef DESKTOP_VERSION | 1449 | #ifndef DESKTOP_VERSION |
1450 | ConfigureDialog->showMaximized(); | 1450 | ConfigureDialog->showMaximized(); |
1451 | #endif | 1451 | #endif |
1452 | if ( ConfigureDialog->exec() ) | 1452 | if ( ConfigureDialog->exec() ) |
1453 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); | 1453 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); |
1454 | delete ConfigureDialog; | 1454 | delete ConfigureDialog; |
1455 | } | 1455 | } |
1456 | 1456 | ||
1457 | void KABCore::openLDAPDialog() | 1457 | void KABCore::openLDAPDialog() |
1458 | { | 1458 | { |
1459 | #ifndef KAB_EMBEDDED | 1459 | #ifndef KAB_EMBEDDED |
1460 | if ( !mLdapSearchDialog ) { | 1460 | if ( !mLdapSearchDialog ) { |
1461 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); | 1461 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); |
1462 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, | 1462 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, |
1463 | SLOT( refreshView() ) ); | 1463 | SLOT( refreshView() ) ); |
1464 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, | 1464 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, |
1465 | SLOT( setModified() ) ); | 1465 | SLOT( setModified() ) ); |
1466 | } else | 1466 | } else |
1467 | mLdapSearchDialog->restoreSettings(); | 1467 | mLdapSearchDialog->restoreSettings(); |
1468 | 1468 | ||
1469 | if ( mLdapSearchDialog->isOK() ) | 1469 | if ( mLdapSearchDialog->isOK() ) |
1470 | mLdapSearchDialog->exec(); | 1470 | mLdapSearchDialog->exec(); |
1471 | #else //KAB_EMBEDDED | 1471 | #else //KAB_EMBEDDED |
1472 | qDebug("KABCore::openLDAPDialog() finsih method"); | 1472 | qDebug("KABCore::openLDAPDialog() finsih method"); |
1473 | #endif //KAB_EMBEDDED | 1473 | #endif //KAB_EMBEDDED |
1474 | } | 1474 | } |
1475 | 1475 | ||
1476 | void KABCore::print() | 1476 | void KABCore::print() |
1477 | { | 1477 | { |
1478 | #ifndef KAB_EMBEDDED | 1478 | #ifndef KAB_EMBEDDED |
1479 | KPrinter printer; | 1479 | KPrinter printer; |
1480 | if ( !printer.setup( this ) ) | 1480 | if ( !printer.setup( this ) ) |
1481 | return; | 1481 | return; |
1482 | 1482 | ||
1483 | KABPrinting::PrintingWizard wizard( &printer, mAddressBook, | 1483 | KABPrinting::PrintingWizard wizard( &printer, mAddressBook, |
1484 | mViewManager->selectedUids(), this ); | 1484 | mViewManager->selectedUids(), this ); |
1485 | 1485 | ||
1486 | wizard.exec(); | 1486 | wizard.exec(); |
1487 | #else //KAB_EMBEDDED | 1487 | #else //KAB_EMBEDDED |
1488 | qDebug("KABCore::print() finsih method"); | 1488 | qDebug("KABCore::print() finsih method"); |
1489 | #endif //KAB_EMBEDDED | 1489 | #endif //KAB_EMBEDDED |
1490 | 1490 | ||
1491 | } | 1491 | } |
1492 | 1492 | ||
1493 | 1493 | ||
1494 | void KABCore::addGUIClient( KXMLGUIClient *client ) | 1494 | void KABCore::addGUIClient( KXMLGUIClient *client ) |
1495 | { | 1495 | { |
1496 | if ( mGUIClient ) | 1496 | if ( mGUIClient ) |
1497 | mGUIClient->insertChildClient( client ); | 1497 | mGUIClient->insertChildClient( client ); |
1498 | else | 1498 | else |
1499 | KMessageBox::error( this, "no KXMLGUICLient"); | 1499 | KMessageBox::error( this, "no KXMLGUICLient"); |
1500 | } | 1500 | } |
1501 | 1501 | ||
1502 | 1502 | ||
1503 | void KABCore::configurationChanged() | 1503 | void KABCore::configurationChanged() |
1504 | { | 1504 | { |
1505 | mExtensionManager->reconfigure(); | 1505 | mExtensionManager->reconfigure(); |
1506 | } | 1506 | } |
1507 | 1507 | ||
1508 | void KABCore::addressBookChanged() | 1508 | void KABCore::addressBookChanged() |
1509 | { | 1509 | { |
1510 | /*US | 1510 | /*US |
1511 | QDictIterator<AddresseeEditorDialog> it( mEditorDict ); | 1511 | QDictIterator<AddresseeEditorDialog> it( mEditorDict ); |
1512 | while ( it.current() ) { | 1512 | while ( it.current() ) { |
1513 | if ( it.current()->dirty() ) { | 1513 | if ( it.current()->dirty() ) { |
1514 | QString text = i18n( "Data has been changed externally. Unsaved " | 1514 | QString text = i18n( "Data has been changed externally. Unsaved " |
1515 | "changes will be lost." ); | 1515 | "changes will be lost." ); |
1516 | KMessageBox::information( this, text ); | 1516 | KMessageBox::information( this, text ); |
1517 | } | 1517 | } |
1518 | it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); | 1518 | it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); |
1519 | ++it; | 1519 | ++it; |
1520 | } | 1520 | } |
1521 | */ | 1521 | */ |
1522 | if (mEditorDialog) | 1522 | if (mEditorDialog) |
1523 | { | 1523 | { |
1524 | if (mEditorDialog->dirty()) | 1524 | if (mEditorDialog->dirty()) |
1525 | { | 1525 | { |
1526 | QString text = i18n( "Data has been changed externally. Unsaved " | 1526 | QString text = i18n( "Data has been changed externally. Unsaved " |
1527 | "changes will be lost." ); | 1527 | "changes will be lost." ); |
1528 | KMessageBox::information( this, text ); | 1528 | KMessageBox::information( this, text ); |
1529 | } | 1529 | } |
1530 | QString currentuid = mEditorDialog->addressee().uid(); | 1530 | QString currentuid = mEditorDialog->addressee().uid(); |
1531 | mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); | 1531 | mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); |
1532 | } | 1532 | } |
1533 | mViewManager->refreshView(); | 1533 | mViewManager->refreshView(); |
1534 | // mDetails->refreshView(); | 1534 | // mDetails->refreshView(); |
1535 | 1535 | ||
1536 | 1536 | ||
1537 | } | 1537 | } |
1538 | 1538 | ||
1539 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, | 1539 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, |
1540 | const char *name ) | 1540 | const char *name ) |
1541 | { | 1541 | { |
1542 | 1542 | ||
1543 | if ( mEditorDialog == 0 ) { | 1543 | if ( mEditorDialog == 0 ) { |
1544 | mEditorDialog = new AddresseeEditorDialog( this, parent, | 1544 | mEditorDialog = new AddresseeEditorDialog( this, parent, |
1545 | name ? name : "editorDialog" ); | 1545 | name ? name : "editorDialog" ); |
1546 | 1546 | ||
1547 | 1547 | ||
1548 | connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), | 1548 | connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), |
1549 | SLOT( contactModified( const KABC::Addressee& ) ) ); | 1549 | SLOT( contactModified( const KABC::Addressee& ) ) ); |
1550 | //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), | 1550 | //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), |
1551 | // SLOT( slotEditorDestroyed( const QString& ) ) ; | 1551 | // SLOT( slotEditorDestroyed( const QString& ) ) ; |
1552 | } | 1552 | } |
1553 | 1553 | ||
1554 | return mEditorDialog; | 1554 | return mEditorDialog; |
1555 | } | 1555 | } |
1556 | 1556 | ||
1557 | void KABCore::slotEditorDestroyed( const QString &uid ) | 1557 | void KABCore::slotEditorDestroyed( const QString &uid ) |
1558 | { | 1558 | { |
1559 | //mEditorDict.remove( uid ); | 1559 | //mEditorDict.remove( uid ); |
1560 | } | 1560 | } |
1561 | 1561 | ||
1562 | void KABCore::initGUI() | 1562 | void KABCore::initGUI() |
1563 | { | 1563 | { |
1564 | #ifndef KAB_EMBEDDED | 1564 | #ifndef KAB_EMBEDDED |
1565 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1565 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1566 | topLayout->setSpacing( KDialogBase::spacingHint() ); | 1566 | topLayout->setSpacing( KDialogBase::spacingHint() ); |
1567 | 1567 | ||
1568 | mExtensionBarSplitter = new QSplitter( this ); | 1568 | mExtensionBarSplitter = new QSplitter( this ); |
1569 | mExtensionBarSplitter->setOrientation( Qt::Vertical ); | 1569 | mExtensionBarSplitter->setOrientation( Qt::Vertical ); |
1570 | 1570 | ||
1571 | mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); | 1571 | mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); |
1572 | 1572 | ||
1573 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); | 1573 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); |
1574 | mIncSearchWidget = new IncSearchWidget( viewSpace ); | 1574 | mIncSearchWidget = new IncSearchWidget( viewSpace ); |
1575 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1575 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1576 | SLOT( incrementalSearch( const QString& ) ) ); | 1576 | SLOT( incrementalSearch( const QString& ) ) ); |
1577 | 1577 | ||
1578 | mViewManager = new ViewManager( this, viewSpace ); | 1578 | mViewManager = new ViewManager( this, viewSpace ); |
1579 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1579 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1580 | 1580 | ||
1581 | mDetails = new ViewContainer( mDetailsSplitter ); | 1581 | mDetails = new ViewContainer( mDetailsSplitter ); |
1582 | 1582 | ||
1583 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1583 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1584 | 1584 | ||
1585 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); | 1585 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); |
1586 | 1586 | ||
1587 | topLayout->addWidget( mExtensionBarSplitter ); | 1587 | topLayout->addWidget( mExtensionBarSplitter ); |
1588 | topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); | 1588 | topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); |
1589 | topLayout->addWidget( mJumpButtonBar ); | 1589 | topLayout->addWidget( mJumpButtonBar ); |
1590 | topLayout->setStretchFactor( mJumpButtonBar, 1 ); | 1590 | topLayout->setStretchFactor( mJumpButtonBar, 1 ); |
1591 | 1591 | ||
1592 | mXXPortManager = new XXPortManager( this, this ); | 1592 | mXXPortManager = new XXPortManager( this, this ); |
1593 | 1593 | ||
1594 | #else //KAB_EMBEDDED | 1594 | #else //KAB_EMBEDDED |
1595 | //US initialize viewMenu before settingup viewmanager. | 1595 | //US initialize viewMenu before settingup viewmanager. |
1596 | // Viewmanager needs this menu to plugin submenues. | 1596 | // Viewmanager needs this menu to plugin submenues. |
1597 | viewMenu = new QPopupMenu( this ); | 1597 | viewMenu = new QPopupMenu( this ); |
1598 | settingsMenu = new QPopupMenu( this ); | 1598 | settingsMenu = new QPopupMenu( this ); |
1599 | //filterMenu = new QPopupMenu( this ); | 1599 | //filterMenu = new QPopupMenu( this ); |
1600 | ImportMenu = new QPopupMenu( this ); | 1600 | ImportMenu = new QPopupMenu( this ); |
1601 | ExportMenu = new QPopupMenu( this ); | 1601 | ExportMenu = new QPopupMenu( this ); |
1602 | syncMenu = new QPopupMenu( this ); | 1602 | syncMenu = new QPopupMenu( this ); |
1603 | changeMenu= new QPopupMenu( this ); | 1603 | changeMenu= new QPopupMenu( this ); |
1604 | 1604 | ||
1605 | //US since we have no splitter for the embedded system, setup | 1605 | //US since we have no splitter for the embedded system, setup |
1606 | // a layout with two frames. One left and one right. | 1606 | // a layout with two frames. One left and one right. |
1607 | 1607 | ||
1608 | QBoxLayout *topLayout; | 1608 | QBoxLayout *topLayout; |
1609 | 1609 | ||
1610 | // = new QHBoxLayout( this ); | 1610 | // = new QHBoxLayout( this ); |
1611 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); | 1611 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); |
1612 | 1612 | ||
1613 | // QWidget *mainBox = new QWidget( this ); | 1613 | // QWidget *mainBox = new QWidget( this ); |
1614 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); | 1614 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); |
1615 | 1615 | ||
1616 | #ifdef DESKTOP_VERSION | 1616 | #ifdef DESKTOP_VERSION |
1617 | topLayout = new QHBoxLayout( this ); | 1617 | topLayout = new QHBoxLayout( this ); |
1618 | 1618 | ||
1619 | 1619 | ||
1620 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 1620 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
1621 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 1621 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
1622 | 1622 | ||
1623 | topLayout->addWidget(mMiniSplitter ); | 1623 | topLayout->addWidget(mMiniSplitter ); |
1624 | 1624 | ||
1625 | mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); | 1625 | mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); |
1626 | mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 1626 | mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
1627 | mViewManager = new ViewManager( this, mExtensionBarSplitter ); | 1627 | mViewManager = new ViewManager( this, mExtensionBarSplitter ); |
1628 | mDetails = new ViewContainer( mMiniSplitter ); | 1628 | mDetails = new ViewContainer( mMiniSplitter ); |
1629 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); | 1629 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); |
1630 | #else | 1630 | #else |
1631 | if ( QApplication::desktop()->width() > 480 ) { | 1631 | if ( QApplication::desktop()->width() > 480 ) { |
1632 | topLayout = new QHBoxLayout( this ); | 1632 | topLayout = new QHBoxLayout( this ); |
1633 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 1633 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
1634 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 1634 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
1635 | } else { | 1635 | } else { |
1636 | 1636 | ||
1637 | topLayout = new QHBoxLayout( this ); | 1637 | topLayout = new QHBoxLayout( this ); |
1638 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 1638 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
1639 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 1639 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
1640 | } | 1640 | } |
1641 | 1641 | ||
1642 | topLayout->addWidget(mMiniSplitter ); | 1642 | topLayout->addWidget(mMiniSplitter ); |
1643 | mViewManager = new ViewManager( this, mMiniSplitter ); | 1643 | mViewManager = new ViewManager( this, mMiniSplitter ); |
1644 | mDetails = new ViewContainer( mMiniSplitter ); | 1644 | mDetails = new ViewContainer( mMiniSplitter ); |
1645 | 1645 | ||
1646 | 1646 | ||
1647 | mExtensionManager = new ExtensionManager( this, mMiniSplitter ); | 1647 | mExtensionManager = new ExtensionManager( this, mMiniSplitter ); |
1648 | #endif | 1648 | #endif |
1649 | //eh->hide(); | 1649 | //eh->hide(); |
1650 | // topLayout->addWidget(mExtensionManager ); | 1650 | // topLayout->addWidget(mExtensionManager ); |
1651 | 1651 | ||
1652 | 1652 | ||
1653 | /*US | 1653 | /*US |
1654 | #ifndef KAB_NOSPLITTER | 1654 | #ifndef KAB_NOSPLITTER |
1655 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1655 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1656 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); | 1656 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); |
1657 | topLayout->setSpacing( 10 ); | 1657 | topLayout->setSpacing( 10 ); |
1658 | 1658 | ||
1659 | mDetailsSplitter = new QSplitter( this ); | 1659 | mDetailsSplitter = new QSplitter( this ); |
1660 | 1660 | ||
1661 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); | 1661 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); |
1662 | 1662 | ||
1663 | mViewManager = new ViewManager( this, viewSpace ); | 1663 | mViewManager = new ViewManager( this, viewSpace ); |
1664 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1664 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1665 | 1665 | ||
1666 | mDetails = new ViewContainer( mDetailsSplitter ); | 1666 | mDetails = new ViewContainer( mDetailsSplitter ); |
1667 | 1667 | ||
1668 | topLayout->addWidget( mDetailsSplitter ); | 1668 | topLayout->addWidget( mDetailsSplitter ); |
1669 | topLayout->setStretchFactor( mDetailsSplitter, 100 ); | 1669 | topLayout->setStretchFactor( mDetailsSplitter, 100 ); |
1670 | #else //KAB_NOSPLITTER | 1670 | #else //KAB_NOSPLITTER |
1671 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1671 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1672 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); | 1672 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); |
1673 | topLayout->setSpacing( 10 ); | 1673 | topLayout->setSpacing( 10 ); |
1674 | 1674 | ||
1675 | // mDetailsSplitter = new QSplitter( this ); | 1675 | // mDetailsSplitter = new QSplitter( this ); |
1676 | 1676 | ||
1677 | QVBox *viewSpace = new QVBox( this ); | 1677 | QVBox *viewSpace = new QVBox( this ); |
1678 | 1678 | ||
1679 | mViewManager = new ViewManager( this, viewSpace ); | 1679 | mViewManager = new ViewManager( this, viewSpace ); |
1680 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1680 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1681 | 1681 | ||
1682 | mDetails = new ViewContainer( this ); | 1682 | mDetails = new ViewContainer( this ); |
1683 | 1683 | ||
1684 | topLayout->addWidget( viewSpace ); | 1684 | topLayout->addWidget( viewSpace ); |
1685 | // topLayout->setStretchFactor( mDetailsSplitter, 100 ); | 1685 | // topLayout->setStretchFactor( mDetailsSplitter, 100 ); |
1686 | topLayout->addWidget( mDetails ); | 1686 | topLayout->addWidget( mDetails ); |
1687 | #endif //KAB_NOSPLITTER | 1687 | #endif //KAB_NOSPLITTER |
1688 | */ | 1688 | */ |
1689 | 1689 | ||
1690 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); | 1690 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); |
1691 | syncManager->setBlockSave(false); | 1691 | syncManager->setBlockSave(false); |
1692 | 1692 | ||
1693 | connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 1693 | connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
1694 | connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 1694 | connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
1695 | syncManager->setDefaultFileName( sentSyncFile()); | 1695 | syncManager->setDefaultFileName( sentSyncFile()); |
1696 | //connect(syncManager , SIGNAL( ), this, SLOT( ) ); | 1696 | //connect(syncManager , SIGNAL( ), this, SLOT( ) ); |
1697 | 1697 | ||
1698 | #endif //KAB_EMBEDDED | 1698 | #endif //KAB_EMBEDDED |
1699 | initActions(); | 1699 | initActions(); |
1700 | 1700 | ||
1701 | #ifdef KAB_EMBEDDED | 1701 | #ifdef KAB_EMBEDDED |
1702 | addActionsManually(); | 1702 | addActionsManually(); |
1703 | //US make sure the export and import menues are initialized before creating the xxPortManager. | 1703 | //US make sure the export and import menues are initialized before creating the xxPortManager. |
1704 | mXXPortManager = new XXPortManager( this, this ); | 1704 | mXXPortManager = new XXPortManager( this, this ); |
1705 | 1705 | ||
1706 | // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); | 1706 | // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); |
1707 | //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); | 1707 | //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); |
1708 | // mActionQuit->plug ( mMainWindow->toolBar()); | 1708 | // mActionQuit->plug ( mMainWindow->toolBar()); |
1709 | //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); | 1709 | //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); |
1710 | //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); | 1710 | //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); |
1711 | // mIncSearchWidget->hide(); | 1711 | // mIncSearchWidget->hide(); |
1712 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1712 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1713 | SLOT( incrementalSearch( const QString& ) ) ); | 1713 | SLOT( incrementalSearch( const QString& ) ) ); |
1714 | connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); | 1714 | connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); |
1715 | connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); | 1715 | connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); |
1716 | 1716 | ||
1717 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1717 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1718 | 1718 | ||
1719 | topLayout->addWidget( mJumpButtonBar ); | 1719 | topLayout->addWidget( mJumpButtonBar ); |
1720 | //US topLayout->setStretchFactor( mJumpButtonBar, 10 ); | 1720 | //US topLayout->setStretchFactor( mJumpButtonBar, 10 ); |
1721 | 1721 | ||
1722 | // mMainWindow->getIconToolBar()->raise(); | 1722 | // mMainWindow->getIconToolBar()->raise(); |
1723 | 1723 | ||
1724 | #endif //KAB_EMBEDDED | 1724 | #endif //KAB_EMBEDDED |
1725 | 1725 | ||
1726 | } | 1726 | } |
1727 | void KABCore::initActions() | 1727 | void KABCore::initActions() |
1728 | { | 1728 | { |
1729 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1729 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1730 | 1730 | ||
1731 | #ifndef KAB_EMBEDDED | 1731 | #ifndef KAB_EMBEDDED |
1732 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), | 1732 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), |
1733 | SLOT( clipboardDataChanged() ) ); | 1733 | SLOT( clipboardDataChanged() ) ); |
1734 | #endif //KAB_EMBEDDED | 1734 | #endif //KAB_EMBEDDED |
1735 | 1735 | ||
1736 | // file menu | 1736 | // file menu |
1737 | if ( mIsPart ) { | 1737 | if ( mIsPart ) { |
1738 | mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, | 1738 | mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, |
1739 | SLOT( sendMail() ), actionCollection(), | 1739 | SLOT( sendMail() ), actionCollection(), |
1740 | "kaddressbook_mail" ); | 1740 | "kaddressbook_mail" ); |
1741 | mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, | 1741 | mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, |
1742 | SLOT( print() ), actionCollection(), "kaddressbook_print" ); | 1742 | SLOT( print() ), actionCollection(), "kaddressbook_print" ); |
1743 | 1743 | ||
1744 | } else { | 1744 | } else { |
1745 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); | 1745 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); |
1746 | mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); | 1746 | mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); |
1747 | } | 1747 | } |
1748 | 1748 | ||
1749 | 1749 | ||
1750 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, | 1750 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, |
1751 | SLOT( save() ), actionCollection(), "file_sync" ); | 1751 | SLOT( save() ), actionCollection(), "file_sync" ); |
1752 | 1752 | ||
1753 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, | 1753 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, |
1754 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); | 1754 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); |
1755 | 1755 | ||
1756 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, | 1756 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, |
1757 | this, SLOT( mailVCard() ), | 1757 | this, SLOT( mailVCard() ), |
1758 | actionCollection(), "file_mail_vcard"); | 1758 | actionCollection(), "file_mail_vcard"); |
1759 | 1759 | ||
1760 | mActionExport2phone = new KAction( i18n( "Selected to phone" ), "ex2phone", 0, this, | 1760 | mActionExport2phone = new KAction( i18n( "Selected to phone" ), "ex2phone", 0, this, |
1761 | SLOT( export2phone() ), actionCollection(), | 1761 | SLOT( export2phone() ), actionCollection(), |
1762 | "kaddressbook_ex2phone" ); | 1762 | "kaddressbook_ex2phone" ); |
1763 | 1763 | ||
1764 | mActionBeamVCard = 0; | 1764 | mActionBeamVCard = 0; |
1765 | mActionBeam = 0; | 1765 | mActionBeam = 0; |
1766 | 1766 | ||
1767 | #ifndef DESKTOP_VERSION | 1767 | #ifndef DESKTOP_VERSION |
1768 | if ( Ir::supported() ) { | 1768 | if ( Ir::supported() ) { |
1769 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, | 1769 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, |
1770 | SLOT( beamVCard() ), actionCollection(), | 1770 | SLOT( beamVCard() ), actionCollection(), |
1771 | "kaddressbook_beam_vcard" ); | 1771 | "kaddressbook_beam_vcard" ); |
1772 | 1772 | ||
1773 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, | 1773 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, |
1774 | SLOT( beamMySelf() ), actionCollection(), | 1774 | SLOT( beamMySelf() ), actionCollection(), |
1775 | "kaddressbook_beam_myself" ); | 1775 | "kaddressbook_beam_myself" ); |
1776 | } | 1776 | } |
1777 | #endif | 1777 | #endif |
1778 | 1778 | ||
1779 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, | 1779 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, |
1780 | this, SLOT( editContact2() ), | 1780 | this, SLOT( editContact2() ), |
1781 | actionCollection(), "file_properties" ); | 1781 | actionCollection(), "file_properties" ); |
1782 | 1782 | ||
1783 | #ifdef KAB_EMBEDDED | 1783 | #ifdef KAB_EMBEDDED |
1784 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); | 1784 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); |
1785 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, | 1785 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, |
1786 | mMainWindow, SLOT( exit() ), | 1786 | mMainWindow, SLOT( exit() ), |
1787 | actionCollection(), "quit" ); | 1787 | actionCollection(), "quit" ); |
1788 | #endif //KAB_EMBEDDED | 1788 | #endif //KAB_EMBEDDED |
1789 | 1789 | ||
1790 | // edit menu | 1790 | // edit menu |
1791 | if ( mIsPart ) { | 1791 | if ( mIsPart ) { |
1792 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, | 1792 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, |
1793 | SLOT( copyContacts() ), actionCollection(), | 1793 | SLOT( copyContacts() ), actionCollection(), |
1794 | "kaddressbook_copy" ); | 1794 | "kaddressbook_copy" ); |
1795 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, | 1795 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, |
1796 | SLOT( cutContacts() ), actionCollection(), | 1796 | SLOT( cutContacts() ), actionCollection(), |
1797 | "kaddressbook_cut" ); | 1797 | "kaddressbook_cut" ); |
1798 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, | 1798 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, |
1799 | SLOT( pasteContacts() ), actionCollection(), | 1799 | SLOT( pasteContacts() ), actionCollection(), |
1800 | "kaddressbook_paste" ); | 1800 | "kaddressbook_paste" ); |
1801 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, | 1801 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, |
1802 | SLOT( selectAllContacts() ), actionCollection(), | 1802 | SLOT( selectAllContacts() ), actionCollection(), |
1803 | "kaddressbook_select_all" ); | 1803 | "kaddressbook_select_all" ); |
1804 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, | 1804 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, |
1805 | SLOT( undo() ), actionCollection(), | 1805 | SLOT( undo() ), actionCollection(), |
1806 | "kaddressbook_undo" ); | 1806 | "kaddressbook_undo" ); |
1807 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, | 1807 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, |
1808 | this, SLOT( redo() ), actionCollection(), | 1808 | this, SLOT( redo() ), actionCollection(), |
1809 | "kaddressbook_redo" ); | 1809 | "kaddressbook_redo" ); |
1810 | } else { | 1810 | } else { |
1811 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); | 1811 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); |
1812 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); | 1812 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); |
1813 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); | 1813 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); |
1814 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); | 1814 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); |
1815 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); | 1815 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); |
1816 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); | 1816 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); |
1817 | } | 1817 | } |
1818 | 1818 | ||
1819 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", | 1819 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", |
1820 | Key_Delete, this, SLOT( deleteContacts() ), | 1820 | Key_Delete, this, SLOT( deleteContacts() ), |
1821 | actionCollection(), "edit_delete" ); | 1821 | actionCollection(), "edit_delete" ); |
1822 | 1822 | ||
1823 | mActionUndo->setEnabled( false ); | 1823 | mActionUndo->setEnabled( false ); |
1824 | mActionRedo->setEnabled( false ); | 1824 | mActionRedo->setEnabled( false ); |
1825 | 1825 | ||
1826 | // settings menu | 1826 | // settings menu |
1827 | #ifdef KAB_EMBEDDED | 1827 | #ifdef KAB_EMBEDDED |
1828 | //US special menuentry to configure the addressbook resources. On KDE | 1828 | //US special menuentry to configure the addressbook resources. On KDE |
1829 | // you do that through the control center !!! | 1829 | // you do that through the control center !!! |
1830 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, | 1830 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, |
1831 | SLOT( configureResources() ), actionCollection(), | 1831 | SLOT( configureResources() ), actionCollection(), |
1832 | "kaddressbook_configure_resources" ); | 1832 | "kaddressbook_configure_resources" ); |
1833 | #endif //KAB_EMBEDDED | 1833 | #endif //KAB_EMBEDDED |
1834 | 1834 | ||
1835 | if ( mIsPart ) { | 1835 | if ( mIsPart ) { |
1836 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, | 1836 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, |
1837 | SLOT( openConfigDialog() ), actionCollection(), | 1837 | SLOT( openConfigDialog() ), actionCollection(), |
1838 | "kaddressbook_configure" ); | 1838 | "kaddressbook_configure" ); |
1839 | 1839 | ||
1840 | //US not implemented yet | 1840 | //US not implemented yet |
1841 | //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, | 1841 | //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, |
1842 | // this, SLOT( configureKeyBindings() ), actionCollection(), | 1842 | // this, SLOT( configureKeyBindings() ), actionCollection(), |
1843 | // "kaddressbook_configure_shortcuts" ); | 1843 | // "kaddressbook_configure_shortcuts" ); |
1844 | #ifdef KAB_EMBEDDED | 1844 | #ifdef KAB_EMBEDDED |
1845 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); | 1845 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); |
1846 | mActionConfigureToolbars->setEnabled( false ); | 1846 | mActionConfigureToolbars->setEnabled( false ); |
1847 | #endif //KAB_EMBEDDED | 1847 | #endif //KAB_EMBEDDED |
1848 | 1848 | ||
1849 | } else { | 1849 | } else { |
1850 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); | 1850 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); |
1851 | 1851 | ||
1852 | //US not implemented yet | 1852 | //US not implemented yet |
1853 | //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); | 1853 | //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); |
1854 | } | 1854 | } |
1855 | 1855 | ||
1856 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, | 1856 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, |
1857 | actionCollection(), "options_show_jump_bar" ); | 1857 | actionCollection(), "options_show_jump_bar" ); |
1858 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); | 1858 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); |
1859 | 1859 | ||
1860 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, | 1860 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, |
1861 | actionCollection(), "options_show_details" ); | 1861 | actionCollection(), "options_show_details" ); |
1862 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); | 1862 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); |
1863 | 1863 | ||
1864 | 1864 | ||
1865 | mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, | 1865 | mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, |
1866 | SLOT( toggleBeamReceive() ), actionCollection(), | 1866 | SLOT( toggleBeamReceive() ), actionCollection(), |
1867 | "kaddressbook_beam_rec" ); | 1867 | "kaddressbook_beam_rec" ); |
1868 | 1868 | ||
1869 | 1869 | ||
1870 | // misc | 1870 | // misc |
1871 | // only enable LDAP lookup if we can handle the protocol | 1871 | // only enable LDAP lookup if we can handle the protocol |
1872 | #ifndef KAB_EMBEDDED | 1872 | #ifndef KAB_EMBEDDED |
1873 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { | 1873 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { |
1874 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, | 1874 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, |
1875 | this, SLOT( openLDAPDialog() ), actionCollection(), | 1875 | this, SLOT( openLDAPDialog() ), actionCollection(), |
1876 | "ldap_lookup" ); | 1876 | "ldap_lookup" ); |
1877 | } | 1877 | } |
1878 | #else //KAB_EMBEDDED | 1878 | #else //KAB_EMBEDDED |
1879 | //qDebug("KABCore::initActions() LDAP has to be implemented"); | 1879 | //qDebug("KABCore::initActions() LDAP has to be implemented"); |
1880 | #endif //KAB_EMBEDDED | 1880 | #endif //KAB_EMBEDDED |
1881 | 1881 | ||
1882 | 1882 | ||
1883 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1883 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1884 | SLOT( setWhoAmI() ), actionCollection(), | 1884 | SLOT( setWhoAmI() ), actionCollection(), |
1885 | "set_personal" ); | 1885 | "set_personal" ); |
1886 | 1886 | ||
1887 | 1887 | ||
1888 | 1888 | ||
1889 | 1889 | ||
1890 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1890 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1891 | SLOT( setCategories() ), actionCollection(), | 1891 | SLOT( setCategories() ), actionCollection(), |
1892 | "edit_set_categories" ); | 1892 | "edit_set_categories" ); |
1893 | 1893 | ||
1894 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1894 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1895 | SLOT( removeVoice() ), actionCollection(), | 1895 | SLOT( removeVoice() ), actionCollection(), |
1896 | "remove_voice" ); | 1896 | "remove_voice" ); |
1897 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, | 1897 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, |
1898 | SLOT( importFromOL() ), actionCollection(), | 1898 | SLOT( importFromOL() ), actionCollection(), |
1899 | "import_OL" ); | 1899 | "import_OL" ); |
1900 | #ifdef KAB_EMBEDDED | 1900 | #ifdef KAB_EMBEDDED |
1901 | mActionLicence = new KAction( i18n( "Licence" ), 0, | 1901 | mActionLicence = new KAction( i18n( "Licence" ), 0, |
1902 | this, SLOT( showLicence() ), actionCollection(), | 1902 | this, SLOT( showLicence() ), actionCollection(), |
1903 | "licence_about_data" ); | 1903 | "licence_about_data" ); |
1904 | mActionFaq = new KAction( i18n( "Faq" ), 0, | 1904 | mActionFaq = new KAction( i18n( "Faq" ), 0, |
1905 | this, SLOT( faq() ), actionCollection(), | 1905 | this, SLOT( faq() ), actionCollection(), |
1906 | "faq_about_data" ); | 1906 | "faq_about_data" ); |
1907 | mActionWN = new KAction( i18n( "What's New?" ), 0, | 1907 | mActionWN = new KAction( i18n( "What's New?" ), 0, |
1908 | this, SLOT( whatsnew() ), actionCollection(), | 1908 | this, SLOT( whatsnew() ), actionCollection(), |
1909 | "wn" ); | 1909 | "wn" ); |
1910 | mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, | 1910 | mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, |
1911 | this, SLOT( synchowto() ), actionCollection(), | 1911 | this, SLOT( synchowto() ), actionCollection(), |
1912 | "sync" ); | 1912 | "sync" ); |
1913 | mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, | 1913 | mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, |
1914 | this, SLOT( kdesynchowto() ), actionCollection(), | 1914 | this, SLOT( kdesynchowto() ), actionCollection(), |
1915 | "kdesync" ); | 1915 | "kdesync" ); |
1916 | mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, | 1916 | mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, |
1917 | this, SLOT( multisynchowto() ), actionCollection(), | 1917 | this, SLOT( multisynchowto() ), actionCollection(), |
1918 | "multisync" ); | 1918 | "multisync" ); |
1919 | 1919 | ||
1920 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1920 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1921 | this, SLOT( createAboutData() ), actionCollection(), | 1921 | this, SLOT( createAboutData() ), actionCollection(), |
1922 | "kaddressbook_about_data" ); | 1922 | "kaddressbook_about_data" ); |
1923 | #endif //KAB_EMBEDDED | 1923 | #endif //KAB_EMBEDDED |
1924 | 1924 | ||
1925 | clipboardDataChanged(); | 1925 | clipboardDataChanged(); |
1926 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1926 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1927 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1927 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1928 | } | 1928 | } |
1929 | 1929 | ||
1930 | //US we need this function, to plug all actions into the correct menues. | 1930 | //US we need this function, to plug all actions into the correct menues. |
1931 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1931 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1932 | void KABCore::addActionsManually() | 1932 | void KABCore::addActionsManually() |
1933 | { | 1933 | { |
1934 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1934 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1935 | 1935 | ||
1936 | #ifdef KAB_EMBEDDED | 1936 | #ifdef KAB_EMBEDDED |
1937 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 1937 | QPopupMenu *fileMenu = new QPopupMenu( this ); |
1938 | QPopupMenu *editMenu = new QPopupMenu( this ); | 1938 | QPopupMenu *editMenu = new QPopupMenu( this ); |
1939 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 1939 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
1940 | 1940 | ||
1941 | KToolBar* tb = mMainWindow->toolBar(); | 1941 | KToolBar* tb = mMainWindow->toolBar(); |
1942 | 1942 | ||
1943 | #ifndef DESKTOP_VERSION | 1943 | #ifndef DESKTOP_VERSION |
1944 | if ( KABPrefs::instance()->mFullMenuBarVisible ) { | 1944 | if ( KABPrefs::instance()->mFullMenuBarVisible ) { |
1945 | #endif | 1945 | #endif |
1946 | QMenuBar* mb = mMainWindow->menuBar(); | 1946 | QMenuBar* mb = mMainWindow->menuBar(); |
1947 | 1947 | ||
1948 | //US setup menubar. | 1948 | //US setup menubar. |
1949 | //Disable the following block if you do not want to have a menubar. | 1949 | //Disable the following block if you do not want to have a menubar. |
1950 | mb->insertItem( "&File", fileMenu ); | 1950 | mb->insertItem( "&File", fileMenu ); |
1951 | mb->insertItem( "&Edit", editMenu ); | 1951 | mb->insertItem( "&Edit", editMenu ); |
1952 | mb->insertItem( "&View", viewMenu ); | 1952 | mb->insertItem( "&View", viewMenu ); |
1953 | mb->insertItem( "&Settings", settingsMenu ); | 1953 | mb->insertItem( "&Settings", settingsMenu ); |
1954 | mb->insertItem( i18n("Synchronize"), syncMenu ); | 1954 | mb->insertItem( i18n("Synchronize"), syncMenu ); |
1955 | mb->insertItem( "&Change selected", changeMenu ); | 1955 | mb->insertItem( "&Change selected", changeMenu ); |
1956 | mb->insertItem( "&Help", helpMenu ); | 1956 | mb->insertItem( "&Help", helpMenu ); |
1957 | mIncSearchWidget = new IncSearchWidget( tb ); | 1957 | mIncSearchWidget = new IncSearchWidget( tb ); |
1958 | // tb->insertWidget(-1, 0, mIncSearchWidget); | 1958 | // tb->insertWidget(-1, 0, mIncSearchWidget); |
1959 | #ifndef DESKTOP_VERSION | 1959 | #ifndef DESKTOP_VERSION |
1960 | } else { | 1960 | } else { |
1961 | //US setup toolbar | 1961 | //US setup toolbar |
1962 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); | 1962 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); |
1963 | QPopupMenu *popupBarTB = new QPopupMenu( this ); | 1963 | QPopupMenu *popupBarTB = new QPopupMenu( this ); |
1964 | menuBarTB->insertItem( "ME", popupBarTB); | 1964 | menuBarTB->insertItem( "ME", popupBarTB); |
1965 | tb->insertWidget(-1, 0, menuBarTB); | 1965 | tb->insertWidget(-1, 0, menuBarTB); |
1966 | mIncSearchWidget = new IncSearchWidget( tb ); | 1966 | mIncSearchWidget = new IncSearchWidget( tb ); |
1967 | 1967 | ||
1968 | tb->enableMoving(false); | 1968 | tb->enableMoving(false); |
1969 | popupBarTB->insertItem( "&File", fileMenu ); | 1969 | popupBarTB->insertItem( "&File", fileMenu ); |
1970 | popupBarTB->insertItem( "&Edit", editMenu ); | 1970 | popupBarTB->insertItem( "&Edit", editMenu ); |
1971 | popupBarTB->insertItem( "&View", viewMenu ); | 1971 | popupBarTB->insertItem( "&View", viewMenu ); |
1972 | popupBarTB->insertItem( "&Settings", settingsMenu ); | 1972 | popupBarTB->insertItem( "&Settings", settingsMenu ); |
1973 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); | 1973 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); |
1974 | mViewManager->getFilterAction()->plug ( popupBarTB); | 1974 | mViewManager->getFilterAction()->plug ( popupBarTB); |
1975 | popupBarTB->insertItem( "&Change selected", changeMenu ); | 1975 | popupBarTB->insertItem( "&Change selected", changeMenu ); |
1976 | popupBarTB->insertItem( "&Help", helpMenu ); | 1976 | popupBarTB->insertItem( "&Help", helpMenu ); |
1977 | if (QApplication::desktop()->width() > 320 ) { | 1977 | if (QApplication::desktop()->width() > 320 ) { |
1978 | // mViewManager->getFilterAction()->plug ( tb); | 1978 | // mViewManager->getFilterAction()->plug ( tb); |
1979 | } | 1979 | } |
1980 | } | 1980 | } |
1981 | #endif | 1981 | #endif |
1982 | // mActionQuit->plug ( mMainWindow->toolBar()); | 1982 | // mActionQuit->plug ( mMainWindow->toolBar()); |
1983 | 1983 | ||
1984 | 1984 | ||
1985 | 1985 | ||
1986 | //US Now connect the actions with the menue entries. | 1986 | //US Now connect the actions with the menue entries. |
1987 | mActionPrint->plug( fileMenu ); | 1987 | mActionPrint->plug( fileMenu ); |
1988 | mActionMail->plug( fileMenu ); | 1988 | mActionMail->plug( fileMenu ); |
1989 | fileMenu->insertSeparator(); | 1989 | fileMenu->insertSeparator(); |
1990 | 1990 | ||
1991 | mActionNewContact->plug( fileMenu ); | 1991 | mActionNewContact->plug( fileMenu ); |
1992 | mActionNewContact->plug( tb ); | 1992 | mActionNewContact->plug( tb ); |
1993 | 1993 | ||
1994 | mActionEditAddressee->plug( fileMenu ); | 1994 | mActionEditAddressee->plug( fileMenu ); |
1995 | // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || | 1995 | // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || |
1996 | // (!KABPrefs::instance()->mMultipleViewsAtOnce )) | 1996 | // (!KABPrefs::instance()->mMultipleViewsAtOnce )) |
1997 | mActionEditAddressee->plug( tb ); | 1997 | mActionEditAddressee->plug( tb ); |
1998 | 1998 | ||
1999 | fileMenu->insertSeparator(); | 1999 | fileMenu->insertSeparator(); |
2000 | mActionSave->plug( fileMenu ); | 2000 | mActionSave->plug( fileMenu ); |
2001 | fileMenu->insertItem( "&Import", ImportMenu ); | 2001 | fileMenu->insertItem( "&Import", ImportMenu ); |
2002 | fileMenu->insertItem( "&Export", ExportMenu ); | 2002 | fileMenu->insertItem( "&Export", ExportMenu ); |
2003 | fileMenu->insertSeparator(); | 2003 | fileMenu->insertSeparator(); |
2004 | mActionMailVCard->plug( fileMenu ); | 2004 | mActionMailVCard->plug( fileMenu ); |
2005 | #ifndef DESKTOP_VERSION | 2005 | #ifndef DESKTOP_VERSION |
2006 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); | 2006 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); |
2007 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); | 2007 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); |
2008 | #endif | 2008 | #endif |
2009 | fileMenu->insertSeparator(); | 2009 | fileMenu->insertSeparator(); |
2010 | mActionQuit->plug( fileMenu ); | 2010 | mActionQuit->plug( fileMenu ); |
2011 | #ifdef _WIN32_ | 2011 | #ifdef _WIN32_ |
2012 | mActionImportOL->plug( ImportMenu ); | 2012 | mActionImportOL->plug( ImportMenu ); |
2013 | #endif | 2013 | #endif |
2014 | // edit menu | 2014 | // edit menu |
2015 | mActionUndo->plug( editMenu ); | 2015 | mActionUndo->plug( editMenu ); |
2016 | mActionRedo->plug( editMenu ); | 2016 | mActionRedo->plug( editMenu ); |
2017 | editMenu->insertSeparator(); | 2017 | editMenu->insertSeparator(); |
2018 | mActionCut->plug( editMenu ); | 2018 | mActionCut->plug( editMenu ); |
2019 | mActionCopy->plug( editMenu ); | 2019 | mActionCopy->plug( editMenu ); |
2020 | mActionPaste->plug( editMenu ); | 2020 | mActionPaste->plug( editMenu ); |
2021 | mActionDelete->plug( editMenu ); | 2021 | mActionDelete->plug( editMenu ); |
2022 | editMenu->insertSeparator(); | 2022 | editMenu->insertSeparator(); |
2023 | mActionSelectAll->plug( editMenu ); | 2023 | mActionSelectAll->plug( editMenu ); |
2024 | 2024 | ||
2025 | mActionRemoveVoice->plug( changeMenu ); | 2025 | mActionRemoveVoice->plug( changeMenu ); |
2026 | // settings menu | 2026 | // settings menu |
2027 | //US special menuentry to configure the addressbook resources. On KDE | 2027 | //US special menuentry to configure the addressbook resources. On KDE |
2028 | // you do that through the control center !!! | 2028 | // you do that through the control center !!! |
2029 | mActionConfigResources->plug( settingsMenu ); | 2029 | mActionConfigResources->plug( settingsMenu ); |
2030 | settingsMenu->insertSeparator(); | 2030 | settingsMenu->insertSeparator(); |
2031 | 2031 | ||
2032 | mActionConfigKAddressbook->plug( settingsMenu ); | 2032 | mActionConfigKAddressbook->plug( settingsMenu ); |
2033 | 2033 | ||
2034 | if ( mIsPart ) { | 2034 | if ( mIsPart ) { |
2035 | //US not implemented yet | 2035 | //US not implemented yet |
2036 | //mActionConfigShortcuts->plug( settingsMenu ); | 2036 | //mActionConfigShortcuts->plug( settingsMenu ); |
2037 | //mActionConfigureToolbars->plug( settingsMenu ); | 2037 | //mActionConfigureToolbars->plug( settingsMenu ); |
2038 | 2038 | ||
2039 | } else { | 2039 | } else { |
2040 | //US not implemented yet | 2040 | //US not implemented yet |
2041 | //mActionKeyBindings->plug( settingsMenu ); | 2041 | //mActionKeyBindings->plug( settingsMenu ); |
2042 | } | 2042 | } |
2043 | 2043 | ||
2044 | settingsMenu->insertSeparator(); | 2044 | settingsMenu->insertSeparator(); |
2045 | 2045 | ||
2046 | mActionJumpBar->plug( settingsMenu ); | 2046 | mActionJumpBar->plug( settingsMenu ); |
2047 | mActionDetails->plug( settingsMenu ); | 2047 | mActionDetails->plug( settingsMenu ); |
2048 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) | 2048 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) |
2049 | mActionDetails->plug( tb ); | 2049 | mActionDetails->plug( tb ); |
2050 | settingsMenu->insertSeparator(); | 2050 | settingsMenu->insertSeparator(); |
2051 | mActionBR->plug(settingsMenu ); | 2051 | mActionBR->plug(settingsMenu ); |
2052 | settingsMenu->insertSeparator(); | 2052 | settingsMenu->insertSeparator(); |
2053 | 2053 | ||
2054 | mActionWhoAmI->plug( settingsMenu ); | 2054 | mActionWhoAmI->plug( settingsMenu ); |
2055 | mActionCategories->plug( settingsMenu ); | 2055 | mActionCategories->plug( settingsMenu ); |
2056 | 2056 | ||
2057 | 2057 | ||
2058 | mActionWN->plug( helpMenu ); | 2058 | mActionWN->plug( helpMenu ); |
2059 | mActionSyncHowto->plug( helpMenu ); | 2059 | mActionSyncHowto->plug( helpMenu ); |
2060 | mActionKdeSyncHowto->plug( helpMenu ); | 2060 | mActionKdeSyncHowto->plug( helpMenu ); |
2061 | mActionMultiSyncHowto->plug( helpMenu ); | 2061 | mActionMultiSyncHowto->plug( helpMenu ); |
2062 | mActionFaq->plug( helpMenu ); | 2062 | mActionFaq->plug( helpMenu ); |
2063 | mActionLicence->plug( helpMenu ); | 2063 | mActionLicence->plug( helpMenu ); |
2064 | mActionAboutKAddressbook->plug( helpMenu ); | 2064 | mActionAboutKAddressbook->plug( helpMenu ); |
2065 | 2065 | ||
2066 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { | 2066 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { |
2067 | 2067 | ||
2068 | mActionSave->plug( tb ); | 2068 | mActionSave->plug( tb ); |
2069 | mViewManager->getFilterAction()->plug ( tb); | 2069 | mViewManager->getFilterAction()->plug ( tb); |
2070 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { | 2070 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { |
2071 | mActionUndo->plug( tb ); | 2071 | mActionUndo->plug( tb ); |
2072 | mActionDelete->plug( tb ); | 2072 | mActionDelete->plug( tb ); |
2073 | mActionRedo->plug( tb ); | 2073 | mActionRedo->plug( tb ); |
2074 | } | 2074 | } |
2075 | } else { | 2075 | } else { |
2076 | mActionSave->plug( tb ); | 2076 | mActionSave->plug( tb ); |
2077 | tb->enableMoving(false); | 2077 | tb->enableMoving(false); |
2078 | } | 2078 | } |
2079 | //mActionQuit->plug ( tb ); | 2079 | //mActionQuit->plug ( tb ); |
2080 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 2080 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
2081 | 2081 | ||
2082 | //US link the searchwidget first to this. | 2082 | //US link the searchwidget first to this. |
2083 | // The real linkage to the toolbar happens later. | 2083 | // The real linkage to the toolbar happens later. |
2084 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 2084 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
2085 | //US tb->insertItem( mIncSearchWidget ); | 2085 | //US tb->insertItem( mIncSearchWidget ); |
2086 | /*US | 2086 | /*US |
2087 | mIncSearchWidget = new IncSearchWidget( tb ); | 2087 | mIncSearchWidget = new IncSearchWidget( tb ); |
2088 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 2088 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
2089 | SLOT( incrementalSearch( const QString& ) ) ); | 2089 | SLOT( incrementalSearch( const QString& ) ) ); |
2090 | 2090 | ||
2091 | mJumpButtonBar = new JumpButtonBar( this, this ); | 2091 | mJumpButtonBar = new JumpButtonBar( this, this ); |
2092 | 2092 | ||
2093 | //US topLayout->addWidget( mJumpButtonBar ); | 2093 | //US topLayout->addWidget( mJumpButtonBar ); |
2094 | this->layout()->add( mJumpButtonBar ); | 2094 | this->layout()->add( mJumpButtonBar ); |
2095 | */ | 2095 | */ |
2096 | 2096 | ||
2097 | #endif //KAB_EMBEDDED | 2097 | #endif //KAB_EMBEDDED |
2098 | 2098 | ||
2099 | mActionExport2phone->plug( ExportMenu ); | 2099 | mActionExport2phone->plug( ExportMenu ); |
2100 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); | 2100 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); |
2101 | syncManager->fillSyncMenu(); | 2101 | syncManager->fillSyncMenu(); |
2102 | 2102 | ||
2103 | } | 2103 | } |
2104 | void KABCore::showLicence() | 2104 | void KABCore::showLicence() |
2105 | { | 2105 | { |
2106 | KApplication::showLicence(); | 2106 | KApplication::showLicence(); |
2107 | } | 2107 | } |
2108 | void KABCore::removeVoice() | 2108 | void KABCore::removeVoice() |
2109 | { | 2109 | { |
2110 | if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) | 2110 | if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) |
2111 | return; | 2111 | return; |
2112 | KABC::Addressee::List list = mViewManager->selectedAddressees(); | 2112 | KABC::Addressee::List list = mViewManager->selectedAddressees(); |
2113 | KABC::Addressee::List::Iterator it; | 2113 | KABC::Addressee::List::Iterator it; |
2114 | for ( it = list.begin(); it != list.end(); ++it ) { | 2114 | for ( it = list.begin(); it != list.end(); ++it ) { |
2115 | 2115 | ||
2116 | if ( (*it).removeVoice() ) | 2116 | if ( (*it).removeVoice() ) |
2117 | contactModified((*it) ); | 2117 | contactModified((*it) ); |
2118 | } | 2118 | } |
2119 | } | 2119 | } |
2120 | 2120 | ||
2121 | 2121 | ||
2122 | 2122 | ||
2123 | void KABCore::clipboardDataChanged() | 2123 | void KABCore::clipboardDataChanged() |
2124 | { | 2124 | { |
2125 | 2125 | ||
2126 | if ( mReadWrite ) | 2126 | if ( mReadWrite ) |
2127 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 2127 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
2128 | 2128 | ||
2129 | } | 2129 | } |
2130 | 2130 | ||
2131 | void KABCore::updateActionMenu() | 2131 | void KABCore::updateActionMenu() |
2132 | { | 2132 | { |
2133 | UndoStack *undo = UndoStack::instance(); | 2133 | UndoStack *undo = UndoStack::instance(); |
2134 | RedoStack *redo = RedoStack::instance(); | 2134 | RedoStack *redo = RedoStack::instance(); |
2135 | 2135 | ||
2136 | if ( undo->isEmpty() ) | 2136 | if ( undo->isEmpty() ) |
2137 | mActionUndo->setText( i18n( "Undo" ) ); | 2137 | mActionUndo->setText( i18n( "Undo" ) ); |
2138 | else | 2138 | else |
2139 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); | 2139 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); |
2140 | 2140 | ||
2141 | mActionUndo->setEnabled( !undo->isEmpty() ); | 2141 | mActionUndo->setEnabled( !undo->isEmpty() ); |
2142 | 2142 | ||
2143 | if ( !redo->top() ) | 2143 | if ( !redo->top() ) |
2144 | mActionRedo->setText( i18n( "Redo" ) ); | 2144 | mActionRedo->setText( i18n( "Redo" ) ); |
2145 | else | 2145 | else |
2146 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); | 2146 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); |
2147 | 2147 | ||
2148 | mActionRedo->setEnabled( !redo->isEmpty() ); | 2148 | mActionRedo->setEnabled( !redo->isEmpty() ); |
2149 | } | 2149 | } |
2150 | 2150 | ||
2151 | void KABCore::configureKeyBindings() | 2151 | void KABCore::configureKeyBindings() |
2152 | { | 2152 | { |
2153 | #ifndef KAB_EMBEDDED | 2153 | #ifndef KAB_EMBEDDED |
2154 | KKeyDialog::configure( actionCollection(), true ); | 2154 | KKeyDialog::configure( actionCollection(), true ); |
2155 | #else //KAB_EMBEDDED | 2155 | #else //KAB_EMBEDDED |
2156 | qDebug("KABCore::configureKeyBindings() not implemented"); | 2156 | qDebug("KABCore::configureKeyBindings() not implemented"); |
2157 | #endif //KAB_EMBEDDED | 2157 | #endif //KAB_EMBEDDED |
2158 | } | 2158 | } |
2159 | 2159 | ||
2160 | #ifdef KAB_EMBEDDED | 2160 | #ifdef KAB_EMBEDDED |
2161 | void KABCore::configureResources() | 2161 | void KABCore::configureResources() |
2162 | { | 2162 | { |
2163 | KRES::KCMKResources dlg( this, "" , 0 ); | 2163 | KRES::KCMKResources dlg( this, "" , 0 ); |
2164 | 2164 | ||
2165 | if ( !dlg.exec() ) | 2165 | if ( !dlg.exec() ) |
2166 | return; | 2166 | return; |
2167 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 2167 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
2168 | } | 2168 | } |
2169 | #endif //KAB_EMBEDDED | 2169 | #endif //KAB_EMBEDDED |
2170 | 2170 | ||
2171 | 2171 | ||
2172 | /* this method will be called through the QCop interface from Ko/Pi to select addresses | 2172 | /* this method will be called through the QCop interface from Ko/Pi to select addresses |
2173 | * for the attendees list of an event. | 2173 | * for the attendees list of an event. |
2174 | */ | 2174 | */ |
2175 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) | 2175 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) |
2176 | { | 2176 | { |
2177 | QStringList nameList; | 2177 | QStringList nameList; |
2178 | QStringList emailList; | 2178 | QStringList emailList; |
2179 | QStringList uidList; | 2179 | QStringList uidList; |
2180 | 2180 | ||
2181 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 2181 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
2182 | uint i=0; | 2182 | uint i=0; |
2183 | for (i=0; i < list.count(); i++) | 2183 | for (i=0; i < list.count(); i++) |
2184 | { | 2184 | { |
2185 | nameList.append(list[i].realName()); | 2185 | nameList.append(list[i].realName()); |
2186 | emailList.append(list[i].preferredEmail()); | 2186 | emailList.append(list[i].preferredEmail()); |
2187 | uidList.append(list[i].uid()); | 2187 | uidList.append(list[i].uid()); |
2188 | } | 2188 | } |
2189 | 2189 | ||
2190 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); | 2190 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); |
2191 | 2191 | ||
2192 | } | 2192 | } |
2193 | 2193 | ||
2194 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays | 2194 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays |
2195 | * to put them into the calendar. | 2195 | * to put them into the calendar. |
2196 | */ | 2196 | */ |
2197 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) | 2197 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) |
2198 | { | 2198 | { |
2199 | // qDebug("KABCore::requestForBirthdayList"); | 2199 | // qDebug("KABCore::requestForBirthdayList"); |
2200 | QStringList birthdayList; | 2200 | QStringList birthdayList; |
2201 | QStringList anniversaryList; | 2201 | QStringList anniversaryList; |
2202 | QStringList realNameList; | 2202 | QStringList realNameList; |
2203 | QStringList preferredEmailList; | 2203 | QStringList preferredEmailList; |
2204 | QStringList assembledNameList; | 2204 | QStringList assembledNameList; |
2205 | QStringList uidList; | 2205 | QStringList uidList; |
2206 | 2206 | ||
2207 | KABC::AddressBook::Iterator it; | 2207 | KABC::AddressBook::Iterator it; |
2208 | 2208 | ||
2209 | int count = 0; | 2209 | int count = 0; |
2210 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2210 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2211 | ++count; | 2211 | ++count; |
2212 | } | 2212 | } |
2213 | QProgressBar bar(count,0 ); | 2213 | QProgressBar bar(count,0 ); |
2214 | int w = 300; | 2214 | int w = 300; |
2215 | if ( QApplication::desktop()->width() < 320 ) | 2215 | if ( QApplication::desktop()->width() < 320 ) |
2216 | w = 220; | 2216 | w = 220; |
2217 | int h = bar.sizeHint().height() ; | 2217 | int h = bar.sizeHint().height() ; |
2218 | int dw = QApplication::desktop()->width(); | 2218 | int dw = QApplication::desktop()->width(); |
2219 | int dh = QApplication::desktop()->height(); | 2219 | int dh = QApplication::desktop()->height(); |
2220 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2220 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2221 | bar.show(); | 2221 | bar.show(); |
2222 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); | 2222 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); |
2223 | qApp->processEvents(); | 2223 | qApp->processEvents(); |
2224 | 2224 | ||
2225 | QDate bday; | 2225 | QDate bday; |
2226 | QString anni; | 2226 | QString anni; |
2227 | QString formattedbday; | 2227 | QString formattedbday; |
2228 | 2228 | ||
2229 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) | 2229 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) |
2230 | { | 2230 | { |
2231 | if ( ! bar.isVisible() ) | 2231 | if ( ! bar.isVisible() ) |
2232 | return; | 2232 | return; |
2233 | bar.setProgress( count++ ); | 2233 | bar.setProgress( count++ ); |
2234 | qApp->processEvents(); | 2234 | qApp->processEvents(); |
2235 | bday = (*it).birthday().date(); | 2235 | bday = (*it).birthday().date(); |
2236 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); | 2236 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); |
2237 | 2237 | ||
2238 | if ( bday.isValid() || !anni.isEmpty()) | 2238 | if ( bday.isValid() || !anni.isEmpty()) |
2239 | { | 2239 | { |
2240 | if (bday.isValid()) | 2240 | if (bday.isValid()) |
2241 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); | 2241 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); |
2242 | else | 2242 | else |
2243 | formattedbday = "NOTVALID"; | 2243 | formattedbday = "NOTVALID"; |
2244 | if (anni.isEmpty()) | 2244 | if (anni.isEmpty()) |
2245 | anni = "INVALID"; | 2245 | anni = "INVALID"; |
2246 | 2246 | ||
2247 | birthdayList.append(formattedbday); | 2247 | birthdayList.append(formattedbday); |
2248 | anniversaryList.append(anni); //should be ISODate | 2248 | anniversaryList.append(anni); //should be ISODate |
2249 | realNameList.append((*it).realName()); | 2249 | realNameList.append((*it).realName()); |
2250 | preferredEmailList.append((*it).preferredEmail()); | 2250 | preferredEmailList.append((*it).preferredEmail()); |
2251 | assembledNameList.append((*it).assembledName()); | 2251 | assembledNameList.append((*it).assembledName()); |
2252 | uidList.append((*it).uid()); | 2252 | uidList.append((*it).uid()); |
2253 | 2253 | ||
2254 | qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); | 2254 | qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); |
2255 | } | 2255 | } |
2256 | } | 2256 | } |
2257 | 2257 | ||
2258 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); | 2258 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); |
2259 | 2259 | ||
2260 | } | 2260 | } |
2261 | 2261 | ||
2262 | /* this method will be called through the QCop interface from other apps to show details of a contact. | 2262 | /* this method will be called through the QCop interface from other apps to show details of a contact. |
2263 | */ | 2263 | */ |
2264 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) | 2264 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) |
2265 | { | 2265 | { |
2266 | qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); | 2266 | qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); |
2267 | 2267 | ||
2268 | QString foundUid = QString::null; | 2268 | QString foundUid = QString::null; |
2269 | if ( ! uid.isEmpty() ) { | 2269 | if ( ! uid.isEmpty() ) { |
2270 | Addressee adrr = mAddressBook->findByUid( uid ); | 2270 | Addressee adrr = mAddressBook->findByUid( uid ); |
2271 | if ( !adrr.isEmpty() ) { | 2271 | if ( !adrr.isEmpty() ) { |
2272 | foundUid = uid; | 2272 | foundUid = uid; |
2273 | } | 2273 | } |
2274 | if ( email == "sendbacklist" ) { | 2274 | if ( email == "sendbacklist" ) { |
2275 | //qDebug("ssssssssssssssssssssssend "); | 2275 | //qDebug("ssssssssssssssssssssssend "); |
2276 | QStringList nameList; | 2276 | QStringList nameList; |
2277 | QStringList emailList; | 2277 | QStringList emailList; |
2278 | QStringList uidList; | 2278 | QStringList uidList; |
2279 | nameList.append(adrr.realName()); | 2279 | nameList.append(adrr.realName()); |
2280 | emailList = adrr.emails(); | 2280 | emailList = adrr.emails(); |
2281 | uidList.append( adrr.preferredEmail()); | 2281 | uidList.append( adrr.preferredEmail()); |
2282 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); | 2282 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); |
2283 | return; | 2283 | return; |
2284 | } | 2284 | } |
2285 | 2285 | ||
2286 | } | 2286 | } |
2287 | 2287 | ||
2288 | if ( email == "sendbacklist" ) | 2288 | if ( email == "sendbacklist" ) |
2289 | return; | 2289 | return; |
2290 | if (foundUid.isEmpty()) | 2290 | if (foundUid.isEmpty()) |
2291 | { | 2291 | { |
2292 | //find the uid of the person first | 2292 | //find the uid of the person first |
2293 | Addressee::List namelist; | 2293 | Addressee::List namelist; |
2294 | Addressee::List emaillist; | 2294 | Addressee::List emaillist; |
2295 | 2295 | ||
2296 | if (!name.isEmpty()) | 2296 | if (!name.isEmpty()) |
2297 | namelist = mAddressBook->findByName( name ); | 2297 | namelist = mAddressBook->findByName( name ); |
2298 | 2298 | ||
2299 | if (!email.isEmpty()) | 2299 | if (!email.isEmpty()) |
2300 | emaillist = mAddressBook->findByEmail( email ); | 2300 | emaillist = mAddressBook->findByEmail( email ); |
2301 | qDebug("count %d %d ", namelist.count(),emaillist.count() ); | 2301 | qDebug("count %d %d ", namelist.count(),emaillist.count() ); |
2302 | //check if we have a match in Namelist and Emaillist | 2302 | //check if we have a match in Namelist and Emaillist |
2303 | if ((namelist.count() == 0) && (emaillist.count() > 0)) { | 2303 | if ((namelist.count() == 0) && (emaillist.count() > 0)) { |
2304 | foundUid = emaillist[0].uid(); | 2304 | foundUid = emaillist[0].uid(); |
2305 | } | 2305 | } |
2306 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) | 2306 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) |
2307 | foundUid = namelist[0].uid(); | 2307 | foundUid = namelist[0].uid(); |
2308 | else | 2308 | else |
2309 | { | 2309 | { |
2310 | for (int i = 0; i < namelist.count(); i++) | 2310 | for (int i = 0; i < namelist.count(); i++) |
2311 | { | 2311 | { |
2312 | for (int j = 0; j < emaillist.count(); j++) | 2312 | for (int j = 0; j < emaillist.count(); j++) |
2313 | { | 2313 | { |
2314 | if (namelist[i] == emaillist[j]) | 2314 | if (namelist[i] == emaillist[j]) |
2315 | { | 2315 | { |
2316 | foundUid = namelist[i].uid(); | 2316 | foundUid = namelist[i].uid(); |
2317 | } | 2317 | } |
2318 | } | 2318 | } |
2319 | } | 2319 | } |
2320 | } | 2320 | } |
2321 | } | 2321 | } |
2322 | else | 2322 | else |
2323 | { | 2323 | { |
2324 | foundUid = uid; | 2324 | foundUid = uid; |
2325 | } | 2325 | } |
2326 | 2326 | ||
2327 | if (!foundUid.isEmpty()) | 2327 | if (!foundUid.isEmpty()) |
2328 | { | 2328 | { |
2329 | 2329 | ||
2330 | // raise Ka/Pi if it is in the background | 2330 | // raise Ka/Pi if it is in the background |
2331 | #ifndef DESKTOP_VERSION | 2331 | #ifndef DESKTOP_VERSION |
2332 | #ifndef KORG_NODCOP | 2332 | #ifndef KORG_NODCOP |
2333 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); | 2333 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); |
2334 | #endif | 2334 | #endif |
2335 | #endif | 2335 | #endif |
2336 | 2336 | ||
2337 | mMainWindow->showMaximized(); | 2337 | mMainWindow->showMaximized(); |
2338 | mMainWindow-> raise(); | 2338 | mMainWindow-> raise(); |
2339 | 2339 | ||
2340 | mViewManager->setSelected( "", false); | 2340 | mViewManager->setSelected( "", false); |
2341 | mViewManager->refreshView( "" ); | 2341 | mViewManager->refreshView( "" ); |
2342 | mViewManager->setSelected( foundUid, true ); | 2342 | mViewManager->setSelected( foundUid, true ); |
2343 | mViewManager->refreshView( foundUid ); | 2343 | mViewManager->refreshView( foundUid ); |
2344 | 2344 | ||
2345 | if ( !mMultipleViewsAtOnce ) | 2345 | if ( !mMultipleViewsAtOnce ) |
2346 | { | 2346 | { |
2347 | setDetailsVisible( true ); | 2347 | setDetailsVisible( true ); |
2348 | mActionDetails->setChecked(true); | 2348 | mActionDetails->setChecked(true); |
2349 | } | 2349 | } |
2350 | } | 2350 | } |
2351 | } | 2351 | } |
2352 | 2352 | ||
2353 | void KABCore::whatsnew() | 2353 | void KABCore::whatsnew() |
2354 | { | 2354 | { |
2355 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 2355 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
2356 | } | 2356 | } |
2357 | void KABCore::synchowto() | 2357 | void KABCore::synchowto() |
2358 | { | 2358 | { |
2359 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 2359 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
2360 | } | 2360 | } |
2361 | void KABCore::kdesynchowto() | 2361 | void KABCore::kdesynchowto() |
2362 | { | 2362 | { |
2363 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 2363 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
2364 | } | 2364 | } |
2365 | void KABCore::multisynchowto() | 2365 | void KABCore::multisynchowto() |
2366 | { | 2366 | { |
2367 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 2367 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
2368 | } | 2368 | } |
2369 | void KABCore::faq() | 2369 | void KABCore::faq() |
2370 | { | 2370 | { |
2371 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); | 2371 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); |
2372 | } | 2372 | } |
2373 | 2373 | ||
2374 | #include <libkcal/syncdefines.h> | 2374 | #include <libkcal/syncdefines.h> |
2375 | 2375 | ||
2376 | KABC::Addressee KABCore::getLastSyncAddressee() | 2376 | KABC::Addressee KABCore::getLastSyncAddressee() |
2377 | { | 2377 | { |
2378 | Addressee lse; | 2378 | Addressee lse; |
2379 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2379 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2380 | 2380 | ||
2381 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); | 2381 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); |
2382 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2382 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2383 | if (lse.isEmpty()) { | 2383 | if (lse.isEmpty()) { |
2384 | qDebug("Creating new last-syncAddressee "); | 2384 | qDebug("Creating new last-syncAddressee "); |
2385 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2385 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2386 | QString sum = ""; | 2386 | QString sum = ""; |
2387 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 2387 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
2388 | sum = "E: "; | 2388 | sum = "E: "; |
2389 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); | 2389 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); |
2390 | lse.setRevision( mLastAddressbookSync ); | 2390 | lse.setRevision( mLastAddressbookSync ); |
2391 | lse.setCategories( i18n("SyncEvent") ); | 2391 | lse.setCategories( i18n("SyncEvent") ); |
2392 | mAddressBook->insertAddressee( lse ); | 2392 | mAddressBook->insertAddressee( lse ); |
2393 | } | 2393 | } |
2394 | return lse; | 2394 | return lse; |
2395 | } | 2395 | } |
2396 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) | 2396 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) |
2397 | { | 2397 | { |
2398 | 2398 | ||
2399 | //void setZaurusId(int id); | 2399 | //void setZaurusId(int id); |
2400 | // int zaurusId() const; | 2400 | // int zaurusId() const; |
2401 | // void setZaurusUid(int id); | 2401 | // void setZaurusUid(int id); |
2402 | // int zaurusUid() const; | 2402 | // int zaurusUid() const; |
2403 | // void setZaurusStat(int id); | 2403 | // void setZaurusStat(int id); |
2404 | // int zaurusStat() const; | 2404 | // int zaurusStat() const; |
2405 | // 0 equal | 2405 | // 0 equal |
2406 | // 1 take local | 2406 | // 1 take local |
2407 | // 2 take remote | 2407 | // 2 take remote |
2408 | // 3 cancel | 2408 | // 3 cancel |
2409 | QDateTime lastSync = mLastAddressbookSync; | 2409 | QDateTime lastSync = mLastAddressbookSync; |
2410 | QDateTime localMod = local->revision(); | 2410 | QDateTime localMod = local->revision(); |
2411 | QDateTime remoteMod = remote->revision(); | 2411 | QDateTime remoteMod = remote->revision(); |
2412 | 2412 | ||
2413 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2413 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2414 | 2414 | ||
2415 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2415 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2416 | bool remCh, locCh; | 2416 | bool remCh, locCh; |
2417 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); | 2417 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); |
2418 | 2418 | ||
2419 | //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); | 2419 | //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); |
2420 | locCh = ( localMod > mLastAddressbookSync ); | 2420 | locCh = ( localMod > mLastAddressbookSync ); |
2421 | if ( !remCh && ! locCh ) { | 2421 | if ( !remCh && ! locCh ) { |
2422 | //qDebug("both not changed "); | 2422 | //qDebug("both not changed "); |
2423 | lastSync = localMod.addDays(1); | 2423 | lastSync = localMod.addDays(1); |
2424 | if ( mode <= SYNC_PREF_ASK ) | 2424 | if ( mode <= SYNC_PREF_ASK ) |
2425 | return 0; | 2425 | return 0; |
2426 | } else { | 2426 | } else { |
2427 | if ( locCh ) { | 2427 | if ( locCh ) { |
2428 | //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); | 2428 | //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); |
2429 | lastSync = localMod.addDays( -1 ); | 2429 | lastSync = localMod.addDays( -1 ); |
2430 | if ( !remCh ) | 2430 | if ( !remCh ) |
2431 | remoteMod =( lastSync.addDays( -1 ) ); | 2431 | remoteMod =( lastSync.addDays( -1 ) ); |
2432 | } else { | 2432 | } else { |
2433 | //qDebug(" not loc changed "); | 2433 | //qDebug(" not loc changed "); |
2434 | lastSync = localMod.addDays( 1 ); | 2434 | lastSync = localMod.addDays( 1 ); |
2435 | if ( remCh ) | 2435 | if ( remCh ) |
2436 | remoteMod =( lastSync.addDays( 1 ) ); | 2436 | remoteMod =( lastSync.addDays( 1 ) ); |
2437 | 2437 | ||
2438 | } | 2438 | } |
2439 | } | 2439 | } |
2440 | full = true; | 2440 | full = true; |
2441 | if ( mode < SYNC_PREF_ASK ) | 2441 | if ( mode < SYNC_PREF_ASK ) |
2442 | mode = SYNC_PREF_ASK; | 2442 | mode = SYNC_PREF_ASK; |
2443 | } else { | 2443 | } else { |
2444 | if ( localMod == remoteMod ) | 2444 | if ( localMod == remoteMod ) |
2445 | return 0; | 2445 | return 0; |
2446 | 2446 | ||
2447 | } | 2447 | } |
2448 | // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); | 2448 | // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); |
2449 | 2449 | ||
2450 | //qDebug("%s %d %s %d", local->lastModified().toString().latin1() , localMod, remote->lastModified().toString().latin1(), remoteMod); | 2450 | //qDebug("%s %d %s %d", local->lastModified().toString().latin1() , localMod, remote->lastModified().toString().latin1(), remoteMod); |
2451 | //qDebug("%d %d %d %d ", local->lastModified().time().second(), local->lastModified().time().msec(), remote->lastModified().time().second(), remote->lastModified().time().msec() ); | 2451 | //qDebug("%d %d %d %d ", local->lastModified().time().second(), local->lastModified().time().msec(), remote->lastModified().time().second(), remote->lastModified().time().msec() ); |
2452 | //full = true; //debug only | 2452 | //full = true; //debug only |
2453 | if ( full ) { | 2453 | if ( full ) { |
2454 | bool equ = ( (*local) == (*remote) ); | 2454 | bool equ = ( (*local) == (*remote) ); |
2455 | if ( equ ) { | 2455 | if ( equ ) { |
2456 | //qDebug("equal "); | 2456 | //qDebug("equal "); |
2457 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2457 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2458 | local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); | 2458 | local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); |
2459 | } | 2459 | } |
2460 | if ( mode < SYNC_PREF_FORCE_LOCAL ) | 2460 | if ( mode < SYNC_PREF_FORCE_LOCAL ) |
2461 | return 0; | 2461 | return 0; |
2462 | 2462 | ||
2463 | }//else //debug only | 2463 | }//else //debug only |
2464 | //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); | 2464 | //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); |
2465 | } | 2465 | } |
2466 | int result; | 2466 | int result; |
2467 | bool localIsNew; | 2467 | bool localIsNew; |
2468 | //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() ); | 2468 | //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() ); |
2469 | 2469 | ||
2470 | if ( full && mode < SYNC_PREF_NEWEST ) | 2470 | if ( full && mode < SYNC_PREF_NEWEST ) |
2471 | mode = SYNC_PREF_ASK; | 2471 | mode = SYNC_PREF_ASK; |
2472 | 2472 | ||
2473 | switch( mode ) { | 2473 | switch( mode ) { |
2474 | case SYNC_PREF_LOCAL: | 2474 | case SYNC_PREF_LOCAL: |
2475 | if ( lastSync > remoteMod ) | 2475 | if ( lastSync > remoteMod ) |
2476 | return 1; | 2476 | return 1; |
2477 | if ( lastSync > localMod ) | 2477 | if ( lastSync > localMod ) |
2478 | return 2; | 2478 | return 2; |
2479 | return 1; | 2479 | return 1; |
2480 | break; | 2480 | break; |
2481 | case SYNC_PREF_REMOTE: | 2481 | case SYNC_PREF_REMOTE: |
2482 | if ( lastSync > remoteMod ) | 2482 | if ( lastSync > remoteMod ) |
2483 | return 1; | 2483 | return 1; |
2484 | if ( lastSync > localMod ) | 2484 | if ( lastSync > localMod ) |
2485 | return 2; | 2485 | return 2; |
2486 | return 2; | 2486 | return 2; |
2487 | break; | 2487 | break; |
2488 | case SYNC_PREF_NEWEST: | 2488 | case SYNC_PREF_NEWEST: |
2489 | if ( localMod > remoteMod ) | 2489 | if ( localMod > remoteMod ) |
2490 | return 1; | 2490 | return 1; |
2491 | else | 2491 | else |
2492 | return 2; | 2492 | return 2; |
2493 | break; | 2493 | break; |
2494 | case SYNC_PREF_ASK: | 2494 | case SYNC_PREF_ASK: |
2495 | //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); | 2495 | //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); |
2496 | if ( lastSync > remoteMod ) | 2496 | if ( lastSync > remoteMod ) |
2497 | return 1; | 2497 | return 1; |
2498 | if ( lastSync > localMod ) | 2498 | if ( lastSync > localMod ) |
2499 | return 2; | 2499 | return 2; |
2500 | localIsNew = localMod >= remoteMod; | 2500 | localIsNew = localMod >= remoteMod; |
2501 | //qDebug("conflict! ************************************** "); | 2501 | //qDebug("conflict! ************************************** "); |
2502 | { | 2502 | { |
2503 | KPIM::AddresseeChooser acd ( *local,*remote, localIsNew , this ); | 2503 | KPIM::AddresseeChooser acd ( *local,*remote, localIsNew , this ); |
2504 | result = acd.executeD(localIsNew); | 2504 | result = acd.executeD(localIsNew); |
2505 | return result; | 2505 | return result; |
2506 | } | 2506 | } |
2507 | break; | 2507 | break; |
2508 | case SYNC_PREF_FORCE_LOCAL: | 2508 | case SYNC_PREF_FORCE_LOCAL: |
2509 | return 1; | 2509 | return 1; |
2510 | break; | 2510 | break; |
2511 | case SYNC_PREF_FORCE_REMOTE: | 2511 | case SYNC_PREF_FORCE_REMOTE: |
2512 | return 2; | 2512 | return 2; |
2513 | break; | 2513 | break; |
2514 | 2514 | ||
2515 | default: | 2515 | default: |
2516 | // SYNC_PREF_TAKE_BOTH not implemented | 2516 | // SYNC_PREF_TAKE_BOTH not implemented |
2517 | break; | 2517 | break; |
2518 | } | 2518 | } |
2519 | return 0; | 2519 | return 0; |
2520 | } | 2520 | } |
2521 | 2521 | ||
2522 | 2522 | ||
2523 | bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode) | 2523 | bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode) |
2524 | { | 2524 | { |
2525 | bool syncOK = true; | 2525 | bool syncOK = true; |
2526 | int addedAddressee = 0; | 2526 | int addedAddressee = 0; |
2527 | int addedAddresseeR = 0; | 2527 | int addedAddresseeR = 0; |
2528 | int deletedAddresseeR = 0; | 2528 | int deletedAddresseeR = 0; |
2529 | int deletedAddresseeL = 0; | 2529 | int deletedAddresseeL = 0; |
2530 | int changedLocal = 0; | 2530 | int changedLocal = 0; |
2531 | int changedRemote = 0; | 2531 | int changedRemote = 0; |
2532 | 2532 | ||
2533 | QString mCurrentSyncName = syncManager->getCurrentSyncName(); | 2533 | QString mCurrentSyncName = syncManager->getCurrentSyncName(); |
2534 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2534 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2535 | 2535 | ||
2536 | //QPtrList<Addressee> el = local->rawAddressees(); | 2536 | //QPtrList<Addressee> el = local->rawAddressees(); |
2537 | Addressee addresseeR; | 2537 | Addressee addresseeR; |
2538 | QString uid; | 2538 | QString uid; |
2539 | int take; | 2539 | int take; |
2540 | Addressee addresseeL; | 2540 | Addressee addresseeL; |
2541 | Addressee addresseeRSync; | 2541 | Addressee addresseeRSync; |
2542 | Addressee addresseeLSync; | 2542 | Addressee addresseeLSync; |
2543 | // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees(); | 2543 | // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees(); |
2544 | //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); | 2544 | //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); |
2545 | bool fullDateRange = false; | 2545 | bool fullDateRange = false; |
2546 | local->resetTempSyncStat(); | 2546 | local->resetTempSyncStat(); |
2547 | mLastAddressbookSync = QDateTime::currentDateTime(); | 2547 | mLastAddressbookSync = QDateTime::currentDateTime(); |
2548 | if ( syncManager->syncWithDesktop() ) { | 2548 | if ( syncManager->syncWithDesktop() ) { |
2549 | // remote->removeSyncInfo( QString());//remove all info | 2549 | // remote->removeSyncInfo( QString());//remove all info |
2550 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { | 2550 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { |
2551 | mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; | 2551 | mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; |
2552 | qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); | 2552 | qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); |
2553 | } else { | 2553 | } else { |
2554 | qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); | 2554 | qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); |
2555 | } | 2555 | } |
2556 | } | 2556 | } |
2557 | QDateTime modifiedCalendar = mLastAddressbookSync; | 2557 | QDateTime modifiedCalendar = mLastAddressbookSync; |
2558 | addresseeLSync = getLastSyncAddressee(); | 2558 | addresseeLSync = getLastSyncAddressee(); |
2559 | qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1()); | 2559 | qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1()); |
2560 | addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); | 2560 | addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); |
2561 | if ( !addresseeR.isEmpty() ) { | 2561 | if ( !addresseeR.isEmpty() ) { |
2562 | addresseeRSync = addresseeR; | 2562 | addresseeRSync = addresseeR; |
2563 | remote->removeAddressee(addresseeR ); | 2563 | remote->removeAddressee(addresseeR ); |
2564 | 2564 | ||
2565 | } else { | 2565 | } else { |
2566 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2566 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2567 | addresseeRSync = addresseeLSync ; | 2567 | addresseeRSync = addresseeLSync ; |
2568 | } else { | 2568 | } else { |
2569 | qDebug("FULLDATE 1"); | 2569 | qDebug("FULLDATE 1"); |
2570 | fullDateRange = true; | 2570 | fullDateRange = true; |
2571 | Addressee newAdd; | 2571 | Addressee newAdd; |
2572 | addresseeRSync = newAdd; | 2572 | addresseeRSync = newAdd; |
2573 | addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); | 2573 | addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); |
2574 | addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); | 2574 | addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); |
2575 | addresseeRSync.setRevision( mLastAddressbookSync ); | 2575 | addresseeRSync.setRevision( mLastAddressbookSync ); |
2576 | addresseeRSync.setCategories( i18n("SyncAddressee") ); | 2576 | addresseeRSync.setCategories( i18n("SyncAddressee") ); |
2577 | } | 2577 | } |
2578 | } | 2578 | } |
2579 | if ( addresseeLSync.revision() == mLastAddressbookSync ) { | 2579 | if ( addresseeLSync.revision() == mLastAddressbookSync ) { |
2580 | qDebug("FULLDATE 2"); | 2580 | qDebug("FULLDATE 2"); |
2581 | fullDateRange = true; | 2581 | fullDateRange = true; |
2582 | } | 2582 | } |
2583 | if ( ! fullDateRange ) { | 2583 | if ( ! fullDateRange ) { |
2584 | if ( addresseeLSync.revision() != addresseeRSync.revision() ) { | 2584 | if ( addresseeLSync.revision() != addresseeRSync.revision() ) { |
2585 | 2585 | ||
2586 | // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() ); | 2586 | // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() ); |
2587 | //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec()); | 2587 | //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec()); |
2588 | fullDateRange = true; | 2588 | fullDateRange = true; |
2589 | qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() ); | 2589 | qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() ); |
2590 | } | 2590 | } |
2591 | } | 2591 | } |
2592 | // fullDateRange = true; // debug only! | 2592 | // fullDateRange = true; // debug only! |
2593 | if ( fullDateRange ) | 2593 | if ( fullDateRange ) |
2594 | mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365); | 2594 | mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365); |
2595 | else | 2595 | else |
2596 | mLastAddressbookSync = addresseeLSync.revision(); | 2596 | mLastAddressbookSync = addresseeLSync.revision(); |
2597 | // for resyncing if own file has changed | 2597 | // for resyncing if own file has changed |
2598 | // PENDING fixme later when implemented | 2598 | // PENDING fixme later when implemented |
2599 | #if 0 | 2599 | #if 0 |
2600 | if ( mCurrentSyncDevice == "deleteaftersync" ) { | 2600 | if ( mCurrentSyncDevice == "deleteaftersync" ) { |
2601 | mLastAddressbookSync = loadedFileVersion; | 2601 | mLastAddressbookSync = loadedFileVersion; |
2602 | qDebug("setting mLastAddressbookSync "); | 2602 | qDebug("setting mLastAddressbookSync "); |
2603 | } | 2603 | } |
2604 | #endif | 2604 | #endif |
2605 | 2605 | ||
2606 | //qDebug("*************************** "); | 2606 | //qDebug("*************************** "); |
2607 | // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() ); | 2607 | // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() ); |
2608 | QStringList er = remote->uidList(); | 2608 | QStringList er = remote->uidList(); |
2609 | Addressee inR ;//= er.first(); | 2609 | Addressee inR ;//= er.first(); |
2610 | Addressee inL; | 2610 | Addressee inL; |
2611 | 2611 | ||
2612 | syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count()); | 2612 | syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count()); |
2613 | 2613 | ||
2614 | int modulo = (er.count()/10)+1; | 2614 | int modulo = (er.count()/10)+1; |
2615 | int incCounter = 0; | 2615 | int incCounter = 0; |
2616 | while ( incCounter < er.count()) { | 2616 | while ( incCounter < er.count()) { |
2617 | if (syncManager->isProgressBarCanceled()) | 2617 | if (syncManager->isProgressBarCanceled()) |
2618 | return false; | 2618 | return false; |
2619 | if ( incCounter % modulo == 0 ) | 2619 | if ( incCounter % modulo == 0 ) |
2620 | syncManager->showProgressBar(incCounter); | 2620 | syncManager->showProgressBar(incCounter); |
2621 | 2621 | ||
2622 | uid = er[ incCounter ]; | 2622 | uid = er[ incCounter ]; |
2623 | bool skipIncidence = false; | 2623 | bool skipIncidence = false; |
2624 | if ( uid.left(19) == QString("last-syncAddressee-") ) | 2624 | if ( uid.left(19) == QString("last-syncAddressee-") ) |
2625 | skipIncidence = true; | 2625 | skipIncidence = true; |
2626 | QString idS,OidS; | 2626 | QString idS,OidS; |
2627 | qApp->processEvents(); | 2627 | qApp->processEvents(); |
2628 | if ( !skipIncidence ) { | 2628 | if ( !skipIncidence ) { |
2629 | inL = local->findByUid( uid ); | 2629 | inL = local->findByUid( uid ); |
2630 | inR = remote->findByUid( uid ); | 2630 | inR = remote->findByUid( uid ); |
2631 | //inL.setResource( 0 ); | 2631 | //inL.setResource( 0 ); |
2632 | //inR.setResource( 0 ); | 2632 | //inR.setResource( 0 ); |
2633 | if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars | 2633 | if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars |
2634 | if ( !inL.resource() || inL.resource()->includeInSync() ) { | 2634 | if ( !inL.resource() || inL.resource()->includeInSync() ) { |
2635 | if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) { | 2635 | if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) { |
2636 | //qDebug("take %d %s ", take, inL.summary().latin1()); | 2636 | //qDebug("take %d %s ", take, inL.summary().latin1()); |
2637 | if ( take == 3 ) | 2637 | if ( take == 3 ) |
2638 | return false; | 2638 | return false; |
2639 | if ( take == 1 ) {// take local ********************** | 2639 | if ( take == 1 ) {// take local ********************** |
2640 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2640 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2641 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | 2641 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); |
2642 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | 2642 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); |
2643 | local->insertAddressee( inL, false ); | 2643 | local->insertAddressee( inL, false ); |
2644 | idS = inR.externalUID(); | 2644 | idS = inR.externalUID(); |
2645 | OidS = inR.originalExternalUID(); | 2645 | OidS = inR.originalExternalUID(); |
2646 | } | 2646 | } |
2647 | else | 2647 | else |
2648 | idS = inR.IDStr(); | 2648 | idS = inR.IDStr(); |
2649 | remote->removeAddressee( inR ); | 2649 | remote->removeAddressee( inR ); |
2650 | inR = inL; | 2650 | inR = inL; |
2651 | inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 2651 | inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
2652 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2652 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2653 | inR.setOriginalExternalUID( OidS ); | 2653 | inR.setOriginalExternalUID( OidS ); |
2654 | inR.setExternalUID( idS ); | 2654 | inR.setExternalUID( idS ); |
2655 | if ( syncManager->syncWithDesktop() ) | 2655 | if ( syncManager->syncWithDesktop() ) |
2656 | inR.setIDStr("changed" ); | 2656 | inR.setIDStr("changed" ); |
2657 | //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); | 2657 | //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); |
2658 | } else { | 2658 | } else { |
2659 | inR.setIDStr( idS ); | 2659 | inR.setIDStr( idS ); |
2660 | } | 2660 | } |
2661 | inR.setResource( 0 ); | 2661 | inR.setResource( 0 ); |
2662 | remote->insertAddressee( inR , false); | 2662 | remote->insertAddressee( inR , false); |
2663 | ++changedRemote; | 2663 | ++changedRemote; |
2664 | } else { // take == 2 take remote ********************** | 2664 | } else { // take == 2 take remote ********************** |
2665 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2665 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2666 | if ( inR.revision().date().year() < 2004 ) | 2666 | if ( inR.revision().date().year() < 2004 ) |
2667 | inR.setRevision( modifiedCalendar ); | 2667 | inR.setRevision( modifiedCalendar ); |
2668 | } | 2668 | } |
2669 | idS = inL.IDStr(); | 2669 | idS = inL.IDStr(); |
2670 | local->removeAddressee( inL ); | 2670 | local->removeAddressee( inL ); |
2671 | inL = inR; | 2671 | inL = inR; |
2672 | inL.setIDStr( idS ); | 2672 | inL.setIDStr( idS ); |
2673 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2673 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2674 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | 2674 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); |
2675 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | 2675 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); |
2676 | } | 2676 | } |
2677 | inL.setResource( 0 ); | 2677 | inL.setResource( 0 ); |
2678 | local->insertAddressee( inL , false ); | 2678 | local->insertAddressee( inL , false ); |
2679 | ++changedLocal; | 2679 | ++changedLocal; |
2680 | } | 2680 | } |
2681 | } | 2681 | } |
2682 | } | 2682 | } |
2683 | } else { // no conflict ********** add or delete remote | 2683 | } else { // no conflict ********** add or delete remote |
2684 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2684 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2685 | QString des = addresseeLSync.note(); | 2685 | QString des = addresseeLSync.note(); |
2686 | if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it | 2686 | if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it |
2687 | inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); | 2687 | inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); |
2688 | remote->insertAddressee( inR, false ); | 2688 | remote->insertAddressee( inR, false ); |
2689 | ++deletedAddresseeR; | 2689 | ++deletedAddresseeR; |
2690 | } else { | 2690 | } else { |
2691 | inR.setRevision( modifiedCalendar ); | 2691 | inR.setRevision( modifiedCalendar ); |
2692 | remote->insertAddressee( inR, false ); | 2692 | remote->insertAddressee( inR, false ); |
2693 | inL = inR; | 2693 | inL = inR; |
2694 | inL.setIDStr( ":" ); | 2694 | inL.setIDStr( ":" ); |
2695 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | 2695 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); |
2696 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | 2696 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); |
2697 | inL.setResource( 0 ); | 2697 | inL.setResource( 0 ); |
2698 | local->insertAddressee( inL , false); | 2698 | local->insertAddressee( inL , false); |
2699 | ++addedAddressee; | 2699 | ++addedAddressee; |
2700 | } | 2700 | } |
2701 | } else { | 2701 | } else { |
2702 | if ( inR.revision() > mLastAddressbookSync || mode == 5 ) { | 2702 | if ( inR.revision() > mLastAddressbookSync || mode == 5 ) { |
2703 | inR.setRevision( modifiedCalendar ); | 2703 | inR.setRevision( modifiedCalendar ); |
2704 | remote->insertAddressee( inR, false ); | 2704 | remote->insertAddressee( inR, false ); |
2705 | inR.setResource( 0 ); | 2705 | inR.setResource( 0 ); |
2706 | local->insertAddressee( inR, false ); | 2706 | local->insertAddressee( inR, false ); |
2707 | ++addedAddressee; | 2707 | ++addedAddressee; |
2708 | } else { | 2708 | } else { |
2709 | // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); | 2709 | // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); |
2710 | remote->removeAddressee( inR ); | 2710 | remote->removeAddressee( inR ); |
2711 | ++deletedAddresseeR; | 2711 | ++deletedAddresseeR; |
2712 | } | 2712 | } |
2713 | } | 2713 | } |
2714 | } | 2714 | } |
2715 | } | 2715 | } |
2716 | ++incCounter; | 2716 | ++incCounter; |
2717 | } | 2717 | } |
2718 | er.clear(); | 2718 | er.clear(); |
2719 | QStringList el = local->uidList(); | 2719 | QStringList el = local->uidList(); |
2720 | modulo = (el.count()/10)+1; | 2720 | modulo = (el.count()/10)+1; |
2721 | 2721 | ||
2722 | syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); | 2722 | syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); |
2723 | incCounter = 0; | 2723 | incCounter = 0; |
2724 | while ( incCounter < el.count()) { | 2724 | while ( incCounter < el.count()) { |
2725 | qApp->processEvents(); | 2725 | qApp->processEvents(); |
2726 | if (syncManager->isProgressBarCanceled()) | 2726 | if (syncManager->isProgressBarCanceled()) |
2727 | return false; | 2727 | return false; |
2728 | if ( incCounter % modulo == 0 ) | 2728 | if ( incCounter % modulo == 0 ) |
2729 | syncManager->showProgressBar(incCounter); | 2729 | syncManager->showProgressBar(incCounter); |
2730 | uid = el[ incCounter ]; | 2730 | uid = el[ incCounter ]; |
2731 | bool skipIncidence = false; | 2731 | bool skipIncidence = false; |
2732 | if ( uid.left(19) == QString("last-syncAddressee-") ) | 2732 | if ( uid.left(19) == QString("last-syncAddressee-") ) |
2733 | skipIncidence = true; | 2733 | skipIncidence = true; |
2734 | if ( !skipIncidence ) { | 2734 | if ( !skipIncidence ) { |
2735 | inL = local->findByUid( uid ); | 2735 | inL = local->findByUid( uid ); |
2736 | if ( !inL.resource() || inL.resource()->includeInSync() ) { | 2736 | if ( !inL.resource() || inL.resource()->includeInSync() ) { |
2737 | inR = remote->findByUid( uid ); | 2737 | inR = remote->findByUid( uid ); |
2738 | if ( inR.isEmpty() ) { / no conflict ********** add or delete local | 2738 | if ( inR.isEmpty() ) { // no conflict ********** add or delete local |
2739 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2739 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2740 | if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 2740 | if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
2741 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); | 2741 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); |
2742 | local->removeAddressee( inL ); | 2742 | local->removeAddressee( inL ); |
2743 | ++deletedAddresseeL; | 2743 | ++deletedAddresseeL; |
2744 | } else { | 2744 | } else { |
2745 | if ( ! syncManager->mWriteBackExistingOnly ) { | 2745 | if ( ! syncManager->mWriteBackExistingOnly ) { |
2746 | inL.removeID(mCurrentSyncDevice ); | 2746 | inL.removeID(mCurrentSyncDevice ); |
2747 | ++addedAddresseeR; | 2747 | ++addedAddresseeR; |
2748 | inL.setRevision( modifiedCalendar ); | 2748 | inL.setRevision( modifiedCalendar ); |
2749 | local->insertAddressee( inL, false ); | 2749 | local->insertAddressee( inL, false ); |
2750 | inR = inL; | 2750 | inR = inL; |
2751 | inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); | 2751 | inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); |
2752 | inR.setResource( 0 ); | 2752 | inR.setResource( 0 ); |
2753 | remote->insertAddressee( inR, false ); | 2753 | remote->insertAddressee( inR, false ); |
2754 | } | 2754 | } |
2755 | } | 2755 | } |
2756 | } else { | 2756 | } else { |
2757 | if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { | 2757 | if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { |
2758 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); | 2758 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); |
2759 | local->removeAddressee( inL ); | 2759 | local->removeAddressee( inL ); |
2760 | ++deletedAddresseeL; | 2760 | ++deletedAddresseeL; |
2761 | } else { | 2761 | } else { |
2762 | if ( ! syncManager->mWriteBackExistingOnly ) { | 2762 | if ( ! syncManager->mWriteBackExistingOnly ) { |
2763 | ++addedAddresseeR; | 2763 | ++addedAddresseeR; |
2764 | inL.setRevision( modifiedCalendar ); | 2764 | inL.setRevision( modifiedCalendar ); |
2765 | local->insertAddressee( inL, false ); | 2765 | local->insertAddressee( inL, false ); |
2766 | inR = inL; | 2766 | inR = inL; |
2767 | inR.setIDStr( ":" ); | 2767 | inR.setIDStr( ":" ); |
2768 | inR.setResource( 0 ); | 2768 | inR.setResource( 0 ); |
2769 | remote->insertAddressee( inR, false ); | 2769 | remote->insertAddressee( inR, false ); |
2770 | } | 2770 | } |
2771 | } | 2771 | } |
2772 | } | 2772 | } |
2773 | } | 2773 | } |
2774 | } | 2774 | } |
2775 | } | 2775 | } |
2776 | ++incCounter; | 2776 | ++incCounter; |
2777 | } | 2777 | } |
2778 | el.clear(); | 2778 | el.clear(); |
2779 | syncManager->hideProgressBar(); | 2779 | syncManager->hideProgressBar(); |
2780 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); | 2780 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); |
2781 | // get rid of micro seconds | 2781 | // get rid of micro seconds |
2782 | QTime t = mLastAddressbookSync.time(); | 2782 | QTime t = mLastAddressbookSync.time(); |
2783 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); | 2783 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); |
2784 | addresseeLSync.setRevision( mLastAddressbookSync ); | 2784 | addresseeLSync.setRevision( mLastAddressbookSync ); |
2785 | addresseeRSync.setRevision( mLastAddressbookSync ); | 2785 | addresseeRSync.setRevision( mLastAddressbookSync ); |
2786 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; | 2786 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; |
2787 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); | 2787 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); |
2788 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; | 2788 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; |
2789 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); | 2789 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); |
2790 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; | 2790 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; |
2791 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); | 2791 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); |
2792 | addresseeRSync.setNote( "" ) ; | 2792 | addresseeRSync.setNote( "" ) ; |
2793 | addresseeLSync.setNote( "" ); | 2793 | addresseeLSync.setNote( "" ); |
2794 | 2794 | ||
2795 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) | 2795 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) |
2796 | remote->insertAddressee( addresseeRSync, false ); | 2796 | remote->insertAddressee( addresseeRSync, false ); |
2797 | local->insertAddressee( addresseeLSync, false ); | 2797 | local->insertAddressee( addresseeLSync, false ); |
2798 | QString mes; | 2798 | QString mes; |
2799 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); | 2799 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); |
2800 | qDebug( mes ); | 2800 | qDebug( mes ); |
2801 | if ( syncManager->mShowSyncSummary ) { | 2801 | if ( syncManager->mShowSyncSummary ) { |
2802 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, | 2802 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, |
2803 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { | 2803 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { |
2804 | qDebug("cancelled "); | 2804 | qDebug("cancelled "); |
2805 | return false; | 2805 | return false; |
2806 | } | 2806 | } |
2807 | } | 2807 | } |
2808 | return syncOK; | 2808 | return syncOK; |
2809 | } | 2809 | } |
2810 | 2810 | ||
2811 | 2811 | ||
2812 | //this is a overwritten callbackmethods from the syncinterface | 2812 | //this is a overwritten callbackmethods from the syncinterface |
2813 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | 2813 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) |
2814 | { | 2814 | { |
2815 | 2815 | ||
2816 | //pending prepare addresseeview for output | 2816 | //pending prepare addresseeview for output |
2817 | //pending detect, if remote file has REV field. if not switch to external sync | 2817 | //pending detect, if remote file has REV field. if not switch to external sync |
2818 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 2818 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
2819 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 2819 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
2820 | 2820 | ||
2821 | AddressBook abLocal(filename,"syncContact"); | 2821 | AddressBook abLocal(filename,"syncContact"); |
2822 | bool syncOK = false; | 2822 | bool syncOK = false; |
2823 | if ( abLocal.load() ) { | 2823 | if ( abLocal.load() ) { |
2824 | qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); | 2824 | qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); |
2825 | bool external = false; | 2825 | bool external = false; |
2826 | bool isXML = false; | 2826 | bool isXML = false; |
2827 | if ( filename.right(4) == ".xml") { | 2827 | if ( filename.right(4) == ".xml") { |
2828 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2828 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2829 | isXML = true; | 2829 | isXML = true; |
2830 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 2830 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
2831 | } else { | 2831 | } else { |
2832 | external = !manager->mIsKapiFile; | 2832 | external = !manager->mIsKapiFile; |
2833 | if ( external ) { | 2833 | if ( external ) { |
2834 | qDebug("Setting vcf mode to external "); | 2834 | qDebug("Setting vcf mode to external "); |
2835 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2835 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2836 | AddressBook::Iterator it; | 2836 | AddressBook::Iterator it; |
2837 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 2837 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
2838 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); | 2838 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); |
2839 | (*it).computeCsum( mCurrentSyncDevice ); | 2839 | (*it).computeCsum( mCurrentSyncDevice ); |
2840 | } | 2840 | } |
2841 | } | 2841 | } |
2842 | } | 2842 | } |
2843 | //AddressBook::Iterator it; | 2843 | //AddressBook::Iterator it; |
2844 | //QStringList vcards; | 2844 | //QStringList vcards; |
2845 | //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 2845 | //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
2846 | // qDebug("Name %s ", (*it).familyName().latin1()); | 2846 | // qDebug("Name %s ", (*it).familyName().latin1()); |
2847 | //} | 2847 | //} |
2848 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); | 2848 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); |
2849 | if ( syncOK ) { | 2849 | if ( syncOK ) { |
2850 | if ( syncManager->mWriteBackFile ) | 2850 | if ( syncManager->mWriteBackFile ) |
2851 | { | 2851 | { |
2852 | if ( external ) | 2852 | if ( external ) |
2853 | abLocal.removeSyncAddressees( !isXML); | 2853 | abLocal.removeSyncAddressees( !isXML); |
2854 | qDebug("Saving remote AB "); | 2854 | qDebug("Saving remote AB "); |
2855 | if ( ! abLocal.saveAB()) | 2855 | if ( ! abLocal.saveAB()) |
2856 | qDebug("Error writing back AB to file "); | 2856 | qDebug("Error writing back AB to file "); |
2857 | if ( external ) { | 2857 | if ( external ) { |
2858 | // afterwrite processing | 2858 | // afterwrite processing |
2859 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); | 2859 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); |
2860 | } | 2860 | } |
2861 | } | 2861 | } |
2862 | } | 2862 | } |
2863 | setModified(); | 2863 | setModified(); |
2864 | 2864 | ||
2865 | } | 2865 | } |
2866 | if ( syncOK ) | 2866 | if ( syncOK ) |
2867 | mViewManager->refreshView(); | 2867 | mViewManager->refreshView(); |
2868 | return syncOK; | 2868 | return syncOK; |
2869 | 2869 | ||
2870 | } | 2870 | } |
2871 | void KABCore::removeSyncInfo( QString syncProfile) | 2871 | void KABCore::removeSyncInfo( QString syncProfile) |
2872 | { | 2872 | { |
2873 | qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1()); | 2873 | qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1()); |
2874 | mAddressBook->removeSyncInfo( syncProfile ); | 2874 | mAddressBook->removeSyncInfo( syncProfile ); |
2875 | setModified(); | 2875 | setModified(); |
2876 | } | 2876 | } |
2877 | 2877 | ||
2878 | 2878 | ||
2879 | //this is a overwritten callbackmethods from the syncinterface | 2879 | //this is a overwritten callbackmethods from the syncinterface |
2880 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) | 2880 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) |
2881 | { | 2881 | { |
2882 | if ( resource == "phone" ) | 2882 | if ( resource == "phone" ) |
2883 | return syncPhone(); | 2883 | return syncPhone(); |
2884 | disableBR( true ); | 2884 | disableBR( true ); |
2885 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 2885 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
2886 | 2886 | ||
2887 | AddressBook abLocal( resource,"syncContact"); | 2887 | AddressBook abLocal( resource,"syncContact"); |
2888 | bool syncOK = false; | 2888 | bool syncOK = false; |
2889 | if ( abLocal.load() ) { | 2889 | if ( abLocal.load() ) { |
2890 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2890 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2891 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2891 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2892 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); | 2892 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); |
2893 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 2893 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
2894 | if ( syncOK ) { | 2894 | if ( syncOK ) { |
2895 | if ( syncManager->mWriteBackFile ) { | 2895 | if ( syncManager->mWriteBackFile ) { |
2896 | abLocal.removeSyncAddressees( false ); | 2896 | abLocal.removeSyncAddressees( false ); |
2897 | abLocal.saveAB(); | 2897 | abLocal.saveAB(); |
2898 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); | 2898 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
2899 | } | 2899 | } |
2900 | } else | 2900 | } else |
2901 | message( i18n("Sync cancelled or failed.") ); | 2901 | message( i18n("Sync cancelled or failed.") ); |
2902 | setModified(); | 2902 | setModified(); |
2903 | } | 2903 | } |
2904 | if ( syncOK ) | 2904 | if ( syncOK ) |
2905 | mViewManager->refreshView(); | 2905 | mViewManager->refreshView(); |
2906 | disableBR( false ); | 2906 | disableBR( false ); |
2907 | return syncOK; | 2907 | return syncOK; |
2908 | 2908 | ||
2909 | } | 2909 | } |
2910 | void KABCore::message( QString m ) | 2910 | void KABCore::message( QString m ) |
2911 | { | 2911 | { |
2912 | topLevelWidget()->setCaption( m ); | 2912 | topLevelWidget()->setCaption( m ); |
2913 | mMessageTimer->start( 15000, true ); | 2913 | mMessageTimer->start( 15000, true ); |
2914 | } | 2914 | } |
2915 | bool KABCore::syncPhone() | 2915 | bool KABCore::syncPhone() |
2916 | { | 2916 | { |
2917 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2917 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2918 | QString fileName = getPhoneFile(); | 2918 | QString fileName = getPhoneFile(); |
2919 | if ( !PhoneAccess::readFromPhone( fileName) ) { | 2919 | if ( !PhoneAccess::readFromPhone( fileName) ) { |
2920 | message(i18n("Phone access failed!")); | 2920 | message(i18n("Phone access failed!")); |
2921 | return false; | 2921 | return false; |
2922 | } | 2922 | } |
2923 | AddressBook abLocal( fileName,"syncContact"); | 2923 | AddressBook abLocal( fileName,"syncContact"); |
2924 | bool syncOK = false; | 2924 | bool syncOK = false; |
2925 | { | 2925 | { |
2926 | abLocal.importFromFile( fileName ); | 2926 | abLocal.importFromFile( fileName ); |
2927 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2927 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2928 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2928 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2929 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); | 2929 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); |
2930 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 2930 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
2931 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 2931 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
2932 | if ( syncOK ) { | 2932 | if ( syncOK ) { |
2933 | if ( syncManager->mWriteBackFile ) { | 2933 | if ( syncManager->mWriteBackFile ) { |
2934 | abLocal.removeSyncAddressees( true ); | 2934 | abLocal.removeSyncAddressees( true ); |
2935 | abLocal.saveABphone( fileName ); | 2935 | abLocal.saveABphone( fileName ); |
2936 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); | 2936 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); |
2937 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); | 2937 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); |
2938 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); | 2938 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
2939 | } | 2939 | } |
2940 | } | 2940 | } |
2941 | setModified(); | 2941 | setModified(); |
2942 | } | 2942 | } |
2943 | if ( syncOK ) | 2943 | if ( syncOK ) |
2944 | mViewManager->refreshView(); | 2944 | mViewManager->refreshView(); |
2945 | return syncOK; | 2945 | return syncOK; |
2946 | } | 2946 | } |
2947 | void KABCore::getFile( bool success ) | 2947 | void KABCore::getFile( bool success ) |
2948 | { | 2948 | { |
2949 | if ( ! success ) { | 2949 | if ( ! success ) { |
2950 | message( i18n("Error receiving file. Nothing changed!") ); | 2950 | message( i18n("Error receiving file. Nothing changed!") ); |
2951 | return; | 2951 | return; |
2952 | } | 2952 | } |
2953 | int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); | 2953 | int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); |
2954 | if ( count ) | 2954 | if ( count ) |
2955 | setModified( true ); | 2955 | setModified( true ); |
2956 | message( i18n("Pi-Sync successful!") ); | 2956 | message( i18n("Pi-Sync successful!") ); |
2957 | mViewManager->refreshView(); | 2957 | mViewManager->refreshView(); |
2958 | } | 2958 | } |
2959 | void KABCore::syncFileRequest() | 2959 | void KABCore::syncFileRequest() |
2960 | { | 2960 | { |
2961 | if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { | 2961 | if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { |
2962 | syncManager->slotSyncMenu( 999 ); | 2962 | syncManager->slotSyncMenu( 999 ); |
2963 | } | 2963 | } |
2964 | mAddressBook->export2File( sentSyncFile() ); | 2964 | mAddressBook->export2File( sentSyncFile() ); |
2965 | } | 2965 | } |
2966 | QString KABCore::sentSyncFile() | 2966 | QString KABCore::sentSyncFile() |
2967 | { | 2967 | { |
2968 | #ifdef DESKTOP_VERSION | 2968 | #ifdef DESKTOP_VERSION |
2969 | return locateLocal( "tmp", "copysyncab.vcf" ); | 2969 | return locateLocal( "tmp", "copysyncab.vcf" ); |
2970 | #else | 2970 | #else |
2971 | return QString( "/tmp/copysyncab.vcf" ); | 2971 | return QString( "/tmp/copysyncab.vcf" ); |
2972 | #endif | 2972 | #endif |
2973 | } | 2973 | } |
2974 | 2974 | ||
2975 | void KABCore::setCaptionBack() | 2975 | void KABCore::setCaptionBack() |
2976 | { | 2976 | { |
2977 | mMessageTimer->stop(); | 2977 | mMessageTimer->stop(); |
2978 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); | 2978 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); |
2979 | } | 2979 | } |