-rw-r--r-- | bin/kdepim/WhatsNew.txt | 9 | ||||
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 8 | ||||
-rw-r--r-- | kaddressbook/xxport/csvimportdialog.cpp | 73 | ||||
-rw-r--r-- | kaddressbook/xxport/csvimportdialog.h | 4 | ||||
-rw-r--r-- | microkde/kfiledialog.cpp | 5 | ||||
-rw-r--r-- | microkde/kio/kfile/kurlrequester.cpp | 2 |
6 files changed, 79 insertions, 22 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index fdcfab1..41b2a81 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,64 +1,73 @@ | |||
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 2.1.3 ************ | ||
4 | |||
5 | Changed the menu structure of the alarm applet: | ||
6 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". | ||
7 | |||
8 | Fixed several problems in the KA/Pi CSV import dialog: | ||
9 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. | ||
10 | |||
11 | |||
3 | ********** VERSION 2.1.2 ************ | 12 | ********** VERSION 2.1.2 ************ |
4 | 13 | ||
5 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. | 14 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. |
6 | 15 | ||
7 | Fixed a problem when importing data from Outlook with mutiple categories set. | 16 | Fixed a problem when importing data from Outlook with mutiple categories set. |
8 | 17 | ||
9 | Changed display of days in datenavigator: | 18 | Changed display of days in datenavigator: |
10 | Birthdays are now blue, not dark green. | 19 | Birthdays are now blue, not dark green. |
11 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. | 20 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. |
12 | When journal view is shown, only holidays are shown and days with journals are blue. | 21 | When journal view is shown, only holidays are shown and days with journals are blue. |
13 | 22 | ||
14 | Added Backup options to global config: | 23 | Added Backup options to global config: |
15 | You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). | 24 | You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). |
16 | It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. | 25 | It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. |
17 | The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. | 26 | The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. |
18 | 27 | ||
19 | ********** VERSION 2.1.1 ************ | 28 | ********** VERSION 2.1.1 ************ |
20 | 29 | ||
21 | Stable release 2.1.1! | 30 | Stable release 2.1.1! |
22 | 31 | ||
23 | KO/Pi: | 32 | KO/Pi: |
24 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. | 33 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. |
25 | 34 | ||
26 | ********** VERSION 2.1.0 ************ | 35 | ********** VERSION 2.1.0 ************ |
27 | 36 | ||
28 | Stable release 2.1.0! | 37 | Stable release 2.1.0! |
29 | 38 | ||
30 | Summary of changes/fixes compared to version 2.0.6: | 39 | Summary of changes/fixes compared to version 2.0.6: |
31 | 40 | ||
32 | Many bugs of version 2.0.6 fixed. | 41 | Many bugs of version 2.0.6 fixed. |
33 | Most of them were small bugs, but some of them were important. | 42 | Most of them were small bugs, but some of them were important. |
34 | It is recommended to use version 2.1.0 and not version 2.0.6. | 43 | It is recommended to use version 2.1.0 and not version 2.0.6. |
35 | 44 | ||
36 | Important changes: | 45 | Important changes: |
37 | 46 | ||
38 | Added recurring todos to KO/Pi. | 47 | Added recurring todos to KO/Pi. |
39 | 48 | ||
40 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. | 49 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. |
41 | 50 | ||
42 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 51 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
43 | 52 | ||
44 | Datenavigator can now display many months. Very useful on the desktop. | 53 | Datenavigator can now display many months. Very useful on the desktop. |
45 | 54 | ||
46 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. | 55 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. |
47 | 56 | ||
48 | Made alarm sound working on Linux desktop. | 57 | Made alarm sound working on Linux desktop. |
49 | 58 | ||
50 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. | 59 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. |
51 | 60 | ||
52 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. | 61 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. |
53 | 62 | ||
54 | Many other usebility enhancements. | 63 | Many other usebility enhancements. |
55 | Special thanks to Ben for his suggestions! | 64 | Special thanks to Ben for his suggestions! |
56 | 65 | ||
57 | You can find the complete changelog | 66 | You can find the complete changelog |
58 | from version 1.7.7 to 2.1.0 | 67 | from version 1.7.7 to 2.1.0 |
59 | in the source package or on | 68 | in the source package or on |
60 | 69 | ||
61 | http://www.pi-sync.net/html/changelog.html | 70 | http://www.pi-sync.net/html/changelog.html |
62 | 71 | ||
63 | 72 | ||
64 | 73 | ||
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index ef4ab3f..899203e 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt | |||
@@ -160,281 +160,281 @@ | |||
160 | { "Export CSV List...","Exportiere CSV-Datei..." }, | 160 | { "Export CSV List...","Exportiere CSV-Datei..." }, |
161 | { "Import KDE 2 Addressbook...","Importiere KDE 2 Adressbuch..." }, | 161 | { "Import KDE 2 Addressbook...","Importiere KDE 2 Adressbuch..." }, |
162 | { "Import vCard...","Importiere vCard..." }, | 162 | { "Import vCard...","Importiere vCard..." }, |
163 | { "Export vCard 3.0...","Exportiere vCard 3.0..." }, | 163 | { "Export vCard 3.0...","Exportiere vCard 3.0..." }, |
164 | { "Import Qtopia...","Importiere Qtopia..." }, | 164 | { "Import Qtopia...","Importiere Qtopia..." }, |
165 | { "Export Qtopia...","Exportiere Qtopia..." }, | 165 | { "Export Qtopia...","Exportiere Qtopia..." }, |
166 | { "Edit Contact","Bearbeite Kontakt" }, | 166 | { "Edit Contact","Bearbeite Kontakt" }, |
167 | { "Ok","Ok" }, | 167 | { "Ok","Ok" }, |
168 | { "Apply","Anwenden" }, | 168 | { "Apply","Anwenden" }, |
169 | { "Cancel","Abbrechen" }, | 169 | { "Cancel","Abbrechen" }, |
170 | { "KAddressbook/Pi","KAdressbuch/Pi" }, | 170 | { "KAddressbook/Pi","KAdressbuch/Pi" }, |
171 | { "No Filter","Kein Filter" }, | 171 | { "No Filter","Kein Filter" }, |
172 | { "Given Name","Vorname" }, | 172 | { "Given Name","Vorname" }, |
173 | { "Family Name","Nachname" }, | 173 | { "Family Name","Nachname" }, |
174 | { "Email Address","E-Mail Adresse" }, | 174 | { "Email Address","E-Mail Adresse" }, |
175 | { "All Fields","Alle Felder" }, | 175 | { "All Fields","Alle Felder" }, |
176 | { "Question","Frage" }, | 176 | { "Question","Frage" }, |
177 | { "After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?","After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?" }, | 177 | { "After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?","After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?" }, |
178 | { "No","Nein" }, | 178 | { "No","Nein" }, |
179 | { "Yes","Ja" }, | 179 | { "Yes","Ja" }, |
180 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile" }, | 180 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile" }, |
181 | { "Local device name:","Name dieses Gerätes:" }, | 181 | { "Local device name:","Name dieses Gerätes:" }, |
182 | { "New profile","Neues Profil" }, | 182 | { "New profile","Neues Profil" }, |
183 | { "Clone profile","Klone Profil" }, | 183 | { "Clone profile","Klone Profil" }, |
184 | { "Delete profile","Lösche Profil" }, | 184 | { "Delete profile","Lösche Profil" }, |
185 | { "Profile:","Profil:" }, | 185 | { "Profile:","Profil:" }, |
186 | { "Ask for every entry on conflict","Frage bei Konflikten nach"}, | 186 | { "Ask for every entry on conflict","Frage bei Konflikten nach"}, |
187 | { "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, | 187 | { "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, |
188 | { "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, | 188 | { "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, |
189 | { "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" } | 189 | { "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" } |
190 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, | 190 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, |
191 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, | 191 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, |
192 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, | 192 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, |
193 | { "Write back file","Schreibe Datei zurück" }, | 193 | { "Write back file","Schreibe Datei zurück" }, |
194 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, | 194 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, |
195 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, | 195 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, |
196 | { "Local device name:","Name dieses Gerätes:" }, | 196 | { "Local device name:","Name dieses Gerätes:" }, |
197 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, | 197 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, |
198 | { "Sync preferences","Synchronisations Einstellungen" }, | 198 | { "Sync preferences","Synchronisations Einstellungen" }, |
199 | { "Profile kind","Profil Art" }, | 199 | { "Profile kind","Profil Art" }, |
200 | { "Local file","Lokale Datei" }, | 200 | { "Local file","Lokale Datei" }, |
201 | { "Local file:","Lokale Datei:" }, | 201 | { "Local file:","Lokale Datei:" }, |
202 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, | 202 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, |
203 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, | 203 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, |
204 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, | 204 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, |
205 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, | 205 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, |
206 | { "Device","Gerät:" }, | 206 | { "Device","Gerät:" }, |
207 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, | 207 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, |
208 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" }, | 208 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" }, |
209 | { "Synchronization successful","Synchronisation erfolgreich" }, | 209 | { "Synchronization successful","Synchronisation erfolgreich" }, |
210 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, | 210 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, |
211 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, | 211 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, |
212 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, | 212 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, |
213 | { "Enter password","Passwort eingeben" }, | 213 | { "Enter password","Passwort eingeben" }, |
214 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, | 214 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, |
215 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, | 215 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, |
216 | { "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" }, | 216 | { "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" }, |
217 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, | 217 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, |
218 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, | 218 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, |
219 | { "Used %1 Client","Benutzter %1 Client" }, | 219 | { "Used %1 Client","Benutzter %1 Client" }, |
220 | { "No email client installed","Kein Email Klient installiert" }, | 220 | { "No email client installed","Kein Email Klient installiert" }, |
221 | { "Userdefined email client","Benutzerdef. Email Klient" }, | 221 | { "Userdefined email client","Benutzerdef. Email Klient" }, |
222 | { "OM/Pi email client","OM/Pi Email Klient" }, | 222 | { "OM/Pi email client","OM/Pi Email Klient" }, |
223 | { "Include in multiple ","Beziehe in mehrfach " }, | 223 | { "Include in multiple ","Beziehe in mehrfach " }, |
224 | { "calendar ","Kalender " }, | 224 | { "calendar ","Kalender " }, |
225 | { "addressbook ","Adressbuch " }, | 225 | { "addressbook ","Adressbuch " }, |
226 | { "pwmanager","PWmanager" }, | 226 | { "pwmanager","PWmanager" }, |
227 | { " sync"," Sync ein" }, | 227 | { " sync"," Sync ein" }, |
228 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, | 228 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, |
229 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, | 229 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, |
230 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, | 230 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, |
231 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, | 231 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, |
232 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, | 232 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, |
233 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, | 233 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, |
234 | { "Help...","Hilfe..." }, | 234 | { "Help...","Hilfe..." }, |
235 | { "Local file Cal:","Lokale Datei Kal:" }, | 235 | { "Local file Cal:","Lokale Datei Kal:" }, |
236 | { "Local file ABook:","Lokale Datei ABuch:" }, | 236 | { "Local file ABook:","Lokale Datei ABuch:" }, |
237 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, | 237 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, |
238 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, | 238 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, |
239 | { "Calendar:","Kalender:" }, | 239 | { "Calendar:","Kalender:" }, |
240 | { "AddressBook:","AdressBuch:" }, | 240 | { "AddressBook:","AdressBuch:" }, |
241 | { "PWManager:","PWManager:" }, | 241 | { "PWManager:","PWManager:" }, |
242 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, | 242 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, |
243 | { "ssh/scp","ssh/scp" }, | 243 | { "ssh/scp","ssh/scp" }, |
244 | { "ftp","ftp" }, | 244 | { "ftp","ftp" }, |
245 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, | 245 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, |
246 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, | 246 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, |
247 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, | 247 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, |
248 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, | 248 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, |
249 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, | 249 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, |
250 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, | 250 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, |
251 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, | 251 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, |
252 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, | 252 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, |
253 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, | 253 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, |
254 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, | 254 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, |
255 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, | 255 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, |
256 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, | 256 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, |
257 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, | 257 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, |
258 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, | 258 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, |
259 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, | 259 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, |
260 | { "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen \"Multi-Syncen\"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, | 260 | { "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen \"Multi-Syncen\"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, |
261 | { "KDE-Pim Sync","KDE-Pim Sync" }, | 261 | { "KDE-Pim Sync","KDE-Pim Sync" }, |
262 | { "Multiple profiles","Multi-Sync Profile" }, | 262 | { "Multiple profiles","Multi-Sync Profile" }, |
263 | { "Device: ","Gerät: " }, | 263 | { "Device: ","Gerät: " }, |
264 | { "Multiple sync started.","Multi-Sync gestartet." }, | 264 | { "Multiple sync started.","Multi-Sync gestartet." }, |
265 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, | 265 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, |
266 | { "KDE-Pim sync config","KDE-Pim Sync Konfig" }, | 266 | { "KDE-Pim sync config","KDE-Pim Sync Konfig" }, |
267 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein, z.B.:\n" }, | 267 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein, z.B.:\n" }, |
268 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Modell\nautomatisch\erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, | 268 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Modell\nautomatisch\erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, |
269 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, | 269 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, |
270 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, | 270 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, |
271 | { "Edit Address Book Filters","Editiere Addressbuch Filter" }, | 271 | { "Edit Address Book Filters","Editiere Addressbuch Filter" }, |
272 | { "&Add...","Hinzufügen..." }, | 272 | { "&Add...","Hinzufügen..." }, |
273 | { "&Edit...","B&earbeiten..." }, | 273 | { "&Edit...","B&earbeiten..." }, |
274 | { "&Remove","Entfe&rne" }, | 274 | { "&Remove","Entfe&rne" }, |
275 | { "Modify View: ","Ansicht ändern: " }, | 275 | { "Modify View: ","Ansicht ändern: " }, |
276 | { "Fields","Felder" }, | 276 | { "Fields","Felder" }, |
277 | { "Select Fields to Display","Wähle anzuzeigende Felder" }, | 277 | { "Select Fields to Display","Wähle anzuzeigende Felder" }, |
278 | { "All","Alles" }, | 278 | { "All","Alles" }, |
279 | { "Frequent","Frequent" }, | 279 | { "Frequent","Frequent" }, |
280 | { "Address","Adresse" }, | 280 | { "Address","Adresse" }, |
281 | { "Email","E-Mail" }, | 281 | { "Email","E-Mail" }, |
282 | { "Personal","Persönl." }, | 282 | { "Personal","Persönl." }, |
283 | { "Organization","Organisation" }, | 283 | { "Organization","Organisation" }, |
284 | { "Custom","Benutzerdefiniert" }, | 284 | { "Custom","Benutzerdefiniert" }, |
285 | { "&Selected\nfields:","&Selektierte\nFelder:" }, | 285 | { "&Selected\nfields:","&Selektierte\nFelder:" }, |
286 | { "Formatted Name","Format. Name" }, | 286 | { "Formatted Name","Format. Name" }, |
287 | { "Additional Names","Mittelname" }, | 287 | { "Additional Names","Mittelname" }, |
288 | { "Honorific Prefixes","Namen Prefix" }, | 288 | { "Honorific Prefixes","Namensprefix" }, |
289 | { "Honorific Suffixes","Namen Suffix" }, | 289 | { "Honorific Suffixes","Namenssuffix" }, |
290 | { "Nick Name","Sptitzname" }, | 290 | { "Nick Name","Spitzname" }, |
291 | { "Birthday","Geburtstag" }, | 291 | { "Birthday","Geburtstag" }, |
292 | { "Home Address Street","Privat Adresse Strasse" }, | 292 | { "Home Address Street","Privat Adresse Strasse" }, |
293 | { "Home Address Locality","Privat Adresse Stadt" }, | 293 | { "Home Address Locality","Privat Adresse Stadt" }, |
294 | { "Home Address Region","Privat Adresse Bundesland" }, | 294 | { "Home Address Region","Privat Adresse Bundesland" }, |
295 | { "Home Address Postal Code","Privat Adresse PLZ" }, | 295 | { "Home Address Postal Code","Privat Adresse PLZ" }, |
296 | { "Home Address Country","Privat Adresse Land" }, | 296 | { "Home Address Country","Privat Adresse Land" }, |
297 | { "Home Address Label","Privat Adresse Label" }, | 297 | { "Home Address Label","Privat Adresse Label" }, |
298 | { "Business Address Street","Büro Adresse Strasse" }, | 298 | { "Business Address Street","Büro Adresse Strasse" }, |
299 | { "Business Address Locality","Büro Adresse Stadt" }, | 299 | { "Business Address Locality","Büro Adresse Stadt" }, |
300 | { "Business Address Region","Büro Adresse Bundesland" }, | 300 | { "Business Address Region","Büro Adresse Bundesland" }, |
301 | { "Business Address Postal Code","Büro Adresse PLZ" }, | 301 | { "Business Address Postal Code","Büro Adresse PLZ" }, |
302 | { "Business Address Country","Büro Adresse Land" }, | 302 | { "Business Address Country","Büro Adresse Land" }, |
303 | { "Business Address Label","Büro Adresse Label" }, | 303 | { "Business Address Label","Büro Adresse Label" }, |
304 | { "Home Phone","Privat Telefon" }, | 304 | { "Home Phone","Privat Telefon" }, |
305 | { "Business Phone","Büro Telefon" }, | 305 | { "Business Phone","Büro Telefon" }, |
306 | { "Mobile Phone","Handy" }, | 306 | { "Mobile Phone","Handy" }, |
307 | { "Home Fax","Privat Fax" }, | 307 | { "Home Fax","Privat Fax" }, |
308 | { "Business Fax","Büro Fax" }, | 308 | { "Business Fax","Büro Fax" }, |
309 | { "Car Phone","Autotelefon" }, | 309 | { "Car Phone","Autotelefon" }, |
310 | { "ISDN","ISDN" }, | 310 | { "ISDN","ISDN" }, |
311 | { "Pager","Pager" }, | 311 | { "Pager","Pager" }, |
312 | { "Mail Client","Mail Client" }, | 312 | { "Mail Client","Mail Klient" }, |
313 | { "Title","Titel" }, | 313 | { "Title","Titel" }, |
314 | { "Role","Rolle" }, | 314 | { "Role","Rolle" }, |
315 | { "Note","Notiz" }, | 315 | { "Note","Notiz" }, |
316 | { "URL","URL" }, | 316 | { "URL","URL" }, |
317 | { "Resource","Resource" }, | 317 | { "Resource","Resource" }, |
318 | { "SIP","SIP" }, | 318 | { "SIP","SIP" }, |
319 | { "Default Filter","Default Filter" }, | 319 | { "Default Filter","Default Filter" }, |
320 | { "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." }, | 320 | { "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." }, |
321 | { "No default filter","Kein default Filter" }, | 321 | { "No default filter","Kein default Filter" }, |
322 | { "Use last active filter","Nutze letzen aktiven Filter" }, | 322 | { "Use last active filter","Nutze letzen aktiven Filter" }, |
323 | { "Use filter:","Nutze Filter:" }, | 323 | { "Use filter:","Nutze Filter:" }, |
324 | { "Look & Feel","Look & Feel" }, | 324 | { "Look & Feel","Look & Feel" }, |
325 | { "Row Separator","Reihen Separator" }, | 325 | { "Row Separator","Reihen Separator" }, |
326 | { "Alternating backgrounds","Abwechselnder Hintergrund" }, | 326 | { "Alternating backgrounds","Abwechselnder Hintergrund" }, |
327 | { "Single line","Einzelne Zeile" }, | 327 | { "Single line","Einzelne Zeile" }, |
328 | { "Enable background image:","Hintergrundbild:" }, | 328 | { "Enable background image:","Hintergrundbild:" }, |
329 | { "Enable contact tooltips","Contact Tooltips" }, | 329 | { "Enable contact tooltips","Contact Tooltips" }, |
330 | { "&Enable custom Colors","Benutzerdef. Farben" }, | 330 | { "&Enable custom Colors","Benutzerdef. Farben" }, |
331 | { "&Colors","Farben" }, | 331 | { "&Colors","Farben" }, |
332 | { "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." }, | 332 | { "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." }, |
333 | { "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." }, | 333 | { "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." }, |
334 | { "&Enable custom fonts","B&enutzerdefinierte Schriften" }, | 334 | { "&Enable custom fonts","B&enutzerdefinierte Schriften" }, |
335 | { "&Text font:","Textschriftart:" }, | 335 | { "&Text font:","Textschriftart:" }, |
336 | { "&Header font:","Titelschriftart:" }, | 336 | { "&Header font:","Titelschriftart:" }, |
337 | { "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." }, | 337 | { "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." }, |
338 | { "&Fonts","Schri&ften" }, | 338 | { "&Fonts","Schri&ften" }, |
339 | { "Background Color","Hintergrundfarbe" }, | 339 | { "Background Color","Hintergrundfarbe" }, |
340 | { "Text Color","Textfarbe" }, | 340 | { "Text Color","Textfarbe" }, |
341 | { "Header Background Color","Titel Hintergrundfarbe" }, | 341 | { "Header Background Color","Titel Hintergrundfarbe" }, |
342 | { "Header Text Color","Titel Farbe" }, | 342 | { "Header Text Color","Titel Farbe" }, |
343 | { "Highlight Color","Auswahlfarbe" }, | 343 | { "Highlight Color","Auswahlfarbe" }, |
344 | { "Highlighted Text Color","Auswahltextfarbe" }, | 344 | { "Highlighted Text Color","Auswahltextfarbe" }, |
345 | { "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, | 345 | { "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, |
346 | { "Postal","Post" }, | 346 | { "Postal","Post" }, |
347 | { "Dr.","Dr." }, | 347 | { "Dr.","Dr." }, |
348 | { "Miss","Frl." }, | 348 | { "Miss","Frl." }, |
349 | { "Mr.","Herr" }, | 349 | { "Mr.","Herr" }, |
350 | { "Mrs.","Frau" }, | 350 | { "Mrs.","Frau" }, |
351 | { "Ms.","Fr." }, | 351 | { "Ms.","Fr." }, |
352 | { "Prof.","Prof." }, | 352 | { "Prof.","Prof." }, |
353 | { "I","I" }, | 353 | { "I","I" }, |
354 | { "II","II" }, | 354 | { "II","II" }, |
355 | { "III","III" }, | 355 | { "III","III" }, |
356 | { "Jr.","Jr." }, | 356 | { "Jr.","Jr." }, |
357 | { "Sr.","Sr." }, | 357 | { "Sr.","Sr." }, |
358 | { "Name:","Name:" }, | 358 | { "Name:","Name:" }, |
359 | { "Documents","Dokumente" }, | 359 | { "Documents","Dokumente" }, |
360 | { "Files","Dateien" }, | 360 | { "Files","Dateien" }, |
361 | { "All Files","Alle Dateien" }, | 361 | { "All Files","Alle Dateien" }, |
362 | { "Name","Name" }, | 362 | { "Name","Name" }, |
363 | { "Size","Größe" }, | 363 | { "Size","Größe" }, |
364 | { "Date","Datum" }, | 364 | { "Date","Datum" }, |
365 | { "Mime Type","Mime Typ" }, | 365 | { "Mime Type","Mime Typ" }, |
366 | { "Geo Data Input","Geo Dateneingabe" }, | 366 | { "Geo Data Input","Geo Dateneingabe" }, |
367 | { "Sexagesimal","Sexagesimal" }, | 367 | { "Sexagesimal","Sexagesimal" }, |
368 | { "North","Nord" }, | 368 | { "North","Nord" }, |
369 | { "South","Süd" }, | 369 | { "South","Süd" }, |
370 | { "East","Ost" }, | 370 | { "East","Ost" }, |
371 | { "West","West" }, | 371 | { "West","West" }, |
372 | { "Undefined","Unbestimmt" }, | 372 | { "Undefined","Unbestimmt" }, |
373 | { "Edit Address","Bearbeite Adresse" }, | 373 | { "Edit Address","Bearbeite Adresse" }, |
374 | { "Street:","Strasse:" }, | 374 | { "Street:","Strasse:" }, |
375 | { "Post office box:","Postfach:" }, | 375 | { "Post office box:","Postfach:" }, |
376 | { "Locality:","Stadt:" }, | 376 | { "Locality:","Stadt:" }, |
377 | { "Region:","Region:" }, | 377 | { "Region:","Region:" }, |
378 | { "Postal code:","PLZ:" }, | 378 | { "Postal code:","PLZ:" }, |
379 | { "Country:","Staat:" }, | 379 | { "Country:","Staat:" }, |
380 | { "This is the preferred address","Dies ist die bevorzugte Adresse" }, | 380 | { "This is the preferred address","Dies ist die bevorzugte Adresse" }, |
381 | { "New...","Neu..." }, | 381 | { "New...","Neu..." }, |
382 | { "Change Type","Ändere Art" }, | 382 | { "Change Type","Ändere Art" }, |
383 | { "Edit Address Type","Ändere Address Art" }, | 383 | { "Edit Address Type","Ändere Address Art" }, |
384 | { "Address Types","Address Art" }, | 384 | { "Address Types","Address Art" }, |
385 | { "Domestic","Inland" }, | 385 | { "Domestic","Inland" }, |
386 | { "International","International" }, | 386 | { "International","International" }, |
387 | { "Parcel","Paket" }, | 387 | { "Parcel","Paket" }, |
388 | { "Edit Contact Name","Ändere Kontakt Name" }, | 388 | { "Edit Contact Name","Ändere Kontakt Name" }, |
389 | { "Honorific prefixes:","Namensprefixes:" }, | 389 | { "Honorific prefixes:","Namensprefixes:" }, |
390 | { "Given name:","Vorname:" }, | 390 | { "Given name:","Vorname:" }, |
391 | { "Additional names:","Mittelnamen:" }, | 391 | { "Additional names:","Mittelnamen:" }, |
392 | { "Family names:","Nachname:" }, | 392 | { "Family names:","Nachname:" }, |
393 | { "Honorific suffixes:","Namenssuffixe:" }, | 393 | { "Honorific suffixes:","Namenssuffixe:" }, |
394 | { "Parse name automatically","Setze Namen automatisch" }, | 394 | { "Parse name automatically","Setze Namen automatisch" }, |
395 | { "Edit Phone Numbers","Bearbeite Telefonnummern" }, | 395 | { "Edit Phone Numbers","Bearbeite Telefonnummern" }, |
396 | { "Number","Nummer" }, | 396 | { "Number","Nummer" }, |
397 | { "Type","Typ" }, | 397 | { "Type","Typ" }, |
398 | { "Edit Phone Number","Bearbeite Telefonnummer" }, | 398 | { "Edit Phone Number","Bearbeite Telefonnummer" }, |
399 | { "Number:","Nummer:" }, | 399 | { "Number:","Nummer:" }, |
400 | { "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, | 400 | { "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, |
401 | { "Types","Typen" }, | 401 | { "Types","Typen" }, |
402 | { "Messenger","Messenger" }, | 402 | { "Messenger","Messenger" }, |
403 | { "Other","Anderes" }, | 403 | { "Other","Anderes" }, |
404 | { "Video","Video" }, | 404 | { "Video","Video" }, |
405 | { "Mailbox","Mailbox" }, | 405 | { "Mailbox","Mailbox" }, |
406 | { "Modem","Modem" }, | 406 | { "Modem","Modem" }, |
407 | { "Car","Auto" }, | 407 | { "Car","Auto" }, |
408 | { "PCS","PCS" }, | 408 | { "PCS","PCS" }, |
409 | { "Category","Kategorie" }, | 409 | { "Category","Kategorie" }, |
410 | { "Select Categories","Wähle Kategorien" }, | 410 | { "Select Categories","Wähle Kategorien" }, |
411 | { " &Deselect All "," &Deselektiere alle " }, | 411 | { " &Deselect All "," &Deselektiere alle " }, |
412 | { " &Edit Categories "," B&earbeite Kategorien " }, | 412 | { " &Edit Categories "," B&earbeite Kategorien " }, |
413 | { "&OK","&OK" }, | 413 | { "&OK","&OK" }, |
414 | { "&Cancel","Abbre&chen" }, | 414 | { "&Cancel","Abbre&chen" }, |
415 | { "Configure","Konfiguriere" }, | 415 | { "Configure","Konfiguriere" }, |
416 | { "Default","Voreinstellungen" }, | 416 | { "Default","Voreinstellungen" }, |
417 | { "Addressbook","Adressbuch" }, | 417 | { "Addressbook","Adressbuch" }, |
418 | { "Details view font","Schriftart Detailansicht" }, | 418 | { "Details view font","Schriftart Detailansicht" }, |
419 | { "phone:123","phone:123" }, | 419 | { "phone:123","phone:123" }, |
420 | { "Search only after <return> key pressed","Suche nur nach <return> Taste" }, | 420 | { "Search only after <return> key pressed","Suche nur nach <return> Taste" }, |
421 | { "Honor KDE single click","Benutze KDE Einzelklick" }, | 421 | { "Honor KDE single click","Benutze KDE Einzelklick" }, |
422 | { "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" }, | 422 | { "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" }, |
423 | { "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, | 423 | { "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, |
424 | { "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, | 424 | { "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, |
425 | { "General","Allgemein" }, | 425 | { "General","Allgemein" }, |
426 | { "Extensions (restart)","Extensions (restart)" }, | 426 | { "Extensions (restart)","Extensions (restart)" }, |
427 | { "Description","Beschreibungen" }, | 427 | { "Description","Beschreibungen" }, |
428 | { "Extensions","Extensions" }, | 428 | { "Extensions","Extensions" }, |
429 | { "Prefixes","Prefixe" }, | 429 | { "Prefixes","Prefixe" }, |
430 | { "Inclusions","Inclusions" }, | 430 | { "Inclusions","Inclusions" }, |
431 | { "Suffixes","Suffixe" }, | 431 | { "Suffixes","Suffixe" }, |
432 | { "Default formatted name:","Default format. Name:" }, | 432 | { "Default formatted name:","Default format. Name:" }, |
433 | { "Empty","Leer" }, | 433 | { "Empty","Leer" }, |
434 | { "Simple Name","Einfacher Name" }, | 434 | { "Simple Name","Einfacher Name" }, |
435 | { "Full Name","Voller Name" }, | 435 | { "Full Name","Voller Name" }, |
436 | { "Reverse Name","Namen umdrehen" }, | 436 | { "Reverse Name","Namen umdrehen" }, |
437 | { "Contact","Kontakt" }, | 437 | { "Contact","Kontakt" }, |
438 | { "Global","Allgemein" }, | 438 | { "Global","Allgemein" }, |
439 | { "Phone","Telefon" }, | 439 | { "Phone","Telefon" }, |
440 | { "SMS","SMS" }, | 440 | { "SMS","SMS" }, |
diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp index cc55a24..41e2612 100644 --- a/kaddressbook/xxport/csvimportdialog.cpp +++ b/kaddressbook/xxport/csvimportdialog.cpp | |||
@@ -1,926 +1,969 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (C) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (C) 2003 Tobias Koenig <tokoe@kde.org> |
4 | based on the code of KSpread's CSV Import Dialog | 4 | based on the code of KSpread's CSV Import Dialog |
5 | 5 | ||
6 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public | 7 | modify it under the terms of the GNU Library General Public |
8 | License as published by the Free Software Foundation; either | 8 | License as published by the Free Software Foundation; either |
9 | version 2 of the License, or (at your option) any later version. | 9 | version 2 of the License, or (at your option) any later version. |
10 | 10 | ||
11 | This library is distributed in the hope that it will be useful, | 11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. | 14 | Library General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. | 19 | Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | /* | 22 | /* |
23 | Enhanced Version of the file for platform independent KDE tools. | 23 | Enhanced Version of the file for platform independent KDE tools. |
24 | Copyright (c) 2004 Ulf Schenk | 24 | Copyright (c) 2004 Ulf Schenk |
25 | 25 | ||
26 | $Id$ | 26 | $Id$ |
27 | */ | 27 | */ |
28 | 28 | ||
29 | 29 | ||
30 | #include <qbuttongroup.h> | 30 | #include <qbuttongroup.h> |
31 | #include <qcheckbox.h> | 31 | #include <qcheckbox.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #ifdef DESKTOP_VERSION | 33 | #ifdef DESKTOP_VERSION |
34 | #include <qinputdialog.h> | 34 | #include <qinputdialog.h> |
35 | #else | 35 | #else |
36 | #include <qtcompat/qinputdialog.h> | 36 | #include <qtcompat/qinputdialog.h> |
37 | #endif | 37 | #endif |
38 | #include <qlabel.h> | 38 | #include <qlabel.h> |
39 | #include <qlineedit.h> | 39 | #include <qlineedit.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qradiobutton.h> | 41 | #include <qradiobutton.h> |
42 | #include <qtable.h> | 42 | #include <qtable.h> |
43 | #include <qlayout.h> | 43 | #include <qlayout.h> |
44 | #include <qtextstream.h> | 44 | #include <qtextstream.h> |
45 | #include <qfile.h> | 45 | #include <qfile.h> |
46 | 46 | ||
47 | #include <kapplication.h> | 47 | #include <kapplication.h> |
48 | #include <kdebug.h> | 48 | #include <kdebug.h> |
49 | #include <kdialogbase.h> | 49 | #include <kdialogbase.h> |
50 | #include <kfiledialog.h> | 50 | #include <kfiledialog.h> |
51 | #include <klineedit.h> | 51 | #include <klineedit.h> |
52 | #include <klocale.h> | 52 | #include <klocale.h> |
53 | #include <kglobal.h> | 53 | #include <kglobal.h> |
54 | #include <kmessagebox.h> | 54 | #include <kmessagebox.h> |
55 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
56 | #include <kurlrequester.h> | 56 | #include <kurlrequester.h> |
57 | 57 | ||
58 | #ifdef DESKTOP_VERSION | 58 | #ifdef DESKTOP_VERSION |
59 | #include "qtable.h" | 59 | #include "qtable.h" |
60 | #else | 60 | #else |
61 | #include "qcombotableitem.h" | 61 | #include "qcombotableitem.h" |
62 | #endif | 62 | #endif |
63 | #include "csvimportdialog.h" | 63 | #include "csvimportdialog.h" |
64 | 64 | ||
65 | CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, | 65 | CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, |
66 | const char * name ) | 66 | const char * name ) |
67 | : KDialogBase( Plain, i18n ( "CSV Import Dialog" ), Ok | Cancel | User1 | | 67 | : KDialogBase( Plain, i18n ( "CSV Import Dialog" ), Ok | Cancel | User1 | |
68 | User2, Ok, parent, name, true, true ), | 68 | User2, Ok, parent, name, true, true ), |
69 | mAdjustRows( false ), | 69 | mAdjustRows( false ), |
70 | mStartLine( 0 ), | 70 | mStartLine( 0 ), |
71 | mTextQuote( '"' ), | 71 | mTextQuote( '"' ), |
72 | mDelimiter( "," ), | 72 | mDelimiter( "," ), |
73 | mAddressBook( ab ) | 73 | mAddressBook( ab ) |
74 | { | 74 | { |
75 | initGUI(); | 75 | initGUI(); |
76 | 76 | ||
77 | mTypeMap.insert( i18n( "Undefined" ), Undefined ); | 77 | mTypeMap.insert( i18n( "Undefined" ), Undefined ); |
78 | mTypeMap.insert( KABC::Addressee::formattedNameLabel(), FormattedName ); | 78 | mTypeMap.insert( KABC::Addressee::formattedNameLabel(), FormattedName ); |
79 | mTypeMap.insert( KABC::Addressee::familyNameLabel(), FamilyName ); | 79 | mTypeMap.insert( KABC::Addressee::familyNameLabel(), FamilyName ); |
80 | mTypeMap.insert( KABC::Addressee::givenNameLabel(), GivenName ); | 80 | mTypeMap.insert( KABC::Addressee::givenNameLabel(), GivenName ); |
81 | mTypeMap.insert( KABC::Addressee::additionalNameLabel(), AdditionalName ); | 81 | mTypeMap.insert( KABC::Addressee::additionalNameLabel(), AdditionalName ); |
82 | mTypeMap.insert( KABC::Addressee::prefixLabel(), Prefix ); | 82 | mTypeMap.insert( KABC::Addressee::prefixLabel(), Prefix ); |
83 | mTypeMap.insert( KABC::Addressee::suffixLabel(), Suffix ); | 83 | mTypeMap.insert( KABC::Addressee::suffixLabel(), Suffix ); |
84 | mTypeMap.insert( KABC::Addressee::nickNameLabel(), NickName ); | 84 | mTypeMap.insert( KABC::Addressee::nickNameLabel(), NickName ); |
85 | mTypeMap.insert( KABC::Addressee::birthdayLabel(), Birthday ); | 85 | mTypeMap.insert( KABC::Addressee::birthdayLabel(), Birthday ); |
86 | 86 | ||
87 | mTypeMap.insert( KABC::Addressee::homeAddressStreetLabel(), HomeAddressStreet ); | 87 | mTypeMap.insert( KABC::Addressee::homeAddressStreetLabel(), HomeAddressStreet ); |
88 | mTypeMap.insert( KABC::Addressee::homeAddressLocalityLabel(), | 88 | mTypeMap.insert( KABC::Addressee::homeAddressLocalityLabel(), |
89 | HomeAddressLocality ); | 89 | HomeAddressLocality ); |
90 | mTypeMap.insert( KABC::Addressee::homeAddressRegionLabel(), HomeAddressRegion ); | 90 | mTypeMap.insert( KABC::Addressee::homeAddressRegionLabel(), HomeAddressRegion ); |
91 | mTypeMap.insert( KABC::Addressee::homeAddressPostalCodeLabel(), | 91 | mTypeMap.insert( KABC::Addressee::homeAddressPostalCodeLabel(), |
92 | HomeAddressPostalCode ); | 92 | HomeAddressPostalCode ); |
93 | mTypeMap.insert( KABC::Addressee::homeAddressCountryLabel(), | 93 | mTypeMap.insert( KABC::Addressee::homeAddressCountryLabel(), |
94 | HomeAddressCountry ); | 94 | HomeAddressCountry ); |
95 | mTypeMap.insert( KABC::Addressee::homeAddressLabelLabel(), HomeAddressLabel ); | 95 | mTypeMap.insert( KABC::Addressee::homeAddressLabelLabel(), HomeAddressLabel ); |
96 | 96 | ||
97 | mTypeMap.insert( KABC::Addressee::businessAddressStreetLabel(), | 97 | mTypeMap.insert( KABC::Addressee::businessAddressStreetLabel(), |
98 | BusinessAddressStreet ); | 98 | BusinessAddressStreet ); |
99 | mTypeMap.insert( KABC::Addressee::businessAddressLocalityLabel(), | 99 | mTypeMap.insert( KABC::Addressee::businessAddressLocalityLabel(), |
100 | BusinessAddressLocality ); | 100 | BusinessAddressLocality ); |
101 | mTypeMap.insert( KABC::Addressee::businessAddressRegionLabel(), | 101 | mTypeMap.insert( KABC::Addressee::businessAddressRegionLabel(), |
102 | BusinessAddressRegion ); | 102 | BusinessAddressRegion ); |
103 | mTypeMap.insert( KABC::Addressee::businessAddressPostalCodeLabel(), | 103 | mTypeMap.insert( KABC::Addressee::businessAddressPostalCodeLabel(), |
104 | BusinessAddressPostalCode ); | 104 | BusinessAddressPostalCode ); |
105 | mTypeMap.insert( KABC::Addressee::businessAddressCountryLabel(), | 105 | mTypeMap.insert( KABC::Addressee::businessAddressCountryLabel(), |
106 | BusinessAddressCountry ); | 106 | BusinessAddressCountry ); |
107 | mTypeMap.insert( KABC::Addressee::businessAddressLabelLabel(), | 107 | mTypeMap.insert( KABC::Addressee::businessAddressLabelLabel(), |
108 | BusinessAddressLabel ); | 108 | BusinessAddressLabel ); |
109 | 109 | ||
110 | mTypeMap.insert( KABC::Addressee::homePhoneLabel(), HomePhone ); | 110 | mTypeMap.insert( KABC::Addressee::homePhoneLabel(), HomePhone ); |
111 | mTypeMap.insert( KABC::Addressee::businessPhoneLabel(), BusinessPhone ); | 111 | mTypeMap.insert( KABC::Addressee::businessPhoneLabel(), BusinessPhone ); |
112 | mTypeMap.insert( KABC::Addressee::mobilePhoneLabel(), MobilePhone ); | 112 | mTypeMap.insert( KABC::Addressee::mobilePhoneLabel(), MobilePhone ); |
113 | mTypeMap.insert( KABC::Addressee::homeFaxLabel(), HomeFax ); | 113 | mTypeMap.insert( KABC::Addressee::homeFaxLabel(), HomeFax ); |
114 | mTypeMap.insert( KABC::Addressee::businessFaxLabel(), BusinessFax ); | 114 | mTypeMap.insert( KABC::Addressee::businessFaxLabel(), BusinessFax ); |
115 | mTypeMap.insert( KABC::Addressee::carPhoneLabel(), CarPhone ); | 115 | mTypeMap.insert( KABC::Addressee::carPhoneLabel(), CarPhone ); |
116 | mTypeMap.insert( KABC::Addressee::isdnLabel(), Isdn ); | 116 | mTypeMap.insert( KABC::Addressee::isdnLabel(), Isdn ); |
117 | mTypeMap.insert( KABC::Addressee::pagerLabel(), Pager ); | 117 | mTypeMap.insert( KABC::Addressee::pagerLabel(), Pager ); |
118 | mTypeMap.insert( KABC::Addressee::emailLabel(), Email ); | 118 | mTypeMap.insert( KABC::Addressee::emailLabel(), Email ); |
119 | mTypeMap.insert( KABC::Addressee::mailerLabel(), Mailer ); | 119 | mTypeMap.insert( KABC::Addressee::mailerLabel(), Mailer ); |
120 | mTypeMap.insert( KABC::Addressee::titleLabel(), Title ); | 120 | mTypeMap.insert( KABC::Addressee::titleLabel(), Title ); |
121 | mTypeMap.insert( KABC::Addressee::roleLabel(), Role ); | 121 | mTypeMap.insert( KABC::Addressee::roleLabel(), Role ); |
122 | mTypeMap.insert( KABC::Addressee::organizationLabel(), Organization ); | 122 | mTypeMap.insert( KABC::Addressee::organizationLabel(), Organization ); |
123 | mTypeMap.insert( KABC::Addressee::noteLabel(), Note ); | 123 | mTypeMap.insert( KABC::Addressee::noteLabel(), Note ); |
124 | mTypeMap.insert( KABC::Addressee::urlLabel(), URL ); | 124 | mTypeMap.insert( KABC::Addressee::urlLabel(), URL ); |
125 | mTypeMap.insert( KABC::Addressee::categoryLabel(), Categories ); | ||
125 | 126 | ||
126 | mCustomCounter = mTypeMap.count(); | 127 | mCustomCounter = mTypeMap.count(); |
127 | int count = mCustomCounter; | 128 | int count = mCustomCounter; |
128 | 129 | ||
129 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); | 130 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); |
130 | KABC::Field::List::Iterator it; | 131 | KABC::Field::List::Iterator it; |
131 | for ( it = fields.begin(); it != fields.end(); ++it, ++count ) | 132 | for ( it = fields.begin(); it != fields.end(); ++it, ++count ) |
132 | mTypeMap.insert( (*it)->label(), count ); | 133 | mTypeMap.insert( (*it)->label(), count ); |
133 | 134 | ||
134 | connect( mDelimiterBox, SIGNAL( clicked( int ) ), | 135 | connect( mDelimiterBox, SIGNAL( clicked( int ) ), |
135 | this, SLOT( delimiterClicked( int ) ) ); | 136 | this, SLOT( delimiterClicked( int ) ) ); |
136 | connect( mDelimiterEdit, SIGNAL( returnPressed() ), | 137 | connect( mDelimiterEdit, SIGNAL( returnPressed() ), |
137 | this, SLOT( returnPressed() ) ); | 138 | this, SLOT( returnPressed() ) ); |
138 | connect( mDelimiterEdit, SIGNAL( textChanged ( const QString& ) ), | 139 | connect( mDelimiterEdit, SIGNAL( textChanged ( const QString& ) ), |
139 | this, SLOT( textChanged ( const QString& ) ) ); | 140 | this, SLOT( textChanged ( const QString& ) ) ); |
140 | connect( mComboLine, SIGNAL( activated( const QString& ) ), | 141 | connect( mComboLine, SIGNAL( activated( const QString& ) ), |
141 | this, SLOT( lineSelected( const QString& ) ) ); | 142 | this, SLOT( lineSelected( const QString& ) ) ); |
143 | connect( mComboCodec, SIGNAL( activated( const QString& ) ), | ||
144 | this, SLOT( codecChanged( const QString& ) ) ); | ||
142 | connect( mComboQuote, SIGNAL( activated( const QString& ) ), | 145 | connect( mComboQuote, SIGNAL( activated( const QString& ) ), |
143 | this, SLOT( textquoteSelected( const QString& ) ) ); | 146 | this, SLOT( textquoteSelected( const QString& ) ) ); |
144 | connect( mIgnoreDuplicates, SIGNAL( stateChanged( int ) ), | 147 | connect( mIgnoreDuplicates, SIGNAL( stateChanged( int ) ), |
145 | this, SLOT( ignoreDuplicatesChanged( int ) ) ); | 148 | this, SLOT( ignoreDuplicatesChanged( int ) ) ); |
146 | 149 | ||
147 | connect( mUrlRequester, SIGNAL( returnPressed( const QString& ) ), | 150 | connect( mUrlRequester, SIGNAL( returnPressed( const QString& ) ), |
148 | this, SLOT( setFile( const QString& ) ) ); | 151 | this, SLOT( setFile( const QString& ) ) ); |
149 | connect( mUrlRequester, SIGNAL( urlSelected( const QString& ) ), | 152 | connect( mUrlRequester, SIGNAL( urlSelected( const QString& ) ), |
150 | this, SLOT( setFile( const QString& ) ) ); | 153 | this, SLOT( setFile( const QString& ) ) ); |
151 | connect( mUrlRequester->lineEdit(), SIGNAL( textChanged ( const QString& ) ), | 154 | connect( mUrlRequester->lineEdit(), SIGNAL( textChanged ( const QString& ) ), |
152 | this, SLOT( urlChanged( const QString& ) ) ); | 155 | this, SLOT( urlChanged( const QString& ) ) ); |
153 | 156 | ||
154 | connect( this, SIGNAL( user1Clicked() ), | 157 | connect( this, SIGNAL( user1Clicked() ), |
155 | this, SLOT( applyTemplate() ) ); | 158 | this, SLOT( applyTemplate() ) ); |
156 | 159 | ||
157 | connect( this, SIGNAL( user2Clicked() ), | 160 | connect( this, SIGNAL( user2Clicked() ), |
158 | this, SLOT( saveTemplate() ) ); | 161 | this, SLOT( saveTemplate() ) ); |
159 | 162 | ||
160 | // if ( QApplication::desktop()->width() < 321 ) | 163 | // if ( QApplication::desktop()->width() < 321 ) |
161 | QIconSet icon = SmallIcon("filesave"); | 164 | QIconSet icon = SmallIcon("filesave"); |
162 | 165 | ||
163 | findButton( User2 )->setIconSet (icon ) ; | 166 | findButton( User2 )->setIconSet (icon ) ; |
164 | icon = SmallIcon("fileopen"); | 167 | icon = SmallIcon("fileopen"); |
165 | findButton( User1 )->setIconSet (icon ) ; | 168 | findButton( User1 )->setIconSet (icon ) ; |
166 | int wid = findButton( User2 )->sizeHint().height(); | 169 | int wid = findButton( User2 )->sizeHint().height(); |
167 | findButton( User2 )->setMaximumWidth( wid+4 ); | 170 | findButton( User2 )->setMaximumWidth( wid+4 ); |
168 | findButton( User1 )->setMaximumWidth( wid+4 ); | 171 | findButton( User1 )->setMaximumWidth( wid+4 ); |
169 | } | 172 | } |
170 | 173 | ||
171 | CSVImportDialog::~CSVImportDialog() | 174 | CSVImportDialog::~CSVImportDialog() |
172 | { | 175 | { |
173 | } | 176 | } |
174 | 177 | ||
175 | KABC::AddresseeList CSVImportDialog::contacts() const | 178 | KABC::AddresseeList CSVImportDialog::contacts() const |
176 | { | 179 | { |
177 | KABC::AddresseeList contacts; | 180 | KABC::AddresseeList contacts; |
178 | 181 | ||
179 | for ( int row = 1; row < mTable->numRows(); ++row ) { | 182 | for ( int row = 1; row < mTable->numRows(); ++row ) { |
180 | KABC::Addressee a; | 183 | KABC::Addressee a; |
181 | bool emptyRow = true; | 184 | bool emptyRow = true; |
182 | KABC::Address addrHome( KABC::Address::Home ); | 185 | KABC::Address addrHome( KABC::Address::Home ); |
183 | KABC::Address addrWork( KABC::Address::Work ); | 186 | KABC::Address addrWork( KABC::Address::Work ); |
184 | for ( int col = 0; col < mTable->numCols(); ++col ) { | 187 | for ( int col = 0; col < mTable->numCols(); ++col ) { |
185 | 188 | ||
186 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, col ) ); | 189 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, col ) ); |
187 | 190 | ||
188 | if ( !item ) { | 191 | if ( !item ) { |
189 | qDebug( "ERROR: item cast failed" ); | 192 | qDebug( "ERROR: item cast failed" ); |
190 | continue; | 193 | continue; |
191 | } | 194 | } |
192 | 195 | ||
193 | QString value = mTable->text( row, col ); | 196 | QString value = mTable->text( row, col ); |
194 | if ( !value.isEmpty() ) | 197 | if ( !value.isEmpty() ) |
195 | emptyRow = false; | 198 | emptyRow = false; |
196 | 199 | ||
197 | switch ( posToType( item->currentItem() ) ) | 200 | switch ( posToType( item->currentItem() ) ) |
198 | { | 201 | { |
199 | case Undefined: | 202 | case Undefined: |
200 | continue; | 203 | continue; |
201 | break; | 204 | break; |
202 | case FormattedName: | 205 | case FormattedName: |
203 | a.setFormattedName( value ); | 206 | a.setFormattedName( value ); |
204 | break; | 207 | break; |
205 | case GivenName: | 208 | case GivenName: |
206 | a.setGivenName( value ); | 209 | a.setGivenName( value ); |
207 | break; | 210 | break; |
208 | case FamilyName: | 211 | case FamilyName: |
209 | a.setFamilyName( value ); | 212 | a.setFamilyName( value ); |
210 | break; | 213 | break; |
211 | case AdditionalName: | 214 | case AdditionalName: |
212 | a.setAdditionalName( value ); | 215 | a.setAdditionalName( value ); |
213 | break; | 216 | break; |
214 | case Prefix: | 217 | case Prefix: |
215 | a.setPrefix( value ); | 218 | a.setPrefix( value ); |
216 | break; | 219 | break; |
217 | case Suffix: | 220 | case Suffix: |
218 | a.setSuffix( value ); | 221 | a.setSuffix( value ); |
219 | break; | 222 | break; |
220 | case NickName: | 223 | case NickName: |
221 | a.setNickName( value ); | 224 | a.setNickName( value ); |
222 | break; | 225 | break; |
223 | case Birthday: | 226 | case Birthday: |
224 | //US | 227 | //US |
225 | //the generated code had the following format: a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); | 228 | //the generated code had the following format: a.setBirthday( QDate::fromString( value, Qt::ISODate ) ); |
226 | // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? | 229 | // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? |
227 | { | 230 | { |
228 | QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate | 231 | QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate |
229 | a.setBirthday(dt); | 232 | a.setBirthday(dt); |
230 | } | 233 | } |
231 | break; | 234 | break; |
232 | case Email: | 235 | case Email: |
233 | if ( !value.isEmpty() ) | 236 | if ( !value.isEmpty() ) |
234 | a.insertEmail( value, true ); | 237 | a.insertEmail( value, true ); |
235 | break; | 238 | break; |
236 | case Role: | 239 | case Role: |
237 | a.setRole( value ); | 240 | a.setRole( value ); |
238 | break; | 241 | break; |
239 | case Title: | 242 | case Title: |
240 | a.setTitle( value ); | 243 | a.setTitle( value ); |
241 | break; | 244 | break; |
242 | case Mailer: | 245 | case Mailer: |
243 | a.setMailer( value ); | 246 | a.setMailer( value ); |
244 | break; | 247 | break; |
245 | case URL: | 248 | case URL: |
246 | a.setUrl( value ); | 249 | a.setUrl( value ); |
247 | break; | 250 | break; |
248 | case Organization: | 251 | case Organization: |
249 | a.setOrganization( value ); | 252 | a.setOrganization( value ); |
250 | break; | 253 | break; |
251 | case Note: | 254 | case Note: |
252 | a.setNote( value ); | 255 | if ( a.note().isEmpty() ) |
256 | a.setNote( value ); | ||
257 | else { | ||
258 | a.setNote( a.note()+"\n"+value ); | ||
259 | } | ||
260 | break; | ||
261 | case Categories: | ||
262 | a.insertCategory( value ); | ||
253 | break; | 263 | break; |
254 | |||
255 | case HomePhone: | 264 | case HomePhone: |
256 | if ( !value.isEmpty() ) { | 265 | if ( !value.isEmpty() ) { |
257 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home ); | 266 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home ); |
258 | a.insertPhoneNumber( number ); | 267 | a.insertPhoneNumber( number ); |
259 | } | 268 | } |
260 | break; | 269 | break; |
261 | case BusinessPhone: | 270 | case BusinessPhone: |
262 | if ( !value.isEmpty() ) { | 271 | if ( !value.isEmpty() ) { |
263 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Work ); | 272 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Work ); |
264 | a.insertPhoneNumber( number ); | 273 | a.insertPhoneNumber( number ); |
265 | } | 274 | } |
266 | break; | 275 | break; |
267 | case MobilePhone: | 276 | case MobilePhone: |
268 | if ( !value.isEmpty() ) { | 277 | if ( !value.isEmpty() ) { |
269 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Cell ); | 278 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Cell ); |
270 | a.insertPhoneNumber( number ); | 279 | a.insertPhoneNumber( number ); |
271 | } | 280 | } |
272 | break; | 281 | break; |
273 | case HomeFax: | 282 | case HomeFax: |
274 | if ( !value.isEmpty() ) { | 283 | if ( !value.isEmpty() ) { |
275 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home | | 284 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home | |
276 | KABC::PhoneNumber::Fax ); | 285 | KABC::PhoneNumber::Fax ); |
277 | a.insertPhoneNumber( number ); | 286 | a.insertPhoneNumber( number ); |
278 | } | 287 | } |
279 | break; | 288 | break; |
280 | case BusinessFax: | 289 | case BusinessFax: |
281 | if ( !value.isEmpty() ) { | 290 | if ( !value.isEmpty() ) { |
282 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Work | | 291 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Work | |
283 | KABC::PhoneNumber::Fax ); | 292 | KABC::PhoneNumber::Fax ); |
284 | a.insertPhoneNumber( number ); | 293 | a.insertPhoneNumber( number ); |
285 | } | 294 | } |
286 | break; | 295 | break; |
287 | case CarPhone: | 296 | case CarPhone: |
288 | if ( !value.isEmpty() ) { | 297 | if ( !value.isEmpty() ) { |
289 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Car ); | 298 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Car ); |
290 | a.insertPhoneNumber( number ); | 299 | a.insertPhoneNumber( number ); |
291 | } | 300 | } |
292 | break; | 301 | break; |
293 | case Isdn: | 302 | case Isdn: |
294 | if ( !value.isEmpty() ) { | 303 | if ( !value.isEmpty() ) { |
295 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Isdn ); | 304 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Isdn ); |
296 | a.insertPhoneNumber( number ); | 305 | a.insertPhoneNumber( number ); |
297 | } | 306 | } |
298 | break; | 307 | break; |
299 | case Pager: | 308 | case Pager: |
300 | if ( !value.isEmpty() ) { | 309 | if ( !value.isEmpty() ) { |
301 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Pager ); | 310 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Pager ); |
302 | a.insertPhoneNumber( number ); | 311 | a.insertPhoneNumber( number ); |
303 | } | 312 | } |
304 | break; | 313 | break; |
305 | 314 | ||
306 | case HomeAddressStreet: | 315 | case HomeAddressStreet: |
307 | addrHome.setStreet( value ); | 316 | addrHome.setStreet( value ); |
308 | break; | 317 | break; |
309 | case HomeAddressLocality: | 318 | case HomeAddressLocality: |
310 | addrHome.setLocality( value ); | 319 | addrHome.setLocality( value ); |
311 | break; | 320 | break; |
312 | case HomeAddressRegion: | 321 | case HomeAddressRegion: |
313 | addrHome.setRegion( value ); | 322 | addrHome.setRegion( value ); |
314 | break; | 323 | break; |
315 | case HomeAddressPostalCode: | 324 | case HomeAddressPostalCode: |
316 | addrHome.setPostalCode( value ); | 325 | addrHome.setPostalCode( value ); |
317 | break; | 326 | break; |
318 | case HomeAddressCountry: | 327 | case HomeAddressCountry: |
319 | addrHome.setCountry( value ); | 328 | addrHome.setCountry( value ); |
320 | break; | 329 | break; |
321 | case HomeAddressLabel: | 330 | case HomeAddressLabel: |
322 | addrHome.setLabel( value ); | 331 | addrHome.setLabel( value ); |
323 | break; | 332 | break; |
324 | 333 | ||
325 | case BusinessAddressStreet: | 334 | case BusinessAddressStreet: |
326 | addrWork.setStreet( value ); | 335 | addrWork.setStreet( value ); |
327 | break; | 336 | break; |
328 | case BusinessAddressLocality: | 337 | case BusinessAddressLocality: |
329 | addrWork.setLocality( value ); | 338 | addrWork.setLocality( value ); |
330 | break; | 339 | break; |
331 | case BusinessAddressRegion: | 340 | case BusinessAddressRegion: |
332 | addrWork.setRegion( value ); | 341 | addrWork.setRegion( value ); |
333 | break; | 342 | break; |
334 | case BusinessAddressPostalCode: | 343 | case BusinessAddressPostalCode: |
335 | addrWork.setPostalCode( value ); | 344 | addrWork.setPostalCode( value ); |
336 | break; | 345 | break; |
337 | case BusinessAddressCountry: | 346 | case BusinessAddressCountry: |
338 | addrWork.setCountry( value ); | 347 | addrWork.setCountry( value ); |
339 | break; | 348 | break; |
340 | case BusinessAddressLabel: | 349 | case BusinessAddressLabel: |
341 | addrWork.setLabel( value ); | 350 | addrWork.setLabel( value ); |
342 | break; | 351 | break; |
343 | default: | 352 | default: |
344 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); | 353 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); |
345 | KABC::Field::List::Iterator it; | 354 | KABC::Field::List::Iterator it; |
346 | 355 | ||
347 | int counter = 0; | 356 | int counter = 0; |
348 | for ( it = fields.begin(); it != fields.end(); ++it ) { | 357 | for ( it = fields.begin(); it != fields.end(); ++it ) { |
349 | if ( counter == (int)( posToType( item->currentItem() ) - mCustomCounter ) ) | 358 | if ( counter == (int)( posToType( item->currentItem() ) - mCustomCounter ) ) |
350 | { | 359 | { |
351 | (*it)->setValue( a, value ); | 360 | (*it)->setValue( a, value ); |
352 | continue; | 361 | continue; |
353 | } | 362 | } |
354 | ++counter; | 363 | ++counter; |
355 | } | 364 | } |
356 | break; | 365 | break; |
357 | } | 366 | } |
358 | } | 367 | } |
359 | 368 | ||
360 | if ( !addrHome.isEmpty() ) | 369 | if ( !addrHome.isEmpty() ) |
361 | a.insertAddress( addrHome ); | 370 | a.insertAddress( addrHome ); |
362 | if ( !addrWork.isEmpty() ) | 371 | if ( !addrWork.isEmpty() ) |
363 | a.insertAddress( addrWork ); | 372 | a.insertAddress( addrWork ); |
364 | 373 | ||
365 | if ( !emptyRow && !a.isEmpty() ) | 374 | if ( !emptyRow && !a.isEmpty() ) |
366 | contacts.append( a ); | 375 | contacts.append( a ); |
367 | } | 376 | } |
368 | 377 | ||
369 | return contacts; | 378 | return contacts; |
370 | } | 379 | } |
371 | 380 | ||
372 | void CSVImportDialog::initGUI() | 381 | void CSVImportDialog::initGUI() |
373 | { | 382 | { |
374 | QWidget* page = plainPage(); | 383 | QWidget* page = plainPage(); |
375 | 384 | ||
376 | QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(), | 385 | QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(), |
377 | spacingHintSmall() ); | 386 | spacingHintSmall() ); |
378 | QHBoxLayout *hbox = new QHBoxLayout(); | 387 | QHBoxLayout *hbox = new QHBoxLayout(); |
379 | hbox->setSpacing( spacingHint() ); | 388 | hbox->setSpacing( spacingHint() ); |
380 | 389 | ||
381 | QLabel *label = new QLabel( i18n( "File to import:" ), page ); | 390 | QLabel *label = new QLabel( i18n( "File to import:" ), page ); |
382 | hbox->addWidget( label ); | 391 | hbox->addWidget( label ); |
383 | 392 | ||
384 | mUrlRequester = new KURLRequester( page ); | 393 | mUrlRequester = new KURLRequester( page ); |
385 | mUrlRequester->setFilter( "*.csv" ); | 394 | mUrlRequester->setFilter( "*.csv" ); |
386 | hbox->addWidget( mUrlRequester ); | 395 | hbox->addWidget( mUrlRequester ); |
387 | 396 | ||
388 | layout->addMultiCellLayout( hbox, 0, 0, 0, 1 ); | 397 | layout->addMultiCellLayout( hbox, 0, 0, 0, 2 ); |
389 | 398 | ||
390 | // Delimiter: comma, semicolon, tab, space, other | 399 | // Delimiter: comma, semicolon, tab, space, other |
391 | mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); | 400 | mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); |
392 | mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); | 401 | mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); |
393 | mDelimiterBox->layout()->setSpacing( spacingHint() ); | 402 | mDelimiterBox->layout()->setSpacing( spacingHint() ); |
394 | mDelimiterBox->layout()->setMargin( marginHint() ); | 403 | mDelimiterBox->layout()->setMargin( marginHint() ); |
395 | QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); | 404 | QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); |
396 | delimiterLayout->setAlignment( Qt::AlignTop ); | 405 | delimiterLayout->setAlignment( Qt::AlignTop ); |
397 | layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 1 ); | 406 | layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 ); |
398 | 407 | ||
399 | mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); | 408 | mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); |
400 | mRadioComma->setChecked( true ); | 409 | mRadioComma->setChecked( true ); |
401 | delimiterLayout->addWidget( mRadioComma, 0, 0 ); | 410 | delimiterLayout->addWidget( mRadioComma, 0, 0 ); |
402 | 411 | ||
403 | mRadioSemicolon = new QRadioButton( i18n( "Semicolon" ), mDelimiterBox ); | 412 | mRadioSemicolon = new QRadioButton( i18n( "Semicolon" ), mDelimiterBox ); |
404 | delimiterLayout->addWidget( mRadioSemicolon, 0, 1 ); | 413 | delimiterLayout->addWidget( mRadioSemicolon, 0, 1 ); |
405 | 414 | ||
406 | mRadioTab = new QRadioButton( i18n( "Tabulator" ), mDelimiterBox ); | 415 | mRadioTab = new QRadioButton( i18n( "Tabulator" ), mDelimiterBox ); |
407 | delimiterLayout->addWidget( mRadioTab, 1, 0 ); | 416 | delimiterLayout->addWidget( mRadioTab, 1, 0 ); |
408 | 417 | ||
409 | mRadioSpace = new QRadioButton( i18n( "Space" ), mDelimiterBox ); | 418 | mRadioSpace = new QRadioButton( i18n( "Space" ), mDelimiterBox ); |
410 | delimiterLayout->addWidget( mRadioSpace, 1, 1 ); | 419 | delimiterLayout->addWidget( mRadioSpace, 1, 1 ); |
411 | 420 | ||
412 | mRadioOther = new QRadioButton( i18n( "Other" ), mDelimiterBox ); | 421 | mRadioOther = new QRadioButton( i18n( "Other" ), mDelimiterBox ); |
413 | delimiterLayout->addWidget( mRadioOther, 0, 2 ); | 422 | delimiterLayout->addWidget( mRadioOther, 0, 2 ); |
414 | 423 | ||
415 | mDelimiterEdit = new QLineEdit( mDelimiterBox ); | 424 | mDelimiterEdit = new QLineEdit( mDelimiterBox ); |
416 | delimiterLayout->addWidget( mDelimiterEdit, 1, 2 ); | 425 | delimiterLayout->addWidget( mDelimiterEdit, 1, 2 ); |
417 | 426 | ||
418 | mComboLine = new QComboBox( false, page ); | 427 | mComboLine = new QComboBox( false, page ); |
419 | mComboLine->insertItem( i18n( "1" ) ); | 428 | mComboLine->insertItem( i18n( "1" ) ); |
420 | layout->addWidget( mComboLine, 3, 1 ); | 429 | layout->addWidget( mComboLine, 3, 1 ); |
421 | 430 | ||
422 | mComboQuote = new QComboBox( false, page ); | 431 | mComboQuote = new QComboBox( false, page ); |
423 | mComboQuote->insertItem( i18n( "\"" ), 0 ); | 432 | mComboQuote->insertItem( i18n( "\"" ), 0 ); |
424 | mComboQuote->insertItem( i18n( "'" ), 1 ); | 433 | mComboQuote->insertItem( i18n( "'" ), 1 ); |
425 | mComboQuote->insertItem( i18n( "None" ), 2 ); | 434 | mComboQuote->insertItem( i18n( "None" ), 2 ); |
426 | layout->addWidget( mComboQuote, 3, 0 ); | 435 | layout->addWidget( mComboQuote, 3, 0 ); |
427 | 436 | mComboCodec = new QComboBox( false, page ); | |
437 | mComboCodec->insertItem( i18n( "UTF8" ), 0 ); | ||
438 | mComboCodec->insertItem( i18n( "LATIN1" ), 1 ); | ||
439 | mComboCodec->insertItem( i18n( "LOCALE" ), 2 ); | ||
440 | layout->addWidget( mComboCodec, 3, 2 ); | ||
428 | label = new QLabel( i18n( "Start at line:" ), page ); | 441 | label = new QLabel( i18n( "Start at line:" ), page ); |
429 | layout->addWidget( label, 2, 1 ); | 442 | layout->addWidget( label, 2, 1 ); |
430 | 443 | ||
431 | label = new QLabel( i18n( "Textquote:" ), page ); | 444 | label = new QLabel( i18n( "Textquote:" ), page ); |
432 | layout->addWidget( label, 2, 0 ); | 445 | layout->addWidget( label, 2, 0 ); |
446 | label = new QLabel( i18n( "Codec:" ), page ); | ||
447 | layout->addWidget( label, 2, 2 ); | ||
433 | 448 | ||
434 | mIgnoreDuplicates = new QCheckBox( page ); | 449 | mIgnoreDuplicates = new QCheckBox( page ); |
435 | mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); | 450 | mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); |
436 | layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 1 ); | 451 | layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 ); |
437 | 452 | ||
438 | mTable = new QTable( 0, 0, page ); | 453 | mTable = new QTable( 0, 0, page ); |
439 | mTable->setSelectionMode( QTable::NoSelection ); | 454 | mTable->setSelectionMode( QTable::NoSelection ); |
440 | //mTable->horizontalHeader()->hide(); | 455 | //mTable->horizontalHeader()->hide(); |
441 | layout->addMultiCellWidget( mTable, 5, 5, 0, 1 ); | 456 | layout->addMultiCellWidget( mTable, 5, 5, 0, 2 ); |
442 | /*US | 457 | /*US |
443 | setButtonText( User1, i18n( "Apply Template" ) ); | 458 | setButtonText( User1, i18n( "Apply Template" ) ); |
444 | setButtonText( User2, i18n( "Save Template" ) ); | 459 | setButtonText( User2, i18n( "Save Template" ) ); |
445 | */ | 460 | */ |
446 | 461 | ||
447 | enableButtonOK( false ); | 462 | enableButtonOK( false ); |
448 | 463 | ||
449 | findButton( User1 )->setEnabled( false ); | 464 | findButton( User1 )->setEnabled( false ); |
450 | findButton( User2 )->setEnabled( false ); | 465 | findButton( User2 )->setEnabled( false ); |
451 | 466 | ||
452 | #ifdef DESKTOP_VERSION | 467 | #ifdef DESKTOP_VERSION |
453 | resize( 500, 300 ); | 468 | resize( 640, 480 ); |
454 | #else | 469 | #else |
455 | showMaximized(); | 470 | showMaximized(); |
456 | #endif | 471 | #endif |
457 | } | 472 | } |
458 | 473 | ||
459 | void CSVImportDialog::fillTable() | 474 | void CSVImportDialog::fillTable() |
460 | { | 475 | { |
461 | int row, column; | 476 | int row, column; |
462 | bool lastCharDelimiter = false; | 477 | bool lastCharDelimiter = false; |
463 | bool ignoreDups = mIgnoreDuplicates->isChecked(); | 478 | bool ignoreDups = mIgnoreDuplicates->isChecked(); |
464 | enum { S_START, S_QUOTED_FIELD, S_MAYBE_END_OF_QUOTED_FIELD, S_END_OF_QUOTED_FIELD, | 479 | enum { S_START, S_QUOTED_FIELD, S_MAYBE_END_OF_QUOTED_FIELD, S_END_OF_QUOTED_FIELD, |
465 | S_MAYBE_NORMAL_FIELD, S_NORMAL_FIELD } state = S_START; | 480 | S_MAYBE_NORMAL_FIELD, S_NORMAL_FIELD } state = S_START; |
466 | 481 | ||
467 | QChar x; | 482 | QChar x; |
468 | QString field = ""; | 483 | QString field = ""; |
469 | 484 | ||
470 | // store previous assignment | 485 | // store previous assignment |
471 | QValueList<int> mTypeOld = mTypeStore; | 486 | QValueList<int> mTypeOld = mTypeStore; |
472 | 487 | ||
473 | mTypeStore.clear(); | 488 | mTypeStore.clear(); |
474 | for ( column = 0; column < mTable->numCols(); ++column ) { | 489 | for ( column = 0; column < mTable->numCols(); ++column ) { |
475 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, column ) ); | 490 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, column ) ); |
476 | 491 | ||
477 | if ( !item || mClearTypeStore ) | 492 | if ( !item || mClearTypeStore ) |
478 | mTypeStore.append( typeToPos( Undefined ) ); | 493 | mTypeStore.append( typeToPos( Undefined ) ); |
479 | else if ( item ) | 494 | else if ( item ) |
480 | mTypeStore.append( item->currentItem() ); | 495 | mTypeStore.append( item->currentItem() ); |
481 | } | 496 | } |
482 | 497 | ||
483 | clearTable(); | 498 | clearTable(); |
484 | 499 | ||
485 | row = column = 1; | 500 | row = column = 1; |
486 | mData = QString( mFileArray ); | 501 | if ( mComboCodec->currentItem () == 0 ) { |
502 | mData = QString::fromUtf8( mFileArray.data() ); | ||
503 | } else if ( mComboCodec->currentItem () == 1 ) { | ||
504 | mData = QString::fromLatin1( mFileArray.data() ); | ||
505 | } else { | ||
506 | mData = QString::fromLocal8Bit( mFileArray.data() ); | ||
507 | } | ||
487 | 508 | ||
488 | QTextStream inputStream( mData, IO_ReadOnly ); | 509 | QTextStream inputStream( mData, IO_ReadOnly ); |
489 | inputStream.setEncoding( QTextStream::Locale ); | 510 | |
511 | if ( mComboCodec->currentItem () == 0 ) { | ||
512 | inputStream.setEncoding( QTextStream::UnicodeUTF8 ); | ||
513 | } else if ( mComboCodec->currentItem () == 1 ) { | ||
514 | inputStream.setEncoding( QTextStream::Latin1 ); | ||
515 | } else { | ||
516 | inputStream.setEncoding( QTextStream::Locale ); | ||
517 | } | ||
490 | 518 | ||
491 | int maxColumn = 0; | 519 | int maxColumn = 0; |
492 | while ( !inputStream.atEnd() ) { | 520 | while ( !inputStream.atEnd() ) { |
493 | inputStream >> x; // read one char | 521 | inputStream >> x; // read one char |
494 | 522 | ||
495 | if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly | 523 | if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly |
496 | 524 | ||
497 | switch ( state ) { | 525 | switch ( state ) { |
498 | case S_START : | 526 | case S_START : |
499 | if ( x == mTextQuote ) { | 527 | if ( x == mTextQuote ) { |
500 | state = S_QUOTED_FIELD; | 528 | state = S_QUOTED_FIELD; |
501 | } else if ( x == mDelimiter ) { | 529 | } else if ( x == mDelimiter ) { |
502 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 530 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
503 | ++column; | 531 | ++column; |
504 | lastCharDelimiter = true; | 532 | lastCharDelimiter = true; |
505 | } else if ( x == '\n' ) { | 533 | } else if ( x == '\n' ) { |
506 | ++row; | 534 | ++row; |
507 | column = 1; | 535 | column = 1; |
508 | } else { | 536 | } else { |
509 | field += x; | 537 | field += x; |
510 | state = S_MAYBE_NORMAL_FIELD; | 538 | state = S_MAYBE_NORMAL_FIELD; |
511 | } | 539 | } |
512 | break; | 540 | break; |
513 | case S_QUOTED_FIELD : | 541 | case S_QUOTED_FIELD : |
514 | if ( x == mTextQuote ) { | 542 | if ( x == mTextQuote ) { |
515 | state = S_MAYBE_END_OF_QUOTED_FIELD; | 543 | state = S_MAYBE_END_OF_QUOTED_FIELD; |
516 | } else if ( x == '\n' ) { | 544 | } else if ( x == '\n' ) { |
517 | setText( row - mStartLine + 1, column, field ); | 545 | setText( row - mStartLine + 1, column, field ); |
518 | field = ""; | 546 | field = ""; |
519 | if ( x == '\n' ) { | 547 | if ( x == '\n' ) { |
520 | ++row; | 548 | ++row; |
521 | column = 1; | 549 | column = 1; |
522 | } else { | 550 | } else { |
523 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 551 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
524 | ++column; | 552 | ++column; |
525 | lastCharDelimiter = true; | 553 | lastCharDelimiter = true; |
526 | } | 554 | } |
527 | state = S_START; | 555 | state = S_START; |
528 | } else { | 556 | } else { |
529 | field += x; | 557 | field += x; |
530 | } | 558 | } |
531 | break; | 559 | break; |
532 | case S_MAYBE_END_OF_QUOTED_FIELD : | 560 | case S_MAYBE_END_OF_QUOTED_FIELD : |
533 | if ( x == mTextQuote ) { | 561 | if ( x == mTextQuote ) { |
534 | field += x; | 562 | field += x; |
535 | state = S_QUOTED_FIELD; | 563 | state = S_QUOTED_FIELD; |
536 | } else if ( x == mDelimiter || x == '\n' ) { | 564 | } else if ( x == mDelimiter || x == '\n' ) { |
537 | setText( row - mStartLine + 1, column, field ); | 565 | setText( row - mStartLine + 1, column, field ); |
538 | field = ""; | 566 | field = ""; |
539 | if ( x == '\n' ) { | 567 | if ( x == '\n' ) { |
540 | ++row; | 568 | ++row; |
541 | column = 1; | 569 | column = 1; |
542 | } else { | 570 | } else { |
543 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 571 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
544 | ++column; | 572 | ++column; |
545 | lastCharDelimiter = true; | 573 | lastCharDelimiter = true; |
546 | } | 574 | } |
547 | state = S_START; | 575 | state = S_START; |
548 | } else { | 576 | } else { |
549 | state = S_END_OF_QUOTED_FIELD; | 577 | state = S_END_OF_QUOTED_FIELD; |
550 | } | 578 | } |
551 | break; | 579 | break; |
552 | case S_END_OF_QUOTED_FIELD : | 580 | case S_END_OF_QUOTED_FIELD : |
553 | if ( x == mDelimiter || x == '\n' ) { | 581 | if ( x == mDelimiter || x == '\n' ) { |
554 | setText( row - mStartLine + 1, column, field ); | 582 | setText( row - mStartLine + 1, column, field ); |
555 | field = ""; | 583 | field = ""; |
556 | if ( x == '\n' ) { | 584 | if ( x == '\n' ) { |
557 | ++row; | 585 | ++row; |
558 | column = 1; | 586 | column = 1; |
559 | } else { | 587 | } else { |
560 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 588 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
561 | ++column; | 589 | ++column; |
562 | lastCharDelimiter = true; | 590 | lastCharDelimiter = true; |
563 | } | 591 | } |
564 | state = S_START; | 592 | state = S_START; |
565 | } else { | 593 | } else { |
566 | state = S_END_OF_QUOTED_FIELD; | 594 | state = S_END_OF_QUOTED_FIELD; |
567 | } | 595 | } |
568 | break; | 596 | break; |
569 | case S_MAYBE_NORMAL_FIELD : | 597 | case S_MAYBE_NORMAL_FIELD : |
570 | if ( x == mTextQuote ) { | 598 | if ( x == mTextQuote ) { |
571 | field = ""; | 599 | field = ""; |
572 | state = S_QUOTED_FIELD; | 600 | state = S_QUOTED_FIELD; |
573 | break; | 601 | break; |
574 | } | 602 | } |
575 | case S_NORMAL_FIELD : | 603 | case S_NORMAL_FIELD : |
576 | if ( x == mDelimiter || x == '\n' ) { | 604 | if ( x == mDelimiter || x == '\n' ) { |
577 | setText( row - mStartLine + 1, column, field ); | 605 | setText( row - mStartLine + 1, column, field ); |
578 | field = ""; | 606 | field = ""; |
579 | if ( x == '\n' ) { | 607 | if ( x == '\n' ) { |
580 | ++row; | 608 | ++row; |
581 | column = 1; | 609 | column = 1; |
582 | } else { | 610 | } else { |
583 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) | 611 | if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) |
584 | ++column; | 612 | ++column; |
585 | lastCharDelimiter = true; | 613 | lastCharDelimiter = true; |
586 | } | 614 | } |
587 | state = S_START; | 615 | state = S_START; |
588 | } else { | 616 | } else { |
589 | field += x; | 617 | field += x; |
590 | } | 618 | } |
591 | } | 619 | } |
592 | if ( x != mDelimiter ) | 620 | if ( x != mDelimiter ) |
593 | lastCharDelimiter = false; | 621 | lastCharDelimiter = false; |
594 | 622 | ||
595 | if ( column > maxColumn ) | 623 | if ( column > maxColumn ) |
596 | maxColumn = column; | 624 | maxColumn = column; |
597 | } | 625 | } |
598 | 626 | ||
599 | // file with only one line without '\n' | 627 | // file with only one line without '\n' |
600 | if ( field.length() > 0 ) { | 628 | if ( field.length() > 0 ) { |
601 | setText( row - mStartLine + 1, column, field ); | 629 | setText( row - mStartLine + 1, column, field ); |
602 | ++row; | 630 | ++row; |
603 | field = ""; | 631 | field = ""; |
604 | } | 632 | } |
605 | 633 | ||
606 | adjustRows( row - mStartLine ); | 634 | adjustRows( row - mStartLine ); |
607 | mTable->setNumCols( maxColumn ); | 635 | mTable->setNumCols( maxColumn ); |
608 | 636 | ||
609 | //US begin | 637 | //US begin |
610 | QStringList keys; | 638 | QStringList keys; |
639 | uint iii = 0, count = mTypeMap.count(); | ||
640 | while ( iii < count ) { | ||
641 | keys << "dummy"; | ||
642 | ++iii; | ||
643 | } | ||
611 | QMap<QString, uint>::ConstIterator it; | 644 | QMap<QString, uint>::ConstIterator it; |
612 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it) | 645 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it) |
613 | keys << it.key(); | 646 | keys[( it.data() )] = it.key(); |
614 | //US end | 647 | //US end |
615 | 648 | ||
616 | for ( column = 0; column < mTable->numCols(); ++column ) { | 649 | for ( column = 0; column < mTable->numCols(); ++column ) { |
617 | 650 | ||
618 | //US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); | 651 | //US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); |
619 | QComboTableItem *item = new QComboTableItem( mTable, keys ); | 652 | QComboTableItem *item = new QComboTableItem( mTable, keys ); |
620 | mTable->setItem( 0, column, item ); | 653 | mTable->setItem( 0, column, item ); |
621 | if ( column < mTypeStore.count() ) | 654 | if ( column < mTypeStore.count() ) |
622 | item->setCurrentItem( mTypeStore[ column ] ); | 655 | item->setCurrentItem( mTypeStore[ column ] ); |
623 | else | 656 | else |
624 | item->setCurrentItem( typeToPos( Undefined ) ); | 657 | item->setCurrentItem( typeToPos( Undefined ) ); |
625 | 658 | ||
626 | mTable->adjustColumn( column ); | 659 | mTable->adjustColumn( column ); |
627 | } | 660 | } |
628 | } | 661 | } |
629 | 662 | ||
630 | void CSVImportDialog::clearTable() | 663 | void CSVImportDialog::clearTable() |
631 | { | 664 | { |
632 | for ( int row = 0; row < mTable->numRows(); ++row ) | 665 | for ( int row = 0; row < mTable->numRows(); ++row ) |
633 | for ( int column = 0; column < mTable->numCols(); ++column ) | 666 | for ( int column = 0; column < mTable->numCols(); ++column ) |
634 | mTable->clearCell( row, column ); | 667 | mTable->clearCell( row, column ); |
635 | } | 668 | } |
636 | 669 | ||
637 | void CSVImportDialog::fillComboBox() | 670 | void CSVImportDialog::fillComboBox() |
638 | { | 671 | { |
639 | mComboLine->clear(); | 672 | mComboLine->clear(); |
640 | for ( int row = 1; row < mTable->numRows() + 1; ++row ) | 673 | for ( int row = 1; row < mTable->numRows() + 1; ++row ) |
641 | mComboLine->insertItem( QString::number( row ), row - 1 ); | 674 | mComboLine->insertItem( QString::number( row ), row - 1 ); |
642 | } | 675 | } |
643 | 676 | ||
644 | void CSVImportDialog::setText( int row, int col, const QString& text ) | 677 | void CSVImportDialog::setText( int row, int col, const QString& text ) |
645 | { | 678 | { |
646 | if ( row < 1 ) // skipped by the user | 679 | if ( row < 1 ) // skipped by the user |
647 | return; | 680 | return; |
648 | 681 | ||
649 | if ( mTable->numRows() < row ) { | 682 | if ( mTable->numRows() < row ) { |
650 | mTable->setNumRows( row + 5000 ); // We add 5000 at a time to limit recalculations | 683 | mTable->setNumRows( row + 5000 ); // We add 5000 at a time to limit recalculations |
651 | mAdjustRows = true; | 684 | mAdjustRows = true; |
652 | } | 685 | } |
653 | 686 | ||
654 | if ( mTable->numCols() < col ) | 687 | if ( mTable->numCols() < col ) |
655 | mTable->setNumCols( col + 50 ); // We add 50 at a time to limit recalculation | 688 | mTable->setNumCols( col + 50 ); // We add 50 at a time to limit recalculation |
656 | 689 | ||
657 | mTable->setText( row - 1, col - 1, text ); | 690 | mTable->setText( row - 1, col - 1, text ); |
658 | } | 691 | } |
659 | 692 | ||
660 | /* | 693 | /* |
661 | * Called after the first fillTable() when number of rows are unknown. | 694 | * Called after the first fillTable() when number of rows are unknown. |
662 | */ | 695 | */ |
663 | void CSVImportDialog::adjustRows( int rows ) | 696 | void CSVImportDialog::adjustRows( int rows ) |
664 | { | 697 | { |
665 | if ( mAdjustRows ) { | 698 | if ( mAdjustRows ) { |
666 | mTable->setNumRows( rows ); | 699 | mTable->setNumRows( rows ); |
667 | mAdjustRows = false; | 700 | mAdjustRows = false; |
668 | } | 701 | } |
669 | } | 702 | } |
670 | 703 | ||
671 | void CSVImportDialog::returnPressed() | 704 | void CSVImportDialog::returnPressed() |
672 | { | 705 | { |
673 | if ( mDelimiterBox->id( mDelimiterBox->selected() ) != 4 ) | 706 | if ( mDelimiterBox->id( mDelimiterBox->selected() ) != 4 ) |
674 | return; | 707 | return; |
675 | 708 | ||
676 | mDelimiter = mDelimiterEdit->text(); | 709 | mDelimiter = mDelimiterEdit->text(); |
677 | fillTable(); | 710 | fillTable(); |
678 | } | 711 | } |
679 | 712 | ||
680 | void CSVImportDialog::textChanged ( const QString& ) | 713 | void CSVImportDialog::textChanged ( const QString& ) |
681 | { | 714 | { |
682 | mRadioOther->setChecked ( true ); | 715 | mRadioOther->setChecked ( true ); |
683 | delimiterClicked( 4 ); // other | 716 | delimiterClicked( 4 ); // other |
684 | } | 717 | } |
718 | void CSVImportDialog::codecChanged ( const QString& ) | ||
719 | { | ||
720 | fillTable(); | ||
721 | } | ||
685 | 722 | ||
686 | void CSVImportDialog::delimiterClicked( int id ) | 723 | void CSVImportDialog::delimiterClicked( int id ) |
687 | { | 724 | { |
688 | switch ( id ) { | 725 | switch ( id ) { |
689 | case 0: // comma | 726 | case 0: // comma |
690 | mDelimiter = ","; | 727 | mDelimiter = ","; |
691 | break; | 728 | break; |
692 | case 4: // other | 729 | case 4: // other |
693 | mDelimiter = mDelimiterEdit->text(); | 730 | mDelimiter = mDelimiterEdit->text(); |
694 | break; | 731 | break; |
695 | case 2: // tab | 732 | case 2: // tab |
696 | mDelimiter = "\t"; | 733 | mDelimiter = "\t"; |
697 | break; | 734 | break; |
698 | case 3: // space | 735 | case 3: // space |
699 | mDelimiter = " "; | 736 | mDelimiter = " "; |
700 | break; | 737 | break; |
701 | case 1: // semicolon | 738 | case 1: // semicolon |
702 | mDelimiter = ";"; | 739 | mDelimiter = ";"; |
703 | break; | 740 | break; |
704 | } | 741 | } |
705 | 742 | ||
706 | fillTable(); | 743 | fillTable(); |
707 | } | 744 | } |
708 | 745 | ||
709 | void CSVImportDialog::textquoteSelected( const QString& mark ) | 746 | void CSVImportDialog::textquoteSelected( const QString& mark ) |
710 | { | 747 | { |
711 | if ( mComboQuote->currentItem() == 2 ) | 748 | if ( mComboQuote->currentItem() == 2 ) |
712 | mTextQuote = 0; | 749 | mTextQuote = 0; |
713 | else | 750 | else |
714 | mTextQuote = mark[ 0 ]; | 751 | mTextQuote = mark[ 0 ]; |
715 | 752 | ||
716 | fillTable(); | 753 | fillTable(); |
717 | } | 754 | } |
718 | 755 | ||
719 | void CSVImportDialog::lineSelected( const QString& line ) | 756 | void CSVImportDialog::lineSelected( const QString& line ) |
720 | { | 757 | { |
721 | mStartLine = line.toInt() - 1; | 758 | mStartLine = line.toInt() - 1; |
722 | fillTable(); | 759 | fillTable(); |
723 | } | 760 | } |
724 | 761 | ||
725 | void CSVImportDialog::slotOk() | 762 | void CSVImportDialog::slotOk() |
726 | { | 763 | { |
727 | bool assigned = false; | 764 | bool assigned = false; |
728 | 765 | ||
729 | for ( int column = 0; column < mTable->numCols(); ++column ) { | 766 | for ( int column = 0; column < mTable->numCols(); ++column ) { |
730 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, | 767 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, |
731 | column ) ); | 768 | column ) ); |
732 | if ( item && posToType( item->currentItem() ) != Undefined ) | 769 | if ( item && posToType( item->currentItem() ) != Undefined ) |
733 | assigned = true; | 770 | assigned = true; |
734 | } | 771 | } |
735 | 772 | ||
736 | if ( assigned ) | 773 | if ( assigned ) |
737 | KDialogBase::slotOk(); | 774 | KDialogBase::slotOk(); |
738 | else | 775 | else |
739 | KMessageBox::sorry( this, i18n( "You have to assign at least one column." ) ); | 776 | KMessageBox::sorry( this, i18n( "You have to assign at least one column." ) ); |
740 | } | 777 | } |
741 | 778 | ||
742 | void CSVImportDialog::applyTemplate() | 779 | void CSVImportDialog::applyTemplate() |
743 | { | 780 | { |
744 | QMap<uint,int> columnMap; | 781 | QMap<uint,int> columnMap; |
745 | QMap<QString, QString> fileMap; | 782 | QMap<QString, QString> fileMap; |
746 | QStringList templates; | 783 | QStringList templates; |
747 | 784 | ||
748 | // load all template files | 785 | // load all template files |
749 | /*US QStringList list = KGlobal::dirs()->findAllResources( "data" , QString( kapp->name() ) + | 786 | /*US QStringList list = KGlobal::dirs()->findAllResources( "data" , QString( kapp->name() ) + |
750 | "/csv-templates/*.desktop", true, true ); | 787 | "/csv-templates/*.desktop", true, true ); |
751 | */ | 788 | */ |
752 | QStringList list = KGlobal::dirs()->findAllResources( "data" , KGlobal::getAppName() + | 789 | QStringList list = KGlobal::dirs()->findAllResources( "data" , KGlobal::getAppName() + |
753 | "/csv-templates/*.desktop", true, true ); | 790 | "/csv-templates/*.desktop", true, true ); |
754 | 791 | ||
755 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) | 792 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
756 | { | 793 | { |
757 | qDebug("for "); | 794 | |
758 | //US KSimpleConfig config( *it, true ); | 795 | //US KSimpleConfig config( *it, true ); |
759 | KConfig config( *it ); | 796 | KConfig config( *it ); |
760 | 797 | ||
761 | if ( !config.hasGroup( "csv column map" ) ) | 798 | if ( !config.hasGroup( "csv column map" ) ) |
762 | continue; | 799 | continue; |
763 | 800 | ||
764 | config.setGroup( "Misc" ); | 801 | config.setGroup( "Misc" ); |
765 | templates.append( config.readEntry( "Name" ) ); | 802 | templates.append( config.readEntry( "Name" ) ); |
766 | fileMap.insert( config.readEntry( "Name" ), *it ); | 803 | fileMap.insert( config.readEntry( "Name" ), *it ); |
767 | } | 804 | } |
768 | qDebug("weiter "); | 805 | |
769 | // let the user chose, what to take | 806 | // let the user chose, what to take |
770 | bool ok = false; | 807 | bool ok = false; |
771 | QString tmp; | 808 | QString tmp; |
772 | tmp = QInputDialog::getItem( i18n( "Template Selection" ), | 809 | tmp = QInputDialog::getItem( i18n( "Template Selection" ), |
773 | i18n( "Please select a template, that matches the CSV file." ), | 810 | i18n( "Please select a template\nthat matches the CSV file." ), |
774 | templates, 0, false, &ok, this ); | 811 | templates, 0, false, &ok, this ); |
775 | 812 | ||
776 | if ( !ok ) | 813 | if ( !ok ) |
777 | return; | 814 | return; |
778 | 815 | ||
779 | //US KSimpleConfig config( fileMap[ tmp ], true ); | 816 | //US KSimpleConfig config( fileMap[ tmp ], true ); |
780 | KConfig config( fileMap[ tmp ] ); | 817 | KConfig config( fileMap[ tmp ] ); |
781 | config.setGroup( "General" ); | 818 | config.setGroup( "General" ); |
782 | //US uint numColumns = config.readUnsignedNumEntry( "Columns" ); | 819 | //US uint numColumns = config.readUnsignedNumEntry( "Columns" ); |
783 | uint numColumns = (uint)config.readNumEntry( "Columns" ); | 820 | uint numColumns = (uint)config.readNumEntry( "Columns" ); |
784 | 821 | ||
785 | mDelimiterEdit->setText( config.readEntry( "DelimiterOther" ) ); | 822 | mDelimiterEdit->setText( config.readEntry( "DelimiterOther" ) ); |
786 | mDelimiterBox->setButton( config.readNumEntry( "DelimiterType" ) ); | 823 | mDelimiterBox->setButton( config.readNumEntry( "DelimiterType" ) ); |
787 | delimiterClicked( config.readNumEntry( "DelimiterType" ) ); | 824 | delimiterClicked( config.readNumEntry( "DelimiterType" ) ); |
788 | int quoteType = config.readNumEntry( "QuoteType" ); | 825 | int quoteType = config.readNumEntry( "QuoteType" ); |
789 | mComboQuote->setCurrentItem( quoteType ); | 826 | mComboQuote->setCurrentItem( quoteType ); |
790 | textquoteSelected( mComboQuote->currentText() ); | 827 | textquoteSelected( mComboQuote->currentText() ); |
791 | 828 | ||
792 | // create the column map | 829 | // create the column map |
793 | config.setGroup( "csv column map" ); | 830 | config.setGroup( "csv column map" ); |
794 | for ( uint i = 0; i < numColumns; ++i ) { | 831 | for ( uint i = 0; i < numColumns; ++i ) { |
795 | int col = config.readNumEntry( QString::number( i ) ); | 832 | int col = config.readNumEntry( QString::number( i ) ); |
796 | columnMap.insert( i, col ); | 833 | columnMap.insert( i, col ); |
797 | } | 834 | } |
798 | 835 | ||
799 | // apply the column map | 836 | // apply the column map |
800 | for ( uint column = 0; column < columnMap.count(); ++column ) { | 837 | for ( uint column = 0; column < columnMap.count(); ++column ) { |
801 | int type = columnMap[ column ]; | 838 | int type = columnMap[ column ]; |
802 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, | 839 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, |
803 | column ) ); | 840 | column ) ); |
804 | if ( item ) | 841 | if ( item ) |
805 | item->setCurrentItem( typeToPos( type ) ); | 842 | item->setCurrentItem( typeToPos( type ) ); |
806 | } | 843 | } |
807 | } | 844 | } |
808 | 845 | ||
809 | void CSVImportDialog::saveTemplate() | 846 | void CSVImportDialog::saveTemplate() |
810 | { | 847 | { |
811 | /*US | 848 | /*US |
812 | QString fileName = KFileDialog::getSaveFileName( | 849 | QString fileName = KFileDialog::getSaveFileName( |
813 | locateLocal( "data", QString( kapp->name() ) + "/csv-templates/" ), | 850 | locateLocal( "data", QString( kapp->name() ) + "/csv-templates/" ), |
814 | "*.desktop", this ); | 851 | "*.desktop", this ); |
815 | */ | 852 | */ |
816 | QString fileName = KFileDialog::getSaveFileName( | 853 | QString fileName = KFileDialog::getSaveFileName( |
817 | locateLocal( "data", KGlobal::getAppName() + "/csv-templates/" )+ | 854 | locateLocal( "data", KGlobal::getAppName() + "/csv-templates/" )+ |
818 | "*.desktop",i18n("Save file name") , this ); | 855 | "*.desktop",i18n("Save file name") , this ); |
819 | 856 | ||
820 | if ( fileName.isEmpty() ) | 857 | if ( fileName.isEmpty() ) |
821 | return; | 858 | return; |
822 | 859 | ||
823 | if ( !fileName.contains( ".desktop" ) ) | 860 | if ( !fileName.contains( ".desktop" ) ) |
824 | fileName += ".desktop"; | 861 | fileName += ".desktop"; |
825 | 862 | ||
826 | QString name = QInputDialog::getText( i18n( "Template name" ), i18n( "Please enter a name for the template" ) ); | 863 | QString name = QInputDialog::getText( i18n( "Template name" ), i18n( "Please enter a name for the template" ) ); |
827 | 864 | ||
828 | if ( name.isEmpty() ) | 865 | if ( name.isEmpty() ) |
829 | return; | 866 | return; |
830 | 867 | ||
831 | KConfig config( fileName ); | 868 | KConfig config( fileName ); |
832 | config.setGroup( "General" ); | 869 | config.setGroup( "General" ); |
833 | config.writeEntry( "Columns", mTable->numCols() ); | 870 | config.writeEntry( "Columns", mTable->numCols() ); |
834 | config.writeEntry( "DelimiterType", mDelimiterBox->id( mDelimiterBox->selected() ) ); | 871 | config.writeEntry( "DelimiterType", mDelimiterBox->id( mDelimiterBox->selected() ) ); |
835 | config.writeEntry( "DelimiterOther", mDelimiterEdit->text() ); | 872 | config.writeEntry( "DelimiterOther", mDelimiterEdit->text() ); |
836 | config.writeEntry( "QuoteType", mComboQuote->currentItem() ); | 873 | config.writeEntry( "QuoteType", mComboQuote->currentItem() ); |
837 | 874 | ||
838 | config.setGroup( "Misc" ); | 875 | config.setGroup( "Misc" ); |
839 | config.writeEntry( "Name", name ); | 876 | config.writeEntry( "Name", name ); |
840 | 877 | ||
841 | config.setGroup( "csv column map" ); | 878 | config.setGroup( "csv column map" ); |
842 | 879 | ||
843 | for ( uint column = 0; column < mTable->numCols(); ++column ) { | 880 | for ( uint column = 0; column < mTable->numCols(); ++column ) { |
844 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, | 881 | QComboTableItem *item = static_cast<QComboTableItem*>( mTable->item( 0, |
845 | column ) ); | 882 | column ) ); |
846 | if ( item ) | 883 | if ( item ) |
847 | config.writeEntry( QString::number( column ), posToType( | 884 | config.writeEntry( QString::number( column ), posToType( |
848 | item->currentItem() ) ); | 885 | item->currentItem() ) ); |
849 | else | 886 | else |
850 | config.writeEntry( QString::number( column ), 0 ); | 887 | config.writeEntry( QString::number( column ), 0 ); |
851 | } | 888 | } |
852 | 889 | ||
853 | config.sync(); | 890 | config.sync(); |
854 | } | 891 | } |
855 | 892 | ||
856 | QString CSVImportDialog::getText( int row, int col ) | 893 | QString CSVImportDialog::getText( int row, int col ) |
857 | { | 894 | { |
858 | return mTable->text( row, col ); | 895 | return mTable->text( row, col ); |
859 | } | 896 | } |
860 | 897 | ||
861 | uint CSVImportDialog::posToType( int pos ) const | 898 | uint CSVImportDialog::posToType( int pos ) const |
862 | { | 899 | { |
900 | return pos; | ||
901 | #if 0 | ||
863 | uint counter = 0; | 902 | uint counter = 0; |
864 | QMap<QString, uint>::ConstIterator it; | 903 | QMap<QString, uint>::ConstIterator it; |
865 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) | 904 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) |
866 | if ( counter == (uint)pos ) | 905 | if ( counter == (uint)pos ) |
867 | return it.data(); | 906 | return it.data(); |
868 | 907 | ||
869 | return 0; | 908 | return 0; |
909 | #endif | ||
870 | } | 910 | } |
871 | 911 | ||
872 | int CSVImportDialog::typeToPos( uint type ) const | 912 | int CSVImportDialog::typeToPos( uint type ) const |
873 | { | 913 | { |
914 | return type; | ||
915 | #if 0 | ||
874 | uint counter = 0; | 916 | uint counter = 0; |
875 | QMap<QString, uint>::ConstIterator it; | 917 | QMap<QString, uint>::ConstIterator it; |
876 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) | 918 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) |
877 | if ( it.data() == type ) | 919 | if ( it.data() == type ) |
878 | return counter; | 920 | return counter; |
879 | 921 | ||
880 | return -1; | 922 | return -1; |
923 | #endif | ||
881 | } | 924 | } |
882 | 925 | ||
883 | void CSVImportDialog::ignoreDuplicatesChanged( int ) | 926 | void CSVImportDialog::ignoreDuplicatesChanged( int ) |
884 | { | 927 | { |
885 | fillTable(); | 928 | fillTable(); |
886 | } | 929 | } |
887 | 930 | ||
888 | void CSVImportDialog::setFile( const QString &fileName ) | 931 | void CSVImportDialog::setFile( const QString &fileName ) |
889 | { | 932 | { |
890 | if ( fileName.isEmpty() ) | 933 | if ( fileName.isEmpty() ) |
891 | return; | 934 | return; |
892 | 935 | ||
893 | QFile file( fileName ); | 936 | QFile file( fileName ); |
894 | if ( !file.open( IO_ReadOnly ) ) { | 937 | if ( !file.open( IO_ReadOnly ) ) { |
895 | KMessageBox::sorry( this, i18n( "Cannot open input file!" ) ); | 938 | KMessageBox::sorry( this, i18n( "Cannot open input file!" ) ); |
896 | file.close(); | 939 | file.close(); |
897 | return; | 940 | return; |
898 | } | 941 | } |
899 | 942 | ||
900 | mFileArray = file.readAll(); | 943 | mFileArray = file.readAll(); |
901 | file.close(); | 944 | file.close(); |
902 | 945 | ||
903 | mClearTypeStore = true; | 946 | mClearTypeStore = true; |
904 | clearTable(); | 947 | clearTable(); |
905 | mTable->setNumCols( 0 ); | 948 | mTable->setNumCols( 0 ); |
906 | mTable->setNumRows( 0 ); | 949 | mTable->setNumRows( 0 ); |
907 | fillTable(); | 950 | fillTable(); |
908 | mClearTypeStore = false; | 951 | mClearTypeStore = false; |
909 | 952 | ||
910 | fillComboBox(); | 953 | fillComboBox(); |
911 | } | 954 | } |
912 | 955 | ||
913 | void CSVImportDialog::urlChanged( const QString &file ) | 956 | void CSVImportDialog::urlChanged( const QString &file ) |
914 | { | 957 | { |
915 | bool state = !file.isEmpty(); | 958 | bool state = !file.isEmpty(); |
916 | 959 | ||
917 | enableButtonOK( state ); | 960 | enableButtonOK( state ); |
918 | 961 | ||
919 | findButton( User1 )->setEnabled( state ); | 962 | findButton( User1 )->setEnabled( state ); |
920 | findButton( User2 )->setEnabled( state ); | 963 | findButton( User2 )->setEnabled( state ); |
921 | 964 | ||
922 | } | 965 | } |
923 | 966 | ||
924 | #ifndef KAB_EMBEDDED | 967 | #ifndef KAB_EMBEDDED |
925 | #include <csvimportdialog.moc> | 968 | #include <csvimportdialog.moc> |
926 | #endif //KAB_EMBEDDED | 969 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/xxport/csvimportdialog.h b/kaddressbook/xxport/csvimportdialog.h index 545b5f9..5f55ab2 100644 --- a/kaddressbook/xxport/csvimportdialog.h +++ b/kaddressbook/xxport/csvimportdialog.h | |||
@@ -1,124 +1,126 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (C) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (C) 2003 Tobias Koenig <tokoe@kde.org> |
4 | based on the code of KSpread's CSV Import Dialog | 4 | based on the code of KSpread's CSV Import Dialog |
5 | 5 | ||
6 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public | 7 | modify it under the terms of the GNU Library General Public |
8 | License as published by the Free Software Foundation; either | 8 | License as published by the Free Software Foundation; either |
9 | version 2 of the License, or (at your option) any later version. | 9 | version 2 of the License, or (at your option) any later version. |
10 | 10 | ||
11 | This library is distributed in the hope that it will be useful, | 11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. | 14 | Library General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. | 19 | Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | /* | 22 | /* |
23 | Enhanced Version of the file for platform independent KDE tools. | 23 | Enhanced Version of the file for platform independent KDE tools. |
24 | Copyright (c) 2004 Ulf Schenk | 24 | Copyright (c) 2004 Ulf Schenk |
25 | 25 | ||
26 | $Id$ | 26 | $Id$ |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef CSV_IMPORT_DLG_H | 29 | #ifndef CSV_IMPORT_DLG_H |
30 | #define CSV_IMPORT_DLG_H | 30 | #define CSV_IMPORT_DLG_H |
31 | 31 | ||
32 | #include <kabc/addressbook.h> | 32 | #include <kabc/addressbook.h> |
33 | #include <kabc/addresseelist.h> | 33 | #include <kabc/addresseelist.h> |
34 | #include <kdialogbase.h> | 34 | #include <kdialogbase.h> |
35 | 35 | ||
36 | #include <qvaluelist.h> | 36 | #include <qvaluelist.h> |
37 | 37 | ||
38 | class KURLRequester; | 38 | class KURLRequester; |
39 | 39 | ||
40 | class QButtonGroup; | 40 | class QButtonGroup; |
41 | class QComboBox; | 41 | class QComboBox; |
42 | class QCheckBox; | 42 | class QCheckBox; |
43 | class QLineEdit; | 43 | class QLineEdit; |
44 | class QPushButton; | 44 | class QPushButton; |
45 | class QRadioButton; | 45 | class QRadioButton; |
46 | class QTable; | 46 | class QTable; |
47 | 47 | ||
48 | class CSVImportDialog : public KDialogBase | 48 | class CSVImportDialog : public KDialogBase |
49 | { | 49 | { |
50 | Q_OBJECT | 50 | Q_OBJECT |
51 | 51 | ||
52 | public: | 52 | public: |
53 | CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, | 53 | CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, |
54 | const char *name = 0 ); | 54 | const char *name = 0 ); |
55 | ~CSVImportDialog(); | 55 | ~CSVImportDialog(); |
56 | 56 | ||
57 | KABC::AddresseeList contacts() const; | 57 | KABC::AddresseeList contacts() const; |
58 | 58 | ||
59 | protected slots: | 59 | protected slots: |
60 | virtual void slotOk(); | 60 | virtual void slotOk(); |
61 | 61 | ||
62 | private slots: | 62 | private slots: |
63 | void returnPressed(); | 63 | void returnPressed(); |
64 | void delimiterClicked( int id ); | 64 | void delimiterClicked( int id ); |
65 | void lineSelected( const QString& line ); | 65 | void lineSelected( const QString& line ); |
66 | void textquoteSelected( const QString& mark ); | 66 | void textquoteSelected( const QString& mark ); |
67 | void textChanged ( const QString & ); | 67 | void textChanged ( const QString & ); |
68 | void ignoreDuplicatesChanged( int ); | 68 | void ignoreDuplicatesChanged( int ); |
69 | void setFile( const QString& ); | 69 | void setFile( const QString& ); |
70 | void urlChanged( const QString& ); | 70 | void urlChanged( const QString& ); |
71 | void codecChanged ( const QString& ); | ||
71 | 72 | ||
72 | void applyTemplate(); | 73 | void applyTemplate(); |
73 | void saveTemplate(); | 74 | void saveTemplate(); |
74 | 75 | ||
75 | private: | 76 | private: |
76 | enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName, | 77 | enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName, |
77 | Prefix, Suffix, NickName, Birthday, | 78 | Prefix, Suffix, NickName, Birthday, |
78 | HomeAddressStreet, HomeAddressLocality, HomeAddressRegion, | 79 | HomeAddressStreet, HomeAddressLocality, HomeAddressRegion, |
79 | HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel, | 80 | HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel, |
80 | BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion, | 81 | BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion, |
81 | BusinessAddressPostalCode, BusinessAddressCountry, | 82 | BusinessAddressPostalCode, BusinessAddressCountry, |
82 | BusinessAddressLabel, | 83 | BusinessAddressLabel, |
83 | HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, CarPhone, | 84 | HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, CarPhone, |
84 | Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL | 85 | Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories |
85 | }; | 86 | }; |
86 | 87 | ||
87 | QTable* mTable; | 88 | QTable* mTable; |
88 | QButtonGroup* mDelimiterBox; | 89 | QButtonGroup* mDelimiterBox; |
89 | QRadioButton* mRadioComma; | 90 | QRadioButton* mRadioComma; |
90 | QRadioButton* mRadioSemicolon; | 91 | QRadioButton* mRadioSemicolon; |
91 | QRadioButton* mRadioTab; | 92 | QRadioButton* mRadioTab; |
92 | QRadioButton* mRadioSpace; | 93 | QRadioButton* mRadioSpace; |
93 | QRadioButton* mRadioOther; | 94 | QRadioButton* mRadioOther; |
94 | QLineEdit* mDelimiterEdit; | 95 | QLineEdit* mDelimiterEdit; |
95 | QComboBox* mComboLine; | 96 | QComboBox* mComboLine; |
96 | QComboBox* mComboQuote; | 97 | QComboBox* mComboQuote; |
98 | QComboBox* mComboCodec; | ||
97 | QCheckBox* mIgnoreDuplicates; | 99 | QCheckBox* mIgnoreDuplicates; |
98 | KURLRequester* mUrlRequester; | 100 | KURLRequester* mUrlRequester; |
99 | 101 | ||
100 | void initGUI(); | 102 | void initGUI(); |
101 | void fillTable(); | 103 | void fillTable(); |
102 | void clearTable(); | 104 | void clearTable(); |
103 | void fillComboBox(); | 105 | void fillComboBox(); |
104 | void setText( int row, int col, const QString& text ); | 106 | void setText( int row, int col, const QString& text ); |
105 | void adjustRows( int rows ); | 107 | void adjustRows( int rows ); |
106 | QString getText( int row, int col ); | 108 | QString getText( int row, int col ); |
107 | uint posToType( int pos ) const; | 109 | uint posToType( int pos ) const; |
108 | int typeToPos( uint type ) const; | 110 | int typeToPos( uint type ) const; |
109 | 111 | ||
110 | bool mAdjustRows; | 112 | bool mAdjustRows; |
111 | int mStartLine; | 113 | int mStartLine; |
112 | QChar mTextQuote; | 114 | QChar mTextQuote; |
113 | QString mDelimiter; | 115 | QString mDelimiter; |
114 | QString mData; | 116 | QString mData; |
115 | QByteArray mFileArray; | 117 | QByteArray mFileArray; |
116 | QMap<QString, uint> mTypeMap; | 118 | QMap<QString, uint> mTypeMap; |
117 | KABC::AddressBook *mAddressBook; | 119 | KABC::AddressBook *mAddressBook; |
118 | int mCustomCounter; | 120 | int mCustomCounter; |
119 | bool mClearTypeStore; | 121 | bool mClearTypeStore; |
120 | QValueList<int> mTypeStore; | 122 | QValueList<int> mTypeStore; |
121 | 123 | ||
122 | }; | 124 | }; |
123 | 125 | ||
124 | #endif | 126 | #endif |
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 3f47425..6be1580 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp | |||
@@ -1,76 +1,79 @@ | |||
1 | #include <kfiledialog.h> | 1 | #include <kfiledialog.h> |
2 | #include <qdialog.h> | 2 | #include <qdialog.h> |
3 | #include <qlayout.h> | 3 | #include <qlayout.h> |
4 | #include <qdir.h> | 4 | #include <qdir.h> |
5 | #include <qfileinfo.h> | 5 | #include <qfileinfo.h> |
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | 7 | ||
8 | #ifndef DESKTOP_VERSION | 8 | #ifndef DESKTOP_VERSION |
9 | //US orig#include <ofileselector.h> | 9 | //US orig#include <ofileselector.h> |
10 | #include <ofileselector_p.h> | 10 | #include <ofileselector_p.h> |
11 | QString KFileDialog::getSaveFileName( const QString & fn, | 11 | QString KFileDialog::getSaveFileName( const QString & fn, |
12 | const QString & cap , QWidget * par ) | 12 | const QString & cap , QWidget * par ) |
13 | { | 13 | { |
14 | QString retfile = ""; | 14 | QString retfile = ""; |
15 | QDialog dia ( par, "input-dialog", true ); | 15 | QDialog dia ( par, "input-dialog", true ); |
16 | QVBoxLayout lay( &dia ); | 16 | QVBoxLayout lay( &dia ); |
17 | lay.setMargin(7); | 17 | lay.setMargin(7); |
18 | lay.setSpacing(7); | 18 | lay.setSpacing(7); |
19 | QString file = fn; | 19 | QString file = fn; |
20 | if ( file.isEmpty() ) | 20 | if ( file.isEmpty() ) |
21 | file = QDir::homeDirPath()+"/*"; | 21 | file = QDir::homeDirPath()+"/*"; |
22 | QFileInfo fi ( file ); | 22 | QFileInfo fi ( file ); |
23 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); | 23 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); |
24 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); | 24 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); |
25 | lay.addWidget( &o); | 25 | lay.addWidget( &o); |
26 | // o.setNewVisible( true ); | 26 | // o.setNewVisible( true ); |
27 | // o.setNameVisible( true ); | 27 | // o.setNameVisible( true ); |
28 | dia.showMaximized(); | 28 | dia.showMaximized(); |
29 | dia.setCaption( cap ); | 29 | if ( cap.isEmpty() ) |
30 | dia.setCaption( file ); | ||
31 | else | ||
32 | dia.setCaption( cap ); | ||
30 | int res = dia.exec(); | 33 | int res = dia.exec(); |
31 | if ( res ) | 34 | if ( res ) |
32 | retfile = o.selectedName(); | 35 | retfile = o.selectedName(); |
33 | return retfile; | 36 | return retfile; |
34 | } | 37 | } |
35 | 38 | ||
36 | QString KFileDialog::getOpenFileName( const QString & fn, | 39 | QString KFileDialog::getOpenFileName( const QString & fn, |
37 | const QString & cap, QWidget * par ) | 40 | const QString & cap, QWidget * par ) |
38 | { | 41 | { |
39 | QString retfile = ""; | 42 | QString retfile = ""; |
40 | QDialog dia ( par, "input-dialog", true ); | 43 | QDialog dia ( par, "input-dialog", true ); |
41 | // QLineEdit lab ( &dia ); | 44 | // QLineEdit lab ( &dia ); |
42 | QVBoxLayout lay( &dia ); | 45 | QVBoxLayout lay( &dia ); |
43 | lay.setMargin(7); | 46 | lay.setMargin(7); |
44 | lay.setSpacing(7); | 47 | lay.setSpacing(7); |
45 | QString file = fn; | 48 | QString file = fn; |
46 | if ( file.isEmpty() ) | 49 | if ( file.isEmpty() ) |
47 | file = QDir::homeDirPath()+"/*";; | 50 | file = QDir::homeDirPath()+"/*";; |
48 | QFileInfo fi ( file ); | 51 | QFileInfo fi ( file ); |
49 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); | 52 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); |
50 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); | 53 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); |
51 | lay.addWidget( &o); | 54 | lay.addWidget( &o); |
52 | dia.showMaximized(); | 55 | dia.showMaximized(); |
53 | dia.setCaption( cap ); | 56 | dia.setCaption( cap ); |
54 | int res = dia.exec(); | 57 | int res = dia.exec(); |
55 | if ( res ) | 58 | if ( res ) |
56 | retfile = o.selectedName(); | 59 | retfile = o.selectedName(); |
57 | return retfile; | 60 | return retfile; |
58 | } | 61 | } |
59 | 62 | ||
60 | #else | 63 | #else |
61 | 64 | ||
62 | #include <qfiledialog.h> | 65 | #include <qfiledialog.h> |
63 | 66 | ||
64 | QString KFileDialog::getSaveFileName( const QString & fn, | 67 | QString KFileDialog::getSaveFileName( const QString & fn, |
65 | const QString & cap , QWidget * par ) | 68 | const QString & cap , QWidget * par ) |
66 | { | 69 | { |
67 | return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); | 70 | return QFileDialog::getSaveFileName( fn, QString::null, par, "openfile", cap ); |
68 | } | 71 | } |
69 | QString KFileDialog::getOpenFileName( const QString & fn, | 72 | QString KFileDialog::getOpenFileName( const QString & fn, |
70 | const QString & cap, QWidget * par ) | 73 | const QString & cap, QWidget * par ) |
71 | { | 74 | { |
72 | 75 | ||
73 | return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); | 76 | return QFileDialog::getOpenFileName( fn, QString::null, par, "openfile", cap ); |
74 | } | 77 | } |
75 | #endif | 78 | #endif |
76 | 79 | ||
diff --git a/microkde/kio/kfile/kurlrequester.cpp b/microkde/kio/kfile/kurlrequester.cpp index 6d39308..991c8be 100644 --- a/microkde/kio/kfile/kurlrequester.cpp +++ b/microkde/kio/kfile/kurlrequester.cpp | |||
@@ -147,257 +147,257 @@ public: | |||
147 | /*US KURLCompletion *comp; | 147 | /*US KURLCompletion *comp; |
148 | if ( combo ) | 148 | if ( combo ) |
149 | comp = dynamic_cast<KURLCompletion*>(combo->completionObject()); | 149 | comp = dynamic_cast<KURLCompletion*>(combo->completionObject()); |
150 | else | 150 | else |
151 | comp = dynamic_cast<KURLCompletion*>(edit->completionObject()); | 151 | comp = dynamic_cast<KURLCompletion*>(edit->completionObject()); |
152 | 152 | ||
153 | if ( comp ) | 153 | if ( comp ) |
154 | return comp->replacedPath( txt ); | 154 | return comp->replacedPath( txt ); |
155 | else | 155 | else |
156 | */ | 156 | */ |
157 | return txt; | 157 | return txt; |
158 | } | 158 | } |
159 | 159 | ||
160 | KLineEdit *edit; | 160 | KLineEdit *edit; |
161 | //US KComboBox *combo; | 161 | //US KComboBox *combo; |
162 | int fileDialogMode; | 162 | int fileDialogMode; |
163 | QString fileDialogFilter; | 163 | QString fileDialogFilter; |
164 | }; | 164 | }; |
165 | 165 | ||
166 | 166 | ||
167 | /*US | 167 | /*US |
168 | KURLRequester::KURLRequester( QWidget *editWidget, QWidget *parent, | 168 | KURLRequester::KURLRequester( QWidget *editWidget, QWidget *parent, |
169 | const char *name ) | 169 | const char *name ) |
170 | : QHBox( parent, name ) | 170 | : QHBox( parent, name ) |
171 | { | 171 | { |
172 | d = new KURLRequesterPrivate; | 172 | d = new KURLRequesterPrivate; |
173 | 173 | ||
174 | // must have this as parent | 174 | // must have this as parent |
175 | editWidget->reparent( this, 0, QPoint(0,0) ); | 175 | editWidget->reparent( this, 0, QPoint(0,0) ); |
176 | //US d->edit = dynamic_cast<KLineEdit*>( editWidget ); | 176 | //US d->edit = dynamic_cast<KLineEdit*>( editWidget ); |
177 | d->edit = (KLineEdit*)( editWidget ); | 177 | d->edit = (KLineEdit*)( editWidget ); |
178 | //US d->combo = dynamic_cast<KComboBox*>( editWidget ); | 178 | //US d->combo = dynamic_cast<KComboBox*>( editWidget ); |
179 | 179 | ||
180 | init(); | 180 | init(); |
181 | } | 181 | } |
182 | */ | 182 | */ |
183 | 183 | ||
184 | KURLRequester::KURLRequester( QWidget *parent, const char *name ) | 184 | KURLRequester::KURLRequester( QWidget *parent, const char *name ) |
185 | : QHBox( parent, name ) | 185 | : QHBox( parent, name ) |
186 | { | 186 | { |
187 | d = new KURLRequesterPrivate; | 187 | d = new KURLRequesterPrivate; |
188 | init(); | 188 | init(); |
189 | } | 189 | } |
190 | 190 | ||
191 | 191 | ||
192 | KURLRequester::KURLRequester( const QString& url, QWidget *parent, | 192 | KURLRequester::KURLRequester( const QString& url, QWidget *parent, |
193 | const char *name ) | 193 | const char *name ) |
194 | : QHBox( parent, name ) | 194 | : QHBox( parent, name ) |
195 | { | 195 | { |
196 | d = new KURLRequesterPrivate; | 196 | d = new KURLRequesterPrivate; |
197 | init(); | 197 | init(); |
198 | setURL( url ); | 198 | setURL( url ); |
199 | } | 199 | } |
200 | 200 | ||
201 | 201 | ||
202 | KURLRequester::~KURLRequester() | 202 | KURLRequester::~KURLRequester() |
203 | { | 203 | { |
204 | //US delete myCompletion; | 204 | //US delete myCompletion; |
205 | delete myFileDialog; | 205 | delete myFileDialog; |
206 | delete d; | 206 | delete d; |
207 | } | 207 | } |
208 | 208 | ||
209 | 209 | ||
210 | void KURLRequester::init() | 210 | void KURLRequester::init() |
211 | { | 211 | { |
212 | myFileDialog = 0L; | 212 | myFileDialog = 0L; |
213 | myShowLocalProt = false; | 213 | myShowLocalProt = false; |
214 | 214 | ||
215 | if (/*US !d->combo && */ !d->edit ) | 215 | if (/*US !d->combo && */ !d->edit ) |
216 | d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" ); | 216 | d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" ); |
217 | 217 | ||
218 | myButton = new KURLDragPushButton( this, "kfile button"); | 218 | myButton = new KURLDragPushButton( this, "kfile button"); |
219 | QIconSet iconSet = SmallIconSet("fileopen"); | 219 | QIconSet iconSet = SmallIconSet("fileopen"); |
220 | QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal ); | 220 | QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal ); |
221 | myButton->setIconSet( iconSet ); | 221 | myButton->setIconSet( iconSet ); |
222 | myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 ); | 222 | myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 ); |
223 | //US QToolTip::add(myButton, i18n("Open file dialog")); | 223 | //US QToolTip::add(myButton, i18n("Open file dialog")); |
224 | 224 | ||
225 | connect( myButton, SIGNAL( pressed() ), SLOT( slotUpdateURL() )); | 225 | connect( myButton, SIGNAL( pressed() ), SLOT( slotUpdateURL() )); |
226 | 226 | ||
227 | setSpacing( KDialog::spacingHint() ); | 227 | setSpacing( KDialog::spacingHint() ); |
228 | 228 | ||
229 | QWidget *widget = /*US d->combo ? (QWidget*) d->combo : */ (QWidget*) d->edit; | 229 | QWidget *widget = /*US d->combo ? (QWidget*) d->combo : */ (QWidget*) d->edit; |
230 | setFocusProxy( widget ); | 230 | setFocusProxy( widget ); |
231 | 231 | ||
232 | d->connectSignals( this ); | 232 | d->connectSignals( this ); |
233 | connect( myButton, SIGNAL( clicked() ), this, SLOT( slotOpenDialog() )); | 233 | connect( myButton, SIGNAL( clicked() ), this, SLOT( slotOpenDialog() )); |
234 | /*US | 234 | /*US |
235 | myCompletion = new KURLCompletion(); | 235 | myCompletion = new KURLCompletion(); |
236 | d->setCompletionObject( myCompletion ); | 236 | d->setCompletionObject( myCompletion ); |
237 | 237 | ||
238 | KAccel *accel = new KAccel( this ); | 238 | KAccel *accel = new KAccel( this ); |
239 | accel->insert( KStdAccel::Open, this, SLOT( slotOpenDialog() )); | 239 | accel->insert( KStdAccel::Open, this, SLOT( slotOpenDialog() )); |
240 | accel->readSettings(); | 240 | accel->readSettings(); |
241 | */ | 241 | */ |
242 | } | 242 | } |
243 | 243 | ||
244 | 244 | ||
245 | void KURLRequester::setURL( const QString& url ) | 245 | void KURLRequester::setURL( const QString& url ) |
246 | { | 246 | { |
247 | bool hasLocalPrefix = (url.startsWith("file:")); | 247 | bool hasLocalPrefix = (url.startsWith("file:")); |
248 | 248 | ||
249 | if ( !myShowLocalProt && hasLocalPrefix ) | 249 | if ( !myShowLocalProt && hasLocalPrefix ) |
250 | d->setText( url.mid( 5, url.length()-5 )); | 250 | d->setText( url.mid( 5, url.length()-5 )); |
251 | else | 251 | else |
252 | d->setText( url ); | 252 | d->setText( url ); |
253 | } | 253 | } |
254 | 254 | ||
255 | void KURLRequester::setCaption( const QString& caption ) | 255 | void KURLRequester::setCaption( const QString& caption ) |
256 | { | 256 | { |
257 | //USfileDialog()->setCaption( caption ); | 257 | //USfileDialog()->setCaption( caption ); |
258 | //USQWidget::setCaption( caption ); | 258 | //USQWidget::setCaption( caption ); |
259 | } | 259 | } |
260 | 260 | ||
261 | QString KURLRequester::url() const | 261 | QString KURLRequester::url() const |
262 | { | 262 | { |
263 | return d->url(); | 263 | return d->url(); |
264 | } | 264 | } |
265 | 265 | ||
266 | 266 | ||
267 | void KURLRequester::slotOpenDialog() | 267 | void KURLRequester::slotOpenDialog() |
268 | { | 268 | { |
269 | emit openFileDialog( this ); | 269 | emit openFileDialog( this ); |
270 | 270 | ||
271 | //US use our special KFIleDialog instead | 271 | //US use our special KFIleDialog instead |
272 | KURL u( url() ); | 272 | KURL u( url() ); |
273 | //QString fn = u.url(); | 273 | //QString fn = u.url(); |
274 | QString fn = d->edit->text(); | 274 | QString fn = d->edit->text(); |
275 | fn = KFileDialog::getSaveFileName( fn, "Save backup filename", this ); | 275 | fn = KFileDialog::getSaveFileName( fn, "", this ); |
276 | 276 | ||
277 | if ( fn == "" ) | 277 | if ( fn == "" ) |
278 | return; | 278 | return; |
279 | 279 | ||
280 | setURL( fn ); | 280 | setURL( fn ); |
281 | emit urlSelected( d->url() ); | 281 | emit urlSelected( d->url() ); |
282 | /*US | 282 | /*US |
283 | KFileDialog *dlg = fileDialog(); | 283 | KFileDialog *dlg = fileDialog(); |
284 | if ( !d->url().isEmpty() ) { | 284 | if ( !d->url().isEmpty() ) { |
285 | KURL u( url() ); | 285 | KURL u( url() ); |
286 | // If we won't be able to list it (e.g. http), then don't try :) | 286 | // If we won't be able to list it (e.g. http), then don't try :) |
287 | if ( KProtocolInfo::supportsListing( u.protocol() ) ) | 287 | if ( KProtocolInfo::supportsListing( u.protocol() ) ) |
288 | dlg->setSelection( u.url() ); | 288 | dlg->setSelection( u.url() ); |
289 | } | 289 | } |
290 | 290 | ||
291 | if ( dlg->exec() == QDialog::Accepted ) | 291 | if ( dlg->exec() == QDialog::Accepted ) |
292 | { | 292 | { |
293 | setURL( dlg->selectedURL().prettyURL() ); | 293 | setURL( dlg->selectedURL().prettyURL() ); |
294 | emit urlSelected( d->url() ); | 294 | emit urlSelected( d->url() ); |
295 | } | 295 | } |
296 | */ | 296 | */ |
297 | 297 | ||
298 | } | 298 | } |
299 | 299 | ||
300 | void KURLRequester::setMode(unsigned int mode) | 300 | void KURLRequester::setMode(unsigned int mode) |
301 | { | 301 | { |
302 | /*US | 302 | /*US |
303 | Q_ASSERT( (mode & KFile::Files) == 0 ); | 303 | Q_ASSERT( (mode & KFile::Files) == 0 ); |
304 | d->fileDialogMode = mode; | 304 | d->fileDialogMode = mode; |
305 | if ( (mode & KFile::Directory) && !(mode & KFile::File) ) | 305 | if ( (mode & KFile::Directory) && !(mode & KFile::File) ) |
306 | myCompletion->setMode( KURLCompletion::DirCompletion ); | 306 | myCompletion->setMode( KURLCompletion::DirCompletion ); |
307 | 307 | ||
308 | if (myFileDialog) | 308 | if (myFileDialog) |
309 | myFileDialog->setMode( d->fileDialogMode ); | 309 | myFileDialog->setMode( d->fileDialogMode ); |
310 | */ | 310 | */ |
311 | } | 311 | } |
312 | 312 | ||
313 | void KURLRequester::setFilter(const QString &filter) | 313 | void KURLRequester::setFilter(const QString &filter) |
314 | { | 314 | { |
315 | /*US | 315 | /*US |
316 | d->fileDialogFilter = filter; | 316 | d->fileDialogFilter = filter; |
317 | if (myFileDialog) | 317 | if (myFileDialog) |
318 | myFileDialog->setFilter( d->fileDialogFilter ); | 318 | myFileDialog->setFilter( d->fileDialogFilter ); |
319 | */ | 319 | */ |
320 | } | 320 | } |
321 | 321 | ||
322 | KFileDialog * KURLRequester::fileDialog() const | 322 | KFileDialog * KURLRequester::fileDialog() const |
323 | { | 323 | { |
324 | /*US | 324 | /*US |
325 | if ( !myFileDialog ) { | 325 | if ( !myFileDialog ) { |
326 | QWidget *p = parentWidget(); | 326 | QWidget *p = parentWidget(); |
327 | myFileDialog = new KFileDialog( QString::null, QString::null, p, | 327 | myFileDialog = new KFileDialog( QString::null, QString::null, p, |
328 | "file dialog", true ); | 328 | "file dialog", true ); |
329 | 329 | ||
330 | myFileDialog->setMode( d->fileDialogMode ); | 330 | myFileDialog->setMode( d->fileDialogMode ); |
331 | myFileDialog->setFilter( d->fileDialogFilter ); | 331 | myFileDialog->setFilter( d->fileDialogFilter ); |
332 | } | 332 | } |
333 | 333 | ||
334 | return myFileDialog; | 334 | return myFileDialog; |
335 | */ | 335 | */ |
336 | return 0; | 336 | return 0; |
337 | } | 337 | } |
338 | 338 | ||
339 | 339 | ||
340 | void KURLRequester::setShowLocalProtocol( bool b ) | 340 | void KURLRequester::setShowLocalProtocol( bool b ) |
341 | { | 341 | { |
342 | if ( myShowLocalProt == b ) | 342 | if ( myShowLocalProt == b ) |
343 | return; | 343 | return; |
344 | 344 | ||
345 | myShowLocalProt = b; | 345 | myShowLocalProt = b; |
346 | setURL( url() ); | 346 | setURL( url() ); |
347 | } | 347 | } |
348 | 348 | ||
349 | void KURLRequester::clear() | 349 | void KURLRequester::clear() |
350 | { | 350 | { |
351 | d->setText( QString::null ); | 351 | d->setText( QString::null ); |
352 | } | 352 | } |
353 | 353 | ||
354 | KLineEdit * KURLRequester::lineEdit() const | 354 | KLineEdit * KURLRequester::lineEdit() const |
355 | { | 355 | { |
356 | return d->edit; | 356 | return d->edit; |
357 | } | 357 | } |
358 | /*US | 358 | /*US |
359 | KComboBox * KURLRequester::comboBox() const | 359 | KComboBox * KURLRequester::comboBox() const |
360 | { | 360 | { |
361 | return d->combo; | 361 | return d->combo; |
362 | } | 362 | } |
363 | */ | 363 | */ |
364 | void KURLRequester::slotUpdateURL() | 364 | void KURLRequester::slotUpdateURL() |
365 | { | 365 | { |
366 | // bin compat, myButton is declared as QPushButton | 366 | // bin compat, myButton is declared as QPushButton |
367 | //US KURL u( QDir::currentDirPath() + '/', url() ); | 367 | //US KURL u( QDir::currentDirPath() + '/', url() ); |
368 | KURL u( url() ); | 368 | KURL u( url() ); |
369 | (static_cast<KURLDragPushButton *>( myButton))->setURL( u ); | 369 | (static_cast<KURLDragPushButton *>( myButton))->setURL( u ); |
370 | } | 370 | } |
371 | 371 | ||
372 | QPushButton * KURLRequester::button() const | 372 | QPushButton * KURLRequester::button() const |
373 | { | 373 | { |
374 | return myButton; | 374 | return myButton; |
375 | } | 375 | } |
376 | /*US | 376 | /*US |
377 | KEditListBox::CustomEditor KURLRequester::customEditor() | 377 | KEditListBox::CustomEditor KURLRequester::customEditor() |
378 | { | 378 | { |
379 | setSizePolicy(QSizePolicy( QSizePolicy::Preferred, | 379 | setSizePolicy(QSizePolicy( QSizePolicy::Preferred, |
380 | QSizePolicy::Fixed)); | 380 | QSizePolicy::Fixed)); |
381 | 381 | ||
382 | KLineEdit *edit = d->edit; | 382 | KLineEdit *edit = d->edit; |
383 | if ( !edit && d->combo ) | 383 | if ( !edit && d->combo ) |
384 | edit = dynamic_cast<KLineEdit*>( d->combo->lineEdit() ); | 384 | edit = dynamic_cast<KLineEdit*>( d->combo->lineEdit() ); |
385 | 385 | ||
386 | #ifndef NDEBUG | 386 | #ifndef NDEBUG |
387 | if ( !edit ) | 387 | if ( !edit ) |
388 | kdWarning() << "KURLRequester's lineedit is not a KLineEdit!??\n"; | 388 | kdWarning() << "KURLRequester's lineedit is not a KLineEdit!??\n"; |
389 | #endif | 389 | #endif |
390 | 390 | ||
391 | KEditListBox::CustomEditor editor( this, edit ); | 391 | KEditListBox::CustomEditor editor( this, edit ); |
392 | return editor; | 392 | return editor; |
393 | } | 393 | } |
394 | */ | 394 | */ |
395 | void KURLRequester::virtual_hook( int, void* ) | 395 | void KURLRequester::virtual_hook( int, void* ) |
396 | { /*BASE::virtual_hook( id, data );*/ } | 396 | { /*BASE::virtual_hook( id, data );*/ } |
397 | 397 | ||
398 | /*US | 398 | /*US |
399 | KURLComboRequester::KURLComboRequester( QWidget *parent, | 399 | KURLComboRequester::KURLComboRequester( QWidget *parent, |
400 | const char *name ) | 400 | const char *name ) |
401 | : KURLRequester( new KComboBox(false), parent, name) | 401 | : KURLRequester( new KComboBox(false), parent, name) |
402 | { | 402 | { |
403 | } | 403 | } |