-rw-r--r-- | bin/kdepim/WhatsNew.txt | 9 | ||||
-rw-r--r-- | kaddressbook/kaddressbookview.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/kaddressbookview.h | 2 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookcardview.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookiconview.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 6 |
6 files changed, 18 insertions, 7 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index a425311..2fd63e7 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,682 +1,691 @@ | |||
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.17 ************ | ||
4 | |||
5 | KO/Pi: | ||
6 | Fixed that tooltips were not updated after moving an item in agenda view. | ||
7 | |||
8 | KA/Pi: | ||
9 | All fields search does now actually search all the (possible) fields, | ||
10 | not only those listed in the contact list. | ||
11 | |||
3 | ********** VERSION 1.9.16 ************ | 12 | ********** VERSION 1.9.16 ************ |
4 | 13 | ||
5 | KO/Pi: | 14 | KO/Pi: |
6 | Fixed search dialog size on Z 6000 (480x640 display). | 15 | Fixed search dialog size on Z 6000 (480x640 display). |
7 | Added setting to hide/show time in agenda items. | 16 | Added setting to hide/show time in agenda items. |
8 | Added setting to hide not running todos in todo view. | 17 | Added setting to hide not running todos in todo view. |
9 | Added columns for start date/time in todo view. | 18 | Added columns for start date/time in todo view. |
10 | Replaced the solid half-hour lines in agenda view by dot lines. | 19 | Replaced the solid half-hour lines in agenda view by dot lines. |
11 | Added possibility of printing the What's Next View on the desktop | 20 | Added possibility of printing the What's Next View on the desktop |
12 | (i.e. Windows and Linux). | 21 | (i.e. Windows and Linux). |
13 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. | 22 | Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. |
14 | Added tooltips in month view.(Tooltips only available on desktop) | 23 | Added tooltips in month view.(Tooltips only available on desktop) |
15 | 24 | ||
16 | Fixed a strange problem in KO/Pi alarm applet. | 25 | Fixed a strange problem in KO/Pi alarm applet. |
17 | Did not find the actual problem, | 26 | Did not find the actual problem, |
18 | such that now Qtopia reboots again if deinstalling the alarm applet. | 27 | such that now Qtopia reboots again if deinstalling the alarm applet. |
19 | But the alarm applet should work again. | 28 | But the alarm applet should work again. |
20 | 29 | ||
21 | KA/Pi: | 30 | KA/Pi: |
22 | Fixed the problem, that internal pictures were not saved. | 31 | Fixed the problem, that internal pictures were not saved. |
23 | 32 | ||
24 | Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. | 33 | Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. |
25 | 34 | ||
26 | Fixed some minor problems. (Like word wrap in help text windows). | 35 | Fixed some minor problems. (Like word wrap in help text windows). |
27 | 36 | ||
28 | Fixed a compiling problem in microkde/kresources. | 37 | Fixed a compiling problem in microkde/kresources. |
29 | 38 | ||
30 | KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. | 39 | KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. |
31 | This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) | 40 | This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) |
32 | such that now syncing KO/Pi with Sharp DTM should work on the | 41 | such that now syncing KO/Pi with Sharp DTM should work on the |
33 | Zaurus C 3000 model. | 42 | Zaurus C 3000 model. |
34 | 43 | ||
35 | ********** VERSION 1.9.15 ************ | 44 | ********** VERSION 1.9.15 ************ |
36 | 45 | ||
37 | Usebilty enhancements in KO/Pi: | 46 | Usebilty enhancements in KO/Pi: |
38 | When clicking on the date in a month view cell, the day view is shown. | 47 | When clicking on the date in a month view cell, the day view is shown. |
39 | Old behaviour was, that the "new event" dialog popped up. | 48 | Old behaviour was, that the "new event" dialog popped up. |
40 | 49 | ||
41 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). | 50 | Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). |
42 | That means, you can restore the latest | 51 | That means, you can restore the latest |
43 | event/todo/journal you have deleted. | 52 | event/todo/journal you have deleted. |
44 | A journal is deleted, if you clear all the text of the journal. | 53 | A journal is deleted, if you clear all the text of the journal. |
45 | 54 | ||
46 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. | 55 | Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. |
47 | 56 | ||
48 | KA/Pi starting in 480x640 resolution: | 57 | KA/Pi starting in 480x640 resolution: |
49 | Hide the filter action in toolbar | 58 | Hide the filter action in toolbar |
50 | and added icons for undo/delete/redo in toolbar. | 59 | and added icons for undo/delete/redo in toolbar. |
51 | 60 | ||
52 | Change in OM/Pi ViewMail dialog: | 61 | Change in OM/Pi ViewMail dialog: |
53 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. | 62 | When clicking on the "delete" icon the mail is deleted after confirmation as usual. |
54 | But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). | 63 | But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). |
55 | 64 | ||
56 | Fixed a crash when deleting mail-accounts in OM/Pi. | 65 | Fixed a crash when deleting mail-accounts in OM/Pi. |
57 | 66 | ||
58 | 67 | ||
59 | ********** VERSION 1.9.14 ************ | 68 | ********** VERSION 1.9.14 ************ |
60 | 69 | ||
61 | Fixed some problems with the dialog sizes when switching | 70 | Fixed some problems with the dialog sizes when switching |
62 | portrait/landscape mode on 640x480 PDA display. | 71 | portrait/landscape mode on 640x480 PDA display. |
63 | 72 | ||
64 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. | 73 | Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. |
65 | 74 | ||
66 | Fixed an ugly bug in KOpieMail: | 75 | Fixed an ugly bug in KOpieMail: |
67 | KOpieMail was not able to write files (mails) to MSDOS file system, | 76 | KOpieMail was not able to write files (mails) to MSDOS file system, |
68 | like on an usual preformatted SD card. That should work now. | 77 | like on an usual preformatted SD card. That should work now. |
69 | To save your mail data on the Sd card do the following: | 78 | To save your mail data on the Sd card do the following: |
70 | Create a dir on the SD card: | 79 | Create a dir on the SD card: |
71 | mkdir /mnt/card/localmail | 80 | mkdir /mnt/card/localmail |
72 | Go to your home dir: | 81 | Go to your home dir: |
73 | cd | 82 | cd |
74 | Go to kopiemail data storage dir: | 83 | Go to kopiemail data storage dir: |
75 | cd kdepim/apps/kopiemail | 84 | cd kdepim/apps/kopiemail |
76 | Create a symlink to the SD card: | 85 | Create a symlink to the SD card: |
77 | ls -s /mnt/card/localmail | 86 | ls -s /mnt/card/localmail |
78 | Now KOpieMail will store all mails on the SD card. | 87 | Now KOpieMail will store all mails on the SD card. |
79 | 88 | ||
80 | KO/Pi Monthview: | 89 | KO/Pi Monthview: |
81 | Now "Go to Today" selects the current month from day 1-end, | 90 | Now "Go to Today" selects the current month from day 1-end, |
82 | not the current date + some days. | 91 | not the current date + some days. |
83 | I.e. "Go to Today" shows now always | 92 | I.e. "Go to Today" shows now always |
84 | the current month with first day of month in the first row. | 93 | the current month with first day of month in the first row. |
85 | 94 | ||
86 | Added missing German translation. | 95 | Added missing German translation. |
87 | 96 | ||
88 | Fixed icons of executeable on Wintendo. | 97 | Fixed icons of executeable on Wintendo. |
89 | 98 | ||
90 | Added a "Show next Mail" button to the OM/Pi | 99 | Added a "Show next Mail" button to the OM/Pi |
91 | mail viewer such that the mail below the current mail | 100 | mail viewer such that the mail below the current mail |
92 | in the mail list view of the current folder | 101 | in the mail list view of the current folder |
93 | can be read with a single click. | 102 | can be read with a single click. |
94 | 103 | ||
95 | 104 | ||
96 | ********** VERSION 1.9.13 ************ | 105 | ********** VERSION 1.9.13 ************ |
97 | 106 | ||
98 | Fixed nasty PwM/Pi file reading bug, when | 107 | Fixed nasty PwM/Pi file reading bug, when |
99 | the used hash algo of file is different then the global | 108 | the used hash algo of file is different then the global |
100 | hash algo. | 109 | hash algo. |
101 | 110 | ||
102 | Added KA/Pi support for opie mailit mailapplication. | 111 | Added KA/Pi support for opie mailit mailapplication. |
103 | 112 | ||
104 | Fixed some bugs in OM/Pi. | 113 | Fixed some bugs in OM/Pi. |
105 | Now character conversion tables are available for the Zaurus | 114 | Now character conversion tables are available for the Zaurus |
106 | to make OM/Pi working properly. | 115 | to make OM/Pi working properly. |
107 | To get the character conversion in OM/Pi working, please download | 116 | To get the character conversion in OM/Pi working, please download |
108 | at the sourceforge project site the package | 117 | at the sourceforge project site the package |
109 | sr-character-conversion_SharpROM_arm.ipk.zip | 118 | sr-character-conversion_SharpROM_arm.ipk.zip |
110 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) | 119 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) |
111 | from the section "general files for KDE/Pim" | 120 | from the section "general files for KDE/Pim" |
112 | Instructions how to install this package are in a ReadMe in this file. | 121 | Instructions how to install this package are in a ReadMe in this file. |
113 | 122 | ||
114 | 123 | ||
115 | Fixed the orientation change problem in KA/Pi when switching | 124 | Fixed the orientation change problem in KA/Pi when switching |
116 | portrait/landscape mode. | 125 | portrait/landscape mode. |
117 | 126 | ||
118 | French translation available for KA/Pi and OM/Pi. | 127 | French translation available for KA/Pi and OM/Pi. |
119 | 128 | ||
120 | Fixed some problems with categories in KO/Pi in DTM sync. | 129 | Fixed some problems with categories in KO/Pi in DTM sync. |
121 | 130 | ||
122 | Added selection dialog for export to phone in KA/Pi. | 131 | Added selection dialog for export to phone in KA/Pi. |
123 | 132 | ||
124 | If in KO/Pi is an attendee selected to add to a meeting and this | 133 | If in KO/Pi is an attendee selected to add to a meeting and this |
125 | attendee is already in the list of attendees, this person is not added | 134 | attendee is already in the list of attendees, this person is not added |
126 | again. | 135 | again. |
127 | 136 | ||
128 | Some menu cleanup in KA/Pi. | 137 | Some menu cleanup in KA/Pi. |
129 | 138 | ||
130 | ********** VERSION 1.9.12 ************ | 139 | ********** VERSION 1.9.12 ************ |
131 | 140 | ||
132 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. | 141 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. |
133 | 142 | ||
134 | Bugfix: Licence file is now shown again. | 143 | Bugfix: Licence file is now shown again. |
135 | 144 | ||
136 | OM/Pi now supports Unicode (utf8 charset). | 145 | OM/Pi now supports Unicode (utf8 charset). |
137 | Fixed some bugs in OM/Pi. | 146 | Fixed some bugs in OM/Pi. |
138 | 147 | ||
139 | KA/Pi has more German translation. | 148 | KA/Pi has more German translation. |
140 | 149 | ||
141 | 150 | ||
142 | ********** VERSION 1.9.11 ************ | 151 | ********** VERSION 1.9.11 ************ |
143 | 152 | ||
144 | Fixed several problems in PWM/Pi, like | 153 | Fixed several problems in PWM/Pi, like |
145 | asking the user, if unsaved changed are pending | 154 | asking the user, if unsaved changed are pending |
146 | when closing the app. | 155 | when closing the app. |
147 | And PwM/Pi handles now different texts for the | 156 | And PwM/Pi handles now different texts for the |
148 | fields Description, Username, Password, configurable per category. | 157 | fields Description, Username, Password, configurable per category. |
149 | 158 | ||
150 | Fixed a crash in KO/Pi , when importing/loading vcs files | 159 | Fixed a crash in KO/Pi , when importing/loading vcs files |
151 | which have an entry with an attendee with state: | 160 | which have an entry with an attendee with state: |
152 | NEEDS ACTION | 161 | NEEDS ACTION |
153 | 162 | ||
154 | Fixed some problems in the German translation of OM/Pi, | 163 | Fixed some problems in the German translation of OM/Pi, |
155 | which makes some dialogs not fitting on the screen | 164 | which makes some dialogs not fitting on the screen |
156 | of the Z 5500. | 165 | of the Z 5500. |
157 | 166 | ||
158 | Fixed Qtopia crash, when disabling/deinstalling | 167 | Fixed Qtopia crash, when disabling/deinstalling |
159 | KO/Pi alarm applet. | 168 | KO/Pi alarm applet. |
160 | 169 | ||
161 | Implemented direct KDE<->KA/Pi sync for KA/Pi running | 170 | Implemented direct KDE<->KA/Pi sync for KA/Pi running |
162 | on Linux desktop. | 171 | on Linux desktop. |
163 | 172 | ||
164 | Added feature "remove sync info" to sync menu. | 173 | Added feature "remove sync info" to sync menu. |
165 | 174 | ||
166 | Tweaked the KO/Pi What's next view a bit, added | 175 | Tweaked the KO/Pi What's next view a bit, added |
167 | setting to hide events that are done. | 176 | setting to hide events that are done. |
168 | 177 | ||
169 | Disabled "beam receive enabled" on startup to | 178 | Disabled "beam receive enabled" on startup to |
170 | avoid problems if Fastload is enabled. | 179 | avoid problems if Fastload is enabled. |
171 | Please set "beam receive enabled", | 180 | Please set "beam receive enabled", |
172 | if you want to receive data via IR. | 181 | if you want to receive data via IR. |
173 | 182 | ||
174 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running | 183 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running |
175 | on Linux desktop. | 184 | on Linux desktop. |
176 | 185 | ||
177 | Made in KA/Pi scrolling possible, if details view is selected. | 186 | Made in KA/Pi scrolling possible, if details view is selected. |
178 | (The keyboard focus is set automatically to the search line) | 187 | (The keyboard focus is set automatically to the search line) |
179 | 188 | ||
180 | Fixed a bug in DMT sync, that a new entry in DTM was added | 189 | Fixed a bug in DMT sync, that a new entry in DTM was added |
181 | on every sync to Kx/Pi. | 190 | on every sync to Kx/Pi. |
182 | 191 | ||
183 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. | 192 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. |
184 | 193 | ||
185 | Fixed a bug in DMT sync with todos created in KO/Pi containing | 194 | Fixed a bug in DMT sync with todos created in KO/Pi containing |
186 | non-latin1 characters. | 195 | non-latin1 characters. |
187 | 196 | ||
188 | Rearranged package contents of Sharp-ipks and made all | 197 | Rearranged package contents of Sharp-ipks and made all |
189 | packages installable on SD again. | 198 | packages installable on SD again. |
190 | 199 | ||
191 | Fixed the writing of addressbook data in DTM sync. | 200 | Fixed the writing of addressbook data in DTM sync. |
192 | Empty fields in KA/Pi were not removed. | 201 | Empty fields in KA/Pi were not removed. |
193 | 202 | ||
194 | Added better category handling in KA/Pi: | 203 | Added better category handling in KA/Pi: |
195 | Added item | 204 | Added item |
196 | Edit Categories and | 205 | Edit Categories and |
197 | Manage new categories | 206 | Manage new categories |
198 | to the settings menu. | 207 | to the settings menu. |
199 | Possible to configure a view to display categories. | 208 | Possible to configure a view to display categories. |
200 | 209 | ||
201 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. | 210 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. |
202 | 211 | ||
203 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. | 212 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. |
204 | 213 | ||
205 | ... and many other bugfixes. | 214 | ... and many other bugfixes. |
206 | 215 | ||
207 | ********** VERSION 1.9.10 ************ | 216 | ********** VERSION 1.9.10 ************ |
208 | 217 | ||
209 | Many internal small bugfixes. | 218 | Many internal small bugfixes. |
210 | And fix of the "big" bug in KO/Pi, | 219 | And fix of the "big" bug in KO/Pi, |
211 | that after Syncing the appointments had an offset by several hours. | 220 | that after Syncing the appointments had an offset by several hours. |
212 | That was a problem with the internal timezone setting, | 221 | That was a problem with the internal timezone setting, |
213 | introduced by the changed timezone configuration settings. | 222 | introduced by the changed timezone configuration settings. |
214 | 223 | ||
215 | German translation for OM/Pi is now available. | 224 | German translation for OM/Pi is now available. |
216 | 225 | ||
217 | 226 | ||
218 | ********** VERSION 1.9.9 ************ | 227 | ********** VERSION 1.9.9 ************ |
219 | 228 | ||
220 | KDE-Pim/Pi has a new Member! | 229 | KDE-Pim/Pi has a new Member! |
221 | It is called PWM/Pi (Passwordmanager/platform-independent) | 230 | It is called PWM/Pi (Passwordmanager/platform-independent) |
222 | and it is available for the Zaurus. | 231 | and it is available for the Zaurus. |
223 | It is planned, that it will be available later for Windows. | 232 | It is planned, that it will be available later for Windows. |
224 | (And for Linux, of course). | 233 | (And for Linux, of course). |
225 | It is a port of the Passwordmanager of KDE. | 234 | It is a port of the Passwordmanager of KDE. |
226 | It will need the MicroKDElibs to run. | 235 | It will need the MicroKDElibs to run. |
227 | 236 | ||
228 | Made loading of addressbooks in KA/Pi up to 7 times faster! | 237 | Made loading of addressbooks in KA/Pi up to 7 times faster! |
229 | The bigger your addressbook file, the more starting speed | 238 | The bigger your addressbook file, the more starting speed |
230 | will you gain. (relatively) | 239 | will you gain. (relatively) |
231 | 240 | ||
232 | The Qtopia addressbook connector is now platform independend | 241 | The Qtopia addressbook connector is now platform independend |
233 | as well and should work on any platform for importing/exporting | 242 | as well and should work on any platform for importing/exporting |
234 | Qtopia and Opie XML files. | 243 | Qtopia and Opie XML files. |
235 | 244 | ||
236 | Added a +30min feature to the timezone settings to make | 245 | Added a +30min feature to the timezone settings to make |
237 | KDE-Pim/Pi useable in Australia and other parts on the | 246 | KDE-Pim/Pi useable in Australia and other parts on the |
238 | world with strange timezones ;-) | 247 | world with strange timezones ;-) |
239 | 248 | ||
240 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. | 249 | German "Umlaute" should now be sorted correctly on the Z in KA/Pi. |
241 | 250 | ||
242 | It is now possible to disable the | 251 | It is now possible to disable the |
243 | "receive data via infrared" feature, such that syncing with | 252 | "receive data via infrared" feature, such that syncing with |
244 | Outlook is now possible again with Kx/Pi runing. | 253 | Outlook is now possible again with Kx/Pi runing. |
245 | Please disable it, before syncing Sharp DTM with Outlook. | 254 | Please disable it, before syncing Sharp DTM with Outlook. |
246 | For your convenience, the "receive data via infrared" feature | 255 | For your convenience, the "receive data via infrared" feature |
247 | is disabled automatically, if you sync Kx/Pi with DTM. | 256 | is disabled automatically, if you sync Kx/Pi with DTM. |
248 | You have to enable it again manually after syncing. | 257 | You have to enable it again manually after syncing. |
249 | Enabling this feature makes it impossible to start the | 258 | Enabling this feature makes it impossible to start the |
250 | Sharp DTM apps. If this feature is enabled, you will only get the | 259 | Sharp DTM apps. If this feature is enabled, you will only get the |
251 | alarm notification from KO/Pi and not from the Sharp calendar. | 260 | alarm notification from KO/Pi and not from the Sharp calendar. |
252 | This is very useful if you sync KO/Pi with Sharp DTM, | 261 | This is very useful if you sync KO/Pi with Sharp DTM, |
253 | because after syncing you usually would get notified about | 262 | because after syncing you usually would get notified about |
254 | an alarm by KO/Pi and the Sharp Calendar. | 263 | an alarm by KO/Pi and the Sharp Calendar. |
255 | 264 | ||
256 | Together with the Linux desktop version of KO/Pi | 265 | Together with the Linux desktop version of KO/Pi |
257 | it is now possible to sync KO/Pi on the Zaurus | 266 | it is now possible to sync KO/Pi on the Zaurus |
258 | with the complete KDE-desktop (3.3 or later) | 267 | with the complete KDE-desktop (3.3 or later) |
259 | calendar data easily. | 268 | calendar data easily. |
260 | That makes it possible to sync the Z with one | 269 | That makes it possible to sync the Z with one |
261 | click of a mouse with the KDE-Desktop. | 270 | click of a mouse with the KDE-Desktop. |
262 | This feature it available for all Zaurus platforms KO/Pi | 271 | This feature it available for all Zaurus platforms KO/Pi |
263 | is running on. | 272 | is running on. |
264 | The only thing needed is a running KO/Pi on Linux and | 273 | The only thing needed is a running KO/Pi on Linux and |
265 | a compiled version of the small | 274 | a compiled version of the small |
266 | KDE-Pim/Pi<->KDE-Desktop access command line program, | 275 | KDE-Pim/Pi<->KDE-Desktop access command line program, |
267 | which is in the KDE-Pim/Pi sources available. | 276 | which is in the KDE-Pim/Pi sources available. |
268 | 277 | ||
269 | The "KDE-desktop" syncing feature for KA/Pi will follow | 278 | The "KDE-desktop" syncing feature for KA/Pi will follow |
270 | in the next releases. | 279 | in the next releases. |
271 | 280 | ||
272 | Fixed the vcard export bug, which had the version 1.9.8. | 281 | Fixed the vcard export bug, which had the version 1.9.8. |
273 | 282 | ||
274 | Added missing GERMAN translation to KO/Pi. | 283 | Added missing GERMAN translation to KO/Pi. |
275 | Hi PsionX, could you add the missing french translation?Thx! | 284 | Hi PsionX, could you add the missing french translation?Thx! |
276 | 285 | ||
277 | Translation files for KA/Pi are available as well. | 286 | Translation files for KA/Pi are available as well. |
278 | GERMAN translation will be available in the next release. | 287 | GERMAN translation will be available in the next release. |
279 | PsionX ( yres, you again ;-) ), could you start translating | 288 | PsionX ( yres, you again ;-) ), could you start translating |
280 | KA/Pi? Thx! | 289 | KA/Pi? Thx! |
281 | 290 | ||
282 | You can download the version 1.9.9 at | 291 | You can download the version 1.9.9 at |
283 | 292 | ||
284 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 | 293 | http://sourceforge.net/project/showfiles.php?group_id=104103&package_id=112604 |
285 | 294 | ||
286 | Note: | 295 | Note: |
287 | To run the mail program OM/Pi you need libopenssl. | 296 | To run the mail program OM/Pi you need libopenssl. |
288 | A link to a download loaction is available at | 297 | A link to a download loaction is available at |
289 | ZSI at www.killefiz.de | 298 | ZSI at www.killefiz.de |
290 | 299 | ||
291 | 300 | ||
292 | ********** VERSION 1.9.8 ************ | 301 | ********** VERSION 1.9.8 ************ |
293 | 302 | ||
294 | Fixed character decoding in OM/Pi. | 303 | Fixed character decoding in OM/Pi. |
295 | (e.g. German "Umlaute" were not displayed properly.) | 304 | (e.g. German "Umlaute" were not displayed properly.) |
296 | 305 | ||
297 | Made is possible to reparent todos in KO/Pi. | 306 | Made is possible to reparent todos in KO/Pi. |
298 | Use contextmenu or keys (look at Help-Keys + Colors) for that. | 307 | Use contextmenu or keys (look at Help-Keys + Colors) for that. |
299 | 308 | ||
300 | Added the missing Sync-Howto and WhatsNew to the packages. | 309 | Added the missing Sync-Howto and WhatsNew to the packages. |
301 | 310 | ||
302 | KO/Pi on Linux desktop can now sync with KDE desktop. | 311 | KO/Pi on Linux desktop can now sync with KDE desktop. |
303 | That means: When using KO/Pi on Linux desktop for syncing with | 312 | That means: When using KO/Pi on Linux desktop for syncing with |
304 | KDE desktop and the Zaurus, the Zaurus can be synced now | 313 | KDE desktop and the Zaurus, the Zaurus can be synced now |
305 | with all KDE-Calendar resources, not only with one local file. | 314 | with all KDE-Calendar resources, not only with one local file. |
306 | (That makes it possible to sync the Zaurus with the | 315 | (That makes it possible to sync the Zaurus with the |
307 | calendar data on a Kolab server) | 316 | calendar data on a Kolab server) |
308 | 317 | ||
309 | KA/Pi syncing with KDE desktop will be available in the next version. | 318 | KA/Pi syncing with KDE desktop will be available in the next version. |
310 | 319 | ||
311 | 320 | ||
312 | ********** VERSION 1.9.7 ************ | 321 | ********** VERSION 1.9.7 ************ |
313 | 322 | ||
314 | KO/Pi - KA/Pi on Windows: | 323 | KO/Pi - KA/Pi on Windows: |
315 | Now a directory can be defined by the user, where the | 324 | Now a directory can be defined by the user, where the |
316 | application/config data should be saved. | 325 | application/config data should be saved. |
317 | Define your desired path in the evironment variable | 326 | Define your desired path in the evironment variable |
318 | MICROKDEHOME | 327 | MICROKDEHOME |
319 | before starting KO/Pi or KA/Pi. | 328 | before starting KO/Pi or KA/Pi. |
320 | 329 | ||
321 | An easy Kx/Pi to Kx/Pi syncing is now possible | 330 | An easy Kx/Pi to Kx/Pi syncing is now possible |
322 | (it is called Pi-Sync) via network. | 331 | (it is called Pi-Sync) via network. |
323 | Please look at the Sync Howto. | 332 | Please look at the Sync Howto. |
324 | 333 | ||
325 | Exporting of calendar data and contacts to mobile phones is now possible. | 334 | Exporting of calendar data and contacts to mobile phones is now possible. |
326 | The SyncHowto is updated with information howto | 335 | The SyncHowto is updated with information howto |
327 | access/sync mobile phones. | 336 | access/sync mobile phones. |
328 | Please look at the Sync Howto. | 337 | Please look at the Sync Howto. |
329 | 338 | ||
330 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. | 339 | Now KO/Pi and KA/Pi on the Zaurus can receive data via infrared directly. |
331 | Please disable Fastload for the original contact/calendar applications | 340 | Please disable Fastload for the original contact/calendar applications |
332 | and close them. | 341 | and close them. |
333 | KO/Pi and KA/Pi must be running in order to receive the data. | 342 | KO/Pi and KA/Pi must be running in order to receive the data. |
334 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) | 343 | (KO/Pi and KA/Pi are always running if Fastload for them is enabled!) |
335 | 344 | ||
336 | In the KA/Pi details view are now the preferred tel. numbers displayed on top | 345 | In the KA/Pi details view are now the preferred tel. numbers displayed on top |
337 | of the other data ( emails/tel.numbers/addresses) | 346 | of the other data ( emails/tel.numbers/addresses) |
338 | 347 | ||
339 | Fixed some syncing problems in KA/Pi. | 348 | Fixed some syncing problems in KA/Pi. |
340 | 349 | ||
341 | Added font settings for the KA/Pi details view. | 350 | Added font settings for the KA/Pi details view. |
342 | Added fields "children's name" and "gender" to KA/Pi. | 351 | Added fields "children's name" and "gender" to KA/Pi. |
343 | 352 | ||
344 | Made searching in KA/Pi better: | 353 | Made searching in KA/Pi better: |
345 | Now the first item in a view is selected after a search automatically and | 354 | Now the first item in a view is selected after a search automatically and |
346 | the views can be scrolled up/down when the search input field has the keyboard focus. | 355 | the views can be scrolled up/down when the search input field has the keyboard focus. |
347 | 356 | ||
348 | And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. | 357 | And, of course, fixed a bunch of reported bugs in KO/Pi and KA/Pi. |
349 | 358 | ||
350 | 359 | ||
351 | ********** VERSION 1.9.6 ************ | 360 | ********** VERSION 1.9.6 ************ |
352 | 361 | ||
353 | Changes in the external application communication on the Zaurus | 362 | Changes in the external application communication on the Zaurus |
354 | in order to use less RAM when the apps are running. | 363 | in order to use less RAM when the apps are running. |
355 | First syncing of addressbooks (KA/Pi) is possible. | 364 | First syncing of addressbooks (KA/Pi) is possible. |
356 | 365 | ||
357 | 366 | ||
358 | ********** VERSION 1.9.5a ************ | 367 | ********** VERSION 1.9.5a ************ |
359 | 368 | ||
360 | Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. | 369 | Fixed a bug in KO/Pi in the SharpDTM sync of version 1.9.5. |
361 | Fixed some small bugs. | 370 | Fixed some small bugs. |
362 | KA/Pi shows now the birthday in summary view. | 371 | KA/Pi shows now the birthday in summary view. |
363 | Now OM/Pi and KA/Pi are using the date format defined in KO/Pi | 372 | Now OM/Pi and KA/Pi are using the date format defined in KO/Pi |
364 | for displaying dates. | 373 | for displaying dates. |
365 | 374 | ||
366 | 375 | ||
367 | ********** VERSION 1.9.5 ************ | 376 | ********** VERSION 1.9.5 ************ |
368 | 377 | ||
369 | There is still no Addressbook syncing! | 378 | There is still no Addressbook syncing! |
370 | 379 | ||
371 | New in 1.9.5: | 380 | New in 1.9.5: |
372 | 381 | ||
373 | Many bugfixes. | 382 | Many bugfixes. |
374 | Better searching in KA/Pi. | 383 | Better searching in KA/Pi. |
375 | You can configure in KA/Pi if you want to search only after | 384 | You can configure in KA/Pi if you want to search only after |
376 | <return> key pressed. | 385 | <return> key pressed. |
377 | 386 | ||
378 | Better mail downloading in OM/Pi. | 387 | Better mail downloading in OM/Pi. |
379 | 388 | ||
380 | First experimental alpha version of sync of KO/Pi with mobile phones. | 389 | First experimental alpha version of sync of KO/Pi with mobile phones. |
381 | See gammu documentation for supported phones. | 390 | See gammu documentation for supported phones. |
382 | 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. | 391 | 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. |
383 | Quick hint how to use: | 392 | Quick hint how to use: |
384 | NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! | 393 | NOTE: MOBILE PHONE SYNC IS EXPERIMENTAL! |
385 | Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. | 394 | Install kammu_1.9.5_arm.ipk , libbluetooth and libsdp. |
386 | Create syncprofile - mobile device | 395 | Create syncprofile - mobile device |
387 | Remove entry for model. (Leave empty ). | 396 | Remove entry for model. (Leave empty ). |
388 | Enable infrared on Zaurus and your Phone. | 397 | Enable infrared on Zaurus and your Phone. |
389 | Sync. | 398 | Sync. |
390 | To get a more detailed log, start kopi from konsole. | 399 | To get a more detailed log, start kopi from konsole. |
391 | 400 | ||
392 | ********** VERSION 1.9.4 ************ | 401 | ********** VERSION 1.9.4 ************ |
393 | 402 | ||
394 | This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. | 403 | This is the version 1.9.4 of KDE-Pim/Pi for the Zaurus. |
395 | 404 | ||
396 | WARNING: | 405 | WARNING: |
397 | PLEASE BACKUP ALL YOUR DATA! | 406 | PLEASE BACKUP ALL YOUR DATA! |
398 | We have changed a lot and maybe there are some unknown problems. | 407 | We have changed a lot and maybe there are some unknown problems. |
399 | 408 | ||
400 | SYNC HANDLING HAS CHANGED! | 409 | SYNC HANDLING HAS CHANGED! |
401 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. | 410 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. |
402 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). | 411 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). |
403 | 412 | ||
404 | You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. | 413 | You need the kmicrokdelibs_1.9.4_arm.ipk as a base for the other programs. |
405 | 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. | 414 | 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. |
406 | 415 | ||
407 | As programs are available: | 416 | As programs are available: |
408 | KO/Pi (korganizer ipk) - a calendar program. | 417 | KO/Pi (korganizer ipk) - a calendar program. |
409 | KA/Pi (kaddressbook ipk ) - an addressbook | 418 | KA/Pi (kaddressbook ipk ) - an addressbook |
410 | OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. | 419 | OM/Pi (kopiemail ipk ) an email program with pop/smtp and IMAP support. |
411 | 420 | ||
412 | An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. | 421 | An alarm notification program ( korganizer-alarm ipk ) for KO/Pi that notifies you about alarms, even if the Zaurus is in suspend mode. |
413 | (If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) | 422 | (If you do not see an icon in the taskbar after installing korganizer-alarm, please restart Qtopia) |
414 | 423 | ||
415 | All the applications are installed in a "Pim" TAB. | 424 | All the applications are installed in a "Pim" TAB. |
416 | 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 | 425 | 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 |
417 | 426 | ||
418 | All the application are integrated. | 427 | All the application are integrated. |
419 | 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. | 428 | 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. |
420 | 429 | ||
421 | HINT: | 430 | HINT: |
422 | If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. | 431 | If you install KPhone/Pi 0.9.7, it will be called, if you click in KA/Pi on a phone number. |
423 | 432 | ||
424 | What's new? | 433 | What's new? |
425 | 434 | ||
426 | SYNC HANDLING HAS CHANGED! | 435 | SYNC HANDLING HAS CHANGED! |
427 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. | 436 | Such that, if you sync now with an already synded device, you will duplicated entries after the first sync. |
428 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). | 437 | (This change was introduced to make it possible to sync with mobile phones, which will be available later (maybe in 4 weeks). |
429 | 438 | ||
430 | New in OM/Pi: | 439 | New in OM/Pi: |
431 | 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. | 440 | 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. |
432 | 441 | ||
433 | New in KO/Pi: | 442 | New in KO/Pi: |
434 | French is now available for KO/Pi. | 443 | French is now available for KO/Pi. |
435 | Choose menu:Actions - Configure:TAB locale | 444 | Choose menu:Actions - Configure:TAB locale |
436 | Syncing has changed. | 445 | Syncing has changed. |
437 | Phone sync available soon. | 446 | Phone sync available soon. |
438 | Not much changes, I cannot remember them ... | 447 | Not much changes, I cannot remember them ... |
439 | 448 | ||
440 | New in KA/Pi: | 449 | New in KA/Pi: |
441 | Beaming possible. | 450 | Beaming possible. |
442 | Sharp DTM readonly access possible( create a new DTM resource ); | 451 | Sharp DTM readonly access possible( create a new DTM resource ); |
443 | Better searching possible. | 452 | Better searching possible. |
444 | Search is performed only after pressing the return key. | 453 | Search is performed only after pressing the return key. |
445 | Use wildcard * to specify parts of a name. | 454 | Use wildcard * to specify parts of a name. |
446 | 455 | ||
447 | 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 * . | 456 | 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 * . |
448 | 457 | ||
449 | A big improvement is the new management of the contact access. | 458 | A big improvement is the new management of the contact access. |
450 | In version 1.9.3, every application was using their own addressbook access data. | 459 | In version 1.9.3, every application was using their own addressbook access data. |
451 | That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. | 460 | That means, the addressbook was loaded up to three times in the memory, when accessed by KA/Pi, KO/Pi and OM/Pi. |
452 | That was wasting of memory, if you had several hundreds of contacts. | 461 | That was wasting of memory, if you had several hundreds of contacts. |
453 | 462 | ||
454 | Now only KA/Pi accesses the addressbook. | 463 | Now only KA/Pi accesses the addressbook. |
455 | 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. | 464 | 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. |
456 | If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. | 465 | If you click on an attendee in a meeting, its contact data is displayed in KA/Pi directly. |
457 | That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. | 466 | That means, if KO/Pi or OM/Pi want to access contact data, KA/Pi is started first. |
458 | 467 | ||
459 | New in the KO/Pi alarm applet: | 468 | New in the KO/Pi alarm applet: |
460 | Configure your own timer popup menu! | 469 | Configure your own timer popup menu! |
461 | (Text and minutes for timer countdown) | 470 | (Text and minutes for timer countdown) |
462 | Just edit the file | 471 | Just edit the file |
463 | (yourhomedir)/.kopialarmtimerrc | 472 | (yourhomedir)/.kopialarmtimerrc |
464 | and start/stop a timer to get a new menu with the data of this file. | 473 | and start/stop a timer to get a new menu with the data of this file. |
465 | 474 | ||
466 | ********** VERSION 1.9.3 ************ | 475 | ********** VERSION 1.9.3 ************ |
467 | 1) | 476 | 1) |
468 | Now KO/Pi on Windows imports directly the calendar data of | 477 | Now KO/Pi on Windows imports directly the calendar data of |
469 | an installed Outlook. Should work with OL version >= 2000. | 478 | an installed Outlook. Should work with OL version >= 2000. |
470 | 479 | ||
471 | ********** VERSION 1.9.2 ************ | 480 | ********** VERSION 1.9.2 ************ |
472 | 1) | 481 | 1) |
473 | KDE-Pim/Pi has got a new member: | 482 | KDE-Pim/Pi has got a new member: |
474 | KmicroMail (KM/Pi) is a mail program, | 483 | KmicroMail (KM/Pi) is a mail program, |
475 | which can handle IMAP and POP mail access. | 484 | which can handle IMAP and POP mail access. |
476 | It is based on Opie-Mail v3. | 485 | It is based on Opie-Mail v3. |
477 | All dependencies to the Opie libraries ar removed, | 486 | All dependencies to the Opie libraries ar removed, |
478 | such that no additional Opie lib is needed. | 487 | such that no additional Opie lib is needed. |
479 | It is already integrated in KO/Pi and KA/Pi. | 488 | It is already integrated in KO/Pi and KA/Pi. |
480 | It it now available for the Zaurus,probably it | 489 | It it now available for the Zaurus,probably it |
481 | will be available for other platforms later. | 490 | will be available for other platforms later. |
482 | Hint: | 491 | Hint: |
483 | Create your own contact (name + email) | 492 | Create your own contact (name + email) |
484 | in KA/Pi, select this contact and choose menu: | 493 | in KA/Pi, select this contact and choose menu: |
485 | Settings - Set Who Am I. | 494 | Settings - Set Who Am I. |
486 | Now the settings of this contact are used as | 495 | Now the settings of this contact are used as |
487 | the sender data in KM/Pi. | 496 | the sender data in KM/Pi. |
488 | 2) | 497 | 2) |
489 | KDE-Pim/Pi is split up in five different | 498 | KDE-Pim/Pi is split up in five different |
490 | packages now precompiled for Sharp Zaurus: | 499 | packages now precompiled for Sharp Zaurus: |
491 | --kmicrokdelibs_1.9.2_arm.ipk | 500 | --kmicrokdelibs_1.9.2_arm.ipk |
492 | The libs are needed for any | 501 | The libs are needed for any |
493 | of the following programs: | 502 | of the following programs: |
494 | --kaddressbook_1.9.2_arm.ipk | 503 | --kaddressbook_1.9.2_arm.ipk |
495 | --kmicromail_1.9.2_arm.ipk | 504 | --kmicromail_1.9.2_arm.ipk |
496 | --korganizer_1.9.2_arm.ipk | 505 | --korganizer_1.9.2_arm.ipk |
497 | Independ from that, there is the alarm applet | 506 | Independ from that, there is the alarm applet |
498 | available for KO/Pi, which also offers | 507 | available for KO/Pi, which also offers |
499 | quick access for a new mail or | 508 | quick access for a new mail or |
500 | showing the addressbook.: | 509 | showing the addressbook.: |
501 | --korganizer-alarm_1.9.2_arm.ipk | 510 | --korganizer-alarm_1.9.2_arm.ipk |
502 | Independend means, that the alarm applet | 511 | Independend means, that the alarm applet |
503 | does not need any of the libs or programs above to run. | 512 | does not need any of the libs or programs above to run. |
504 | But it would be quite useless without these programs. | 513 | But it would be quite useless without these programs. |
505 | NOTE: | 514 | NOTE: |
506 | If you get a | 515 | If you get a |
507 | "This application depends on other programs" | 516 | "This application depends on other programs" |
508 | during installation of | 517 | during installation of |
509 | --kmicrokdelibs_1.9.2_arm.ipk | 518 | --kmicrokdelibs_1.9.2_arm.ipk |
510 | you probably do not have to care about that. | 519 | you probably do not have to care about that. |
511 | kmicrokdelibs_1.9.2 will come with some | 520 | kmicrokdelibs_1.9.2 will come with some |
512 | resource plugins, which needs additional libraries. | 521 | resource plugins, which needs additional libraries. |
513 | (E.g. libopie1, if you want to use the | 522 | (E.g. libopie1, if you want to use the |
514 | opie resource connector in KA/Pi). | 523 | opie resource connector in KA/Pi). |
515 | If you do not have this libraries installed, | 524 | If you do not have this libraries installed, |
516 | you simply cannot use the resource. | 525 | you simply cannot use the resource. |
517 | To make it clear: | 526 | To make it clear: |
518 | If the libraries are missing, the applications | 527 | If the libraries are missing, the applications |
519 | using kmicrokdelibs will start, | 528 | using kmicrokdelibs will start, |
520 | because the resources are plugins. | 529 | because the resources are plugins. |
521 | 3) | 530 | 3) |
522 | KO/Pi and friends are now installable on SD-Card! | 531 | KO/Pi and friends are now installable on SD-Card! |
523 | It is recommended to install all libs and apps | 532 | It is recommended to install all libs and apps |
524 | on the SD card or all in the internal storage. | 533 | on the SD card or all in the internal storage. |
525 | There may be problems, if this is mixed. | 534 | There may be problems, if this is mixed. |
526 | 4) | 535 | 4) |
527 | Fixed two bugs in the alarm notification on Windows. | 536 | Fixed two bugs in the alarm notification on Windows. |
528 | 5) | 537 | 5) |
529 | Great improvement! | 538 | Great improvement! |
530 | KO/Pi uses now the latest version of libical. | 539 | KO/Pi uses now the latest version of libical. |
531 | Libical is the library which actually reads | 540 | Libical is the library which actually reads |
532 | the calendar files and extract the data from it. | 541 | the calendar files and extract the data from it. |
533 | With the old version, there were problems | 542 | With the old version, there were problems |
534 | (crashes or program hangs) when licical did read | 543 | (crashes or program hangs) when licical did read |
535 | files, which were not stored from KO/Pi. | 544 | files, which were not stored from KO/Pi. |
536 | I do not know, if the new libical works perfect, | 545 | I do not know, if the new libical works perfect, |
537 | but actually it works much better than | 546 | but actually it works much better than |
538 | the old version. | 547 | the old version. |
539 | There are no problems with compatibility with | 548 | There are no problems with compatibility with |
540 | old calendar files of KO/Pi, of course! | 549 | old calendar files of KO/Pi, of course! |
541 | 6) | 550 | 6) |
542 | New in KA/Pi: | 551 | New in KA/Pi: |
543 | Opie addressbook resource connector available! | 552 | Opie addressbook resource connector available! |
544 | You will need libopie1 and the opie addressbook, | 553 | You will need libopie1 and the opie addressbook, |
545 | of course. | 554 | of course. |
546 | With the Opie addressbook resource connector, | 555 | With the Opie addressbook resource connector, |
547 | you can access the Opie addressbook readonly in KA/Pi. | 556 | you can access the Opie addressbook readonly in KA/Pi. |
548 | If you want to edit or import the data into KA/Pi, | 557 | If you want to edit or import the data into KA/Pi, |
549 | do this: | 558 | do this: |
550 | a) Create an Opie resource. | 559 | a) Create an Opie resource. |
551 | (Menu: Settings-Configure Resources). | 560 | (Menu: Settings-Configure Resources). |
552 | After configuration and restarting KA/Pi you should see | 561 | After configuration and restarting KA/Pi you should see |
553 | the Opie contacts in KA/Pi. | 562 | the Opie contacts in KA/Pi. |
554 | b) Select some or all Opie contacts. | 563 | b) Select some or all Opie contacts. |
555 | (NOTE: +++++ | 564 | (NOTE: +++++ |
556 | To know exactly, what contacts are Opie contacts, | 565 | To know exactly, what contacts are Opie contacts, |
557 | do this: Choose menu: | 566 | do this: Choose menu: |
558 | View-Modify View - TAB Fields. | 567 | View-Modify View - TAB Fields. |
559 | Select in the above list "Resource" and click | 568 | Select in the above list "Resource" and click |
560 | down arrow to add it to the "Selected fields". | 569 | down arrow to add it to the "Selected fields". |
561 | Click OK. | 570 | Click OK. |
562 | Now you have a new column "Resource" in your list, | 571 | Now you have a new column "Resource" in your list, |
563 | where you can see, what an Opie resource is. | 572 | where you can see, what an Opie resource is. |
564 | ++++ NOTE end.) | 573 | ++++ NOTE end.) |
565 | Ok, we do have now some Opie contacts seleted. | 574 | Ok, we do have now some Opie contacts seleted. |
566 | (Use SHIFT or CTRL key in order to multiple select). | 575 | (Use SHIFT or CTRL key in order to multiple select). |
567 | c) Choose menu: Edit-Copy. | 576 | c) Choose menu: Edit-Copy. |
568 | d) Choose menu: Edit-Paste. | 577 | d) Choose menu: Edit-Paste. |
569 | e) Select the resource, you want to add the contacts to. | 578 | e) Select the resource, you want to add the contacts to. |
570 | Congrats! Now you have read/write access to the copied | 579 | Congrats! Now you have read/write access to the copied |
571 | opie contacts as "real" KA/Pi contacts. | 580 | opie contacts as "real" KA/Pi contacts. |
572 | 581 | ||
573 | 582 | ||
574 | ********** VERSION 1.9.1 ************ | 583 | ********** VERSION 1.9.1 ************ |
575 | 1) | 584 | 1) |
576 | +++ IMPORTANT 1 +++ | 585 | +++ IMPORTANT 1 +++ |
577 | 586 | ||
578 | The storing place of the default calendar | 587 | The storing place of the default calendar |
579 | file has changed! | 588 | file has changed! |
580 | The default calendar file was | 589 | The default calendar file was |
581 | Applications/korganizer/mycalendar.ics | 590 | Applications/korganizer/mycalendar.ics |
582 | on Zaurus and | 591 | on Zaurus and |
583 | (yourHomeDir)/korganizer/mycalendar.ics | 592 | (yourHomeDir)/korganizer/mycalendar.ics |
584 | on Windows/Linux desktop. Now it is | 593 | on Windows/Linux desktop. Now it is |
585 | (yourHomeDir)/kdepim/korganizer/mycalendar.ics | 594 | (yourHomeDir)/kdepim/korganizer/mycalendar.ics |
586 | on Zaurus, Windows and Linux. | 595 | on Zaurus, Windows and Linux. |
587 | To load the old file, choose menu | 596 | To load the old file, choose menu |
588 | File-Load calendar backup. | 597 | File-Load calendar backup. |
589 | (It should be loaded automatically | 598 | (It should be loaded automatically |
590 | at startup with a warning message displayed). | 599 | at startup with a warning message displayed). |
591 | The place of the configuration file has changed too. | 600 | The place of the configuration file has changed too. |
592 | If you want to use your old KO/Pi config, | 601 | If you want to use your old KO/Pi config, |
593 | copy it to | 602 | copy it to |
594 | (yourHomeDir)/kdepim/config/korganizerrc | 603 | (yourHomeDir)/kdepim/config/korganizerrc |
595 | Please read VERSION 1.9.0 - topic 3) as well! | 604 | Please read VERSION 1.9.0 - topic 3) as well! |
596 | 605 | ||
597 | +++ IMPORTANT 2 +++ | 606 | +++ IMPORTANT 2 +++ |
598 | 607 | ||
599 | Because of the new paths, you will need | 608 | Because of the new paths, you will need |
600 | a new version of the KO/Pi alarm applet | 609 | a new version of the KO/Pi alarm applet |
601 | for Zaurus. | 610 | for Zaurus. |
602 | Use version >= 1.9.1 | 611 | Use version >= 1.9.1 |
603 | 612 | ||
604 | 2) | 613 | 2) |
605 | Now the QWhat'sThis Icon works for items | 614 | Now the QWhat'sThis Icon works for items |
606 | in the month view as well. | 615 | in the month view as well. |
607 | (See VERSION 1.7.8 Topic 1) ). | 616 | (See VERSION 1.7.8 Topic 1) ). |
608 | 3) | 617 | 3) |
609 | You can import birtsdays/anniversaries | 618 | You can import birtsdays/anniversaries |
610 | from KA/Pi into KO/Pi. | 619 | from KA/Pi into KO/Pi. |
611 | Choose menu File-Import birthdays. | 620 | Choose menu File-Import birthdays. |
612 | If you import twice, already imported items | 621 | If you import twice, already imported items |
613 | will not be imported again, if they | 622 | will not be imported again, if they |
614 | have not been changed in KO/Pi. | 623 | have not been changed in KO/Pi. |
615 | 4) | 624 | 4) |
616 | When syncing with sharp DTM, now a progress | 625 | When syncing with sharp DTM, now a progress |
617 | is shown, when the data is written back. | 626 | is shown, when the data is written back. |
618 | If there is much data in KO/Pi and no data | 627 | If there is much data in KO/Pi and no data |
619 | in DTM, that can take a long time. | 628 | in DTM, that can take a long time. |
620 | (But only for the first time ). | 629 | (But only for the first time ). |
621 | 5) | 630 | 5) |
622 | In the search dialog, you can search | 631 | In the search dialog, you can search |
623 | now for the name/email of an attendee | 632 | now for the name/email of an attendee |
624 | of an event/todo. | 633 | of an event/todo. |
625 | To get more space for displaying | 634 | To get more space for displaying |
626 | search results, the buttons | 635 | search results, the buttons |
627 | for "search" and "close" on the | 636 | for "search" and "close" on the |
628 | bottom are removed in the PDA version. | 637 | bottom are removed in the PDA version. |
629 | You have to click OK in the top right | 638 | You have to click OK in the top right |
630 | corner to do a search. | 639 | corner to do a search. |
631 | 6) | 640 | 6) |
632 | Now it is possible to disable the displaying | 641 | Now it is possible to disable the displaying |
633 | of todo items in the Allday part of the Agenda. | 642 | of todo items in the Allday part of the Agenda. |
634 | Choose Menu Action-Configure, | 643 | Choose Menu Action-Configure, |
635 | TAB Todo View, checkbox | 644 | TAB Todo View, checkbox |
636 | "Allday Agenda view shows todos" | 645 | "Allday Agenda view shows todos" |
637 | 7) | 646 | 7) |
638 | If FastLoad is enabled, now the settings and the | 647 | If FastLoad is enabled, now the settings and the |
639 | calendar data are saved, when KO/Pi is closed. | 648 | calendar data are saved, when KO/Pi is closed. |
640 | (If no Fastload is enabled, KO/Pi saves | 649 | (If no Fastload is enabled, KO/Pi saves |
641 | the data as well, of course) | 650 | the data as well, of course) |
642 | 8) | 651 | 8) |
643 | The Agenda View has a minimize-splitter now, | 652 | The Agenda View has a minimize-splitter now, |
644 | such that the height of the allday part can be | 653 | such that the height of the allday part can be |
645 | changed quickly. | 654 | changed quickly. |
646 | 655 | ||
647 | ********** VERSION 1.9.0 ************ | 656 | ********** VERSION 1.9.0 ************ |
648 | 1) | 657 | 1) |
649 | KO/Pi is now merged with the new microKDE from KA/Pi. | 658 | KO/Pi is now merged with the new microKDE from KA/Pi. |
650 | KO/Pi accesses now KA/Pi as the addressbook. | 659 | KO/Pi accesses now KA/Pi as the addressbook. |
651 | The other ddressbook-plugins are not working any longer. | 660 | The other ddressbook-plugins are not working any longer. |
652 | (It is planned, that later KA/Pi itself uses these plugins) | 661 | (It is planned, that later KA/Pi itself uses these plugins) |
653 | New versions of KO/Pi are only available | 662 | New versions of KO/Pi are only available |
654 | together with KA/Pi as the KDE-Pim/Pi package. | 663 | together with KA/Pi as the KDE-Pim/Pi package. |
655 | 2) | 664 | 2) |
656 | If you click on an attendee of a meeting in the | 665 | If you click on an attendee of a meeting in the |
657 | event viewer, a detailed summary of the | 666 | event viewer, a detailed summary of the |
658 | attendee is shown. | 667 | attendee is shown. |
659 | 3) | 668 | 3) |
660 | The place of the configuration file has changed. | 669 | The place of the configuration file has changed. |
661 | If you want to use your old KO/Pi config, copy | 670 | If you want to use your old KO/Pi config, copy |
662 | Applications/korganizer/config_korganizerrc | 671 | Applications/korganizer/config_korganizerrc |
663 | to | 672 | to |
664 | Applications/korganizer/config/korganizerrc | 673 | Applications/korganizer/config/korganizerrc |
665 | 674 | ||
666 | ********** VERSION 1.7.8 ************ | 675 | ********** VERSION 1.7.8 ************ |
667 | 1) | 676 | 1) |
668 | Now the QWhat'sThis ist working. | 677 | Now the QWhat'sThis ist working. |
669 | Enable the QWhat'sThis icon in the toolbar. | 678 | Enable the QWhat'sThis icon in the toolbar. |
670 | (You have to restart to reload the changed toolbar config). | 679 | (You have to restart to reload the changed toolbar config). |
671 | Now click on the QWhat'sThis Icon | 680 | Now click on the QWhat'sThis Icon |
672 | in the top right corner of KO/Pi. | 681 | in the top right corner of KO/Pi. |
673 | Then click on an item in the Agenda View: | 682 | Then click on an item in the Agenda View: |
674 | You will get a detailed display of the items content. | 683 | You will get a detailed display of the items content. |
675 | 2) | 684 | 2) |
676 | Some other very minor changes. | 685 | Some other very minor changes. |
677 | But I have forgotten the details ... | 686 | But I have forgotten the details ... |
678 | For that reason I start this log here: | 687 | For that reason I start this log here: |
679 | To document my changes, when I am doing it. | 688 | To document my changes, when I am doing it. |
680 | 689 | ||
681 | ********** VERSION 1.7.7 ************ | 690 | ********** VERSION 1.7.7 ************ |
682 | Stable Version of KO/Pi | 691 | Stable Version of KO/Pi |
diff --git a/kaddressbook/kaddressbookview.cpp b/kaddressbook/kaddressbookview.cpp index 8062354..424d52a 100644 --- a/kaddressbook/kaddressbookview.cpp +++ b/kaddressbook/kaddressbookview.cpp | |||
@@ -1,166 +1,170 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef KAB_EMBEDDED | 24 | #ifndef KAB_EMBEDDED |
25 | #include <qapplication.h> | 25 | #include <qapplication.h> |
26 | 26 | ||
27 | #include <kabc/distributionlistdialog.h> | 27 | #include <kabc/distributionlistdialog.h> |
28 | #include <kconfig.h> | 28 | #include <kconfig.h> |
29 | #include <klocale.h> | 29 | #include <klocale.h> |
30 | 30 | ||
31 | #include "viewmanager.h" | 31 | #include "viewmanager.h" |
32 | 32 | ||
33 | #endif //KAB_EMBEDDED | 33 | #endif //KAB_EMBEDDED |
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | 35 | ||
36 | #include <kabc/distributionlistdialog.h> | 36 | #include <kabc/distributionlistdialog.h> |
37 | #include <kabc/addressbook.h> | 37 | #include <kabc/addressbook.h> |
38 | #include <kdebug.h> | 38 | #include <kdebug.h> |
39 | 39 | ||
40 | #include "kaddressbookview.h" | 40 | #include "kaddressbookview.h" |
41 | 41 | ||
42 | KAddressBookView::KAddressBookView( KABC::AddressBook *ab, QWidget *parent, | 42 | KAddressBookView::KAddressBookView( KABC::AddressBook *ab, QWidget *parent, |
43 | const char *name ) | 43 | const char *name ) |
44 | : QWidget( parent, name ), mAddressBook( ab ), mFieldList() | 44 | : QWidget( parent, name ), mAddressBook( ab ), mFieldList() |
45 | { | 45 | { |
46 | 46 | ||
47 | initGUI(); | 47 | initGUI(); |
48 | } | 48 | } |
49 | 49 | ||
50 | KAddressBookView::~KAddressBookView() | 50 | KAddressBookView::~KAddressBookView() |
51 | { | 51 | { |
52 | kdDebug(5720) << "KAddressBookView::~KAddressBookView: destroying - " | 52 | kdDebug(5720) << "KAddressBookView::~KAddressBookView: destroying - " |
53 | << name() << endl; | 53 | << name() << endl; |
54 | } | 54 | } |
55 | 55 | ||
56 | void KAddressBookView::readConfig( KConfig *config ) | 56 | void KAddressBookView::readConfig( KConfig *config ) |
57 | { | 57 | { |
58 | mFieldList = KABC::Field::restoreFields( config, "KABCFields" ); | 58 | mFieldList = KABC::Field::restoreFields( config, "KABCFields" ); |
59 | 59 | ||
60 | if ( mFieldList.isEmpty() ) | 60 | if ( mFieldList.isEmpty() ) |
61 | mFieldList = KABC::Field::defaultFields(); | 61 | mFieldList = KABC::Field::defaultFields(); |
62 | 62 | ||
63 | mDefaultFilterType = (DefaultFilterType)config->readNumEntry( "DefaultFilterType", 1 ); | 63 | mDefaultFilterType = (DefaultFilterType)config->readNumEntry( "DefaultFilterType", 1 ); |
64 | mDefaultFilterName = config->readEntry( "DefaultFilterName", QString::null ); | 64 | mDefaultFilterName = config->readEntry( "DefaultFilterName", QString::null ); |
65 | } | 65 | } |
66 | 66 | ||
67 | void KAddressBookView::writeConfig( KConfig* ) | 67 | void KAddressBookView::writeConfig( KConfig* ) |
68 | { | 68 | { |
69 | // Most of writing the config is handled by the ConfigureViewDialog | 69 | // Most of writing the config is handled by the ConfigureViewDialog |
70 | } | 70 | } |
71 | 71 | ||
72 | QString KAddressBookView::selectedEmails() | 72 | QString KAddressBookView::selectedEmails() |
73 | { | 73 | { |
74 | bool first = true; | 74 | bool first = true; |
75 | QString emailAddrs; | 75 | QString emailAddrs; |
76 | QStringList uidList = selectedUids(); | 76 | QStringList uidList = selectedUids(); |
77 | KABC::Addressee addr; | 77 | KABC::Addressee addr; |
78 | QString email; | 78 | QString email; |
79 | 79 | ||
80 | QStringList::Iterator it; | 80 | QStringList::Iterator it; |
81 | for ( it = uidList.begin(); it != uidList.end(); ++it ) { | 81 | for ( it = uidList.begin(); it != uidList.end(); ++it ) { |
82 | addr = mAddressBook->findByUid( *it ); | 82 | addr = mAddressBook->findByUid( *it ); |
83 | 83 | ||
84 | if ( !addr.isEmpty() ) { | 84 | if ( !addr.isEmpty() ) { |
85 | QString m = QString::null; | 85 | QString m = QString::null; |
86 | 86 | ||
87 | if ( addr.emails().count() > 1 ) | 87 | if ( addr.emails().count() > 1 ) |
88 | m = KABC::EmailSelector::getEmail( addr.emails(), addr.preferredEmail(), this ); | 88 | m = KABC::EmailSelector::getEmail( addr.emails(), addr.preferredEmail(), this ); |
89 | 89 | ||
90 | email = addr.fullEmail( m ); | 90 | email = addr.fullEmail( m ); |
91 | 91 | ||
92 | if ( !first ) | 92 | if ( !first ) |
93 | emailAddrs += ", "; | 93 | emailAddrs += ", "; |
94 | else | 94 | else |
95 | first = false; | 95 | first = false; |
96 | 96 | ||
97 | emailAddrs += email; | 97 | emailAddrs += email; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | return emailAddrs; | 101 | return emailAddrs; |
102 | } | 102 | } |
103 | 103 | ||
104 | KABC::Addressee::List KAddressBookView::addressees() | 104 | KABC::Addressee::List KAddressBookView::addressees() |
105 | { | 105 | { |
106 | KABC::Addressee::List addresseeList; | 106 | KABC::Addressee::List addresseeList; |
107 | 107 | ||
108 | KABC::AddressBook::Iterator it; | 108 | KABC::AddressBook::Iterator it; |
109 | for (it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 109 | for (it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
110 | if ( mFilter.filterAddressee( *it ) ) | 110 | if ( mFilter.filterAddressee( *it ) ) |
111 | addresseeList.append( *it ); | 111 | addresseeList.append( *it ); |
112 | } | 112 | } |
113 | 113 | ||
114 | return addresseeList; | 114 | return addresseeList; |
115 | } | 115 | } |
116 | 116 | ||
117 | void KAddressBookView::initGUI() | 117 | void KAddressBookView::initGUI() |
118 | { | 118 | { |
119 | // Create the layout | 119 | // Create the layout |
120 | QVBoxLayout *layout = new QVBoxLayout( this ); | 120 | QVBoxLayout *layout = new QVBoxLayout( this ); |
121 | 121 | ||
122 | // Add the view widget | 122 | // Add the view widget |
123 | mViewWidget = new QWidget( this ); | 123 | mViewWidget = new QWidget( this ); |
124 | layout->addWidget( mViewWidget ); | 124 | layout->addWidget( mViewWidget ); |
125 | } | 125 | } |
126 | 126 | ||
127 | KABC::Field::List KAddressBookView::fields() const | 127 | KABC::Field::List KAddressBookView::fields() const |
128 | { | 128 | { |
129 | return mFieldList; | 129 | return mFieldList; |
130 | } | 130 | } |
131 | KABC::Field::List KAddressBookView::allFields() const | ||
132 | { | ||
133 | return KABC::Field::allFields(); | ||
134 | } | ||
131 | 135 | ||
132 | void KAddressBookView::setFilter( const Filter &filter ) | 136 | void KAddressBookView::setFilter( const Filter &filter ) |
133 | { | 137 | { |
134 | mFilter = filter; | 138 | mFilter = filter; |
135 | } | 139 | } |
136 | 140 | ||
137 | KAddressBookView::DefaultFilterType KAddressBookView::defaultFilterType() const | 141 | KAddressBookView::DefaultFilterType KAddressBookView::defaultFilterType() const |
138 | { | 142 | { |
139 | return mDefaultFilterType; | 143 | return mDefaultFilterType; |
140 | } | 144 | } |
141 | 145 | ||
142 | const QString &KAddressBookView::defaultFilterName() const | 146 | const QString &KAddressBookView::defaultFilterName() const |
143 | { | 147 | { |
144 | return mDefaultFilterName; | 148 | return mDefaultFilterName; |
145 | } | 149 | } |
146 | 150 | ||
147 | KABC::AddressBook *KAddressBookView::addressBook() const | 151 | KABC::AddressBook *KAddressBookView::addressBook() const |
148 | { | 152 | { |
149 | return mAddressBook; | 153 | return mAddressBook; |
150 | } | 154 | } |
151 | 155 | ||
152 | QWidget *KAddressBookView::viewWidget() | 156 | QWidget *KAddressBookView::viewWidget() |
153 | { | 157 | { |
154 | return mViewWidget; | 158 | return mViewWidget; |
155 | } | 159 | } |
156 | 160 | ||
157 | ViewConfigureWidget *ViewFactory::configureWidget( KABC::AddressBook *ab, | 161 | ViewConfigureWidget *ViewFactory::configureWidget( KABC::AddressBook *ab, |
158 | QWidget *parent, | 162 | QWidget *parent, |
159 | const char *name ) | 163 | const char *name ) |
160 | { | 164 | { |
161 | return new ViewConfigureWidget( ab, parent, name ); | 165 | return new ViewConfigureWidget( ab, parent, name ); |
162 | } | 166 | } |
163 | 167 | ||
164 | #ifndef KAB_EMBEDDED | 168 | #ifndef KAB_EMBEDDED |
165 | #include "kaddressbookview.moc" | 169 | #include "kaddressbookview.moc" |
166 | #endif //KAB_EMBEDDED | 170 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/kaddressbookview.h b/kaddressbook/kaddressbookview.h index 2e91cbc..8646136 100644 --- a/kaddressbook/kaddressbookview.h +++ b/kaddressbook/kaddressbookview.h | |||
@@ -1,299 +1,301 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef KADDRESSBOOKVIEW_H | 24 | #ifndef KADDRESSBOOKVIEW_H |
25 | #define KADDRESSBOOKVIEW_H | 25 | #define KADDRESSBOOKVIEW_H |
26 | 26 | ||
27 | #ifndef KAB_EMBEDDED | 27 | #ifndef KAB_EMBEDDED |
28 | #include <klibloader.h> | 28 | #include <klibloader.h> |
29 | #endif //KAB_EMBEDDED | 29 | #endif //KAB_EMBEDDED |
30 | 30 | ||
31 | class KConfig; | 31 | class KConfig; |
32 | class QDropEvent; | 32 | class QDropEvent; |
33 | 33 | ||
34 | #include <qstringlist.h> | 34 | #include <qstringlist.h> |
35 | #include <kabc/field.h> | 35 | #include <kabc/field.h> |
36 | #include <qwidget.h> | 36 | #include <qwidget.h> |
37 | 37 | ||
38 | #include "viewconfigurewidget.h" | 38 | #include "viewconfigurewidget.h" |
39 | #include "filter.h" | 39 | #include "filter.h" |
40 | 40 | ||
41 | namespace KABC { class AddressBook; } | 41 | namespace KABC { class AddressBook; } |
42 | 42 | ||
43 | /** | 43 | /** |
44 | Base class for all views in kaddressbook. This class implements | 44 | Base class for all views in kaddressbook. This class implements |
45 | all the common methods needed to provide a view to the user. | 45 | all the common methods needed to provide a view to the user. |
46 | 46 | ||
47 | To implement a specific view (table, card, etc), just inherit from | 47 | To implement a specific view (table, card, etc), just inherit from |
48 | this class and implement all the pure virtuals. | 48 | this class and implement all the pure virtuals. |
49 | 49 | ||
50 | @author Mike Pilone <mpilone@slac.com> | 50 | @author Mike Pilone <mpilone@slac.com> |
51 | */ | 51 | */ |
52 | class KAddressBookView : public QWidget | 52 | class KAddressBookView : public QWidget |
53 | { | 53 | { |
54 | Q_OBJECT | 54 | Q_OBJECT |
55 | 55 | ||
56 | public: | 56 | public: |
57 | enum DefaultFilterType { None = 0, Active = 1, Specific = 2 }; | 57 | enum DefaultFilterType { None = 0, Active = 1, Specific = 2 }; |
58 | 58 | ||
59 | KAddressBookView( KABC::AddressBook *ab, QWidget *parent, const char *name ); | 59 | KAddressBookView( KABC::AddressBook *ab, QWidget *parent, const char *name ); |
60 | virtual ~KAddressBookView(); | 60 | virtual ~KAddressBookView(); |
61 | 61 | ||
62 | /** | 62 | /** |
63 | Must be overloaded in subclasses. Should return a list of | 63 | Must be overloaded in subclasses. Should return a list of |
64 | all the uids of selected contacts. | 64 | all the uids of selected contacts. |
65 | */ | 65 | */ |
66 | virtual QStringList selectedUids() = 0; | 66 | virtual QStringList selectedUids() = 0; |
67 | virtual void doSearch( const QString& s ,KABC::Field *field ) = 0; | 67 | virtual void doSearch( const QString& s ,KABC::Field *field ) = 0; |
68 | virtual void scrollUP() = 0; | 68 | virtual void scrollUP() = 0; |
69 | virtual void scrollDOWN() = 0; | 69 | virtual void scrollDOWN() = 0; |
70 | virtual void setFocusAV() = 0; | 70 | virtual void setFocusAV() = 0; |
71 | 71 | ||
72 | /** | 72 | /** |
73 | Called whenever this view should read the config. This can be used | 73 | Called whenever this view should read the config. This can be used |
74 | as a sign that the config has changed, therefore the view should | 74 | as a sign that the config has changed, therefore the view should |
75 | assume the worst and rebuild itself if necessary. For example, | 75 | assume the worst and rebuild itself if necessary. For example, |
76 | in a table view this method may be called when the user adds or | 76 | in a table view this method may be called when the user adds or |
77 | removes columns from the view. | 77 | removes columns from the view. |
78 | 78 | ||
79 | If overloaded in the subclass, do not forget to call super class's | 79 | If overloaded in the subclass, do not forget to call super class's |
80 | method. | 80 | method. |
81 | 81 | ||
82 | @param config The KConfig object to read from. The group will already | 82 | @param config The KConfig object to read from. The group will already |
83 | be set, so do not change the group. | 83 | be set, so do not change the group. |
84 | */ | 84 | */ |
85 | virtual void readConfig( KConfig *config ); | 85 | virtual void readConfig( KConfig *config ); |
86 | 86 | ||
87 | /** | 87 | /** |
88 | Called whenever this view should write the config. The view should not | 88 | Called whenever this view should write the config. The view should not |
89 | write out information handled by the application, such as which fields | 89 | write out information handled by the application, such as which fields |
90 | are visible. The view should only write out information specific | 90 | are visible. The view should only write out information specific |
91 | to itself (i.e.: All information in the ViewConfigWidget) | 91 | to itself (i.e.: All information in the ViewConfigWidget) |
92 | 92 | ||
93 | If overloaded in the subclass, do not forget to call the super class's | 93 | If overloaded in the subclass, do not forget to call the super class's |
94 | method. | 94 | method. |
95 | 95 | ||
96 | @param config The KConfig object to read from. The group will already | 96 | @param config The KConfig object to read from. The group will already |
97 | be set, so do not change the group. | 97 | be set, so do not change the group. |
98 | */ | 98 | */ |
99 | virtual void writeConfig( KConfig *config ); | 99 | virtual void writeConfig( KConfig *config ); |
100 | 100 | ||
101 | /** | 101 | /** |
102 | Returns a QString with all the selected email addresses concatenated | 102 | Returns a QString with all the selected email addresses concatenated |
103 | together with a ',' seperator. | 103 | together with a ',' seperator. |
104 | */ | 104 | */ |
105 | virtual QString selectedEmails(); | 105 | virtual QString selectedEmails(); |
106 | 106 | ||
107 | /** | 107 | /** |
108 | Return the type of the view: Icon, Table, etc. Please make sure that | 108 | Return the type of the view: Icon, Table, etc. Please make sure that |
109 | this is the same value that ViewWrapper::type() will return for your | 109 | this is the same value that ViewWrapper::type() will return for your |
110 | view. | 110 | view. |
111 | */ | 111 | */ |
112 | virtual QString type() const = 0; | 112 | virtual QString type() const = 0; |
113 | 113 | ||
114 | /** | 114 | /** |
115 | Returns a list of the fields that should be displayed. The list | 115 | Returns a list of the fields that should be displayed. The list |
116 | is composed of the fields proper names (ie: Home Address), so | 116 | is composed of the fields proper names (ie: Home Address), so |
117 | the view may need to translate them in order to get the | 117 | the view may need to translate them in order to get the |
118 | value from the addressee. | 118 | value from the addressee. |
119 | 119 | ||
120 | This list is generated from the config file, so it is advisable to call | 120 | This list is generated from the config file, so it is advisable to call |
121 | this method whenever a readConfig() is called in order to get the newest | 121 | this method whenever a readConfig() is called in order to get the newest |
122 | list of fields. | 122 | list of fields. |
123 | */ | 123 | */ |
124 | KABC::Field::List fields() const; | 124 | KABC::Field::List fields() const; |
125 | |||
126 | KABC::Field::List allFields() const; | ||
125 | 127 | ||
126 | /** | 128 | /** |
127 | Sets the active filter. This filter will be used for filtering | 129 | Sets the active filter. This filter will be used for filtering |
128 | the list of addressees to display. The view will <b>not</b> | 130 | the list of addressees to display. The view will <b>not</b> |
129 | automatically refresh itself, so in most cases you will want to call | 131 | automatically refresh itself, so in most cases you will want to call |
130 | KAddressBookView::refresh() after this method. | 132 | KAddressBookView::refresh() after this method. |
131 | */ | 133 | */ |
132 | void setFilter( const Filter& ); | 134 | void setFilter( const Filter& ); |
133 | 135 | ||
134 | /** | 136 | /** |
135 | @return The default filter type selection. If the selection | 137 | @return The default filter type selection. If the selection |
136 | is SpecificFilter, the name of the filter can be retrieved with | 138 | is SpecificFilter, the name of the filter can be retrieved with |
137 | defaultFilterName() | 139 | defaultFilterName() |
138 | */ | 140 | */ |
139 | DefaultFilterType defaultFilterType() const; | 141 | DefaultFilterType defaultFilterType() const; |
140 | 142 | ||
141 | /** | 143 | /** |
142 | @return The name of the default filter. This string is | 144 | @return The name of the default filter. This string is |
143 | only valid if defaultFilterType() is returning SpecificFilter. | 145 | only valid if defaultFilterType() is returning SpecificFilter. |
144 | */ | 146 | */ |
145 | const QString &defaultFilterName() const; | 147 | const QString &defaultFilterName() const; |
146 | 148 | ||
147 | /** | 149 | /** |
148 | @return The address book. | 150 | @return The address book. |
149 | */ | 151 | */ |
150 | KABC::AddressBook *addressBook() const; | 152 | KABC::AddressBook *addressBook() const; |
151 | 153 | ||
152 | public slots: | 154 | public slots: |
153 | /** | 155 | /** |
154 | Must be overloaded in subclasses to refresh the view. | 156 | Must be overloaded in subclasses to refresh the view. |
155 | Refreshing includes updating the view to ensure that only items | 157 | Refreshing includes updating the view to ensure that only items |
156 | in the document are visible. If <i>uid</i> is valid, only the | 158 | in the document are visible. If <i>uid</i> is valid, only the |
157 | addressee with uid needs to be refreshed. This is an optimization | 159 | addressee with uid needs to be refreshed. This is an optimization |
158 | only. | 160 | only. |
159 | */ | 161 | */ |
160 | virtual void refresh( QString uid = QString::null ) = 0; | 162 | virtual void refresh( QString uid = QString::null ) = 0; |
161 | 163 | ||
162 | /** | 164 | /** |
163 | This method must be overloaded in subclasses. Select (highlight) | 165 | This method must be overloaded in subclasses. Select (highlight) |
164 | the addressee matching <i>uid</i>. If uid | 166 | the addressee matching <i>uid</i>. If uid |
165 | is equal to QString::null, then all addressees should be selected. | 167 | is equal to QString::null, then all addressees should be selected. |
166 | */ | 168 | */ |
167 | #ifndef KAB_EMBEDDED | 169 | #ifndef KAB_EMBEDDED |
168 | //MOC_SKIP_BEGIN | 170 | //MOC_SKIP_BEGIN |
169 | virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0; | 171 | virtual void setSelected( QString uid = QString::null, bool selected = true ) = 0; |
170 | //MOC_SKIP_END | 172 | //MOC_SKIP_END |
171 | #else //KAB_EMBEDDED | 173 | #else //KAB_EMBEDDED |
172 | //US my moc can not handle the default parameters. Is this a problem ??? | 174 | //US my moc can not handle the default parameters. Is this a problem ??? |
173 | virtual void setSelected( QString uid, bool selected) = 0; | 175 | virtual void setSelected( QString uid, bool selected) = 0; |
174 | #endif //KAB_EMBEDDED | 176 | #endif //KAB_EMBEDDED |
175 | 177 | ||
176 | signals: | 178 | signals: |
177 | /** | 179 | /** |
178 | This signal should be emitted by a subclass whenever an addressee | 180 | This signal should be emitted by a subclass whenever an addressee |
179 | is modified. | 181 | is modified. |
180 | */ | 182 | */ |
181 | void modified(); | 183 | void modified(); |
182 | 184 | ||
183 | /** | 185 | /** |
184 | This signal should be emitted by a subclass whenever an addressee | 186 | This signal should be emitted by a subclass whenever an addressee |
185 | is selected. Selected means that the addressee was given the focus. | 187 | is selected. Selected means that the addressee was given the focus. |
186 | Some widgets may call this 'highlighted'. The view is responsible for | 188 | Some widgets may call this 'highlighted'. The view is responsible for |
187 | emitting this signal multiple times if multiple items are selected, | 189 | emitting this signal multiple times if multiple items are selected, |
188 | with the last item selected being the last emit. | 190 | with the last item selected being the last emit. |
189 | 191 | ||
190 | @param uid The uid of the selected addressee. | 192 | @param uid The uid of the selected addressee. |
191 | 193 | ||
192 | @see KListView | 194 | @see KListView |
193 | */ | 195 | */ |
194 | void selected( const QString &uid ); | 196 | void selected( const QString &uid ); |
195 | void deleteRequest(); | 197 | void deleteRequest(); |
196 | /** | 198 | /** |
197 | This signal should be emitted by a subclass whenever an addressee | 199 | This signal should be emitted by a subclass whenever an addressee |
198 | is executed. This is defined by the KDE system wide config, but it | 200 | is executed. This is defined by the KDE system wide config, but it |
199 | either means single or doubleclicked. | 201 | either means single or doubleclicked. |
200 | 202 | ||
201 | @param ui The uid of the selected addressee | 203 | @param ui The uid of the selected addressee |
202 | 204 | ||
203 | @see KListView | 205 | @see KListView |
204 | */ | 206 | */ |
205 | void executed( const QString &uid ); | 207 | void executed( const QString &uid ); |
206 | 208 | ||
207 | /** | 209 | /** |
208 | This signal is emitted whenever a user attempts to start a drag | 210 | This signal is emitted whenever a user attempts to start a drag |
209 | in the view. The slot connected to this signal would usually want | 211 | in the view. The slot connected to this signal would usually want |
210 | to create a QDragObject. | 212 | to create a QDragObject. |
211 | */ | 213 | */ |
212 | void startDrag(); | 214 | void startDrag(); |
213 | 215 | ||
214 | /** | 216 | /** |
215 | This signal is emitted whenever the user drops something on the | 217 | This signal is emitted whenever the user drops something on the |
216 | view. The individual view should handle checking if the item is | 218 | view. The individual view should handle checking if the item is |
217 | droppable (ie: if it is a vcard). | 219 | droppable (ie: if it is a vcard). |
218 | */ | 220 | */ |
219 | void dropped( QDropEvent* ); | 221 | void dropped( QDropEvent* ); |
220 | 222 | ||
221 | protected: | 223 | protected: |
222 | /** | 224 | /** |
223 | Returns a list of the addressees that should be displayed. This method | 225 | Returns a list of the addressees that should be displayed. This method |
224 | should always be used by the subclass to get a list of addressees. This | 226 | should always be used by the subclass to get a list of addressees. This |
225 | method internally takes many factors into account, including the current | 227 | method internally takes many factors into account, including the current |
226 | filter. | 228 | filter. |
227 | */ | 229 | */ |
228 | KABC::Addressee::List addressees(); | 230 | KABC::Addressee::List addressees(); |
229 | 231 | ||
230 | /** | 232 | /** |
231 | This method returns the widget that should be used as the parent for | 233 | This method returns the widget that should be used as the parent for |
232 | all view components. By using this widget as the parent and not | 234 | all view components. By using this widget as the parent and not |
233 | 'this', the view subclass has the option of placing other widgets | 235 | 'this', the view subclass has the option of placing other widgets |
234 | around the view (ie: search fields, etc). Do not delete this widget! | 236 | around the view (ie: search fields, etc). Do not delete this widget! |
235 | */ | 237 | */ |
236 | QWidget *viewWidget(); | 238 | QWidget *viewWidget(); |
237 | 239 | ||
238 | private: | 240 | private: |
239 | void initGUI(); | 241 | void initGUI(); |
240 | 242 | ||
241 | DefaultFilterType mDefaultFilterType; | 243 | DefaultFilterType mDefaultFilterType; |
242 | Filter mFilter; | 244 | Filter mFilter; |
243 | QString mDefaultFilterName; | 245 | QString mDefaultFilterName; |
244 | KABC::AddressBook *mAddressBook; | 246 | KABC::AddressBook *mAddressBook; |
245 | KABC::Field::List mFieldList; | 247 | KABC::Field::List mFieldList; |
246 | 248 | ||
247 | QWidget *mViewWidget; | 249 | QWidget *mViewWidget; |
248 | }; | 250 | }; |
249 | 251 | ||
250 | #ifndef KAB_EMBEDDED | 252 | #ifndef KAB_EMBEDDED |
251 | //MOC_SKIP_BEGIN | 253 | //MOC_SKIP_BEGIN |
252 | class ViewFactory : public KLibFactory | 254 | class ViewFactory : public KLibFactory |
253 | //MOC_SKIP_END | 255 | //MOC_SKIP_END |
254 | #else //KAB_EMBEDDED | 256 | #else //KAB_EMBEDDED |
255 | class ViewFactory | 257 | class ViewFactory |
256 | #endif //KAB_EMBEDDED | 258 | #endif //KAB_EMBEDDED |
257 | { | 259 | { |
258 | 260 | ||
259 | public: | 261 | public: |
260 | virtual KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, | 262 | virtual KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, |
261 | const char *name = 0 ) = 0; | 263 | const char *name = 0 ) = 0; |
262 | 264 | ||
263 | /** | 265 | /** |
264 | @return The type of the view. This is normally a small one word | 266 | @return The type of the view. This is normally a small one word |
265 | string (ie: Table, Icon, Tree, etc). | 267 | string (ie: Table, Icon, Tree, etc). |
266 | */ | 268 | */ |
267 | virtual QString type() const = 0; | 269 | virtual QString type() const = 0; |
268 | 270 | ||
269 | /** | 271 | /** |
270 | @return The description of the view. This should be a 3 to | 272 | @return The description of the view. This should be a 3 to |
271 | 4 line string (don't actually use return characters in the string) | 273 | 4 line string (don't actually use return characters in the string) |
272 | describing the features offered by the view. | 274 | describing the features offered by the view. |
273 | */ | 275 | */ |
274 | virtual QString description() const = 0; | 276 | virtual QString description() const = 0; |
275 | 277 | ||
276 | /** | 278 | /** |
277 | Creates a config dialog for the view type. The default | 279 | Creates a config dialog for the view type. The default |
278 | implementation will return a ViewConfigDialog. This default | 280 | implementation will return a ViewConfigDialog. This default |
279 | dialog will allow the user to set the visible fields only. If | 281 | dialog will allow the user to set the visible fields only. If |
280 | you need more config options (as most views will), this method | 282 | you need more config options (as most views will), this method |
281 | can be overloaded to return your sublcass of ViewConfigDialog. | 283 | can be overloaded to return your sublcass of ViewConfigDialog. |
282 | If this method is over loaded the base classes method should | 284 | If this method is over loaded the base classes method should |
283 | <B>not</B> be called. | 285 | <B>not</B> be called. |
284 | */ | 286 | */ |
285 | virtual ViewConfigureWidget *configureWidget( KABC::AddressBook *ab, | 287 | virtual ViewConfigureWidget *configureWidget( KABC::AddressBook *ab, |
286 | QWidget *parent, | 288 | QWidget *parent, |
287 | const char *name = 0 ); | 289 | const char *name = 0 ); |
288 | 290 | ||
289 | protected: | 291 | protected: |
290 | virtual QObject* createObject( QObject*, const char*, const char*, | 292 | virtual QObject* createObject( QObject*, const char*, const char*, |
291 | const QStringList & ) | 293 | const QStringList & ) |
292 | { | 294 | { |
293 | return 0; | 295 | return 0; |
294 | } | 296 | } |
295 | 297 | ||
296 | }; | 298 | }; |
297 | 299 | ||
298 | 300 | ||
299 | #endif | 301 | #endif |
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp index 2c9b162..2d7ed08 100644 --- a/kaddressbook/views/kaddressbookcardview.cpp +++ b/kaddressbook/views/kaddressbookcardview.cpp | |||
@@ -1,478 +1,478 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qdragobject.h> | 24 | #include <qdragobject.h> |
25 | #include <qevent.h> | 25 | #include <qevent.h> |
26 | #include <qiconview.h> | 26 | #include <qiconview.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | #include <qregexp.h> | 29 | #include <qregexp.h> |
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | 31 | ||
32 | #include <kabc/addressbook.h> | 32 | #include <kabc/addressbook.h> |
33 | #include <kabc/addressee.h> | 33 | #include <kabc/addressee.h> |
34 | #include <kconfig.h> | 34 | #include <kconfig.h> |
35 | #include <kdebug.h> | 35 | #include <kdebug.h> |
36 | #include <klocale.h> | 36 | #include <klocale.h> |
37 | 37 | ||
38 | #include "kabprefs.h" | 38 | #include "kabprefs.h" |
39 | #include "viewmanager.h" | 39 | #include "viewmanager.h" |
40 | 40 | ||
41 | #include "kaddressbookcardview.h" | 41 | #include "kaddressbookcardview.h" |
42 | 42 | ||
43 | #ifndef KAB_EMBEDDED | 43 | #ifndef KAB_EMBEDDED |
44 | extern "C" { | 44 | extern "C" { |
45 | void *init_libkaddrbk_cardview() | 45 | void *init_libkaddrbk_cardview() |
46 | { | 46 | { |
47 | return ( new CardViewFactory ); | 47 | return ( new CardViewFactory ); |
48 | } | 48 | } |
49 | } | 49 | } |
50 | #endif //KAB_EMBEDDED | 50 | #endif //KAB_EMBEDDED |
51 | 51 | ||
52 | //////////////////////////////// | 52 | //////////////////////////////// |
53 | // AddresseeCardViewItem (internal class) | 53 | // AddresseeCardViewItem (internal class) |
54 | class AddresseeCardViewItem : public CardViewItem | 54 | class AddresseeCardViewItem : public CardViewItem |
55 | { | 55 | { |
56 | public: | 56 | public: |
57 | AddresseeCardViewItem(const KABC::Field::List &fields, | 57 | AddresseeCardViewItem(const KABC::Field::List &fields, |
58 | bool showEmptyFields, | 58 | bool showEmptyFields, |
59 | KABC::AddressBook *doc, const KABC::Addressee &a, | 59 | KABC::AddressBook *doc, const KABC::Addressee &a, |
60 | CardView *parent) | 60 | CardView *parent) |
61 | : CardViewItem(parent, a.formattedName()), | 61 | : CardViewItem(parent, a.formattedName()), |
62 | mFields( fields ), mShowEmptyFields(showEmptyFields), | 62 | mFields( fields ), mShowEmptyFields(showEmptyFields), |
63 | mDocument(doc), mAddressee(a) | 63 | mDocument(doc), mAddressee(a) |
64 | { | 64 | { |
65 | if ( mFields.isEmpty() ) { | 65 | if ( mFields.isEmpty() ) { |
66 | mFields = KABC::Field::defaultFields(); | 66 | mFields = KABC::Field::defaultFields(); |
67 | } | 67 | } |
68 | refresh(); | 68 | refresh(); |
69 | } | 69 | } |
70 | 70 | ||
71 | const KABC::Addressee &addressee() const { return mAddressee; } | 71 | const KABC::Addressee &addressee() const { return mAddressee; } |
72 | 72 | ||
73 | void refresh() | 73 | void refresh() |
74 | { | 74 | { |
75 | // Update our addressee, since it may have changed elsewhere | 75 | // Update our addressee, since it may have changed elsewhere |
76 | mAddressee = mDocument->findByUid(mAddressee.uid()); | 76 | mAddressee = mDocument->findByUid(mAddressee.uid()); |
77 | 77 | ||
78 | if (!mAddressee.isEmpty()) | 78 | if (!mAddressee.isEmpty()) |
79 | { | 79 | { |
80 | clearFields(); | 80 | clearFields(); |
81 | 81 | ||
82 | // Try all the selected fields until we find one with text. | 82 | // Try all the selected fields until we find one with text. |
83 | // This will limit the number of unlabeled icons in the view | 83 | // This will limit the number of unlabeled icons in the view |
84 | KABC::Field::List::Iterator iter; | 84 | KABC::Field::List::Iterator iter; |
85 | for (iter = mFields.begin(); iter != mFields.end(); ++iter) | 85 | for (iter = mFields.begin(); iter != mFields.end(); ++iter) |
86 | { | 86 | { |
87 | // insert empty fields or not? not doing so saves a bit of memory and CPU | 87 | // insert empty fields or not? not doing so saves a bit of memory and CPU |
88 | // (during geometry calculations), but prevents having equally | 88 | // (during geometry calculations), but prevents having equally |
89 | // wide label columns in all cards, unless CardViewItem/CardView search | 89 | // wide label columns in all cards, unless CardViewItem/CardView search |
90 | // globally for the widest label. (anders) | 90 | // globally for the widest label. (anders) |
91 | //if (mShowEmptyFields || !(*iter)->value( mAddressee ).isEmpty()) | 91 | //if (mShowEmptyFields || !(*iter)->value( mAddressee ).isEmpty()) |
92 | insertField((*iter)->label(), (*iter)->value( mAddressee )); | 92 | insertField((*iter)->label(), (*iter)->value( mAddressee )); |
93 | } | 93 | } |
94 | 94 | ||
95 | // We might want to make this the first field. hmm... -mpilone | 95 | // We might want to make this the first field. hmm... -mpilone |
96 | setCaption( mAddressee.realName() ); | 96 | setCaption( mAddressee.realName() ); |
97 | } | 97 | } |
98 | } | 98 | } |
99 | 99 | ||
100 | private: | 100 | private: |
101 | KABC::Field::List mFields; | 101 | KABC::Field::List mFields; |
102 | bool mShowEmptyFields; | 102 | bool mShowEmptyFields; |
103 | KABC::AddressBook *mDocument; | 103 | KABC::AddressBook *mDocument; |
104 | KABC::Addressee mAddressee; | 104 | KABC::Addressee mAddressee; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | /////////////////////////////// | 107 | /////////////////////////////// |
108 | // AddresseeCardView | 108 | // AddresseeCardView |
109 | 109 | ||
110 | AddresseeCardView::AddresseeCardView(QWidget *parent, const char *name) | 110 | AddresseeCardView::AddresseeCardView(QWidget *parent, const char *name) |
111 | : CardView(parent, name) | 111 | : CardView(parent, name) |
112 | { | 112 | { |
113 | setAcceptDrops(true); | 113 | setAcceptDrops(true); |
114 | } | 114 | } |
115 | 115 | ||
116 | AddresseeCardView::~AddresseeCardView() | 116 | AddresseeCardView::~AddresseeCardView() |
117 | { | 117 | { |
118 | } | 118 | } |
119 | 119 | ||
120 | 120 | ||
121 | void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e) | 121 | void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e) |
122 | { | 122 | { |
123 | #ifndef KAB_EMBEDDED | 123 | #ifndef KAB_EMBEDDED |
124 | if (QTextDrag::canDecode(e)) | 124 | if (QTextDrag::canDecode(e)) |
125 | e->accept(); | 125 | e->accept(); |
126 | #else //KAB_EMBEDDED | 126 | #else //KAB_EMBEDDED |
127 | qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented"); | 127 | qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented"); |
128 | #endif //KAB_EMBEDDED | 128 | #endif //KAB_EMBEDDED |
129 | } | 129 | } |
130 | 130 | ||
131 | void AddresseeCardView::dropEvent(QDropEvent *e) | 131 | void AddresseeCardView::dropEvent(QDropEvent *e) |
132 | { | 132 | { |
133 | emit addresseeDropped(e); | 133 | emit addresseeDropped(e); |
134 | } | 134 | } |
135 | 135 | ||
136 | void AddresseeCardView::startDrag() | 136 | void AddresseeCardView::startDrag() |
137 | { | 137 | { |
138 | emit startAddresseeDrag(); | 138 | emit startAddresseeDrag(); |
139 | } | 139 | } |
140 | 140 | ||
141 | 141 | ||
142 | /////////////////////////////// | 142 | /////////////////////////////// |
143 | // KAddressBookCardView | 143 | // KAddressBookCardView |
144 | 144 | ||
145 | KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab, | 145 | KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab, |
146 | QWidget *parent, const char *name ) | 146 | QWidget *parent, const char *name ) |
147 | : KAddressBookView( ab, parent, name ) | 147 | : KAddressBookView( ab, parent, name ) |
148 | { | 148 | { |
149 | mShowEmptyFields = false; | 149 | mShowEmptyFields = false; |
150 | 150 | ||
151 | // Init the GUI | 151 | // Init the GUI |
152 | QVBoxLayout *layout = new QVBoxLayout(viewWidget()); | 152 | QVBoxLayout *layout = new QVBoxLayout(viewWidget()); |
153 | 153 | ||
154 | mCardView = new AddresseeCardView(viewWidget(), "mCardView"); | 154 | mCardView = new AddresseeCardView(viewWidget(), "mCardView"); |
155 | mCardView->setSelectionMode(CardView::Extended); | 155 | mCardView->setSelectionMode(CardView::Extended); |
156 | layout->addWidget(mCardView); | 156 | layout->addWidget(mCardView); |
157 | 157 | ||
158 | // Connect up the signals | 158 | // Connect up the signals |
159 | connect(mCardView, SIGNAL(executed(CardViewItem *)), | 159 | connect(mCardView, SIGNAL(executed(CardViewItem *)), |
160 | this, SLOT(addresseeExecuted(CardViewItem *))); | 160 | this, SLOT(addresseeExecuted(CardViewItem *))); |
161 | connect(mCardView, SIGNAL(selectionChanged()), | 161 | connect(mCardView, SIGNAL(selectionChanged()), |
162 | this, SLOT(addresseeSelected())); | 162 | this, SLOT(addresseeSelected())); |
163 | connect(mCardView, SIGNAL(addresseeDropped(QDropEvent*)), | 163 | connect(mCardView, SIGNAL(addresseeDropped(QDropEvent*)), |
164 | this, SIGNAL(dropped(QDropEvent*))); | 164 | this, SIGNAL(dropped(QDropEvent*))); |
165 | connect(mCardView, SIGNAL(startAddresseeDrag()), | 165 | connect(mCardView, SIGNAL(startAddresseeDrag()), |
166 | this, SIGNAL(startDrag())); | 166 | this, SIGNAL(startDrag())); |
167 | } | 167 | } |
168 | 168 | ||
169 | KAddressBookCardView::~KAddressBookCardView() | 169 | KAddressBookCardView::~KAddressBookCardView() |
170 | { | 170 | { |
171 | } | 171 | } |
172 | void KAddressBookCardView::setFocusAV() | 172 | void KAddressBookCardView::setFocusAV() |
173 | { | 173 | { |
174 | if ( mCardView ) | 174 | if ( mCardView ) |
175 | mCardView->setFocus(); | 175 | mCardView->setFocus(); |
176 | 176 | ||
177 | } | 177 | } |
178 | void KAddressBookCardView::scrollUP() | 178 | void KAddressBookCardView::scrollUP() |
179 | { | 179 | { |
180 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); | 180 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); |
181 | QApplication::postEvent( mCardView, ev ); | 181 | QApplication::postEvent( mCardView, ev ); |
182 | 182 | ||
183 | } | 183 | } |
184 | void KAddressBookCardView::scrollDOWN() | 184 | void KAddressBookCardView::scrollDOWN() |
185 | { | 185 | { |
186 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); | 186 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); |
187 | QApplication::postEvent( mCardView, ev ); | 187 | QApplication::postEvent( mCardView, ev ); |
188 | } | 188 | } |
189 | void KAddressBookCardView::readConfig(KConfig *config) | 189 | void KAddressBookCardView::readConfig(KConfig *config) |
190 | { | 190 | { |
191 | KAddressBookView::readConfig(config); | 191 | KAddressBookView::readConfig(config); |
192 | 192 | ||
193 | // costum colors? | 193 | // costum colors? |
194 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) | 194 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) |
195 | { | 195 | { |
196 | QPalette p( mCardView->palette() ); | 196 | QPalette p( mCardView->palette() ); |
197 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); | 197 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); |
198 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); | 198 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); |
199 | c = p.color(QPalette::Normal, QColorGroup::Text ); | 199 | c = p.color(QPalette::Normal, QColorGroup::Text ); |
200 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); | 200 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); |
201 | c = p.color(QPalette::Normal, QColorGroup::Button ); | 201 | c = p.color(QPalette::Normal, QColorGroup::Button ); |
202 | p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); | 202 | p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); |
203 | c = p.color(QPalette::Normal, QColorGroup::ButtonText ); | 203 | c = p.color(QPalette::Normal, QColorGroup::ButtonText ); |
204 | p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); | 204 | p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); |
205 | c = p.color(QPalette::Normal, QColorGroup::Highlight ); | 205 | c = p.color(QPalette::Normal, QColorGroup::Highlight ); |
206 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); | 206 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); |
207 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); | 207 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); |
208 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); | 208 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); |
209 | mCardView->viewport()->setPalette( p ); | 209 | mCardView->viewport()->setPalette( p ); |
210 | } | 210 | } |
211 | else | 211 | else |
212 | { | 212 | { |
213 | // needed if turned off during a session. | 213 | // needed if turned off during a session. |
214 | mCardView->viewport()->setPalette( mCardView->palette() ); | 214 | mCardView->viewport()->setPalette( mCardView->palette() ); |
215 | } | 215 | } |
216 | 216 | ||
217 | //custom fonts? | 217 | //custom fonts? |
218 | QFont f( font() ); | 218 | QFont f( font() ); |
219 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) | 219 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) |
220 | { | 220 | { |
221 | mCardView->setFont( config->readFontEntry( "TextFont", &f) ); | 221 | mCardView->setFont( config->readFontEntry( "TextFont", &f) ); |
222 | f.setBold( true ); | 222 | f.setBold( true ); |
223 | mCardView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); | 223 | mCardView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); |
224 | } | 224 | } |
225 | else | 225 | else |
226 | { | 226 | { |
227 | mCardView->setFont( f ); | 227 | mCardView->setFont( f ); |
228 | f.setBold( true ); | 228 | f.setBold( true ); |
229 | mCardView->setHeaderFont( f ); | 229 | mCardView->setHeaderFont( f ); |
230 | } | 230 | } |
231 | 231 | ||
232 | mCardView->setDrawCardBorder(config->readBoolEntry("DrawBorder", true)); | 232 | mCardView->setDrawCardBorder(config->readBoolEntry("DrawBorder", true)); |
233 | mCardView->setDrawColSeparators(config->readBoolEntry("DrawSeparators", | 233 | mCardView->setDrawColSeparators(config->readBoolEntry("DrawSeparators", |
234 | true)); | 234 | true)); |
235 | mCardView->setDrawFieldLabels(config->readBoolEntry("DrawFieldLabels",false)); | 235 | mCardView->setDrawFieldLabels(config->readBoolEntry("DrawFieldLabels",false)); |
236 | mShowEmptyFields = config->readBoolEntry("ShowEmptyFields", false); | 236 | mShowEmptyFields = config->readBoolEntry("ShowEmptyFields", false); |
237 | 237 | ||
238 | mCardView->setShowEmptyFields( mShowEmptyFields ); | 238 | mCardView->setShowEmptyFields( mShowEmptyFields ); |
239 | 239 | ||
240 | mCardView->setItemWidth( config->readNumEntry( "ItemWidth", 200 ) ); | 240 | mCardView->setItemWidth( config->readNumEntry( "ItemWidth", 200 ) ); |
241 | mCardView->setItemMargin( config->readNumEntry( "ItemMargin", 0 ) ); | 241 | mCardView->setItemMargin( config->readNumEntry( "ItemMargin", 0 ) ); |
242 | mCardView->setItemSpacing( config->readNumEntry( "ItemSpacing", 10 ) ); | 242 | mCardView->setItemSpacing( config->readNumEntry( "ItemSpacing", 10 ) ); |
243 | mCardView->setSeparatorWidth( config->readNumEntry( "SeparatorWidth", 2 ) ); | 243 | mCardView->setSeparatorWidth( config->readNumEntry( "SeparatorWidth", 2 ) ); |
244 | 244 | ||
245 | #if 0 | 245 | #if 0 |
246 | // LR KABPrefs::instance()->mHonorSingleClick is handled and fixed in cardviews contentsMouseDoubleClickEven | 246 | // LR KABPrefs::instance()->mHonorSingleClick is handled and fixed in cardviews contentsMouseDoubleClickEven |
247 | disconnect(mCardView, SIGNAL(executed(CardViewItem *)), | 247 | disconnect(mCardView, SIGNAL(executed(CardViewItem *)), |
248 | this, SLOT(addresseeExecuted(CardViewItem *))); | 248 | this, SLOT(addresseeExecuted(CardViewItem *))); |
249 | 249 | ||
250 | if (KABPrefs::instance()->mHonorSingleClick) | 250 | if (KABPrefs::instance()->mHonorSingleClick) |
251 | connect(mCardView, SIGNAL(executed(CardViewItem *)), | 251 | connect(mCardView, SIGNAL(executed(CardViewItem *)), |
252 | this, SLOT(addresseeExecuted(CardViewItem *))); | 252 | this, SLOT(addresseeExecuted(CardViewItem *))); |
253 | else | 253 | else |
254 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), | 254 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), |
255 | this, SLOT(addresseeExecuted(CardViewItem *))); | 255 | this, SLOT(addresseeExecuted(CardViewItem *))); |
256 | #endif | 256 | #endif |
257 | 257 | ||
258 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), | 258 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), |
259 | this, SLOT(addresseeExecuted(CardViewItem *))); | 259 | this, SLOT(addresseeExecuted(CardViewItem *))); |
260 | } | 260 | } |
261 | 261 | ||
262 | void KAddressBookCardView::writeConfig( KConfig *config ) | 262 | void KAddressBookCardView::writeConfig( KConfig *config ) |
263 | { | 263 | { |
264 | config->writeEntry( "ItemWidth", mCardView->itemWidth() ); | 264 | config->writeEntry( "ItemWidth", mCardView->itemWidth() ); |
265 | KAddressBookView::writeConfig( config ); | 265 | KAddressBookView::writeConfig( config ); |
266 | } | 266 | } |
267 | void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) | 267 | void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) |
268 | { | 268 | { |
269 | mCardView->clear(); | 269 | mCardView->clear(); |
270 | if ( s.isEmpty() || s == "*" ) { | 270 | if ( s.isEmpty() || s == "*" ) { |
271 | refresh(); | 271 | refresh(); |
272 | return; | 272 | return; |
273 | } | 273 | } |
274 | QString pattern = s.lower()+"*"; | 274 | QString pattern = s.lower()+"*"; |
275 | QRegExp re; | 275 | QRegExp re; |
276 | re.setWildcard(true); // most people understand these better. | 276 | re.setWildcard(true); // most people understand these better. |
277 | re.setCaseSensitive(false); | 277 | re.setCaseSensitive(false); |
278 | re.setPattern( pattern ); | 278 | re.setPattern( pattern ); |
279 | if (!re.isValid()) | 279 | if (!re.isValid()) |
280 | return; | 280 | return; |
281 | mCardView->viewport()->setUpdatesEnabled( false ); | 281 | mCardView->viewport()->setUpdatesEnabled( false ); |
282 | KABC::Addressee::List addresseeList = addressees(); | 282 | KABC::Addressee::List addresseeList = addressees(); |
283 | KABC::Addressee::List::Iterator it; | 283 | KABC::Addressee::List::Iterator it; |
284 | if ( field ) { | 284 | if ( field ) { |
285 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 285 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
286 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 286 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
287 | continue; | 287 | continue; |
288 | #if QT_VERSION >= 300 | 288 | #if QT_VERSION >= 300 |
289 | if (re.search(field->value( *it ).lower()) != -1) | 289 | if (re.search(field->value( *it ).lower()) != -1) |
290 | #else | 290 | #else |
291 | if (re.match(field->value( *it ).lower()) != -1) | 291 | if (re.match(field->value( *it ).lower()) != -1) |
292 | #endif | 292 | #endif |
293 | new AddresseeCardViewItem(fields(), mShowEmptyFields, | 293 | new AddresseeCardViewItem(fields(), mShowEmptyFields, |
294 | addressBook(), *it, mCardView); | 294 | addressBook(), *it, mCardView); |
295 | 295 | ||
296 | } | 296 | } |
297 | } else { | 297 | } else { |
298 | KABC::Field::List fieldList = fields(); | 298 | KABC::Field::List fieldList = allFields(); |
299 | KABC::Field::List::ConstIterator fieldIt; | 299 | KABC::Field::List::ConstIterator fieldIt; |
300 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 300 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
301 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 301 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
302 | continue; | 302 | continue; |
303 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 303 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
304 | #if QT_VERSION >= 300 | 304 | #if QT_VERSION >= 300 |
305 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 305 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) |
306 | #else | 306 | #else |
307 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 307 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) |
308 | #endif | 308 | #endif |
309 | { | 309 | { |
310 | new AddresseeCardViewItem(fields(), mShowEmptyFields, | 310 | new AddresseeCardViewItem(fields(), mShowEmptyFields, |
311 | addressBook(), *it, mCardView); | 311 | addressBook(), *it, mCardView); |
312 | continue; | 312 | continue; |
313 | } | 313 | } |
314 | } | 314 | } |
315 | } | 315 | } |
316 | } | 316 | } |
317 | mCardView->viewport()->setUpdatesEnabled( true ); | 317 | mCardView->viewport()->setUpdatesEnabled( true ); |
318 | mCardView->viewport()->update(); | 318 | mCardView->viewport()->update(); |
319 | if ( mCardView->firstItem() ) { | 319 | if ( mCardView->firstItem() ) { |
320 | mCardView->setCurrentItem ( mCardView->firstItem() ); | 320 | mCardView->setCurrentItem ( mCardView->firstItem() ); |
321 | mCardView->setSelected ( mCardView->firstItem() , true ); | 321 | mCardView->setSelected ( mCardView->firstItem() , true ); |
322 | } | 322 | } |
323 | else | 323 | else |
324 | emit selected(QString::null); | 324 | emit selected(QString::null); |
325 | } | 325 | } |
326 | QStringList KAddressBookCardView::selectedUids() | 326 | QStringList KAddressBookCardView::selectedUids() |
327 | { | 327 | { |
328 | QStringList uidList; | 328 | QStringList uidList; |
329 | CardViewItem *item; | 329 | CardViewItem *item; |
330 | AddresseeCardViewItem *aItem; | 330 | AddresseeCardViewItem *aItem; |
331 | 331 | ||
332 | for (item = mCardView->firstItem(); item; item = item->nextItem()) | 332 | for (item = mCardView->firstItem(); item; item = item->nextItem()) |
333 | { | 333 | { |
334 | if (item->isSelected()) | 334 | if (item->isSelected()) |
335 | { | 335 | { |
336 | #ifndef KAB_EMBEDDED | 336 | #ifndef KAB_EMBEDDED |
337 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 337 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
338 | #else //KAB_EMBEDDED | 338 | #else //KAB_EMBEDDED |
339 | aItem = (AddresseeCardViewItem*)(item); | 339 | aItem = (AddresseeCardViewItem*)(item); |
340 | #endif //KAB_EMBEDDED | 340 | #endif //KAB_EMBEDDED |
341 | if (aItem) | 341 | if (aItem) |
342 | uidList << aItem->addressee().uid(); | 342 | uidList << aItem->addressee().uid(); |
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | return uidList; | 346 | return uidList; |
347 | } | 347 | } |
348 | 348 | ||
349 | void KAddressBookCardView::refresh(QString uid) | 349 | void KAddressBookCardView::refresh(QString uid) |
350 | { | 350 | { |
351 | CardViewItem *item; | 351 | CardViewItem *item; |
352 | AddresseeCardViewItem *aItem; | 352 | AddresseeCardViewItem *aItem; |
353 | 353 | ||
354 | if (uid.isNull()) | 354 | if (uid.isNull()) |
355 | { | 355 | { |
356 | // Rebuild the view | 356 | // Rebuild the view |
357 | mCardView->viewport()->setUpdatesEnabled( false ); | 357 | mCardView->viewport()->setUpdatesEnabled( false ); |
358 | mCardView->clear(); | 358 | mCardView->clear(); |
359 | 359 | ||
360 | KABC::Addressee::List addresseeList = addressees(); | 360 | KABC::Addressee::List addresseeList = addressees(); |
361 | KABC::Addressee::List::Iterator iter; | 361 | KABC::Addressee::List::Iterator iter; |
362 | for (iter = addresseeList.begin(); iter != addresseeList.end(); ++iter) | 362 | for (iter = addresseeList.begin(); iter != addresseeList.end(); ++iter) |
363 | { | 363 | { |
364 | if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") ) | 364 | if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") ) |
365 | continue; | 365 | continue; |
366 | aItem = new AddresseeCardViewItem(fields(), mShowEmptyFields, | 366 | aItem = new AddresseeCardViewItem(fields(), mShowEmptyFields, |
367 | addressBook(), *iter, mCardView); | 367 | addressBook(), *iter, mCardView); |
368 | } | 368 | } |
369 | mCardView->viewport()->setUpdatesEnabled( true ); | 369 | mCardView->viewport()->setUpdatesEnabled( true ); |
370 | mCardView->viewport()->update(); | 370 | mCardView->viewport()->update(); |
371 | 371 | ||
372 | // by default nothing is selected | 372 | // by default nothing is selected |
373 | emit selected(QString::null); | 373 | emit selected(QString::null); |
374 | } | 374 | } |
375 | else | 375 | else |
376 | { | 376 | { |
377 | // Try to find the one to refresh | 377 | // Try to find the one to refresh |
378 | bool found = false; | 378 | bool found = false; |
379 | for (item = mCardView->firstItem(); item && !found; | 379 | for (item = mCardView->firstItem(); item && !found; |
380 | item = item->nextItem()) | 380 | item = item->nextItem()) |
381 | { | 381 | { |
382 | #ifndef KAB_EMBEDDED | 382 | #ifndef KAB_EMBEDDED |
383 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 383 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
384 | #else //KAB_EMBEDDED | 384 | #else //KAB_EMBEDDED |
385 | aItem = (AddresseeCardViewItem*)(item); | 385 | aItem = (AddresseeCardViewItem*)(item); |
386 | #endif //KAB_EMBEDDED | 386 | #endif //KAB_EMBEDDED |
387 | 387 | ||
388 | if ((aItem) && (aItem->addressee().uid() == uid)) | 388 | if ((aItem) && (aItem->addressee().uid() == uid)) |
389 | { | 389 | { |
390 | aItem->refresh(); | 390 | aItem->refresh(); |
391 | found = true; | 391 | found = true; |
392 | } | 392 | } |
393 | } | 393 | } |
394 | } | 394 | } |
395 | } | 395 | } |
396 | 396 | ||
397 | void KAddressBookCardView::setSelected(QString uid, bool selected) | 397 | void KAddressBookCardView::setSelected(QString uid, bool selected) |
398 | { | 398 | { |
399 | CardViewItem *item; | 399 | CardViewItem *item; |
400 | AddresseeCardViewItem *aItem; | 400 | AddresseeCardViewItem *aItem; |
401 | 401 | ||
402 | if (uid.isNull()) | 402 | if (uid.isNull()) |
403 | { | 403 | { |
404 | mCardView->selectAll(selected); | 404 | mCardView->selectAll(selected); |
405 | } | 405 | } |
406 | else | 406 | else |
407 | { | 407 | { |
408 | bool found = false; | 408 | bool found = false; |
409 | for (item = mCardView->firstItem(); item && !found; | 409 | for (item = mCardView->firstItem(); item && !found; |
410 | item = item->nextItem()) | 410 | item = item->nextItem()) |
411 | { | 411 | { |
412 | #ifndef KAB_EMBEDDED | 412 | #ifndef KAB_EMBEDDED |
413 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 413 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
414 | #else //KAB_EMBEDDED | 414 | #else //KAB_EMBEDDED |
415 | aItem = (AddresseeCardViewItem*)(item); | 415 | aItem = (AddresseeCardViewItem*)(item); |
416 | #endif //KAB_EMBEDDED | 416 | #endif //KAB_EMBEDDED |
417 | 417 | ||
418 | if ((aItem) && (aItem->addressee().uid() == uid)) | 418 | if ((aItem) && (aItem->addressee().uid() == uid)) |
419 | { | 419 | { |
420 | mCardView->setSelected(aItem, selected); | 420 | mCardView->setSelected(aItem, selected); |
421 | mCardView->ensureItemVisible(item); | 421 | mCardView->ensureItemVisible(item); |
422 | found = true; | 422 | found = true; |
423 | } | 423 | } |
424 | } | 424 | } |
425 | } | 425 | } |
426 | } | 426 | } |
427 | 427 | ||
428 | //US added an additional method without parameter | 428 | //US added an additional method without parameter |
429 | void KAddressBookCardView::setSelected() | 429 | void KAddressBookCardView::setSelected() |
430 | { | 430 | { |
431 | setSelected(QString::null, true); | 431 | setSelected(QString::null, true); |
432 | } | 432 | } |
433 | 433 | ||
434 | void KAddressBookCardView::addresseeExecuted(CardViewItem *item) | 434 | void KAddressBookCardView::addresseeExecuted(CardViewItem *item) |
435 | { | 435 | { |
436 | #ifndef KAB_EMBEDDED | 436 | #ifndef KAB_EMBEDDED |
437 | AddresseeCardViewItem *aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 437 | AddresseeCardViewItem *aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
438 | #else //KAB_EMBEDDED | 438 | #else //KAB_EMBEDDED |
439 | AddresseeCardViewItem *aItem = (AddresseeCardViewItem*)(item); | 439 | AddresseeCardViewItem *aItem = (AddresseeCardViewItem*)(item); |
440 | #endif //KAB_EMBEDDED | 440 | #endif //KAB_EMBEDDED |
441 | if (aItem) | 441 | if (aItem) |
442 | { | 442 | { |
443 | //kdDebug()<<"... even has a valid item:)"<<endl; | 443 | //kdDebug()<<"... even has a valid item:)"<<endl; |
444 | emit executed(aItem->addressee().uid()); | 444 | emit executed(aItem->addressee().uid()); |
445 | } | 445 | } |
446 | } | 446 | } |
447 | 447 | ||
448 | void KAddressBookCardView::addresseeSelected() | 448 | void KAddressBookCardView::addresseeSelected() |
449 | { | 449 | { |
450 | CardViewItem *item; | 450 | CardViewItem *item; |
451 | AddresseeCardViewItem *aItem; | 451 | AddresseeCardViewItem *aItem; |
452 | 452 | ||
453 | bool found = false; | 453 | bool found = false; |
454 | for (item = mCardView->firstItem(); item && !found; | 454 | for (item = mCardView->firstItem(); item && !found; |
455 | item = item->nextItem()) | 455 | item = item->nextItem()) |
456 | { | 456 | { |
457 | if (item->isSelected()) | 457 | if (item->isSelected()) |
458 | { | 458 | { |
459 | #ifndef KAB_EMBEDDED | 459 | #ifndef KAB_EMBEDDED |
460 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 460 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
461 | #else //KAB_EMBEDDED | 461 | #else //KAB_EMBEDDED |
462 | aItem = (AddresseeCardViewItem*)(item); | 462 | aItem = (AddresseeCardViewItem*)(item); |
463 | #endif //KAB_EMBEDDED | 463 | #endif //KAB_EMBEDDED |
464 | if ( aItem ) | 464 | if ( aItem ) |
465 | { | 465 | { |
466 | emit selected(aItem->addressee().uid()); | 466 | emit selected(aItem->addressee().uid()); |
467 | found = true; | 467 | found = true; |
468 | } | 468 | } |
469 | } | 469 | } |
470 | } | 470 | } |
471 | 471 | ||
472 | if (!found) | 472 | if (!found) |
473 | emit selected(QString::null); | 473 | emit selected(QString::null); |
474 | 474 | ||
475 | } | 475 | } |
476 | #ifndef KAB_EMBEDDED | 476 | #ifndef KAB_EMBEDDED |
477 | #include "kaddressbookcardview.moc" | 477 | #include "kaddressbookcardview.moc" |
478 | #endif //KAB_EMBEDDED | 478 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp index 0ce56c8..faeda06 100644 --- a/kaddressbook/views/kaddressbookiconview.cpp +++ b/kaddressbook/views/kaddressbookiconview.cpp | |||
@@ -1,456 +1,456 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef KAB_EMBEDDED | 24 | #ifndef KAB_EMBEDDED |
25 | #include <qiconview.h> | 25 | #include <qiconview.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | 27 | ||
28 | #include <kabc/addressee.h> | 28 | #include <kabc/addressee.h> |
29 | #include <kconfig.h> | 29 | #include <kconfig.h> |
30 | #include <kdebug.h> | 30 | #include <kdebug.h> |
31 | #include <kglobal.h> | 31 | #include <kglobal.h> |
32 | #include <kiconloader.h> | 32 | #include <kiconloader.h> |
33 | #include <klocale.h> | 33 | #include <klocale.h> |
34 | 34 | ||
35 | #else //KAB_EMBEDDED | 35 | #else //KAB_EMBEDDED |
36 | #endif //KAB_EMBEDDED | 36 | #endif //KAB_EMBEDDED |
37 | 37 | ||
38 | #include <kabc/addressbook.h> | 38 | #include <kabc/addressbook.h> |
39 | #include "kabprefs.h" | 39 | #include "kabprefs.h" |
40 | #include "viewmanager.h" | 40 | #include "viewmanager.h" |
41 | #include "kaddressbookiconview.h" | 41 | #include "kaddressbookiconview.h" |
42 | #include <qlayout.h> | 42 | #include <qlayout.h> |
43 | #include <qregexp.h> | 43 | #include <qregexp.h> |
44 | #include <qapplication.h> | 44 | #include <qapplication.h> |
45 | #include <kglobal.h> | 45 | #include <kglobal.h> |
46 | /*US transfered to the headerfile | 46 | /*US transfered to the headerfile |
47 | class IconViewFactory : public ViewFactory | 47 | class IconViewFactory : public ViewFactory |
48 | { | 48 | { |
49 | public: | 49 | public: |
50 | KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name ) | 50 | KAddressBookView *view( KABC::AddressBook *ab, QWidget *parent, const char *name ) |
51 | { | 51 | { |
52 | return new KAddressBookIconView( ab, parent, name ); | 52 | return new KAddressBookIconView( ab, parent, name ); |
53 | } | 53 | } |
54 | 54 | ||
55 | QString type() const { return "Icon"; } | 55 | QString type() const { return "Icon"; } |
56 | 56 | ||
57 | QString description() const { return i18n( "Icons represent contacts. Very simple view." ); } | 57 | QString description() const { return i18n( "Icons represent contacts. Very simple view." ); } |
58 | }; | 58 | }; |
59 | 59 | ||
60 | */ | 60 | */ |
61 | 61 | ||
62 | extern "C" { | 62 | extern "C" { |
63 | void *init_libkaddrbk_iconview() | 63 | void *init_libkaddrbk_iconview() |
64 | { | 64 | { |
65 | return ( new IconViewFactory ); | 65 | return ( new IconViewFactory ); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | //////////////////////////////// | 69 | //////////////////////////////// |
70 | // AddresseeIconView (internal class) | 70 | // AddresseeIconView (internal class) |
71 | #ifndef KAB_EMBEDDED | 71 | #ifndef KAB_EMBEDDED |
72 | AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) | 72 | AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) |
73 | : KIconView(parent, name) | 73 | : KIconView(parent, name) |
74 | #else //KAB_EMBEDDED | 74 | #else //KAB_EMBEDDED |
75 | AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) | 75 | AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) |
76 | : QIconView(parent, name) | 76 | : QIconView(parent, name) |
77 | #endif //KAB_EMBEDDED | 77 | #endif //KAB_EMBEDDED |
78 | 78 | ||
79 | { | 79 | { |
80 | setSelectionMode( QIconView::Extended ); | 80 | setSelectionMode( QIconView::Extended ); |
81 | setResizeMode( QIconView::Adjust ); | 81 | setResizeMode( QIconView::Adjust ); |
82 | setWordWrapIconText( true ); | 82 | setWordWrapIconText( true ); |
83 | setGridX( 100 ); | 83 | setGridX( 100 ); |
84 | setItemsMovable(false); | 84 | setItemsMovable(false); |
85 | setSorting(true, true); | 85 | setSorting(true, true); |
86 | 86 | ||
87 | 87 | ||
88 | //US ??? setMode( KIconView::Select ); | 88 | //US ??? setMode( KIconView::Select ); |
89 | 89 | ||
90 | #ifndef KAB_EMBEDDED | 90 | #ifndef KAB_EMBEDDED |
91 | 91 | ||
92 | connect(this, SIGNAL(dropped(QDropEvent*, const QValueList<QIconDragItem>&)), | 92 | connect(this, SIGNAL(dropped(QDropEvent*, const QValueList<QIconDragItem>&)), |
93 | this, SLOT(itemDropped(QDropEvent*, const QValueList<QIconDragItem>&))); | 93 | this, SLOT(itemDropped(QDropEvent*, const QValueList<QIconDragItem>&))); |
94 | #endif //KAB_EMBEDDED | 94 | #endif //KAB_EMBEDDED |
95 | } | 95 | } |
96 | 96 | ||
97 | AddresseeIconView::~AddresseeIconView() | 97 | AddresseeIconView::~AddresseeIconView() |
98 | { | 98 | { |
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
102 | void AddresseeIconView::itemDropped(QDropEvent *e, | 102 | void AddresseeIconView::itemDropped(QDropEvent *e, |
103 | const QValueList<QIconDragItem> &) | 103 | const QValueList<QIconDragItem> &) |
104 | { | 104 | { |
105 | emit addresseeDropped(e); | 105 | emit addresseeDropped(e); |
106 | } | 106 | } |
107 | 107 | ||
108 | QDragObject *AddresseeIconView::dragObject() | 108 | QDragObject *AddresseeIconView::dragObject() |
109 | { | 109 | { |
110 | emit startAddresseeDrag(); | 110 | emit startAddresseeDrag(); |
111 | 111 | ||
112 | // We never want IconView to start the drag | 112 | // We never want IconView to start the drag |
113 | return 0; | 113 | return 0; |
114 | } | 114 | } |
115 | //////////////////////////////// | 115 | //////////////////////////////// |
116 | // AddresseeIconViewItem (internal class) | 116 | // AddresseeIconViewItem (internal class) |
117 | #ifndef KAB_EMBEDDED | 117 | #ifndef KAB_EMBEDDED |
118 | class AddresseeIconViewItem : public KIconViewItem | 118 | class AddresseeIconViewItem : public KIconViewItem |
119 | #else //KAB_EMBEDDED | 119 | #else //KAB_EMBEDDED |
120 | class AddresseeIconViewItem : public QIconViewItem | 120 | class AddresseeIconViewItem : public QIconViewItem |
121 | #endif //KAB_EMBEDDED | 121 | #endif //KAB_EMBEDDED |
122 | { | 122 | { |
123 | public: | 123 | public: |
124 | #ifndef KAB_EMBEDDED | 124 | #ifndef KAB_EMBEDDED |
125 | AddresseeIconViewItem(const KABC::Field::List &fields, | 125 | AddresseeIconViewItem(const KABC::Field::List &fields, |
126 | KABC::AddressBook *doc, const KABC::Addressee &a, | 126 | KABC::AddressBook *doc, const KABC::Addressee &a, |
127 | QIconView *parent) | 127 | QIconView *parent) |
128 | : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) | 128 | : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) |
129 | #else //KAB_EMBEDDED | 129 | #else //KAB_EMBEDDED |
130 | AddresseeIconViewItem(const KABC::Field::List &fields, | 130 | AddresseeIconViewItem(const KABC::Field::List &fields, |
131 | KABC::AddressBook *doc, const KABC::Addressee &a, | 131 | KABC::AddressBook *doc, const KABC::Addressee &a, |
132 | QIconView *parent) | 132 | QIconView *parent) |
133 | : QIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) | 133 | : QIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) |
134 | #endif //KAB_EMBEDDED | 134 | #endif //KAB_EMBEDDED |
135 | { | 135 | { |
136 | if ( mFields.isEmpty() ) { | 136 | if ( mFields.isEmpty() ) { |
137 | mFields = KABC::Field::defaultFields(); | 137 | mFields = KABC::Field::defaultFields(); |
138 | } | 138 | } |
139 | refresh(); | 139 | refresh(); |
140 | } | 140 | } |
141 | 141 | ||
142 | const KABC::Addressee &addressee() const { return mAddressee; } | 142 | const KABC::Addressee &addressee() const { return mAddressee; } |
143 | 143 | ||
144 | void refresh() | 144 | void refresh() |
145 | { | 145 | { |
146 | // Update our addressee, since it may have changed elsewhere | 146 | // Update our addressee, since it may have changed elsewhere |
147 | mAddressee = mDocument->findByUid(mAddressee.uid()); | 147 | mAddressee = mDocument->findByUid(mAddressee.uid()); |
148 | 148 | ||
149 | if (!mAddressee.isEmpty()) | 149 | if (!mAddressee.isEmpty()) |
150 | setText( mAddressee.givenName() + " " + mAddressee.familyName() ); | 150 | setText( mAddressee.givenName() + " " + mAddressee.familyName() ); |
151 | 151 | ||
152 | QPixmap icon; | 152 | QPixmap icon; |
153 | QPixmap defaultIcon( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop, 128 ) ); | 153 | QPixmap defaultIcon( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop, 128 ) ); |
154 | KABC::Picture pic = mAddressee.photo(); | 154 | KABC::Picture pic = mAddressee.photo(); |
155 | if ( pic.data().isNull() ) | 155 | if ( pic.data().isNull() ) |
156 | pic = mAddressee.logo(); | 156 | pic = mAddressee.logo(); |
157 | 157 | ||
158 | if ( pic.isIntern() && !pic.data().isNull() ) { | 158 | if ( pic.isIntern() && !pic.data().isNull() ) { |
159 | QImage img = pic.data(); | 159 | QImage img = pic.data(); |
160 | #ifndef KAB_EMBEDDED | 160 | #ifndef KAB_EMBEDDED |
161 | if ( img.width() > img.height() ) | 161 | if ( img.width() > img.height() ) |
162 | icon = img.scaleWidth( 32 ); | 162 | icon = img.scaleWidth( 32 ); |
163 | else | 163 | else |
164 | icon = img.scaleHeight( 32 ); | 164 | icon = img.scaleHeight( 32 ); |
165 | #else //KAB_EMBEDDED | 165 | #else //KAB_EMBEDDED |
166 | qDebug("AddresseeIconViewItem::refresh - scale here dependend of the displaysize and the right factor"); | 166 | qDebug("AddresseeIconViewItem::refresh - scale here dependend of the displaysize and the right factor"); |
167 | icon.convertFromImage(img.smoothScale(32, 32)); | 167 | icon.convertFromImage(img.smoothScale(32, 32)); |
168 | #endif //KAB_EMBEDDED | 168 | #endif //KAB_EMBEDDED |
169 | 169 | ||
170 | } else | 170 | } else |
171 | icon = defaultIcon; | 171 | icon = defaultIcon; |
172 | 172 | ||
173 | setPixmap( icon ); | 173 | setPixmap( icon ); |
174 | } | 174 | } |
175 | 175 | ||
176 | private: | 176 | private: |
177 | KABC::Field::List mFields; | 177 | KABC::Field::List mFields; |
178 | KABC::AddressBook *mDocument; | 178 | KABC::AddressBook *mDocument; |
179 | KABC::Addressee mAddressee; | 179 | KABC::Addressee mAddressee; |
180 | }; | 180 | }; |
181 | 181 | ||
182 | /////////////////////////////// | 182 | /////////////////////////////// |
183 | // KAddressBookView | 183 | // KAddressBookView |
184 | 184 | ||
185 | KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, | 185 | KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, |
186 | QWidget *parent, const char *name) | 186 | QWidget *parent, const char *name) |
187 | : KAddressBookView( ab, parent, name ) | 187 | : KAddressBookView( ab, parent, name ) |
188 | { | 188 | { |
189 | // Init the GUI | 189 | // Init the GUI |
190 | QVBoxLayout *layout = new QVBoxLayout(viewWidget()); | 190 | QVBoxLayout *layout = new QVBoxLayout(viewWidget()); |
191 | 191 | ||
192 | mIconView = new AddresseeIconView(viewWidget(), "mIconView"); | 192 | mIconView = new AddresseeIconView(viewWidget(), "mIconView"); |
193 | layout->addWidget(mIconView); | 193 | layout->addWidget(mIconView); |
194 | 194 | ||
195 | // Connect up the signals | 195 | // Connect up the signals |
196 | 196 | ||
197 | //US method executed is part of KIconView | 197 | //US method executed is part of KIconView |
198 | //US connect(mIconView, SIGNAL(executed(QIconViewItem *)), | 198 | //US connect(mIconView, SIGNAL(executed(QIconViewItem *)), |
199 | //US this, SLOT(addresseeExecuted(QIconViewItem *))); | 199 | //US this, SLOT(addresseeExecuted(QIconViewItem *))); |
200 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), | 200 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), |
201 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 201 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
202 | 202 | ||
203 | connect(mIconView, SIGNAL(selectionChanged()), | 203 | connect(mIconView, SIGNAL(selectionChanged()), |
204 | this, SLOT(addresseeSelected())); | 204 | this, SLOT(addresseeSelected())); |
205 | connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)), | 205 | connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)), |
206 | this, SIGNAL(dropped(QDropEvent*))); | 206 | this, SIGNAL(dropped(QDropEvent*))); |
207 | connect(mIconView, SIGNAL(startAddresseeDrag()), | 207 | connect(mIconView, SIGNAL(startAddresseeDrag()), |
208 | this, SIGNAL(startDrag())); | 208 | this, SIGNAL(startDrag())); |
209 | } | 209 | } |
210 | 210 | ||
211 | KAddressBookIconView::~KAddressBookIconView() | 211 | KAddressBookIconView::~KAddressBookIconView() |
212 | { | 212 | { |
213 | } | 213 | } |
214 | void KAddressBookIconView::setFocusAV() | 214 | void KAddressBookIconView::setFocusAV() |
215 | { | 215 | { |
216 | if ( mIconView ) | 216 | if ( mIconView ) |
217 | mIconView->setFocus(); | 217 | mIconView->setFocus(); |
218 | } | 218 | } |
219 | 219 | ||
220 | 220 | ||
221 | void KAddressBookIconView::scrollUP() | 221 | void KAddressBookIconView::scrollUP() |
222 | { | 222 | { |
223 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); | 223 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); |
224 | QApplication::postEvent( mIconView, ev ); | 224 | QApplication::postEvent( mIconView, ev ); |
225 | } | 225 | } |
226 | void KAddressBookIconView::scrollDOWN() | 226 | void KAddressBookIconView::scrollDOWN() |
227 | { | 227 | { |
228 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); | 228 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); |
229 | QApplication::postEvent( mIconView, ev ); | 229 | QApplication::postEvent( mIconView, ev ); |
230 | } | 230 | } |
231 | void KAddressBookIconView::readConfig(KConfig *config) | 231 | void KAddressBookIconView::readConfig(KConfig *config) |
232 | { | 232 | { |
233 | KAddressBookView::readConfig(config); | 233 | KAddressBookView::readConfig(config); |
234 | 234 | ||
235 | //US method executed is part of KIconView | 235 | //US method executed is part of KIconView |
236 | //US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), | 236 | //US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), |
237 | //US this, SLOT(addresseeExecuted(QIconViewItem *))); | 237 | //US this, SLOT(addresseeExecuted(QIconViewItem *))); |
238 | disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), | 238 | disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), |
239 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 239 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
240 | 240 | ||
241 | //US method executed is part of KIconView. Use selectionChanged instead | 241 | //US method executed is part of KIconView. Use selectionChanged instead |
242 | /*US | 242 | /*US |
243 | if (KABPrefs::instance()->mHonorSingleClick) | 243 | if (KABPrefs::instance()->mHonorSingleClick) |
244 | connect(mIconView, SIGNAL(executed(QIconViewItem *)), | 244 | connect(mIconView, SIGNAL(executed(QIconViewItem *)), |
245 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 245 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
246 | else | 246 | else |
247 | connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), | 247 | connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), |
248 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 248 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
249 | */ | 249 | */ |
250 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), | 250 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), |
251 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 251 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
252 | 252 | ||
253 | } | 253 | } |
254 | void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) | 254 | void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) |
255 | { | 255 | { |
256 | mIconView->clear(); | 256 | mIconView->clear(); |
257 | mIconList.clear(); | 257 | mIconList.clear(); |
258 | if ( s.isEmpty() || s == "*" ) { | 258 | if ( s.isEmpty() || s == "*" ) { |
259 | refresh(); | 259 | refresh(); |
260 | return; | 260 | return; |
261 | } | 261 | } |
262 | QString pattern = s.lower()+"*"; | 262 | QString pattern = s.lower()+"*"; |
263 | QRegExp re; | 263 | QRegExp re; |
264 | re.setWildcard(true); // most people understand these better. | 264 | re.setWildcard(true); // most people understand these better. |
265 | re.setCaseSensitive(false); | 265 | re.setCaseSensitive(false); |
266 | re.setPattern( pattern ); | 266 | re.setPattern( pattern ); |
267 | if (!re.isValid()) | 267 | if (!re.isValid()) |
268 | return; | 268 | return; |
269 | KABC::Addressee::List addresseeList = addressees(); | 269 | KABC::Addressee::List addresseeList = addressees(); |
270 | KABC::Addressee::List::Iterator it; | 270 | KABC::Addressee::List::Iterator it; |
271 | if ( field ) { | 271 | if ( field ) { |
272 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 272 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
273 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 273 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
274 | continue; | 274 | continue; |
275 | #if QT_VERSION >= 300 | 275 | #if QT_VERSION >= 300 |
276 | if (re.search(field->value( *it ).lower()) != -1) | 276 | if (re.search(field->value( *it ).lower()) != -1) |
277 | #else | 277 | #else |
278 | if (re.match(field->value( *it ).lower()) != -1) | 278 | if (re.match(field->value( *it ).lower()) != -1) |
279 | #endif | 279 | #endif |
280 | mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); | 280 | mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); |
281 | 281 | ||
282 | 282 | ||
283 | } | 283 | } |
284 | } else { | 284 | } else { |
285 | KABC::Field::List fieldList = fields(); | 285 | KABC::Field::List fieldList = allFields(); |
286 | KABC::Field::List::ConstIterator fieldIt; | 286 | KABC::Field::List::ConstIterator fieldIt; |
287 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 287 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
288 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 288 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
289 | continue; | 289 | continue; |
290 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 290 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
291 | #if QT_VERSION >= 300 | 291 | #if QT_VERSION >= 300 |
292 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 292 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) |
293 | #else | 293 | #else |
294 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 294 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) |
295 | #endif | 295 | #endif |
296 | { | 296 | { |
297 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); | 297 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); |
298 | continue; | 298 | continue; |
299 | } | 299 | } |
300 | } | 300 | } |
301 | } | 301 | } |
302 | } | 302 | } |
303 | mIconView->arrangeItemsInGrid( true ); | 303 | mIconView->arrangeItemsInGrid( true ); |
304 | if ( mIconView->firstItem() ) { | 304 | if ( mIconView->firstItem() ) { |
305 | mIconView->setCurrentItem ( mIconView->firstItem() ); | 305 | mIconView->setCurrentItem ( mIconView->firstItem() ); |
306 | mIconView->setSelected ( mIconView->firstItem() , true ); | 306 | mIconView->setSelected ( mIconView->firstItem() , true ); |
307 | } | 307 | } |
308 | else | 308 | else |
309 | emit selected(QString::null); | 309 | emit selected(QString::null); |
310 | } | 310 | } |
311 | QStringList KAddressBookIconView::selectedUids() | 311 | QStringList KAddressBookIconView::selectedUids() |
312 | { | 312 | { |
313 | QStringList uidList; | 313 | QStringList uidList; |
314 | QIconViewItem *item; | 314 | QIconViewItem *item; |
315 | AddresseeIconViewItem *aItem; | 315 | AddresseeIconViewItem *aItem; |
316 | 316 | ||
317 | for (item = mIconView->firstItem(); item; item = item->nextItem()) | 317 | for (item = mIconView->firstItem(); item; item = item->nextItem()) |
318 | { | 318 | { |
319 | if (item->isSelected()) | 319 | if (item->isSelected()) |
320 | { | 320 | { |
321 | #ifndef KAB_EMBEDDED | 321 | #ifndef KAB_EMBEDDED |
322 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 322 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
323 | #else //KAB_EMBEDDED | 323 | #else //KAB_EMBEDDED |
324 | aItem = (AddresseeIconViewItem*)(item); | 324 | aItem = (AddresseeIconViewItem*)(item); |
325 | #endif //KAB_EMBEDDED | 325 | #endif //KAB_EMBEDDED |
326 | if (aItem) | 326 | if (aItem) |
327 | uidList << aItem->addressee().uid(); | 327 | uidList << aItem->addressee().uid(); |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
331 | return uidList; | 331 | return uidList; |
332 | } | 332 | } |
333 | 333 | ||
334 | void KAddressBookIconView::refresh(QString uid) | 334 | void KAddressBookIconView::refresh(QString uid) |
335 | { | 335 | { |
336 | QIconViewItem *item; | 336 | QIconViewItem *item; |
337 | AddresseeIconViewItem *aItem; | 337 | AddresseeIconViewItem *aItem; |
338 | 338 | ||
339 | if ( uid.isNull() ) { | 339 | if ( uid.isNull() ) { |
340 | // Rebuild the view | 340 | // Rebuild the view |
341 | mIconView->clear(); | 341 | mIconView->clear(); |
342 | mIconList.clear(); | 342 | mIconList.clear(); |
343 | 343 | ||
344 | KABC::Addressee::List addresseeList = addressees(); | 344 | KABC::Addressee::List addresseeList = addressees(); |
345 | KABC::Addressee::List::Iterator iter; | 345 | KABC::Addressee::List::Iterator iter; |
346 | for ( iter = addresseeList.begin(); iter != addresseeList.end(); ++iter ) { | 346 | for ( iter = addresseeList.begin(); iter != addresseeList.end(); ++iter ) { |
347 | if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") ) | 347 | if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") ) |
348 | continue; | 348 | continue; |
349 | aItem = new AddresseeIconViewItem( fields(), addressBook(), *iter, mIconView ); | 349 | aItem = new AddresseeIconViewItem( fields(), addressBook(), *iter, mIconView ); |
350 | } | 350 | } |
351 | 351 | ||
352 | mIconView->arrangeItemsInGrid( true ); | 352 | mIconView->arrangeItemsInGrid( true ); |
353 | 353 | ||
354 | for ( item = mIconView->firstItem(); item; item = item->nextItem() ) | 354 | for ( item = mIconView->firstItem(); item; item = item->nextItem() ) |
355 | { | 355 | { |
356 | #ifndef KAB_EMBEDDED | 356 | #ifndef KAB_EMBEDDED |
357 | AddresseeIconViewItem* aivi = dynamic_cast<AddresseeIconViewItem*>( item ); | 357 | AddresseeIconViewItem* aivi = dynamic_cast<AddresseeIconViewItem*>( item ); |
358 | #else //KAB_EMBEDDED | 358 | #else //KAB_EMBEDDED |
359 | AddresseeIconViewItem* aivi = (AddresseeIconViewItem*)( item ); | 359 | AddresseeIconViewItem* aivi = (AddresseeIconViewItem*)( item ); |
360 | #endif //KAB_EMBEDDED | 360 | #endif //KAB_EMBEDDED |
361 | mIconList.append( aivi ); | 361 | mIconList.append( aivi ); |
362 | } | 362 | } |
363 | 363 | ||
364 | } else { | 364 | } else { |
365 | // Try to find the one to refresh | 365 | // Try to find the one to refresh |
366 | for ( item = mIconView->firstItem(); item; item = item->nextItem() ) { | 366 | for ( item = mIconView->firstItem(); item; item = item->nextItem() ) { |
367 | #ifndef KAB_EMBEDDED | 367 | #ifndef KAB_EMBEDDED |
368 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 368 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
369 | #else //KAB_EMBEDDED | 369 | #else //KAB_EMBEDDED |
370 | aItem = (AddresseeIconViewItem*)(item); | 370 | aItem = (AddresseeIconViewItem*)(item); |
371 | #endif //KAB_EMBEDDED | 371 | #endif //KAB_EMBEDDED |
372 | if ((aItem) && (aItem->addressee().uid() == uid)) { | 372 | if ((aItem) && (aItem->addressee().uid() == uid)) { |
373 | aItem->refresh(); | 373 | aItem->refresh(); |
374 | mIconView->arrangeItemsInGrid( true ); | 374 | mIconView->arrangeItemsInGrid( true ); |
375 | return; | 375 | return; |
376 | } | 376 | } |
377 | } | 377 | } |
378 | refresh( QString::null ); | 378 | refresh( QString::null ); |
379 | } | 379 | } |
380 | } | 380 | } |
381 | 381 | ||
382 | void KAddressBookIconView::setSelected(QString uid, bool selected) | 382 | void KAddressBookIconView::setSelected(QString uid, bool selected) |
383 | { | 383 | { |
384 | QIconViewItem *item; | 384 | QIconViewItem *item; |
385 | AddresseeIconViewItem *aItem; | 385 | AddresseeIconViewItem *aItem; |
386 | 386 | ||
387 | if (uid.isNull()) | 387 | if (uid.isNull()) |
388 | { | 388 | { |
389 | mIconView->selectAll(selected); | 389 | mIconView->selectAll(selected); |
390 | } | 390 | } |
391 | else | 391 | else |
392 | { | 392 | { |
393 | bool found = false; | 393 | bool found = false; |
394 | for (item = mIconView->firstItem(); item && !found; | 394 | for (item = mIconView->firstItem(); item && !found; |
395 | item = item->nextItem()) | 395 | item = item->nextItem()) |
396 | { | 396 | { |
397 | #ifndef KAB_EMBEDDED | 397 | #ifndef KAB_EMBEDDED |
398 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 398 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
399 | #else //KAB_EMBEDDED | 399 | #else //KAB_EMBEDDED |
400 | aItem = (AddresseeIconViewItem*)(item); | 400 | aItem = (AddresseeIconViewItem*)(item); |
401 | #endif //KAB_EMBEDDED | 401 | #endif //KAB_EMBEDDED |
402 | 402 | ||
403 | if ((aItem) && (aItem->addressee().uid() == uid)) | 403 | if ((aItem) && (aItem->addressee().uid() == uid)) |
404 | { | 404 | { |
405 | mIconView->setSelected(aItem, selected); | 405 | mIconView->setSelected(aItem, selected); |
406 | mIconView->ensureItemVisible( aItem ); | 406 | mIconView->ensureItemVisible( aItem ); |
407 | found = true; | 407 | found = true; |
408 | } | 408 | } |
409 | } | 409 | } |
410 | } | 410 | } |
411 | } | 411 | } |
412 | 412 | ||
413 | void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) | 413 | void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) |
414 | { | 414 | { |
415 | #ifndef KAB_EMBEDDED | 415 | #ifndef KAB_EMBEDDED |
416 | AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 416 | AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
417 | #else //KAB_EMBEDDED | 417 | #else //KAB_EMBEDDED |
418 | AddresseeIconViewItem *aItem = (AddresseeIconViewItem*)(item); | 418 | AddresseeIconViewItem *aItem = (AddresseeIconViewItem*)(item); |
419 | #endif //KAB_EMBEDDED | 419 | #endif //KAB_EMBEDDED |
420 | 420 | ||
421 | if (aItem) { | 421 | if (aItem) { |
422 | emit executed(aItem->addressee().uid()); | 422 | emit executed(aItem->addressee().uid()); |
423 | } | 423 | } |
424 | } | 424 | } |
425 | 425 | ||
426 | void KAddressBookIconView::addresseeSelected() | 426 | void KAddressBookIconView::addresseeSelected() |
427 | { | 427 | { |
428 | QIconViewItem *item; | 428 | QIconViewItem *item; |
429 | AddresseeIconViewItem *aItem; | 429 | AddresseeIconViewItem *aItem; |
430 | 430 | ||
431 | bool found = false; | 431 | bool found = false; |
432 | for (item = mIconView->firstItem(); item && !found; | 432 | for (item = mIconView->firstItem(); item && !found; |
433 | item = item->nextItem()) | 433 | item = item->nextItem()) |
434 | { | 434 | { |
435 | if (item->isSelected()) | 435 | if (item->isSelected()) |
436 | { | 436 | { |
437 | #ifndef KAB_EMBEDDED | 437 | #ifndef KAB_EMBEDDED |
438 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 438 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
439 | #else //KAB_EMBEDDED | 439 | #else //KAB_EMBEDDED |
440 | aItem = (AddresseeIconViewItem*)(item); | 440 | aItem = (AddresseeIconViewItem*)(item); |
441 | #endif //KAB_EMBEDDED | 441 | #endif //KAB_EMBEDDED |
442 | if (aItem) | 442 | if (aItem) |
443 | { | 443 | { |
444 | emit selected(aItem->addressee().uid()); | 444 | emit selected(aItem->addressee().uid()); |
445 | found = true; | 445 | found = true; |
446 | } | 446 | } |
447 | } | 447 | } |
448 | } | 448 | } |
449 | 449 | ||
450 | if (!found) | 450 | if (!found) |
451 | emit selected(QString::null); | 451 | emit selected(QString::null); |
452 | } | 452 | } |
453 | 453 | ||
454 | #ifndef KAB_EMBEDDED | 454 | #ifndef KAB_EMBEDDED |
455 | #include "kaddressbookiconview.moc" | 455 | #include "kaddressbookiconview.moc" |
456 | #endif //KAB_EMBEDDED | 456 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 89053c2..61703ee 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp | |||
@@ -1,475 +1,471 @@ | |||
1 | // $Id$ | 1 | // $Id$ |
2 | 2 | ||
3 | #include <qvbox.h> | 3 | #include <qvbox.h> |
4 | #include <qlistbox.h> | 4 | #include <qlistbox.h> |
5 | #include <qwidget.h> | 5 | #include <qwidget.h> |
6 | #include <qfile.h> | 6 | #include <qfile.h> |
7 | #include <qimage.h> | 7 | #include <qimage.h> |
8 | #include <qcombobox.h> | 8 | #include <qcombobox.h> |
9 | #include <qapplication.h> | 9 | #include <qapplication.h> |
10 | #include <qdragobject.h> | 10 | #include <qdragobject.h> |
11 | #include <qevent.h> | 11 | #include <qevent.h> |
12 | #include <qurl.h> | 12 | #include <qurl.h> |
13 | #include <qpixmap.h> | 13 | #include <qpixmap.h> |
14 | 14 | ||
15 | #include <kabc/addressbook.h> | 15 | #include <kabc/addressbook.h> |
16 | #include <kapplication.h> | 16 | #include <kapplication.h> |
17 | #include <kconfig.h> | 17 | #include <kconfig.h> |
18 | #include <kcolorbutton.h> | 18 | #include <kcolorbutton.h> |
19 | #include <kdebug.h> | 19 | #include <kdebug.h> |
20 | #include <kglobal.h> | 20 | #include <kglobal.h> |
21 | #include <kiconloader.h> | 21 | #include <kiconloader.h> |
22 | #include <klineedit.h> | 22 | #include <klineedit.h> |
23 | #include <klocale.h> | 23 | #include <klocale.h> |
24 | #include <kmessagebox.h> | 24 | #include <kmessagebox.h> |
25 | #include <kurl.h> | 25 | #include <kurl.h> |
26 | #include <kurlrequester.h> | 26 | #include <kurlrequester.h> |
27 | 27 | ||
28 | //US#include "configuretableviewdialog.h" | 28 | //US#include "configuretableviewdialog.h" |
29 | #include "contactlistview.h" | 29 | #include "contactlistview.h" |
30 | #include "kabprefs.h" | 30 | #include "kabprefs.h" |
31 | #include "undocmds.h" | 31 | #include "undocmds.h" |
32 | #include "viewmanager.h" | 32 | #include "viewmanager.h" |
33 | 33 | ||
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qheader.h> | 35 | #include <qheader.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | 37 | ||
38 | #include "kaddressbooktableview.h" | 38 | #include "kaddressbooktableview.h" |
39 | 39 | ||
40 | 40 | ||
41 | KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, | 41 | KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, |
42 | QWidget *parent, const char *name ) | 42 | QWidget *parent, const char *name ) |
43 | : KAddressBookView( ab, parent, name ) | 43 | : KAddressBookView( ab, parent, name ) |
44 | { | 44 | { |
45 | mainLayout = new QVBoxLayout( viewWidget(), 2 ); | 45 | mainLayout = new QVBoxLayout( viewWidget(), 2 ); |
46 | 46 | ||
47 | // The list view will be created when the config is read. | 47 | // The list view will be created when the config is read. |
48 | mListView = 0; | 48 | mListView = 0; |
49 | } | 49 | } |
50 | 50 | ||
51 | KAddressBookTableView::~KAddressBookTableView() | 51 | KAddressBookTableView::~KAddressBookTableView() |
52 | { | 52 | { |
53 | } | 53 | } |
54 | void KAddressBookTableView::setFocusAV() | 54 | void KAddressBookTableView::setFocusAV() |
55 | { | 55 | { |
56 | if ( mListView ) | 56 | if ( mListView ) |
57 | mListView->setFocus(); | 57 | mListView->setFocus(); |
58 | 58 | ||
59 | } | 59 | } |
60 | void KAddressBookTableView::scrollUP() | 60 | void KAddressBookTableView::scrollUP() |
61 | { | 61 | { |
62 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); | 62 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); |
63 | QApplication::postEvent( mListView, ev ); | 63 | QApplication::postEvent( mListView, ev ); |
64 | } | 64 | } |
65 | void KAddressBookTableView::scrollDOWN() | 65 | void KAddressBookTableView::scrollDOWN() |
66 | { | 66 | { |
67 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); | 67 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); |
68 | QApplication::postEvent( mListView, ev ); | 68 | QApplication::postEvent( mListView, ev ); |
69 | } | 69 | } |
70 | void KAddressBookTableView::reconstructListView() | 70 | void KAddressBookTableView::reconstructListView() |
71 | { | 71 | { |
72 | if (mListView) | 72 | if (mListView) |
73 | { | 73 | { |
74 | disconnect(mListView, SIGNAL(selectionChanged()), | 74 | disconnect(mListView, SIGNAL(selectionChanged()), |
75 | this, SLOT(addresseeSelected())); | 75 | this, SLOT(addresseeSelected())); |
76 | disconnect(mListView, SIGNAL(executed(QListViewItem*)), | 76 | disconnect(mListView, SIGNAL(executed(QListViewItem*)), |
77 | this, SLOT(addresseeExecuted(QListViewItem*))); | 77 | this, SLOT(addresseeExecuted(QListViewItem*))); |
78 | disconnect(mListView, SIGNAL(doubleClicked(QListViewItem*)), | 78 | disconnect(mListView, SIGNAL(doubleClicked(QListViewItem*)), |
79 | this, SLOT(addresseeExecuted(QListViewItem*))); | 79 | this, SLOT(addresseeExecuted(QListViewItem*))); |
80 | disconnect(mListView, SIGNAL(startAddresseeDrag()), this, | 80 | disconnect(mListView, SIGNAL(startAddresseeDrag()), this, |
81 | SIGNAL(startDrag())); | 81 | SIGNAL(startDrag())); |
82 | disconnect(mListView, SIGNAL(returnPressed(QListViewItem*)), | 82 | disconnect(mListView, SIGNAL(returnPressed(QListViewItem*)), |
83 | this, SLOT(addresseeExecuted(QListViewItem*))); | 83 | this, SLOT(addresseeExecuted(QListViewItem*))); |
84 | 84 | ||
85 | disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, | 85 | disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, |
86 | SIGNAL(dropped(QDropEvent*))); | 86 | SIGNAL(dropped(QDropEvent*))); |
87 | delete mListView; | 87 | delete mListView; |
88 | } | 88 | } |
89 | 89 | ||
90 | mListView = new ContactListView( this, addressBook(), viewWidget() ); | 90 | mListView = new ContactListView( this, addressBook(), viewWidget() ); |
91 | 91 | ||
92 | //US set singleClick manually, because it is no global configparameter in embedded space | 92 | //US set singleClick manually, because it is no global configparameter in embedded space |
93 | mListView->setSingleClick(KABPrefs::instance()->mHonorSingleClick); | 93 | mListView->setSingleClick(KABPrefs::instance()->mHonorSingleClick); |
94 | 94 | ||
95 | // Add the columns | 95 | // Add the columns |
96 | KABC::Field::List fieldList = fields(); | 96 | KABC::Field::List fieldList = fields(); |
97 | KABC::Field::List::ConstIterator it; | 97 | KABC::Field::List::ConstIterator it; |
98 | 98 | ||
99 | int c = 0; | 99 | int c = 0; |
100 | for( it = fieldList.begin(); it != fieldList.end(); ++it ) { | 100 | for( it = fieldList.begin(); it != fieldList.end(); ++it ) { |
101 | mListView->addColumn( (*it)->label() ); | 101 | mListView->addColumn( (*it)->label() ); |
102 | mListView->setColumnWidthMode(c++, QListView::Manual); | 102 | mListView->setColumnWidthMode(c++, QListView::Manual); |
103 | //US | 103 | //US |
104 | // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); | 104 | // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); |
105 | } | 105 | } |
106 | 106 | ||
107 | connect(mListView, SIGNAL(selectionChanged()), | 107 | connect(mListView, SIGNAL(selectionChanged()), |
108 | this, SLOT(addresseeSelected())); | 108 | this, SLOT(addresseeSelected())); |
109 | connect(mListView, SIGNAL(startAddresseeDrag()), this, | 109 | connect(mListView, SIGNAL(startAddresseeDrag()), this, |
110 | SIGNAL(startDrag())); | 110 | SIGNAL(startDrag())); |
111 | connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, | 111 | connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, |
112 | SIGNAL(dropped(QDropEvent*))); | 112 | SIGNAL(dropped(QDropEvent*))); |
113 | 113 | ||
114 | if (KABPrefs::instance()->mHonorSingleClick) { | 114 | if (KABPrefs::instance()->mHonorSingleClick) { |
115 | // qDebug("KAddressBookTableView::reconstructListView single"); | 115 | // qDebug("KAddressBookTableView::reconstructListView single"); |
116 | connect(mListView, SIGNAL(executed(QListViewItem*)), | 116 | connect(mListView, SIGNAL(executed(QListViewItem*)), |
117 | this, SLOT(addresseeExecuted(QListViewItem*))); | 117 | this, SLOT(addresseeExecuted(QListViewItem*))); |
118 | } else { | 118 | } else { |
119 | // qDebug("KAddressBookTableView::reconstructListView double"); | 119 | // qDebug("KAddressBookTableView::reconstructListView double"); |
120 | connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), | 120 | connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), |
121 | this, SLOT(addresseeExecuted(QListViewItem*))); | 121 | this, SLOT(addresseeExecuted(QListViewItem*))); |
122 | } | 122 | } |
123 | connect(mListView, SIGNAL(returnPressed(QListViewItem*)), | 123 | connect(mListView, SIGNAL(returnPressed(QListViewItem*)), |
124 | this, SLOT(addresseeExecuted(QListViewItem*))); | 124 | this, SLOT(addresseeExecuted(QListViewItem*))); |
125 | connect(mListView, SIGNAL(signalDelete()), | 125 | connect(mListView, SIGNAL(signalDelete()), |
126 | this, SLOT(addresseeDeleted())); | 126 | this, SLOT(addresseeDeleted())); |
127 | 127 | ||
128 | //US performceimprovement. Refresh is done from the outside | 128 | //US performceimprovement. Refresh is done from the outside |
129 | //US refresh(); | 129 | //US refresh(); |
130 | 130 | ||
131 | mListView->setSorting( 0, true ); | 131 | mListView->setSorting( 0, true ); |
132 | mainLayout->addWidget( mListView ); | 132 | mainLayout->addWidget( mListView ); |
133 | mainLayout->activate(); | 133 | mainLayout->activate(); |
134 | mListView->show(); | 134 | mListView->show(); |
135 | } | 135 | } |
136 | 136 | ||
137 | void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) | 137 | void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) |
138 | { | 138 | { |
139 | mListView->clear(); | 139 | mListView->clear(); |
140 | if ( s.isEmpty() || s == "*" ) { | 140 | if ( s.isEmpty() || s == "*" ) { |
141 | refresh(); | 141 | refresh(); |
142 | return; | 142 | return; |
143 | } | 143 | } |
144 | QString pattern = s.lower()+"*"; | 144 | QString pattern = s.lower()+"*"; |
145 | QRegExp re; | 145 | QRegExp re; |
146 | re.setWildcard(true); // most people understand these better. | 146 | re.setWildcard(true); // most people understand these better. |
147 | re.setCaseSensitive(false); | 147 | re.setCaseSensitive(false); |
148 | re.setPattern( pattern ); | 148 | re.setPattern( pattern ); |
149 | if (!re.isValid()) | 149 | if (!re.isValid()) |
150 | return; | 150 | return; |
151 | KABC::Addressee::List addresseeList = addressees(); | 151 | KABC::Addressee::List addresseeList = addressees(); |
152 | KABC::Addressee::List::Iterator it; | 152 | KABC::Addressee::List::Iterator it; |
153 | if ( field ) { | 153 | if ( field ) { |
154 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 154 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
155 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 155 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
156 | continue; | 156 | continue; |
157 | #if QT_VERSION >= 300 | 157 | #if QT_VERSION >= 300 |
158 | if (re.search(field->value( *it ).lower()) != -1) | 158 | if (re.search(field->value( *it ).lower()) != -1) |
159 | #else | 159 | #else |
160 | if (re.match(field->value( *it ).lower()) != -1) | 160 | if (re.match(field->value( *it ).lower()) != -1) |
161 | #endif | 161 | #endif |
162 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 162 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
163 | 163 | ||
164 | } | 164 | } |
165 | } else { | 165 | } else { |
166 | KABC::Field::List fieldList = fields(); | 166 | KABC::Field::List fieldList = allFields(); |
167 | KABC::Field::List::ConstIterator fieldIt; | 167 | KABC::Field::List::ConstIterator fieldIt; |
168 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 168 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
169 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 169 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
170 | continue; | 170 | continue; |
171 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 171 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
172 | #if QT_VERSION >= 300 | 172 | #if QT_VERSION >= 300 |
173 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 173 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) |
174 | #else | 174 | #else |
175 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 175 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) |
176 | #endif | 176 | #endif |
177 | { | 177 | { |
178 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 178 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
179 | break; | 179 | break; |
180 | } | 180 | } |
181 | } | 181 | } |
182 | } | 182 | } |
183 | } | 183 | } |
184 | // Sometimes the background pixmap gets messed up when we add lots | 184 | // Sometimes the background pixmap gets messed up when we add lots |
185 | // of items. | 185 | // of items. |
186 | mListView->repaint(); | 186 | mListView->repaint(); |
187 | if ( mListView->firstChild() ) { | 187 | if ( mListView->firstChild() ) { |
188 | mListView->setCurrentItem ( mListView->firstChild() ); | 188 | mListView->setCurrentItem ( mListView->firstChild() ); |
189 | mListView->setSelected ( mListView->firstChild(), true ); | 189 | mListView->setSelected ( mListView->firstChild(), true ); |
190 | } | 190 | } |
191 | else | 191 | else |
192 | emit selected(QString::null); | 192 | emit selected(QString::null); |
193 | 193 | ||
194 | } | 194 | } |
195 | void KAddressBookTableView::writeConfig(KConfig *config) | 195 | void KAddressBookTableView::writeConfig(KConfig *config) |
196 | { | 196 | { |
197 | KAddressBookView::writeConfig(config); | 197 | KAddressBookView::writeConfig(config); |
198 | 198 | ||
199 | mListView->saveLayout(config, config->group()); | 199 | mListView->saveLayout(config, config->group()); |
200 | } | 200 | } |
201 | 201 | ||
202 | void KAddressBookTableView::readConfig(KConfig *config) | 202 | void KAddressBookTableView::readConfig(KConfig *config) |
203 | { | 203 | { |
204 | KAddressBookView::readConfig( config ); | 204 | KAddressBookView::readConfig( config ); |
205 | // The config could have changed the fields, so we need to reconstruct | 205 | // The config could have changed the fields, so we need to reconstruct |
206 | // the listview. | 206 | // the listview. |
207 | reconstructListView(); | 207 | reconstructListView(); |
208 | 208 | ||
209 | // costum colors? | 209 | // costum colors? |
210 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) | 210 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) |
211 | { | 211 | { |
212 | QPalette p( mListView->palette() ); | 212 | QPalette p( mListView->palette() ); |
213 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); | 213 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); |
214 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); | 214 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); |
215 | c = p.color(QPalette::Normal, QColorGroup::Text ); | 215 | c = p.color(QPalette::Normal, QColorGroup::Text ); |
216 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); | 216 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); |
217 | c = p.color(QPalette::Normal, QColorGroup::Button ); | 217 | c = p.color(QPalette::Normal, QColorGroup::Button ); |
218 | p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); | 218 | p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); |
219 | c = p.color(QPalette::Normal, QColorGroup::ButtonText ); | 219 | c = p.color(QPalette::Normal, QColorGroup::ButtonText ); |
220 | p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); | 220 | p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); |
221 | c = p.color(QPalette::Normal, QColorGroup::Highlight ); | 221 | c = p.color(QPalette::Normal, QColorGroup::Highlight ); |
222 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); | 222 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); |
223 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); | 223 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); |
224 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); | 224 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); |
225 | #ifndef KAB_EMBEDDED | 225 | #ifndef KAB_EMBEDDED |
226 | c = KGlobalSettings::alternateBackgroundColor(); | 226 | c = KGlobalSettings::alternateBackgroundColor(); |
227 | #else //KAB_EMBEDDED | 227 | #else //KAB_EMBEDDED |
228 | c = QColor(240, 240, 240); | 228 | c = QColor(240, 240, 240); |
229 | #endif //KAB_EMBEDDED | 229 | #endif //KAB_EMBEDDED |
230 | c = config->readColorEntry ("AlternatingBackgroundColor", &c); | 230 | c = config->readColorEntry ("AlternatingBackgroundColor", &c); |
231 | mListView->setAlternateColor(c); | 231 | mListView->setAlternateColor(c); |
232 | 232 | ||
233 | 233 | ||
234 | //US mListView->viewport()->setPalette( p ); | 234 | //US mListView->viewport()->setPalette( p ); |
235 | mListView->setPalette( p ); | 235 | mListView->setPalette( p ); |
236 | } | 236 | } |
237 | else | 237 | else |
238 | { | 238 | { |
239 | // needed if turned off during a session. | 239 | // needed if turned off during a session. |
240 | //US mListView->viewport()->setPalette( mListView->palette() ); | 240 | //US mListView->viewport()->setPalette( mListView->palette() ); |
241 | mListView->setPalette( mListView->palette() ); | 241 | mListView->setPalette( mListView->palette() ); |
242 | } | 242 | } |
243 | 243 | ||
244 | //custom fonts? | 244 | //custom fonts? |
245 | QFont f( font() ); | 245 | QFont f( font() ); |
246 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) | 246 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) |
247 | { | 247 | { |
248 | mListView->setFont( config->readFontEntry( "TextFont", &f) ); | 248 | mListView->setFont( config->readFontEntry( "TextFont", &f) ); |
249 | f.setBold( true ); | 249 | f.setBold( true ); |
250 | //US mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); | 250 | //US mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); |
251 | mListView->header()->setFont( config->readFontEntry( "HeaderFont", &f ) ); | 251 | mListView->header()->setFont( config->readFontEntry( "HeaderFont", &f ) ); |
252 | } | 252 | } |
253 | else | 253 | else |
254 | { | 254 | { |
255 | mListView->setFont( f ); | 255 | mListView->setFont( f ); |
256 | f.setBold( true ); | 256 | f.setBold( true ); |
257 | //US mListView->setHeaderFont( f ); | 257 | //US mListView->setHeaderFont( f ); |
258 | mListView->header()->setFont( f ); | 258 | mListView->header()->setFont( f ); |
259 | } | 259 | } |
260 | 260 | ||
261 | |||
262 | |||
263 | |||
264 | |||
265 | // Set the list view options | 261 | // Set the list view options |
266 | mListView->setAlternateBackgroundEnabled(config->readBoolEntry("ABackground", | 262 | mListView->setAlternateBackgroundEnabled(config->readBoolEntry("ABackground", |
267 | true)); | 263 | true)); |
268 | mListView->setSingleLineEnabled(config->readBoolEntry("SingleLine", false)); | 264 | mListView->setSingleLineEnabled(config->readBoolEntry("SingleLine", false)); |
269 | mListView->setToolTipsEnabled(config->readBoolEntry("ToolTips", true)); | 265 | mListView->setToolTipsEnabled(config->readBoolEntry("ToolTips", true)); |
270 | 266 | ||
271 | if (config->readBoolEntry("Background", false)) | 267 | if (config->readBoolEntry("Background", false)) |
272 | mListView->setBackgroundPixmap(config->readEntry("BackgroundName")); | 268 | mListView->setBackgroundPixmap(config->readEntry("BackgroundName")); |
273 | 269 | ||
274 | // Restore the layout of the listview | 270 | // Restore the layout of the listview |
275 | mListView->restoreLayout(config, config->group()); | 271 | mListView->restoreLayout(config, config->group()); |
276 | } | 272 | } |
277 | 273 | ||
278 | void KAddressBookTableView::refresh(QString uid) | 274 | void KAddressBookTableView::refresh(QString uid) |
279 | { | 275 | { |
280 | // For now just repopulate. In reality this method should | 276 | // For now just repopulate. In reality this method should |
281 | // check the value of uid, and if valid iterate through | 277 | // check the value of uid, and if valid iterate through |
282 | // the listview to find the entry, then tell it to refresh. | 278 | // the listview to find the entry, then tell it to refresh. |
283 | 279 | ||
284 | if (uid.isNull()) { | 280 | if (uid.isNull()) { |
285 | // Clear the list view | 281 | // Clear the list view |
286 | QString currentUID, nextUID; | 282 | QString currentUID, nextUID; |
287 | #ifndef KAB_EMBEDDED | 283 | #ifndef KAB_EMBEDDED |
288 | ContactListViewItem *currentItem = dynamic_cast<ContactListViewItem*>( mListView->currentItem() ); | 284 | ContactListViewItem *currentItem = dynamic_cast<ContactListViewItem*>( mListView->currentItem() ); |
289 | #else //KAB_EMBEDDED | 285 | #else //KAB_EMBEDDED |
290 | ContactListViewItem *currentItem = (ContactListViewItem*)( mListView->currentItem() ); | 286 | ContactListViewItem *currentItem = (ContactListViewItem*)( mListView->currentItem() ); |
291 | #endif //KAB_EMBEDDED | 287 | #endif //KAB_EMBEDDED |
292 | 288 | ||
293 | if ( currentItem ) { | 289 | if ( currentItem ) { |
294 | #ifndef KAB_EMBEDDED | 290 | #ifndef KAB_EMBEDDED |
295 | ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() ); | 291 | ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() ); |
296 | #else //KAB_EMBEDDED | 292 | #else //KAB_EMBEDDED |
297 | ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() ); | 293 | ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() ); |
298 | #endif //KAB_EMBEDDED | 294 | #endif //KAB_EMBEDDED |
299 | if ( nextItem ) | 295 | if ( nextItem ) |
300 | nextUID = nextItem->addressee().uid(); | 296 | nextUID = nextItem->addressee().uid(); |
301 | currentUID = currentItem->addressee().uid(); | 297 | currentUID = currentItem->addressee().uid(); |
302 | } | 298 | } |
303 | 299 | ||
304 | mListView->clear(); | 300 | mListView->clear(); |
305 | 301 | ||
306 | currentItem = 0; | 302 | currentItem = 0; |
307 | KABC::Addressee::List addresseeList = addressees(); | 303 | KABC::Addressee::List addresseeList = addressees(); |
308 | KABC::Addressee::List::Iterator it; | 304 | KABC::Addressee::List::Iterator it; |
309 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 305 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
310 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 306 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
311 | continue; | 307 | continue; |
312 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 308 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
313 | if ( (*it).uid() == currentUID ) | 309 | if ( (*it).uid() == currentUID ) |
314 | currentItem = item; | 310 | currentItem = item; |
315 | else if ( (*it).uid() == nextUID && !currentItem ) | 311 | else if ( (*it).uid() == nextUID && !currentItem ) |
316 | currentItem = item; | 312 | currentItem = item; |
317 | } | 313 | } |
318 | 314 | ||
319 | // Sometimes the background pixmap gets messed up when we add lots | 315 | // Sometimes the background pixmap gets messed up when we add lots |
320 | // of items. | 316 | // of items. |
321 | mListView->repaint(); | 317 | mListView->repaint(); |
322 | 318 | ||
323 | if ( currentItem ) { | 319 | if ( currentItem ) { |
324 | mListView->setCurrentItem( currentItem ); | 320 | mListView->setCurrentItem( currentItem ); |
325 | mListView->ensureItemVisible( currentItem ); | 321 | mListView->ensureItemVisible( currentItem ); |
326 | } | 322 | } |
327 | } else { | 323 | } else { |
328 | // Only need to update on entry. Iterate through and try to find it | 324 | // Only need to update on entry. Iterate through and try to find it |
329 | ContactListViewItem *ceItem; | 325 | ContactListViewItem *ceItem; |
330 | QListViewItemIterator it( mListView ); | 326 | QListViewItemIterator it( mListView ); |
331 | while ( it.current() ) { | 327 | while ( it.current() ) { |
332 | #ifndef KAB_EMBEDDED | 328 | #ifndef KAB_EMBEDDED |
333 | ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); | 329 | ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); |
334 | #else //KAB_EMBEDDED | 330 | #else //KAB_EMBEDDED |
335 | ceItem = (ContactListViewItem*)( it.current() ); | 331 | ceItem = (ContactListViewItem*)( it.current() ); |
336 | #endif //KAB_EMBEDDED | 332 | #endif //KAB_EMBEDDED |
337 | 333 | ||
338 | if ( ceItem && ceItem->addressee().uid() == uid ) { | 334 | if ( ceItem && ceItem->addressee().uid() == uid ) { |
339 | ceItem->refresh(); | 335 | ceItem->refresh(); |
340 | return; | 336 | return; |
341 | } | 337 | } |
342 | ++it; | 338 | ++it; |
343 | } | 339 | } |
344 | 340 | ||
345 | refresh( QString::null ); | 341 | refresh( QString::null ); |
346 | } | 342 | } |
347 | } | 343 | } |
348 | 344 | ||
349 | QStringList KAddressBookTableView::selectedUids() | 345 | QStringList KAddressBookTableView::selectedUids() |
350 | { | 346 | { |
351 | QStringList uidList; | 347 | QStringList uidList; |
352 | QListViewItem *item; | 348 | QListViewItem *item; |
353 | ContactListViewItem *ceItem; | 349 | ContactListViewItem *ceItem; |
354 | 350 | ||
355 | for(item = mListView->firstChild(); item; item = item->itemBelow()) | 351 | for(item = mListView->firstChild(); item; item = item->itemBelow()) |
356 | { | 352 | { |
357 | if (mListView->isSelected( item )) | 353 | if (mListView->isSelected( item )) |
358 | { | 354 | { |
359 | #ifndef KAB_EMBEDDED | 355 | #ifndef KAB_EMBEDDED |
360 | ceItem = dynamic_cast<ContactListViewItem*>(item); | 356 | ceItem = dynamic_cast<ContactListViewItem*>(item); |
361 | #else //KAB_EMBEDDED | 357 | #else //KAB_EMBEDDED |
362 | ceItem = (ContactListViewItem*)(item); | 358 | ceItem = (ContactListViewItem*)(item); |
363 | #endif //KAB_EMBEDDED | 359 | #endif //KAB_EMBEDDED |
364 | 360 | ||
365 | if (ceItem != 0L) | 361 | if (ceItem != 0L) |
366 | uidList << ceItem->addressee().uid(); | 362 | uidList << ceItem->addressee().uid(); |
367 | } | 363 | } |
368 | } | 364 | } |
369 | if ( uidList.count() == 0 ) | 365 | if ( uidList.count() == 0 ) |
370 | if ( mListView->currentItem() ) { | 366 | if ( mListView->currentItem() ) { |
371 | ceItem = (ContactListViewItem*)(mListView->currentItem()) ; | 367 | ceItem = (ContactListViewItem*)(mListView->currentItem()) ; |
372 | uidList << ceItem->addressee().uid(); | 368 | uidList << ceItem->addressee().uid(); |
373 | } | 369 | } |
374 | 370 | ||
375 | return uidList; | 371 | return uidList; |
376 | } | 372 | } |
377 | 373 | ||
378 | void KAddressBookTableView::setSelected(QString uid, bool selected) | 374 | void KAddressBookTableView::setSelected(QString uid, bool selected) |
379 | { | 375 | { |
380 | QListViewItem *item; | 376 | QListViewItem *item; |
381 | ContactListViewItem *ceItem; | 377 | ContactListViewItem *ceItem; |
382 | 378 | ||
383 | if (uid.isNull()) | 379 | if (uid.isNull()) |
384 | { | 380 | { |
385 | mListView->selectAll(selected); | 381 | mListView->selectAll(selected); |
386 | } | 382 | } |
387 | else | 383 | else |
388 | { | 384 | { |
389 | for(item = mListView->firstChild(); item; item = item->itemBelow()) | 385 | for(item = mListView->firstChild(); item; item = item->itemBelow()) |
390 | { | 386 | { |
391 | #ifndef KAB_EMBEDDED | 387 | #ifndef KAB_EMBEDDED |
392 | ceItem = dynamic_cast<ContactListViewItem*>(item); | 388 | ceItem = dynamic_cast<ContactListViewItem*>(item); |
393 | #else //KAB_EMBEDDED | 389 | #else //KAB_EMBEDDED |
394 | ceItem = (ContactListViewItem*)(item); | 390 | ceItem = (ContactListViewItem*)(item); |
395 | #endif //KAB_EMBEDDED | 391 | #endif //KAB_EMBEDDED |
396 | 392 | ||
397 | 393 | ||
398 | if ((ceItem != 0L) && (ceItem->addressee().uid() == uid)) | 394 | if ((ceItem != 0L) && (ceItem->addressee().uid() == uid)) |
399 | { | 395 | { |
400 | mListView->setSelected(item, selected); | 396 | mListView->setSelected(item, selected); |
401 | 397 | ||
402 | if (selected) | 398 | if (selected) |
403 | mListView->ensureItemVisible(item); | 399 | mListView->ensureItemVisible(item); |
404 | } | 400 | } |
405 | } | 401 | } |
406 | } | 402 | } |
407 | } | 403 | } |
408 | 404 | ||
409 | void KAddressBookTableView::addresseeSelected() | 405 | void KAddressBookTableView::addresseeSelected() |
410 | { | 406 | { |
411 | // We need to try to find the first selected item. This might not be the | 407 | // We need to try to find the first selected item. This might not be the |
412 | // last selected item, but when QListView is in multiselection mode, | 408 | // last selected item, but when QListView is in multiselection mode, |
413 | // there is no way to figure out which one was | 409 | // there is no way to figure out which one was |
414 | // selected last. | 410 | // selected last. |
415 | QListViewItem *item; | 411 | QListViewItem *item; |
416 | bool found =false; | 412 | bool found =false; |
417 | for (item = mListView->firstChild(); item && !found; | 413 | for (item = mListView->firstChild(); item && !found; |
418 | item = item->nextSibling()) | 414 | item = item->nextSibling()) |
419 | { | 415 | { |
420 | if (item->isSelected()) | 416 | if (item->isSelected()) |
421 | { | 417 | { |
422 | found = true; | 418 | found = true; |
423 | #ifndef KAB_EMBEDDED | 419 | #ifndef KAB_EMBEDDED |
424 | ContactListViewItem *ceItem | 420 | ContactListViewItem *ceItem |
425 | = dynamic_cast<ContactListViewItem*>(item); | 421 | = dynamic_cast<ContactListViewItem*>(item); |
426 | #else //KAB_EMBEDDED | 422 | #else //KAB_EMBEDDED |
427 | ContactListViewItem *ceItem | 423 | ContactListViewItem *ceItem |
428 | = (ContactListViewItem*)(item); | 424 | = (ContactListViewItem*)(item); |
429 | #endif //KAB_EMBEDDED | 425 | #endif //KAB_EMBEDDED |
430 | 426 | ||
431 | if ( ceItem ) emit selected(ceItem->addressee().uid()); | 427 | if ( ceItem ) emit selected(ceItem->addressee().uid()); |
432 | } | 428 | } |
433 | } | 429 | } |
434 | 430 | ||
435 | if (!found) | 431 | if (!found) |
436 | emit selected(QString::null); | 432 | emit selected(QString::null); |
437 | } | 433 | } |
438 | 434 | ||
439 | void KAddressBookTableView::addresseeExecuted(QListViewItem *item) | 435 | void KAddressBookTableView::addresseeExecuted(QListViewItem *item) |
440 | { | 436 | { |
441 | if (item) | 437 | if (item) |
442 | { | 438 | { |
443 | #ifndef KAB_EMBEDDED | 439 | #ifndef KAB_EMBEDDED |
444 | ContactListViewItem *ceItem | 440 | ContactListViewItem *ceItem |
445 | = dynamic_cast<ContactListViewItem*>(item); | 441 | = dynamic_cast<ContactListViewItem*>(item); |
446 | #else //KAB_EMBEDDED | 442 | #else //KAB_EMBEDDED |
447 | ContactListViewItem *ceItem | 443 | ContactListViewItem *ceItem |
448 | = (ContactListViewItem*)(item); | 444 | = (ContactListViewItem*)(item); |
449 | #endif //KAB_EMBEDDED | 445 | #endif //KAB_EMBEDDED |
450 | 446 | ||
451 | if (ceItem) | 447 | if (ceItem) |
452 | { | 448 | { |
453 | emit executed(ceItem->addressee().uid()); | 449 | emit executed(ceItem->addressee().uid()); |
454 | } | 450 | } |
455 | } | 451 | } |
456 | else | 452 | else |
457 | { | 453 | { |
458 | emit executed(QString::null); | 454 | emit executed(QString::null); |
459 | } | 455 | } |
460 | } | 456 | } |
461 | 457 | ||
462 | void KAddressBookTableView::addresseeDeleted() | 458 | void KAddressBookTableView::addresseeDeleted() |
463 | { | 459 | { |
464 | 460 | ||
465 | emit deleteRequest(); | 461 | emit deleteRequest(); |
466 | 462 | ||
467 | } | 463 | } |
468 | 464 | ||
469 | 465 | ||
470 | 466 | ||
471 | 467 | ||
472 | 468 | ||
473 | #ifndef KAB_EMBEDDED | 469 | #ifndef KAB_EMBEDDED |
474 | #include "kaddressbooktableview.moc" | 470 | #include "kaddressbooktableview.moc" |
475 | #endif //KAB_EMBEDDED | 471 | #endif //KAB_EMBEDDED |