summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt4
-rw-r--r--kabc/plugins/file/resourcefile.cpp2
-rw-r--r--kaddressbook/kabcore.cpp17
3 files changed, 19 insertions, 4 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt
index 7879194..e54e140 100644
--- a/bin/kdepim/kaddressbook/germantranslation.txt
+++ b/bin/kdepim/kaddressbook/germantranslation.txt
@@ -1,758 +1,762 @@
1{ "file","Datei" }, 1{ "file","Datei" },
2{ "Choose one file","Wähle eine Datei" }, 2{ "Choose one file","Wähle eine Datei" },
3{ "dir","Verzeichnis" }, 3{ "dir","Verzeichnis" },
4{ "Choose a directory with may files","Wähle Verzeichnis" }, 4{ "Choose a directory with may files","Wähle Verzeichnis" },
5{ "ldap","ldap" }, 5{ "ldap","ldap" },
6{ "No description available","Keine Beschreibung verfügbar" }, 6{ "No description available","Keine Beschreibung verfügbar" },
7{ "Library files for "%1" not found in paths","Bibliothek für "%1" nicht gefunden" }, 7{ "Library files for "%1" not found in paths","Bibliothek für "%1" nicht gefunden" },
8{ "qtopia","qtopia" }, 8{ "qtopia","qtopia" },
9{ "Qtopia PIM Addressbook.","Qtopia PIM Adressbuch." }, 9{ "Qtopia PIM Addressbook.","Qtopia PIM Adressbuch." },
10{ "vCard","vCard" }, 10{ "vCard","vCard" },
11{ "vCard Format","vCard Format" }, 11{ "vCard Format","vCard Format" },
12{ "microkabcformat_binary","microkabcformat_binary" }, 12{ "microkabcformat_binary","microkabcformat_binary" },
13{ "Binary","Binary" }, 13{ "Binary","Binary" },
14{ "No description available.","Keine Beschreibung verfügbar." }, 14{ "No description available.","Keine Beschreibung verfügbar." },
15{ "Department","Abteilung" }, 15{ "Department","Abteilung" },
16{ "Profession","Beruf" }, 16{ "Profession","Beruf" },
17{ "Assistant's Name","Name d.Assistenten" }, 17{ "Assistant's Name","Name d.Assistenten" },
18{ "Manager's Name","Name d.Manager's" }, 18{ "Manager's Name","Name d.Manager's" },
19{ "Spouse's Name","Name d.Ehegatten" }, 19{ "Spouse's Name","Name d.Ehegatten" },
20{ "Office","Büro" }, 20{ "Office","Büro" },
21{ "IM Address","IM Adresse" }, 21{ "IM Address","IM Adresse" },
22{ "Anniversary","Jahrestag" }, 22{ "Anniversary","Jahrestag" },
23{ "Gender","Geschlecht" }, 23{ "Gender","Geschlecht" },
24{ "Children","Kinder" }, 24{ "Children","Kinder" },
25{ "FreeBusyUrl","FreeBusyUrl" }, 25{ "FreeBusyUrl","FreeBusyUrl" },
26{ "ExternalID","ExternalID" }, 26{ "ExternalID","ExternalID" },
27{ "Resource loaded: '%1'","Resource geladen: '%1'" }, 27{ "Resource loaded: '%1'","Resource geladen: '%1'" },
28{ "Select View","Ansicht wählen" }, 28{ "Select View","Ansicht wählen" },
29{ "Modify View...","Ansicht ändern..." }, 29{ "Modify View...","Ansicht ändern..." },
30{ "Add View...","Ansicht hinzufügen..." }, 30{ "Add View...","Ansicht hinzufügen..." },
31{ "Delete View","Ansicht löschen" }, 31{ "Delete View","Ansicht löschen" },
32{ "Refresh View","Ansicht aktualisieren" }, 32{ "Refresh View","Ansicht aktualisieren" },
33{ "Edit &Filters...","Bearbeite &Filter..." }, 33{ "Edit &Filters...","Bearbeite &Filter..." },
34{ "Select Filter","Filter wählen" }, 34{ "Select Filter","Filter wählen" },
35{ "Style:","Stil:" }, 35{ "Style:","Stil:" },
36{ "HTML table style.","HTML tabellen stil." }, 36{ "HTML table style.","HTML tabellen stil." },
37{ "Default Table View","Standard Tabellen Ansicht" }, 37{ "Default Table View","Standard Tabellen Ansicht" },
38{ "Show Extension Bar","Zeige Extension Bar" }, 38{ "Show Extension Bar","Zeige Extension Bar" },
39{ "None","Kein" }, 39{ "None","Kein" },
40{ "Name...","Name..." }, 40{ "Name...","Name..." },
41{ "Role:","Funktion:" }, 41{ "Role:","Funktion:" },
42{ "Organization:","Firma:" }, 42{ "Organization:","Firma:" },
43{ "Formatted name:","Formatt. Name:" }, 43{ "Formatted name:","Formatt. Name:" },
44{ "Edit Phone Numbers...","Bearbeite Telefonnummern..." }, 44{ "Edit Phone Numbers...","Bearbeite Telefonnummern..." },
45{ "Categories","Kategorien" }, 45{ "Categories","Kategorien" },
46{ "Public","Öffentlich" }, 46{ "Public","Öffentlich" },
47{ "Private","Privat" }, 47{ "Private","Privat" },
48{ "Confidential","Vertraulich" }, 48{ "Confidential","Vertraulich" },
49{ "&General","Allgemein" }, 49{ "&General","Allgemein" },
50{ "&Edit Addresses...","B&earbeite Adressen..." }, 50{ "&Edit Addresses...","B&earbeite Adressen..." },
51{ "Edit Email Addresses...","Bearbeite E-Mail Adressen..." }, 51{ "Edit Email Addresses...","Bearbeite E-Mail Adressen..." },
52{ "Email:","Email:" }, 52{ "Email:","Email:" },
53{ "URL:","URL:" }, 53{ "URL:","URL:" },
54{ "&IM address:","&IM address:" }, 54{ "&IM address:","&IM address:" },
55{ "&Address","&Adresse" }, 55{ "&Address","&Adresse" },
56{ "Department:","Abteilung:" }, 56{ "Department:","Abteilung:" },
57{ "Office:","Büro:" }, 57{ "Office:","Büro:" },
58{ "Profession:","Beruf:" }, 58{ "Profession:","Beruf:" },
59{ "Manager's name:","N.d.Manager's:" }, 59{ "Manager's name:","N.d.Manager's:" },
60{ "Assistant's name:","N.d.Assistenten:" }, 60{ "Assistant's name:","N.d.Assistenten:" },
61{ "Nick name:","Spitzname:" }, 61{ "Nick name:","Spitzname:" },
62{ "Spouse's name:","N.d.Ehegatten:" }, 62{ "Spouse's name:","N.d.Ehegatten:" },
63{ "Children's names:","N.d.Kinder:" }, 63{ "Children's names:","N.d.Kinder:" },
64{ "Birthday:","Geburtstag:" }, 64{ "Birthday:","Geburtstag:" },
65{ " Local Time","Ortszeit" }, 65{ " Local Time","Ortszeit" },
66{ "Mon","Mo" }, 66{ "Mon","Mo" },
67{ "Tue","Di" }, 67{ "Tue","Di" },
68{ "Wed","Mi" }, 68{ "Wed","Mi" },
69{ "Thu","Do" }, 69{ "Thu","Do" },
70{ "Fri","Fr" }, 70{ "Fri","Fr" },
71{ "Sat","Sa" }, 71{ "Sat","Sa" },
72{ "Sun","So" }, 72{ "Sun","So" },
73{ "January","Januar" }, 73{ "January","Januar" },
74{ "February","Februar" }, 74{ "February","Februar" },
75{ "March","März" }, 75{ "March","März" },
76{ "April","April" }, 76{ "April","April" },
77{ "May","Mai" }, 77{ "May","Mai" },
78{ "June","Juni" }, 78{ "June","Juni" },
79{ "July","July" }, 79{ "July","July" },
80{ "August","August" }, 80{ "August","August" },
81{ "September","September" }, 81{ "September","September" },
82{ "October","October" }, 82{ "October","October" },
83{ "November","November" }, 83{ "November","November" },
84{ "December","Dezember" }, 84{ "December","Dezember" },
85{ "tomorrow","Morgen" }, 85{ "tomorrow","Morgen" },
86{ "today","Heute" }, 86{ "today","Heute" },
87{ "yesterday","Gestern" }, 87{ "yesterday","Gestern" },
88{ "Monday","Montag" }, 88{ "Monday","Montag" },
89{ "Tuesday","Dienstag" }, 89{ "Tuesday","Dienstag" },
90{ "Wednesday","Mittwoch" }, 90{ "Wednesday","Mittwoch" },
91{ "Thursday","Donnerstag" }, 91{ "Thursday","Donnerstag" },
92{ "Friday","Freitag" }, 92{ "Friday","Freitag" },
93{ "Saturday","Samstag" }, 93{ "Saturday","Samstag" },
94{ "Sunday","Sonntag" }, 94{ "Sunday","Sonntag" },
95{ "Anniversary:","Jahrestag:" }, 95{ "Anniversary:","Jahrestag:" },
96{ "Gender:","Geschlecht:" }, 96{ "Gender:","Geschlecht:" },
97{ "ALIEN (gender undefined)","ALIEN (Geschlecht unbekannt)" }, 97{ "ALIEN (gender undefined)","ALIEN (Geschlecht unbekannt)" },
98{ "female","weiblich" }, 98{ "female","weiblich" },
99{ "male","männlich" }, 99{ "male","männlich" },
100{ "&Details","&Details" }, 100{ "&Details","&Details" },
101{ "Note:","Notiz:" }, 101{ "Note:","Notiz:" },
102{ "&Notes","&Notizen" }, 102{ "&Notes","&Notizen" },
103{ "Use geo data","Benutze geo Daten" }, 103{ "Use geo data","Benutze geo Daten" },
104{ "Latitude:","Breitengrad:" }, 104{ "Latitude:","Breitengrad:" },
105{ "Longitude:","Längengrad:" }, 105{ "Longitude:","Längengrad:" },
106{ "Edit Geo Data...","Edit geo Daten..." }, 106{ "Edit Geo Data...","Edit geo Daten..." },
107{ "Keys:","Schlüssel:" }, 107{ "Keys:","Schlüssel:" },
108{ "Add","Hinzu" }, 108{ "Add","Hinzu" },
109{ "Remove","Entf." }, 109{ "Remove","Entf." },
110{ "Export","Exportiere" }, 110{ "Export","Exportiere" },
111{ "&Misc","Verschiedenes" }, 111{ "&Misc","Verschiedenes" },
112{ "Photo","Foto" }, 112{ "Photo","Foto" },
113{ "Store as URL","Speichere als URL" }, 113{ "Store as URL","Speichere als URL" },
114{ "Logo","Logo" }, 114{ "Logo","Logo" },
115{ "&Images","B&ilder" }, 115{ "&Images","B&ilder" },
116{ "Home","Privat" }, 116{ "Home","Privat" },
117{ "Work","Geschäft" }, 117{ "Work","Geschäft" },
118{ "Mobile","Handy" }, 118{ "Mobile","Handy" },
119{ "Fax","Fax" }, 119{ "Fax","Fax" },
120{ "Contact Editor","Bearbeite Kontakt" }, 120{ "Contact Editor","Bearbeite Kontakt" },
121{ "&Mail...","&Mail..." }, 121{ "&Mail...","&Mail..." },
122{ "&Print...","Drucken..." }, 122{ "&Print...","Drucken..." },
123{ "&Save","&Speichern" }, 123{ "&Save","&Speichern" },
124{ "&New Contact...","&Neuer Kontakt..." }, 124{ "&New Contact...","&Neuer Kontakt..." },
125{ "Mail &vCard...","Mail &vCard..." }, 125{ "Mail &vCard...","Mail &vCard..." },
126{ "Selected to phone","Auswahl zum Telefon" }, 126{ "Selected to phone","Auswahl zum Telefon" },
127{ "Beam selected v&Card(s)","Beame ausgewählte v&Card(s)" }, 127{ "Beam selected v&Card(s)","Beame ausgewählte v&Card(s)" },
128{ "&Beam personal vCard","Beame persönliche vCard" }, 128{ "&Beam personal vCard","Beame persönliche vCard" },
129{ "&Edit Contact...","Bearbeite Kontakt..." }, 129{ "&Edit Contact...","Bearbeite Kontakt..." },
130{ "&Exit","B&eenden" }, 130{ "&Exit","B&eenden" },
131{ "&Copy","Kopieren" }, 131{ "&Copy","Kopieren" },
132{ "Cu&t","Ausschneiden" }, 132{ "Cu&t","Ausschneiden" },
133{ "&Paste","Einfügen" }, 133{ "&Paste","Einfügen" },
134{ "Select &All","Alles auswählen" }, 134{ "Select &All","Alles auswählen" },
135{ "&Undo","Rückgängig machen" }, 135{ "&Undo","Rückgängig machen" },
136{ "Re&do","Wiederherstellen" }, 136{ "Re&do","Wiederherstellen" },
137{ "&Delete Contact","Lösche Kontakt" }, 137{ "&Delete Contact","Lösche Kontakt" },
138{ "Configure &Resources...","Konfiguriere &Resourcen..." }, 138{ "Configure &Resources...","Konfiguriere &Resourcen..." },
139{ "&Configure %1...","Konfiguriere %1..." }, 139{ "&Configure %1...","Konfiguriere %1..." },
140{ "Configure S&hortcuts...","Konfiguriere S&hortcuts..." }, 140{ "Configure S&hortcuts...","Konfiguriere S&hortcuts..." },
141{ "Show Jump Bar","Zeige Jump Bar" }, 141{ "Show Jump Bar","Zeige Jump Bar" },
142{ "Show Details","Zeige Details" }, 142{ "Show Details","Zeige Details" },
143{ "Beam receive enabled","Beam (IR) Empfang AN" }, 143{ "Beam receive enabled","Beam (IR) Empfang AN" },
144{ "Set Who Am I","Setze "wer bin ich"" }, 144{ "Set Who Am I","Setze "wer bin ich"" },
145{ "Set Categories for Contacts...","Setze Kategorien für Kontakte..." }, 145{ "Set Categories for Contacts...","Setze Kategorien für Kontakte..." },
146{ "Edit Category List...","Editiere Kategorieliste..." }, 146{ "Edit Category List...","Editiere Kategorieliste..." },
147{ "Remove "voice"...","Entferne "voice"..." }, 147{ "Remove "voice"...","Entferne "voice"..." },
148{ "Import from Outlook...","Importiere aus Outlook..." }, 148{ "Import from Outlook...","Importiere aus Outlook..." },
149{ "Licence","Lizenz" }, 149{ "Licence","Lizenz" },
150{ "Faq","Fragen + Antworten" }, 150{ "Faq","Fragen + Antworten" },
151{ "What's New?","Was ist neu?" }, 151{ "What's New?","Was ist neu?" },
152{ "Sync HowTo","Sync Anleitung" }, 152{ "Sync HowTo","Sync Anleitung" },
153{ "&About KAddressBook","Über KAdressBuch" }, 153{ "&About KAddressBook","Über KAdressBuch" },
154{ "Select Incremental Search Field","Selektiere Such Feld" }, 154{ "Select Incremental Search Field","Selektiere Such Feld" },
155{ "Synchronize","Synchronisieren" }, 155{ "Synchronize","Synchronisieren" },
156{ "Configure...","Konfigurieren..." }, 156{ "Configure...","Konfigurieren..." },
157{ "Enable Pi-Sync","Aktiviere Pi-Sync" }, 157{ "Enable Pi-Sync","Aktiviere Pi-Sync" },
158{ "Multiple sync","Multi Sync" }, 158{ "Multiple sync","Multi Sync" },
159{ "Import CSV List...","Importiere CSV-Datei..." }, 159{ "Import CSV List...","Importiere CSV-Datei..." },
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","Namen Prefix" },
289{ "Honorific Suffixes","Namen Suffix" }, 289{ "Honorific Suffixes","Namen Suffix" },
290{ "Nick Name","Sptitzname" }, 290{ "Nick Name","Sptitzname" },
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 Client" },
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" },
441{ "Language:(needs restart)","Sprache:(Neustart)" }, 441{ "Language:(needs restart)","Sprache:(Neustart)" },
442{ "English","English" }, 442{ "English","English" },
443{ "German","Deutsch" }, 443{ "German","Deutsch" },
444{ "French","Französisch" }, 444{ "French","Französisch" },
445{ "Italian","Italienisch" }, 445{ "Italian","Italienisch" },
446{ "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" }, 446{ "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" },
447{ "Time Format(nr):","Zeit Format(nr):" }, 447{ "Time Format(nr):","Zeit Format(nr):" },
448{ "24:00","24:00" }, 448{ "24:00","24:00" },
449{ "12:00am","12:00am" }, 449{ "12:00am","12:00am" },
450{ "Week starts on Sunday","Woche beginnt Sonntags" }, 450{ "Week starts on Sunday","Woche beginnt Sonntags" },
451{ "Locale","Locale" }, 451{ "Locale","Locale" },
452{ "Date Format:","Datums Format:" }, 452{ "Date Format:","Datums Format:" },
453{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, 453{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" },
454{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, 454{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" },
455{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, 455{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" },
456{ "User defined","Benutzerdefiniert" }, 456{ "User defined","Benutzerdefiniert" },
457{ "User long date:","Format langes Datum:" }, 457{ "User long date:","Format langes Datum:" },
458{ "User short date:","Format kurzes Datum:" }, 458{ "User short date:","Format kurzes Datum:" },
459{ "Daylight start:","Sommerzeit Beginn:" }, 459{ "Daylight start:","Sommerzeit Beginn:" },
460{ "Daylight end:","Sommerzeit Ende:" }, 460{ "Daylight end:","Sommerzeit Ende:" },
461{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, 461{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" },
462{ "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" }, 462{ "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" },
463{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, 463{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" },
464{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, 464{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" },
465{ "Date Format","Datums Format" }, 465{ "Date Format","Datums Format" },
466{ "Timezone:","Zeitzone:" }, 466{ "Timezone:","Zeitzone:" },
467{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, 467{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." },
468{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, 468{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" },
469{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, 469{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" },
470{ "Used Mail Client","Benutzter Mail Client" }, 470{ "Used Mail Client","Benutzter Mail Client" },
471{ "Channel:","Channel:" }, 471{ "Channel:","Channel:" },
472{ "Message:","Message:" }, 472{ "Message:","Message:" },
473{ "Parameters:","Parameter:" }, 473{ "Parameters:","Parameter:" },
474{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, 474{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" },
475{ "extra Message:","extra Message:" }, 475{ "extra Message:","extra Message:" },
476{ "extra Parameters:","extra Parameter:" }, 476{ "extra Parameters:","extra Parameter:" },
477{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, 477{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" },
478{ "External Apps.","Externe Appl." }, 478{ "External Apps.","Externe Appl." },
479{ "Used %1 Client","Benutzer %1 Client" }, 479{ "Used %1 Client","Benutzer %1 Client" },
480{ "No email client installed","Keine Email Client installiert" }, 480{ "No email client installed","Keine Email Client installiert" },
481{ "Userdefined email client","Benutzerdef. Email Client" }, 481{ "Userdefined email client","Benutzerdef. Email Client" },
482{ "OM/Pi email client","OM/Pi Email Client" }, 482{ "OM/Pi email client","OM/Pi Email Client" },
483{ "Close KA/Pi?","Schließe KA/Pi?" }, 483{ "Close KA/Pi?","Schließe KA/Pi?" },
484{ "\nChanges will be saved!","\nÄnderungen werden gespeichert!" }, 484{ "\nChanges will be saved!","\nÄnderungen werden gespeichert!" },
485{ "Yes!","Ja!" }, 485{ "Yes!","Ja!" },
486{ "There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. ","#There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. " }, 486{ "There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. ","#There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. " },
487{ "Saving addressbook ... ","Speichere Adressbuch ... " }, 487{ "Saving addressbook ... ","Speichere Adressbuch ... " },
488{ "Addressbook saved!","Adressbuch gespeichert!" }, 488{ "Addressbook saved!","Adressbuch gespeichert!" },
489{ "Default Table View","Default Tabellenansicht" }, 489{ "Default Table View","Default Tabellenansicht" },
490{ "Merge and Remove","Zusammenfügen/entfernen" }, 490{ "Merge and Remove","Zusammenfügen/entfernen" },
491{ "Merge","Zusammenfügen" }, 491{ "Merge","Zusammenfügen" },
492{ "Merge Contacts Editor","Contact-Zusammenfüge-Editor" }, 492{ "Merge Contacts Editor","Contact-Zusammenfüge-Editor" },
493{ "New List...","Neue Liste..." }, 493{ "New List...","Neue Liste..." },
494{ "Rename List...","Ändere Namen..." }, 494{ "Rename List...","Ändere Namen..." },
495{ "Remove List","Lösche Liste" }, 495{ "Remove List","Lösche Liste" },
496{ "Add Contact","Kontakt hinzu" }, 496{ "Add Contact","Kontakt hinzu" },
497{ "Change Email...","Ändere Email..." }, 497{ "Change Email...","Ändere Email..." },
498{ "Remove Contact","Entferne Kontakt" }, 498{ "Remove Contact","Entferne Kontakt" },
499{ "Use Preferred","Nutze Preferred" }, 499{ "Use Preferred","Nutze Preferred" },
500{ "Distribution List Editor","Distribution List Editor" }, 500{ "Distribution List Editor","Distribution List Editor" },
501{ "Choose which contacts to export","Wähle Kontakte zum Exportieren" }, 501{ "Choose which contacts to export","Wähle Kontakte zum Exportieren" },
502{ "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" }, 502{ "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" },
503{ "Contact Selection","Kontaktauswahl" }, 503{ "Contact Selection","Kontaktauswahl" },
504{ "&All","&Alle" }, 504{ "&All","&Alle" },
505{ "Export the entire address book","Exportiere das komplette Addressbuch" }, 505{ "Export the entire address book","Exportiere das komplette Addressbuch" },
506{ "&Selected","Au&sgewählte" }, 506{ "&Selected","Au&sgewählte" },
507{ "Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","###Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected." }, 507{ "Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","###Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected." },
508{ "By matching &filter","Zutreffender &Filter" }, 508{ "By matching &filter","Zutreffender &Filter" },
509{ "Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","###Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters" }, 509{ "Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","###Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters" },
510{ "By Cate&gories","Kategorien" }, 510{ "By Cate&gories","Kategorien" },
511{ "Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","###Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories." }, 511{ "Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","###Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories." },
512{ "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." }, 512{ "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." },
513{ "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." }, 513{ "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." },
514{ "Sorting","Sortieren" }, 514{ "Sorting","Sortieren" },
515{ "Criterion:","Merkmal:" }, 515{ "Criterion:","Merkmal:" },
516{ "Order:","Reihenfolge:" }, 516{ "Order:","Reihenfolge:" },
517{ "Ascending","Aufsteigend" }, 517{ "Ascending","Aufsteigend" },
518{ "Descending","Absteigend" }, 518{ "Descending","Absteigend" },
519{ "Save file","Datei speichern" }, 519{ "Save file","Datei speichern" },
520{ "Error","Fehler" }, 520{ "Error","Fehler" },
521{ "Unable to export contacts.","Exportieren der Kontakte geht nicht." }, 521{ "Unable to export contacts.","Exportieren der Kontakte geht nicht." },
522{ "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" }, 522{ "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" },
523{ "Manage new categories...","Verwalte neue Kategorien..." }, 523{ "Manage new categories...","Verwalte neue Kategorien..." },
524{ "&File","Datei" }, 524{ "&File","Datei" },
525{ "&Edit","Bearbeite" }, 525{ "&Edit","Bearbeite" },
526{ "&View","Ansichten" }, 526{ "&View","Ansichten" },
527{ "&Settings","Konfiguration" }, 527{ "&Settings","Konfiguration" },
528{ "&Change selected","Ändere Selekt." }, 528{ "&Change selected","Ändere Selekt." },
529{ "&Help","Hilfe" }, 529{ "&Help","Hilfe" },
530{ "Remove sync info","Entferne Sync Info" }, 530{ "Remove sync info","Entferne Sync Info" },
531{ "For all profiles","Für alle Profile" }, 531{ "For all profiles","Für alle Profile" },
532{ "&Change","Ändere" }, 532{ "&Change","Ändere" },
533{ "Import xml (Qtopia)...","Importiere xml (Qtopia)..." }, 533{ "Import xml (Qtopia)...","Importiere xml (Qtopia)..." },
534{ "Export xml (Qtopia)...","Exportiere xml (Qtopia)..." }, 534{ "Export xml (Qtopia)...","Exportiere xml (Qtopia)..." },
535{ "Export to phone","Exportiere aufs Handy..." }, 535{ "Export to phone","Exportiere aufs Handy..." },
536{ "Which contacts do you want to select?","Welche Kontakte möchten Sie wählen?" }, 536{ "Which contacts do you want to select?","Welche Kontakte möchten Sie wählen?" },
537{ "&Modify","Ändere" }, 537{ "&Modify","Ändere" },
538{ "Choose which contacts to select","Bitte Kontakte auswählen!" }, 538{ "Choose which contacts to select","Bitte Kontakte auswählen!" },
539{ "After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nKontakten geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, 539{ "After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nKontakten geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " },
540{ "Manage new Categories","Verwalte neue Kategorien" }, 540{ "Manage new Categories","Verwalte neue Kategorien" },
541{ "Add to category list","Füge zur Kategorieliste hinzu" }, 541{ "Add to category list","Füge zur Kategorieliste hinzu" },
542{ "Remove from addressees","Entferne von den Kontakten" }, 542{ "Remove from addressees","Entferne von den Kontakten" },
543{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, 543{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" },
544{ "A&dd","Hinzufügen" }, 544{ "A&dd","Hinzufügen" },
545{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, 545{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." },
546{ "NOTE: This will remove all old\ncontact data on phone!","ACHTUNG: Das löscht alle alten\nKontakt Daten auf dem Handy!" }, 546{ "NOTE: This will remove all old\ncontact data on phone!","ACHTUNG: Das löscht alle alten\nKontakt Daten auf dem Handy!" },
547{ "Export to mobile phone!","Exportiere auf das Handy!" }, 547{ "Export to mobile phone!","Exportiere auf das Handy!" },
548{ "Export to phone options","Export ans Handy Optionen" }, 548{ "Export to phone options","Export ans Handy Optionen" },
549{ "Writing to phone...","Sende Daten ans Handy..." }, 549{ "Writing to phone...","Sende Daten ans Handy..." },
550{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, 550{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" },
551{ "Retry","Nochmal versuchen" }, 551{ "Retry","Nochmal versuchen" },
552{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, 552{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" },
553{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, 553{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" },
554{ "Error exporting to phone!","Fehler beim Export auf das Handy!" }, 554{ "Error exporting to phone!","Fehler beim Export auf das Handy!" },
555{ "&Print View","Drucke Ansicht" }, 555{ "&Print View","Drucke Ansicht" },
556{ "&Print Details","Drucke Details" }, 556{ "&Print Details","Drucke Details" },
557{ "Beam v&Card(s)...","Beame v&Card(s)..." }, 557{ "Beam v&Card(s)...","Beame v&Card(s)..." },
558{ "Set formatted name...","Setze formatierten Namen..." }, 558{ "Set formatted name...","Setze formatierten Namen..." },
559{ "Kde Sync HowTo","Kde Sync HowTo" }, 559{ "Kde Sync HowTo","Kde Sync HowTo" },
560{ "Multi Sync HowTo","Multi Sync HowTo" }, 560{ "Multi Sync HowTo","Multi Sync HowTo" },
561{ "&Beam","&Beame" }, 561{ "&Beam","&Beame" },
562{ "Edit Email Addresses","Editiere Email Adressen" }, 562{ "Edit Email Addresses","Editiere Email Adressen" },
563{ "Email address:","Email Adresse:" }, 563{ "Email address:","Email Adresse:" },
564{ "Change","Ändere" }, 564{ "Change","Ändere" },
565{ "Set Standard","Setze Standard" }, 565{ "Set Standard","Setze Standard" },
566{ "New Contact","Neuer Contact" }, 566{ "New Contact","Neuer Contact" },
567{ "Undo %1","Rückgängig %1" }, 567{ "Undo %1","Rückgängig %1" },
568{ "Redo","Wiederholen" }, 568{ "Redo","Wiederholen" },
569{ "Saving ... please wait! ","Am Speichern ... bitte warten! " }, 569{ "Saving ... please wait! ","Am Speichern ... bitte warten! " },
570{ "CSV Import Dialog","CSV Import Dialog" }, 570{ "CSV Import Dialog","CSV Import Dialog" },
571{ "File to import:","Datei zum Import:" }, 571{ "File to import:","Datei zum Import:" },
572{ "Delimiter","Trennzeichen" }, 572{ "Delimiter","Trennzeichen" },
573{ "Comma","Komma" }, 573{ "Comma","Komma" },
574{ "Semicolon","Semikolon" }, 574{ "Semicolon","Semikolon" },
575{ "Tabulator","Tabulator" }, 575{ "Tabulator","Tabulator" },
576{ "Space","Leerzeichen" }, 576{ "Space","Leerzeichen" },
577{ "1","1" }, 577{ "1","1" },
578{ """,""" }, 578{ """,""" },
579{ "'","'" }, 579{ "'","'" },
580{ "Start at line:","Beginne mit Zeile:" }, 580{ "Start at line:","Beginne mit Zeile:" },
581{ "Textquote:","Textquote:" }, 581{ "Textquote:","Textquote:" },
582{ "Ignore duplicate delimiters","Ignoriere doppelte Trennzeichen" }, 582{ "Ignore duplicate delimiters","Ignoriere doppelte Trennzeichen" },
583{ "Import KDE 2 Addressbook","Importiere KDE 2 Addressbook" }, 583{ "Import KDE 2 Addressbook","Importiere KDE 2 Addressbook" },
584{ "Override previously imported entries?","Überschreibe bereits importierte Einträge?" }, 584{ "Override previously imported entries?","Überschreibe bereits importierte Einträge?" },
585{ "Select vCard to Import","Selektiere zu importierende vCard" }, 585{ "Select vCard to Import","Selektiere zu importierende vCard" },
586{ "Information","Information" }, 586{ "Information","Information" },
587{ "contacts successfully imported.","Kontakte erfolgreich importiert." }, 587{ "contacts successfully imported.","Kontakte erfolgreich importiert." },
588{ "Import xml file","Importiere xml Datei" }, 588{ "Import xml file","Importiere xml Datei" },
589{ "Choose contact selection","Wähle Kontakt Auswahl" }, 589{ "Choose contact selection","Wähle Kontakt Auswahl" },
590{ "Select the entire address book","Wähle das ganze Adressbuch" }, 590{ "Select the entire address book","Wähle das ganze Adressbuch" },
591{ "Only contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","Nur in KA/Pi selektierte Kontate.\nDiese Option ist nicht verfügbar\nwhen keine Kontakte selektiert sind." }, 591{ "Only contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","Nur in KA/Pi selektierte Kontate.\nDiese Option ist nicht verfügbar\nwhen keine Kontakte selektiert sind." },
592{ "Only contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","Nur Kontakte die auf den Filter zutreffen.\nDiese Option ist nicht verfügbar, wenn keine Filter definiert sind." }, 592{ "Only contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","Nur Kontakte die auf den Filter zutreffen.\nDiese Option ist nicht verfügbar, wenn keine Filter definiert sind." },
593{ "Only contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","Nur Kontakte die Mitglieder der Kategirien sind,\die links selektiert sind.\nDiese Option ist nicht verfügbar, wenn es keine Kategirien gibt." }, 593{ "Only contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","Nur Kontakte die Mitglieder der Kategirien sind,\die links selektiert sind.\nDiese Option ist nicht verfügbar, wenn es keine Kategirien gibt." },
594{ "Select a filter to decide which contacts to select.","Selektiere einen Filter um festzulegen welche Kontakte ausgewählt werden sollen." }, 594{ "Select a filter to decide which contacts to select.","Selektiere einen Filter um festzulegen welche Kontakte ausgewählt werden sollen." },
595{ "Check the categories whose members you want to select.","Setzte die Kategorien, dessen Mitglieder Sie auswählen möchten." }, 595{ "Check the categories whose members you want to select.","Setzte die Kategorien, dessen Mitglieder Sie auswählen möchten." },
596{ "I/O device: ","I/O device: " }, 596{ "I/O device: ","I/O device: " },
597{ "Connection: ","Connection: " }, 597{ "Connection: ","Connection: " },
598{ "Model(opt.): ","Model(opt.): " }, 598{ "Model(opt.): ","Model(opt.): " },
599{ "Exporting to phone...","Exportiere aufs Handy..." }, 599{ "Exporting to phone...","Exportiere aufs Handy..." },
600{ "Error exporting to phone","Fehler beim Export aufs Handy" }, 600{ "Error exporting to phone","Fehler beim Export aufs Handy" },
601{ "contacts successfully exported.","Kontakte erfolgreich exportiert." }, 601{ "contacts successfully exported.","Kontakte erfolgreich exportiert." },
602{ "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" }, 602{ "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" },
603{ "Set formatted name","Setze formatierten Namen" }, 603{ "Set formatted name","Setze formatierten Namen" },
604{ "You can set the formatted name\nfor a list of contacts in one go.","Sie können den formatierten Namen für\nein Liste von Kontakten auf einmal setzen." }, 604{ "You can set the formatted name\nfor a list of contacts in one go.","Sie können den formatierten Namen für\nein Liste von Kontakten auf einmal setzen." },
605{ "Set formatted name to:","Setze formatierten Name auf:" }, 605{ "Set formatted name to:","Setze formatierten Name auf:" },
606{ "Simple: James Bond","Einfach: James Bond" }, 606{ "Simple: James Bond","Einfach: James Bond" },
607{ "Full: Mr. James 007 Bond I","Voll: Mr. James 007 Bond I" }, 607{ "Full: Mr. James 007 Bond I","Voll: Mr. James 007 Bond I" },
608{ "Reverse: Bond, James","Umgekehrt: Bond, James" }, 608{ "Reverse: Bond, James","Umgekehrt: Bond, James" },
609{ "Organization: MI6","Organisation: MI6" }, 609{ "Organization: MI6","Organisation: MI6" },
610{ "Set formatted name to\norganization, if name empty","Setze formatierten Namen auf\nOrganisation, wenn Name leer ist." }, 610{ "Set formatted name to\norganization, if name empty","Setze formatierten Namen auf\nOrganisation, wenn Name leer ist." },
611{ "Select contact list","Selektiere Kontakt Liste" }, 611{ "Select contact list","Selektiere Kontakt Liste" },
612{ "Changing contact #%1","Ändere Kontakt #%1" }, 612{ "Changing contact #%1","Ändere Kontakt #%1" },
613{ "Refreshing view...","Lade Ansicht neu..." }, 613{ "Refreshing view...","Lade Ansicht neu..." },
614{ "Setting formatted name completed!","Setzen vom formatierten Namen beendet!" }, 614{ "Setting formatted name completed!","Setzen vom formatierten Namen beendet!" },
615{ "Removing voice...","Entferne voice..." }, 615{ "Removing voice...","Entferne voice..." },
616{ "Remove voice completed!","Entferne voice beendet!" }, 616{ "Remove voice completed!","Entferne voice beendet!" },
617{ "Merge with existing categories?","Zu bestehenden\nKategorien hinzufügen?" }, 617{ "Merge with existing categories?","Zu bestehenden\nKategorien hinzufügen?" },
618{ "Setting categories ... please wait!","Setze Kategorien ... bitte warten!" }, 618{ "Setting categories ... please wait!","Setze Kategorien ... bitte warten!" },
619{ "Setting categories completed!","Setzen der Kategorien beendet!" }, 619{ "Setting categories completed!","Setzen der Kategorien beendet!" },
620{ "OK","OK" }, 620{ "OK","OK" },
621{ "Please wait, processing categories...","Bitte warten, bearbeite Kategorien..." }, 621{ "Please wait, processing categories...","Bitte warten, bearbeite Kategorien..." },
622{ "Processing contact #%1","Bearbeite Kontakt #%1" }, 622{ "Processing contact #%1","Bearbeite Kontakt #%1" },
623{ " categories added to list! "," Kategorien zur Liste hinzugefügt! " }, 623{ " categories added to list! "," Kategorien zur Liste hinzugefügt! " },
624{ "%1: %2","%1: %2" }, 624{ "%1: %2","%1: %2" },
625{ "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n","Ihr persönlicher Kontakt ist\nnicht gesetzt! Bitte selektieren Sie\nihn und setzen ihn mit Menu:\nKonfiguration - Setze wer bin ich\n" }, 625{ "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n","Ihr persönlicher Kontakt ist\nnicht gesetzt! Bitte selektieren Sie\nihn und setzen ihn mit Menu:\nKonfiguration - Setze wer bin ich\n" },
626{ "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>","<qt>Wollen Sie wirklich<br><b>%1</b><br>als persönlichen Kontakt setzent?</qt>" }, 626{ "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>","<qt>Wollen Sie wirklich<br><b>%1</b><br>als persönlichen Kontakt setzent?</qt>" },
627{ "Cut","Ausschneiden" }, 627{ "Cut","Ausschneiden" },
628{ "Paste","Einfügen" }, 628{ "Paste","Einfügen" },
629{ "Delete","Löschen" }, 629{ "Delete","Löschen" },
630{ "Choose...","Wähle..." }, 630{ "Choose...","Wähle..." },
631{ "Add View","Ansicht hinzufügen" }, 631{ "Add View","Ansicht hinzufügen" },
632{ "View name:","Ansicht Name:" }, 632{ "View name:","Ansicht Name:" },
633{ "View Type","Ainsicht Typ" }, 633{ "View Type","Ainsicht Typ" },
634{ "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." }, 634{ "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." },
635{ "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." }, 635{ "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." },
636{ "Rolodex style cards represent contacts.","Rolodex Stil Karten repräsentieren Kontakte." }, 636{ "Rolodex style cards represent contacts.","Rolodex Stil Karten repräsentieren Kontakte." },
637{ "Draw &separators","Zeichne &Trennlinie" }, 637{ "Draw &separators","Zeichne &Trennlinie" },
638{ "Separator &width:","Trennlinien &Breite:" }, 638{ "Separator &width:","Trennlinien &Breite:" },
639{ "&Padding:","Füllung:" }, 639{ "&Padding:","Füllung:" },
640{ "Cards","Karten" }, 640{ "Cards","Karten" },
641{ "&Margin:","&Rand:" }, 641{ "&Margin:","&Rand:" },
642{ "Draw &borders","Zeichne Ränder" }, 642{ "Draw &borders","Zeichne Ränder" },
643{ "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data.","The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data." }, 643{ "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data.","The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data." },
644{ "The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators.","The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators." }, 644{ "The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators.","The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators." },
645{ "Sets the width of column separators","Sets the width of column separators" }, 645{ "Sets the width of column separators","Sets the width of column separators" },
646{ "&Layout","&Layout" }, 646{ "&Layout","&Layout" },
647{ "Show &empty fields","Zeige leere Felder" }, 647{ "Show &empty fields","Zeige leere Felder" },
648{ "Show field &labels","Zeige Feld Label" }, 648{ "Show field &labels","Zeige Feld Label" },
649{ "Be&havior","Ver&halten" }, 649{ "Be&havior","Ver&halten" },
650{ "Header, Border and Separator Color","Kopf, Rand und Trennlinien Farbe" }, 650{ "Header, Border and Separator Color","Kopf, Rand und Trennlinien Farbe" },
651{ "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>","<qt>Sind Sie sicher, dass Sie die Ansicht <b>%1</b> löschen möchten?</qt>" }, 651{ "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>","<qt>Sind Sie sicher, dass Sie die Ansicht <b>%1</b> löschen möchten?</qt>" },
652{ "Confirm Delete","Bestätige Löschen" }, 652{ "Confirm Delete","Bestätige Löschen" },
653{ "Edit Address Book Filter","Editiere Adressbuch Filter" }, 653{ "Edit Address Book Filter","Editiere Adressbuch Filter" },
654{ "Category rule","Kategorie Regel" }, 654{ "Category rule","Kategorie Regel" },
655{ "Include categories","Inklusive" }, 655{ "Include categories","Inklusive" },
656{ "Exclude categories","Exclusive" }, 656{ "Exclude categories","Exclusive" },
657{ "Include contacts, that are:","Schließe folgende Kontakte ein:" }, 657{ "Include contacts, that are:","Schließe folgende Kontakte ein:" },
658{ "public","Öffentlich" }, 658{ "public","Öffentlich" },
659{ "private","Privat" }, 659{ "private","Privat" },
660{ "confidential","Vertraulich" }, 660{ "confidential","Vertraulich" },
661{ "Configure Resources","Konfiguriere Resourcen" }, 661{ "Configure Resources","Konfiguriere Resourcen" },
662{ "Resource Configuration","Resource Konfiguration" }, 662{ "Resource Configuration","Resource Konfiguration" },
663{ "Resources","Resourcen" }, 663{ "Resources","Resourcen" },
664{ "Standard","Standard" }, 664{ "Standard","Standard" },
665{ "&Use as Standard","Setze als Standard" }, 665{ "&Use as Standard","Setze als Standard" },
666{ "Select type of the new resource:","Selektiere Typ der neuen Resource:" }, 666{ "Select type of the new resource:","Selektiere Typ der neuen Resource:" },
667{ "General Settings","Allgemeine Einstellungen" }, 667{ "General Settings","Allgemeine Einstellungen" },
668{ "Read-only","Nur-Lesen" }, 668{ "Read-only","Nur-Lesen" },
669{ "Include in sync","Schließe in Sync mit ein" }, 669{ "Include in sync","Schließe in Sync mit ein" },
670{ "%1 Resource Settings","%1 Resource Einstellungen" }, 670{ "%1 Resource Settings","%1 Resource Einstellungen" },
671{ "Format:","Format:" }, 671{ "Format:","Format:" },
672{ "Location:","Ort:" }, 672{ "Location:","Ort:" },
673{ "Full Menu bar (restart)","Volle Menu Leiste (Neustart!)" }, 673{ "Full Menu bar (restart)","Volle Menu Leiste (Neustart!)" },
674{ "Language","Sprache" }, 674{ "Language","Sprache" },
675{ "Time Format","Zeit Format" }, 675{ "Time Format","Zeit Format" },
676{ "Time Zone","Zeit Zone" }, 676{ "Time Zone","Zeit Zone" },
677{ "Data storage path","Daten Speicherpfad" }, 677{ "Data storage path","Daten Speicherpfad" },
678{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, 678{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" },
679{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, 679{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" },
680{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, 680{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" },
681{ "Save settings","Speichere Einstellungen" }, 681{ "Save settings","Speichere Einstellungen" },
682{ "Save standard","Speichere Standard" }, 682{ "Save standard","Speichere Standard" },
683{ "Save","Speichern" }, 683{ "Save","Speichern" },
684{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, 684{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
685{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, 685{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
686{ "Multiple Sync options","Multi Sync Optionen" }, 686{ "Multiple Sync options","Multi Sync Optionen" },
687{ "Sync algo options","Sync Ablauf Optionen" }, 687{ "Sync algo options","Sync Ablauf Optionen" },
688{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, 688{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" },
689{ "Incoming calendar filter:","Eingehender Kalender Filter:" }, 689{ "Incoming calendar filter:","Eingehender Kalender Filter:" },
690{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, 690{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" },
691{ "Write back options","Optionen zum Zurückschreiben" }, 691{ "Write back options","Optionen zum Zurückschreiben" },
692{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, 692{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" },
693{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, 693{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" },
694{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, 694{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" },
695{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, 695{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" },
696{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, 696{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" },
697{ "Time period","Zeitspanne" }, 697{ "Time period","Zeitspanne" },
698{ "From ","Von " }, 698{ "From ","Von " },
699{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, 699{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " },
700{ " weeks in the future "," Wochen in der Zukunft " }, 700{ " weeks in the future "," Wochen in der Zukunft " },
701{ "Profile kind specific settings","Profil Art abhängige Einstellungen" }, 701{ "Profile kind specific settings","Profil Art abhängige Einstellungen" },
702{ "Local temp file:","Lokale temp Datei:" }, 702{ "Local temp file:","Lokale temp Datei:" },
703{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, 703{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" },
704{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, 704{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" },
705{ "You cannot remove your standard resource!\n Please select a new standard resource first.","Standard Resource kann\nnicht entfernt werden!\nBitte eine andere Resource\nals Standard setzen." }, 705{ "You cannot remove your standard resource!\n Please select a new standard resource first.","Standard Resource kann\nnicht entfernt werden!\nBitte eine andere Resource\nals Standard setzen." },
706{ "Sorry","Tut mir leid" }, 706{ "Sorry","Tut mir leid" },
707{ "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" }, 707{ "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" },
708{ "Please restart to get the \nchanged resources (re)loaded!\n","Bitte starten Sie jetzt\ndas Programm neu, um die geänderten\nResourcen neu zu laden!\n" }, 708{ "Please restart to get the \nchanged resources (re)loaded!\n","Bitte starten Sie jetzt\ndas Programm neu, um die geänderten\nResourcen neu zu laden!\n" },
709{ "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n","Die gewählte Datei enthält\nkeine gültige vCard.\nBitte prüfen Sie die Datei\nund versuchen es erneut.\n" }, 709{ "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n","Die gewählte Datei enthält\nkeine gültige vCard.\nBitte prüfen Sie die Datei\nund versuchen es erneut.\n" },
710{ "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" }, 710{ "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" },
711{ "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" }, 711{ "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" },
712{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, 712{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
713{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, 713{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
714{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, 714{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
715{ "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, 715{ "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" },
716{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, 716{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
717{ "Error","Fehler" }, 717{ "Error","Fehler" },
718{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, 718{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
719{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 719{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
720{ "Warning","Warnung" }, 720{ "Warning","Warnung" },
721{ "Select week number","Wähle Wochen Nummer" }, 721{ "Select week number","Wähle Wochen Nummer" },
722{ "Februar","Februar" }, 722{ "Februar","Februar" },
723{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 723{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
724{ "Password for remote access:","Passwort für fernen Zugriff:" }, 724{ "Password for remote access:","Passwort für fernen Zugriff:" },
725{ "Remote IP address:","Ferne IP Adresse:" }, 725{ "Remote IP address:","Ferne IP Adresse:" },
726{ "Remote port number:","Ferne Port Nummer:" }, 726{ "Remote port number:","Ferne Port Nummer:" },
727{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 727{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
728{ "Remote from: ","Fern von: " }, 728{ "Remote from: ","Fern von: " },
729{ "Local from: ","Lokal von: " }, 729{ "Local from: ","Lokal von: " },
730{ "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 %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, 730{ "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 %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" },
731{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 731{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
732{ "Write back","Schreibe zurück" }, 732{ "Write back","Schreibe zurück" },
733{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 733{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
734{ "Received sync request","Sync Anfrage erhalten" }, 734{ "Received sync request","Sync Anfrage erhalten" },
735{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, 735{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." },
736{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 736{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
737{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 737{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
738{ "Sending file...","Sende Datei..." }, 738{ "Sending file...","Sende Datei..." },
739{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 739{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
740{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 740{ "Receiving synced file...","Gesyncte Daten erhalten..." },
741{ "Received %1 bytes","%1 Bytes erhalten" }, 741{ "Received %1 bytes","%1 Bytes erhalten" },
742{ "Writing file to disk...","Speichere Datei..." }, 742{ "Writing file to disk...","Speichere Datei..." },
743{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 743{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
744{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 744{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
745{ "Synchronize!","Synchronisiere!" }, 745{ "Synchronize!","Synchronisiere!" },
746{ "High clock skew!","Großer Uhrzeitunterschied!" }, 746{ "High clock skew!","Großer Uhrzeitunterschied!" },
747{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 747{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
748{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, 748{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
749{ "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, 749{ "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" },
750{ "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" }, 750{ "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" },
751{ "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" }, 751{ "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" },
752{ "Edit new contact","Bearbeite neuen Kontakt" }, 752{ "Edit new contact","Bearbeite neuen Kontakt" },
753{ "Edit ","Bearbeite " }, 753{ "Edit ","Bearbeite " },
754{ "No contact changed!","Kein Kontakt verändert" },
755{ "%1 contacts changed!","%1 Kontakte geändert!" },
756{ "","" },
757{ "","" },
754{ "","" }, 758{ "","" },
755{ "","" }, 759{ "","" },
756{ "","" }, 760{ "","" },
757{ "","" }, 761{ "","" },
758{ "","" }, \ No newline at end of file 762{ "","" }, \ No newline at end of file
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp
index af76558..2bd9e71 100644
--- a/kabc/plugins/file/resourcefile.cpp
+++ b/kabc/plugins/file/resourcefile.cpp
@@ -1,433 +1,433 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#ifndef _WIN32_ 30#ifndef _WIN32_
31#include <unistd.h> 31#include <unistd.h>
32#endif 32#endif
33 33
34#include <qfile.h> 34#include <qfile.h>
35#include <qfileinfo.h> 35#include <qfileinfo.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qtimer.h> 37#include <qtimer.h>
38 38
39#include <kapplication.h> 39#include <kapplication.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <klocale.h> 42#include <klocale.h>
43//US #include <ksavefile.h> 43//US #include <ksavefile.h>
44#include <kstandarddirs.h> 44#include <kstandarddirs.h>
45#include <kmessagebox.h> 45#include <kmessagebox.h>
46 46
47#include "formatfactory.h" 47#include "formatfactory.h"
48 48
49#include "resource.h" 49#include "resource.h"
50#include "resourcefileconfig.h" 50#include "resourcefileconfig.h"
51#include "stdaddressbook.h" 51#include "stdaddressbook.h"
52#define NO_DIRWATCH 52#define NO_DIRWATCH
53#include "resourcefile.h" 53#include "resourcefile.h"
54 54
55//#define ALLOW_LOCKING 55//#define ALLOW_LOCKING
56 56
57 57
58using namespace KABC; 58using namespace KABC;
59 59
60extern "C" 60extern "C"
61#ifdef _WIN32_ 61#ifdef _WIN32_
62__declspec(dllexport) 62__declspec(dllexport)
63#else 63#else
64{ 64{
65#endif 65#endif
66 66
67//US void *init_kabc_file() 67//US void *init_kabc_file()
68 void *init_microkabc_file() 68 void *init_microkabc_file()
69 { 69 {
70 return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>(); 70 return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>();
71 } 71 }
72#ifndef _WIN32_ 72#ifndef _WIN32_
73} 73}
74#endif 74#endif
75 75
76ResourceFile::ResourceFile( const KConfig *config ) 76ResourceFile::ResourceFile( const KConfig *config )
77 : Resource( config ) , mFormat( 0 ) 77 : Resource( config ) , mFormat( 0 )
78{ 78{
79 QString fileName, formatName, default_fileName; 79 QString fileName, formatName, default_fileName;
80 80
81 default_fileName = StdAddressBook::fileName(); 81 default_fileName = StdAddressBook::fileName();
82 82
83 KConfig *cfg = (KConfig *)config; 83 KConfig *cfg = (KConfig *)config;
84 if ( cfg ) { 84 if ( cfg ) {
85 fileName = cfg->readEntry( "FileName", default_fileName ); 85 fileName = cfg->readEntry( "FileName", default_fileName );
86 formatName = cfg->readEntry( "FileFormat", "vcard" ); 86 formatName = cfg->readEntry( "FileFormat", "vcard" );
87 mFamily = cfg->readEntry( "ResourceName", "std" ); 87 mFamily = cfg->readEntry( "ResourceName", "std" );
88 } else { 88 } else {
89 fileName = default_fileName; 89 fileName = default_fileName;
90 formatName = "vcard"; 90 formatName = "vcard";
91 } 91 }
92 92
93 init( fileName, formatName ); 93 init( fileName, formatName );
94} 94}
95 95
96ResourceFile::ResourceFile( const QString &fileName , 96ResourceFile::ResourceFile( const QString &fileName ,
97 const QString &formatName ) 97 const QString &formatName )
98 : Resource( 0 ) 98 : Resource( 0 )
99{ 99{
100// qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); 100// qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1());
101 101
102 102
103 103
104 init( fileName, formatName ); 104 init( fileName, formatName );
105} 105}
106 106
107void ResourceFile::init( const QString &fileName, const QString &formatName ) 107void ResourceFile::init( const QString &fileName, const QString &formatName )
108{ 108{
109 mFormatName = formatName; 109 mFormatName = formatName;
110 110
111 FormatFactory *factory = FormatFactory::self(); 111 FormatFactory *factory = FormatFactory::self();
112 mFormat = factory->format( mFormatName ); 112 mFormat = factory->format( mFormatName );
113 113
114 if ( !mFormat ) { 114 if ( !mFormat ) {
115 mFormatName = "vcard"; 115 mFormatName = "vcard";
116 mFormat = factory->format( mFormatName ); 116 mFormat = factory->format( mFormatName );
117 } 117 }
118 118
119#ifndef NO_DIRWATCH 119#ifndef NO_DIRWATCH
120 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 120 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
121 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); 121 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
122 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 122 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
123#endif 123#endif
124 124
125 QString localKdeDir; 125 QString localKdeDir;
126 localKdeDir = readEnvPath("LOCALMICROKDEHOME"); 126 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
127 if ( ! localKdeDir.isEmpty() ) { 127 if ( ! localKdeDir.isEmpty() ) {
128 qDebug("LOCALMICROKDEHOME is set to: %s",localKdeDir.latin1() ); 128 qDebug("LOCALMICROKDEHOME is set to: %s",localKdeDir.latin1() );
129 QFileInfo fi ( fileName ); 129 QFileInfo fi ( fileName );
130 QString localname = localKdeDir + "/apps/kabc/" + fi.fileName (); 130 QString localname = localKdeDir + "/apps/kabc/" + fi.fileName ();
131 QFileInfo fi2 ( localname ); 131 QFileInfo fi2 ( localname );
132 if ( ! fi2.exists() || mFamily == "sync_res" ) { 132 if ( ! fi2.exists() || mFamily == "sync_res" ) {
133 if ( fi.exists() && mFamily == "sync_res") { 133 if ( fi.exists() && mFamily == "sync_res") {
134 qDebug("LOCAL mode SYNC mode using absolute file path "); 134 qDebug("LOCAL mode SYNC mode using absolute file path ");
135 setFileName( fileName ); 135 setFileName( fileName );
136 return; 136 return;
137 } else { 137 } else {
138 KMessageBox::error(0,i18n("Addressbook resource file not found:\n '%1'.\nIn LOCAL mode only resource files in\n'%2'\nare supported.\n(i.e. in the dir ./apps/kabc/ relative to the kapi(.exe) binary.)\n\nIf you are starting KA/Pi for the very first time\nyou will get this error message as well.\nIt will create the missing file automatically for you.").arg(localname).arg(localKdeDir+"/apps/kabc/") ); 138 KMessageBox::error(0,i18n("Addressbook resource file not found:\n '%1'.\nIn LOCAL mode only resource files in\n'%2'\nare supported.\n(i.e. in the dir ./apps/kabc/ relative to the kapi(.exe) binary.)\n\nIf you are starting KA/Pi for the very first time\nyou will get this error message as well.\nIt will create the missing file automatically for you.").arg(localname).arg(localKdeDir+"/apps/kabc/") );
139 setFileName( localname ); 139 setFileName( localname );
140 return; 140 return;
141 } 141 }
142 142
143 } else { 143 } else {
144 qDebug("Local resource file found. Changing filename to: %s",localname.latin1() ); 144 qDebug("Local resource file found. Changing filename to: %s",localname.latin1() );
145 setFileName( localname ); 145 setFileName( localname );
146 return; 146 return;
147 } 147 }
148 148
149 } 149 }
150 setFileName( fileName ); 150 setFileName( fileName );
151} 151}
152 152
153ResourceFile::~ResourceFile() 153ResourceFile::~ResourceFile()
154{ 154{
155 delete mFormat; 155 delete mFormat;
156 mFormat = 0; 156 mFormat = 0;
157} 157}
158 158
159void ResourceFile::writeConfig( KConfig *config ) 159void ResourceFile::writeConfig( KConfig *config )
160{ 160{
161 161
162 config->setGroup( "Resource_" + identifier() ); 162 config->setGroup( "Resource_" + identifier() );
163 Resource::writeConfig( config ); 163 Resource::writeConfig( config );
164 164
165 config->writeEntry( "FileName", fileName() ); 165 config->writeEntry( "FileName", fileName() );
166 config->writeEntry( "FileFormat", mFormatName ); 166 config->writeEntry( "FileFormat", mFormatName );
167 167
168// qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); 168// qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1());
169 169
170} 170}
171 171
172Ticket *ResourceFile::requestSaveTicket() 172Ticket *ResourceFile::requestSaveTicket()
173{ 173{
174 kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; 174 kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl;
175 175
176 if ( !addressBook() ) return 0; 176 if ( !addressBook() ) return 0;
177 177
178#ifdef ALLOW_LOCKING 178#ifdef ALLOW_LOCKING
179 if ( !lock( mFileName ) ) { 179 if ( !lock( mFileName ) ) {
180 qDebug("unablt to lock file "); 180 qDebug("unablt to lock file ");
181 return 0; 181 return 0;
182 } 182 }
183#endif 183#endif
184 return createTicket( this ); 184 return createTicket( this );
185} 185}
186 186
187 187
188bool ResourceFile::doOpen() 188bool ResourceFile::doOpen()
189{ 189{
190 QFile file( fileName() ); 190 QFile file( fileName() );
191 qDebug("ResourceFile::openfile %s ", fileName().latin1()); 191 qDebug("ResourceFile::openfile %s ", fileName().latin1());
192 192
193 if ( !file.exists() ) { 193 if ( !file.exists() ) {
194 // try to create the file 194 // try to create the file
195 bool ok = file.open( IO_WriteOnly ); 195 bool ok = file.open( IO_WriteOnly );
196 if ( ok ) 196 if ( ok )
197 file.close(); 197 file.close();
198 198
199 return ok; 199 return ok;
200 } else { 200 } else {
201 if ( !file.open( IO_ReadWrite ) ) 201 if ( !file.open( IO_ReadWrite ) )
202 return false; 202 return false;
203 203
204 if ( file.size() == 0 ) { 204 if ( file.size() < 10 ) {
205 file.close(); 205 file.close();
206 return true; 206 return true;
207 } 207 }
208 208
209 bool ok = mFormat->checkFormat( &file ); 209 bool ok = mFormat->checkFormat( &file );
210 file.close(); 210 file.close();
211 211
212 return ok; 212 return ok;
213 } 213 }
214} 214}
215 215
216void ResourceFile::doClose() 216void ResourceFile::doClose()
217{ 217{
218} 218}
219 219
220bool ResourceFile::load() 220bool ResourceFile::load()
221{ 221{
222 222
223 QFile file( fileName() ); 223 QFile file( fileName() );
224 if ( !file.open( IO_ReadOnly ) ) { 224 if ( !file.open( IO_ReadOnly ) ) {
225 addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) ); 225 addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) );
226 return false; 226 return false;
227 } 227 }
228 228
229// qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1()); 229// qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1());
230 230
231 return mFormat->loadAll( addressBook(), this, &file ); 231 return mFormat->loadAll( addressBook(), this, &file );
232} 232}
233 233
234bool ResourceFile::save( Ticket *ticket ) 234bool ResourceFile::save( Ticket *ticket )
235{ 235{
236// qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1()); 236// qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1());
237 237
238 238
239 // create backup file 239 // create backup file
240 QString extension = "_" + QString::number( QDate::currentDate().dayOfWeek() ); 240 QString extension = "_" + QString::number( QDate::currentDate().dayOfWeek() );
241 241
242/*US we use a simpler method to create a backupfile 242/*US we use a simpler method to create a backupfile
243 243
244 (void) KSaveFile::backupFile( mFileName, QString::null 244 (void) KSaveFile::backupFile( mFileName, QString::null
245 ,extension ); 245 ,extension );
246 246
247 KSaveFile saveFile( mFileName ); 247 KSaveFile saveFile( mFileName );
248 bool ok = false; 248 bool ok = false;
249 if ( saveFile.status() == 0 && saveFile.file() ) 249 if ( saveFile.status() == 0 && saveFile.file() )
250 { 250 {
251 mFormat->saveAll( addressBook(), this, saveFile.file() ); 251 mFormat->saveAll( addressBook(), this, saveFile.file() );
252 ok = saveFile.close(); 252 ok = saveFile.close();
253 } 253 }
254*/ 254*/
255 255
256//US ToDo: write backupfile 256//US ToDo: write backupfile
257#ifndef NO_DIRWATCH 257#ifndef NO_DIRWATCH
258 mDirWatch.stopScan(); 258 mDirWatch.stopScan();
259#endif 259#endif
260 QFile info; 260 QFile info;
261 info.setName( fileName() ); 261 info.setName( fileName() );
262 bool ok = info.open( IO_WriteOnly ); 262 bool ok = info.open( IO_WriteOnly );
263 if ( ok ) { 263 if ( ok ) {
264 mFormat->saveAll( addressBook(), this, &info ); 264 mFormat->saveAll( addressBook(), this, &info );
265 265
266 info.close(); 266 info.close();
267 ok = true; 267 ok = true;
268 } 268 }
269 else { 269 else {
270 270
271 } 271 }
272 272
273 if ( !ok ) 273 if ( !ok )
274 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( fileName() ) ); 274 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( fileName() ) );
275#ifndef NO_DIRWATCH 275#ifndef NO_DIRWATCH
276 mDirWatch.startScan(); 276 mDirWatch.startScan();
277#endif 277#endif
278 delete ticket; 278 delete ticket;
279#ifdef ALLOW_LOCKING 279#ifdef ALLOW_LOCKING
280 unlock( mFileName ); 280 unlock( mFileName );
281#endif 281#endif
282 282
283 return ok; 283 return ok;
284} 284}
285 285
286bool ResourceFile::lock( const QString &fileName ) 286bool ResourceFile::lock( const QString &fileName )
287{ 287{
288#ifdef ALLOW_LOCKING 288#ifdef ALLOW_LOCKING
289 289
290 290
291 QString fn = fileName; 291 QString fn = fileName;
292 292
293//US change the implementation how the lockfilename is getting created 293//US change the implementation how the lockfilename is getting created
294//US fn.replace( QRegExp("/"), "_" ); 294//US fn.replace( QRegExp("/"), "_" );
295//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" ); 295//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" );
296 296
297 KURL url(fn); 297 KURL url(fn);
298 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" ); 298 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" );
299 299
300 300
301 301
302 if (QFile::exists( lockName )) return false; 302 if (QFile::exists( lockName )) return false;
303 303
304 QString lockUniqueName; 304 QString lockUniqueName;
305 lockUniqueName = fn + KApplication::randomString( 8 ); 305 lockUniqueName = fn + KApplication::randomString( 8 );
306 306
307 url = lockUniqueName; 307 url = lockUniqueName;
308//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); 308//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName );
309 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); 309 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() );
310 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; 310 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl;
311 311
312 // Create unique file 312 // Create unique file
313 QFile file( mLockUniqueName ); 313 QFile file( mLockUniqueName );
314 file.open( IO_WriteOnly ); 314 file.open( IO_WriteOnly );
315 file.close(); 315 file.close();
316 316
317 // Create lock file 317 // Create lock file
318 int result = 0; 318 int result = 0;
319#ifndef _WIN32_ 319#ifndef _WIN32_
320 result = ::link( QFile::encodeName( mLockUniqueName ), 320 result = ::link( QFile::encodeName( mLockUniqueName ),
321 QFile::encodeName( lockName ) ); 321 QFile::encodeName( lockName ) );
322#endif 322#endif
323 if ( result == 0 ) { 323 if ( result == 0 ) {
324 addressBook()->emitAddressBookLocked(); 324 addressBook()->emitAddressBookLocked();
325 return true; 325 return true;
326 } 326 }
327 327
328 // TODO: check stat 328 // TODO: check stat
329 329
330 return false; 330 return false;
331#else 331#else
332 return true; 332 return true;
333#endif 333#endif
334} 334}
335 335
336void ResourceFile::unlock( const QString &fileName ) 336void ResourceFile::unlock( const QString &fileName )
337{ 337{
338#ifdef ALLOW_LOCKING 338#ifdef ALLOW_LOCKING
339 QString fn = fileName; 339 QString fn = fileName;
340//US change the implementation how the lockfilename is getting created 340//US change the implementation how the lockfilename is getting created
341//US fn.replace( QRegExp( "/" ), "_" ); 341//US fn.replace( QRegExp( "/" ), "_" );
342//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" ); 342//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" );
343//US QString lockName = fn + ".lock"; 343//US QString lockName = fn + ".lock";
344 KURL url(fn); 344 KURL url(fn);
345 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" ); 345 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" );
346 346
347 QFile::remove( lockName ); 347 QFile::remove( lockName );
348 QFile::remove( mLockUniqueName ); 348 QFile::remove( mLockUniqueName );
349 addressBook()->emitAddressBookUnlocked(); 349 addressBook()->emitAddressBookUnlocked();
350#else 350#else
351 return; 351 return;
352#endif 352#endif
353} 353}
354 354
355void ResourceFile::setFileName( const QString &fileName ) 355void ResourceFile::setFileName( const QString &fileName )
356{ 356{
357#ifndef NO_DIRWATCH 357#ifndef NO_DIRWATCH
358 mDirWatch.stopScan(); 358 mDirWatch.stopScan();
359 mDirWatch.removeFile( mFileName ); 359 mDirWatch.removeFile( mFileName );
360 mFileName = fileName; 360 mFileName = fileName;
361 361
362 362
363 mDirWatch.addFile( mFileName ); 363 mDirWatch.addFile( mFileName );
364 mDirWatch.startScan(); 364 mDirWatch.startScan();
365#else 365#else
366 mFileName2 = fileName; 366 mFileName2 = fileName;
367#endif 367#endif
368 368
369//US simulate KDirWatch event 369//US simulate KDirWatch event
370//US fileChanged(); 370//US fileChanged();
371} 371}
372 372
373QString ResourceFile::fileName() const 373QString ResourceFile::fileName() const
374{ 374{
375 return mFileName2; 375 return mFileName2;
376} 376}
377 377
378void ResourceFile::setFormat( const QString &format ) 378void ResourceFile::setFormat( const QString &format )
379{ 379{
380 mFormatName = format; 380 mFormatName = format;
381 delete mFormat; 381 delete mFormat;
382 382
383 FormatFactory *factory = FormatFactory::self(); 383 FormatFactory *factory = FormatFactory::self();
384 mFormat = factory->format( mFormatName ); 384 mFormat = factory->format( mFormatName );
385/*US 385/*US
386//qDebug("ResourceFile::setFormat initialized with format %s ", format.latin1()); 386//qDebug("ResourceFile::setFormat initialized with format %s ", format.latin1());
387 if (mFormatName == "vcard") { 387 if (mFormatName == "vcard") {
388 mFormat = new VCardFormatPlugin2(); 388 mFormat = new VCardFormatPlugin2();
389// qDebug("ResourceFile::setFormat format %s", mFormatName.latin1()); 389// qDebug("ResourceFile::setFormat format %s", mFormatName.latin1());
390 } 390 }
391 else if (mFormatName == "binary") { 391 else if (mFormatName == "binary") {
392 mFormat = new BinaryFormat(); 392 mFormat = new BinaryFormat();
393// qDebug("ResourceFile::setFormat format %s", mFormatName.latin1()); 393// qDebug("ResourceFile::setFormat format %s", mFormatName.latin1());
394 } 394 }
395 else 395 else
396 qDebug("ResourceFile::setFormat format unknown !!! %s ", format.latin1()); 396 qDebug("ResourceFile::setFormat format unknown !!! %s ", format.latin1());
397*/ 397*/
398 398
399} 399}
400 400
401QString ResourceFile::format() const 401QString ResourceFile::format() const
402{ 402{
403 return mFormatName; 403 return mFormatName;
404} 404}
405 405
406void ResourceFile::fileChanged() 406void ResourceFile::fileChanged()
407{ 407{
408 // There is a small theoretical chance that KDirWatch calls us before 408 // There is a small theoretical chance that KDirWatch calls us before
409 // we are fully constructed 409 // we are fully constructed
410 if (!addressBook()) 410 if (!addressBook())
411 return; 411 return;
412 412
413 413
414 QString text( i18n( "File resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( fileName() ) ); 414 QString text( i18n( "File resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( fileName() ) );
415 if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) { 415 if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) {
416 load(); 416 load();
417 addressBook()->emitAddressBookChanged(); 417 addressBook()->emitAddressBookChanged();
418 } 418 }
419} 419}
420 420
421void ResourceFile::removeAddressee( const Addressee &addr ) 421void ResourceFile::removeAddressee( const Addressee &addr )
422{ 422{
423 QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/photos/" ) + addr.uid() ) ); 423 QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/photos/" ) + addr.uid() ) );
424 QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/logos/" ) + addr.uid() ) ); 424 QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/logos/" ) + addr.uid() ) );
425 QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/sounds/" ) + addr.uid() ) ); 425 QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/sounds/" ) + addr.uid() ) );
426} 426}
427 427
428void ResourceFile::cleanUp() 428void ResourceFile::cleanUp()
429{ 429{
430 unlock( fileName() ); 430 unlock( fileName() );
431} 431}
432 432
433//US #include "resourcefile.moc" 433//US #include "resourcefile.moc"
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 20b107e..fa9f130 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1,3412 +1,3423 @@
1/* 1/*
2 This file is part of KAddressbook. 2 This file is part of KAddressbook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 Async a special exception, permission is given to link this program 19 Async a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/*s 24/*s
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include "kabcore.h" 31#include "kabcore.h"
32 32
33#include <stdaddressbook.h> 33#include <stdaddressbook.h>
34#include <klocale.h> 34#include <klocale.h>
35#include <kfiledialog.h> 35#include <kfiledialog.h>
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qregexp.h> 38#include <qregexp.h>
39#include <qlineedit.h> 39#include <qlineedit.h>
40#include <qcheckbox.h> 40#include <qcheckbox.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qprogressbar.h> 42#include <qprogressbar.h>
43#include <libkdepim/phoneaccess.h> 43#include <libkdepim/phoneaccess.h>
44 44
45#ifndef KAB_EMBEDDED 45#ifndef KAB_EMBEDDED
46#include <qclipboard.h> 46#include <qclipboard.h>
47#include <qdir.h> 47#include <qdir.h>
48#include <qfile.h> 48#include <qfile.h>
49#include <qapplicaton.h> 49#include <qapplicaton.h>
50#include <qprogressbar.h> 50#include <qprogressbar.h>
51#include <qlayout.h> 51#include <qlayout.h>
52#include <qregexp.h> 52#include <qregexp.h>
53#include <qvbox.h> 53#include <qvbox.h>
54#include <kabc/addresseelist.h> 54#include <kabc/addresseelist.h>
55#include <kabc/errorhandler.h> 55#include <kabc/errorhandler.h>
56#include <kabc/resource.h> 56#include <kabc/resource.h>
57#include <kabc/vcardconverter.h> 57#include <kabc/vcardconverter.h>
58#include <kapplication.h> 58#include <kapplication.h>
59#include <kactionclasses.h> 59#include <kactionclasses.h>
60#include <kcmultidialog.h> 60#include <kcmultidialog.h>
61#include <kdebug.h> 61#include <kdebug.h>
62#include <kdeversion.h> 62#include <kdeversion.h>
63#include <kkeydialog.h> 63#include <kkeydialog.h>
64#include <kmessagebox.h> 64#include <kmessagebox.h>
65#include <kprinter.h> 65#include <kprinter.h>
66#include <kprotocolinfo.h> 66#include <kprotocolinfo.h>
67#include <kresources/selectdialog.h> 67#include <kresources/selectdialog.h>
68#include <kstandarddirs.h> 68#include <kstandarddirs.h>
69#include <ktempfile.h> 69#include <ktempfile.h>
70#include <kxmlguiclient.h> 70#include <kxmlguiclient.h>
71#include <kaboutdata.h> 71#include <kaboutdata.h>
72#include <libkdepim/categoryselectdialog.h> 72#include <libkdepim/categoryselectdialog.h>
73 73
74#include "addresseeutil.h" 74#include "addresseeutil.h"
75#include "addresseeeditordialog.h" 75#include "addresseeeditordialog.h"
76#include "extensionmanager.h" 76#include "extensionmanager.h"
77#include "kstdaction.h" 77#include "kstdaction.h"
78#include "kaddressbookservice.h" 78#include "kaddressbookservice.h"
79#include "ldapsearchdialog.h" 79#include "ldapsearchdialog.h"
80#include "printing/printingwizard.h" 80#include "printing/printingwizard.h"
81#else // KAB_EMBEDDED 81#else // KAB_EMBEDDED
82 82
83#include <kapplication.h> 83#include <kapplication.h>
84#include "KDGanttMinimizeSplitter.h" 84#include "KDGanttMinimizeSplitter.h"
85#include "kaddressbookmain.h" 85#include "kaddressbookmain.h"
86#include "kactioncollection.h" 86#include "kactioncollection.h"
87#include "addresseedialog.h" 87#include "addresseedialog.h"
88//US 88//US
89#include <addresseeview.h> 89#include <addresseeview.h>
90 90
91#include <qapp.h> 91#include <qapp.h>
92#include <qmenubar.h> 92#include <qmenubar.h>
93//#include <qtoolbar.h> 93//#include <qtoolbar.h>
94#include <qmessagebox.h> 94#include <qmessagebox.h>
95#include <kdebug.h> 95#include <kdebug.h>
96#include <kiconloader.h> // needed for SmallIcon 96#include <kiconloader.h> // needed for SmallIcon
97#include <kresources/kcmkresources.h> 97#include <kresources/kcmkresources.h>
98#include <ktoolbar.h> 98#include <ktoolbar.h>
99 99
100 100
101//#include <qlabel.h> 101//#include <qlabel.h>
102 102
103 103
104#ifndef DESKTOP_VERSION 104#ifndef DESKTOP_VERSION
105#include <qpe/ir.h> 105#include <qpe/ir.h>
106#include <qpe/qpemenubar.h> 106#include <qpe/qpemenubar.h>
107#include <qtopia/qcopenvelope_qws.h> 107#include <qtopia/qcopenvelope_qws.h>
108#else 108#else
109 109
110#include <qmenubar.h> 110#include <qmenubar.h>
111#endif 111#endif
112 112
113#endif // KAB_EMBEDDED 113#endif // KAB_EMBEDDED
114#include "kcmconfigs/kcmkabconfig.h" 114#include "kcmconfigs/kcmkabconfig.h"
115#include "kcmconfigs/kcmkdepimconfig.h" 115#include "kcmconfigs/kcmkdepimconfig.h"
116#include "kpimglobalprefs.h" 116#include "kpimglobalprefs.h"
117#include "externalapphandler.h" 117#include "externalapphandler.h"
118#include "xxportselectdialog.h" 118#include "xxportselectdialog.h"
119 119
120 120
121#include <kresources/selectdialog.h> 121#include <kresources/selectdialog.h>
122#include <kmessagebox.h> 122#include <kmessagebox.h>
123 123
124#include <picture.h> 124#include <picture.h>
125#include <resource.h> 125#include <resource.h>
126 126
127//US#include <qsplitter.h> 127//US#include <qsplitter.h>
128#include <qmap.h> 128#include <qmap.h>
129#include <qdir.h> 129#include <qdir.h>
130#include <qfile.h> 130#include <qfile.h>
131#include <qvbox.h> 131#include <qvbox.h>
132#include <qlayout.h> 132#include <qlayout.h>
133#include <qclipboard.h> 133#include <qclipboard.h>
134#include <qtextstream.h> 134#include <qtextstream.h>
135#include <qradiobutton.h> 135#include <qradiobutton.h>
136#include <qbuttongroup.h> 136#include <qbuttongroup.h>
137 137
138#include <libkdepim/categoryselectdialog.h> 138#include <libkdepim/categoryselectdialog.h>
139#include <libkdepim/categoryeditdialog.h> 139#include <libkdepim/categoryeditdialog.h>
140#include <kabc/vcardconverter.h> 140#include <kabc/vcardconverter.h>
141 141
142 142
143#include "addresseeutil.h" 143#include "addresseeutil.h"
144#include "undocmds.h" 144#include "undocmds.h"
145#include "addresseeeditordialog.h" 145#include "addresseeeditordialog.h"
146#include "viewmanager.h" 146#include "viewmanager.h"
147#include "details/detailsviewcontainer.h" 147#include "details/detailsviewcontainer.h"
148#include "kabprefs.h" 148#include "kabprefs.h"
149#include "xxportmanager.h" 149#include "xxportmanager.h"
150#include "incsearchwidget.h" 150#include "incsearchwidget.h"
151#include "jumpbuttonbar.h" 151#include "jumpbuttonbar.h"
152#include "extensionmanager.h" 152#include "extensionmanager.h"
153#include "addresseeconfig.h" 153#include "addresseeconfig.h"
154#include "nameeditdialog.h" 154#include "nameeditdialog.h"
155#include <kcmultidialog.h> 155#include <kcmultidialog.h>
156 156
157#ifdef _WIN32_ 157#ifdef _WIN32_
158#ifdef _OL_IMPORT_ 158#ifdef _OL_IMPORT_
159#include "kaimportoldialog.h" 159#include "kaimportoldialog.h"
160#endif 160#endif
161#else 161#else
162#include <unistd.h> 162#include <unistd.h>
163#endif 163#endif
164// sync includes 164// sync includes
165#include <libkdepim/ksyncprofile.h> 165#include <libkdepim/ksyncprofile.h>
166#include <libkdepim/ksyncprefsdialog.h> 166#include <libkdepim/ksyncprefsdialog.h>
167 167
168 168
169class KABCatPrefs : public QDialog 169class KABCatPrefs : public QDialog
170{ 170{
171 public: 171 public:
172 KABCatPrefs( QWidget *parent=0, const char *name=0 ) : 172 KABCatPrefs( QWidget *parent=0, const char *name=0 ) :
173 QDialog( parent, name, true ) 173 QDialog( parent, name, true )
174 { 174 {
175 setCaption( i18n("Manage new Categories") ); 175 setCaption( i18n("Manage new Categories") );
176 QVBoxLayout* lay = new QVBoxLayout( this ); 176 QVBoxLayout* lay = new QVBoxLayout( this );
177 lay->setSpacing( 3 ); 177 lay->setSpacing( 3 );
178 lay->setMargin( 3 ); 178 lay->setMargin( 3 );
179 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 179 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
180 lay->addWidget( lab ); 180 lay->addWidget( lab );
181 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 181 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
182 lay->addWidget( format ); 182 lay->addWidget( format );
183 format->setExclusive ( true ) ; 183 format->setExclusive ( true ) ;
184 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 184 addCatBut = new QRadioButton(i18n("Add to category list"), format );
185 new QRadioButton(i18n("Remove from addressees"), format ); 185 new QRadioButton(i18n("Remove from addressees"), format );
186 addCatBut->setChecked( true ); 186 addCatBut->setChecked( true );
187 QPushButton * ok = new QPushButton( i18n("OK"), this ); 187 QPushButton * ok = new QPushButton( i18n("OK"), this );
188 lay->addWidget( ok ); 188 lay->addWidget( ok );
189 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 189 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
190 lay->addWidget( cancel ); 190 lay->addWidget( cancel );
191 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 191 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
192 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 192 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
193 resize( 200, 200 ); 193 resize( 200, 200 );
194 } 194 }
195 195
196 bool addCat() { return addCatBut->isChecked(); } 196 bool addCat() { return addCatBut->isChecked(); }
197private: 197private:
198 QRadioButton* addCatBut; 198 QRadioButton* addCatBut;
199}; 199};
200 200
201class KABFormatPrefs : public QDialog 201class KABFormatPrefs : public QDialog
202{ 202{
203 public: 203 public:
204 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : 204 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) :
205 QDialog( parent, name, true ) 205 QDialog( parent, name, true )
206 { 206 {
207 setCaption( i18n("Set formatted name") ); 207 setCaption( i18n("Set formatted name") );
208 QVBoxLayout* lay = new QVBoxLayout( this ); 208 QVBoxLayout* lay = new QVBoxLayout( this );
209 lay->setSpacing( 3 ); 209 lay->setSpacing( 3 );
210 lay->setMargin( 3 ); 210 lay->setMargin( 3 );
211 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); 211 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this );
212 lay->addWidget( lab ); 212 lay->addWidget( lab );
213 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); 213 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this );
214 lay->addWidget( format ); 214 lay->addWidget( format );
215 format->setExclusive ( true ) ; 215 format->setExclusive ( true ) ;
216 simple = new QRadioButton(i18n("Simple: James Bond"), format ); 216 simple = new QRadioButton(i18n("Simple: James Bond"), format );
217 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); 217 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format );
218 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); 218 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format );
219 company = new QRadioButton(i18n("Organization: MI6"), format ); 219 company = new QRadioButton(i18n("Organization: MI6"), format );
220 simple->setChecked( true ); 220 simple->setChecked( true );
221 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); 221 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this);
222 lay->addWidget( setCompany ); 222 lay->addWidget( setCompany );
223 QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); 223 QPushButton * ok = new QPushButton( i18n("Select contact list"), this );
224 lay->addWidget( ok ); 224 lay->addWidget( ok );
225 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 225 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
226 lay->addWidget( cancel ); 226 lay->addWidget( cancel );
227 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 227 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
228 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 228 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
229 //resize( 200, 200 ); 229 //resize( 200, 200 );
230 230
231 } 231 }
232public: 232public:
233 QRadioButton* simple, *full, *reverse, *company; 233 QRadioButton* simple, *full, *reverse, *company;
234 QCheckBox* setCompany; 234 QCheckBox* setCompany;
235}; 235};
236 236
237 237
238 238
239class KAex2phonePrefs : public QDialog 239class KAex2phonePrefs : public QDialog
240{ 240{
241 public: 241 public:
242 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 242 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
243 QDialog( parent, name, true ) 243 QDialog( parent, name, true )
244 { 244 {
245 setCaption( i18n("Export to phone options") ); 245 setCaption( i18n("Export to phone options") );
246 QVBoxLayout* lay = new QVBoxLayout( this ); 246 QVBoxLayout* lay = new QVBoxLayout( this );
247 lay->setSpacing( 3 ); 247 lay->setSpacing( 3 );
248 lay->setMargin( 3 ); 248 lay->setMargin( 3 );
249 QLabel *lab; 249 QLabel *lab;
250 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 250 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
251 lab->setAlignment (AlignHCenter ); 251 lab->setAlignment (AlignHCenter );
252 QHBox* temphb; 252 QHBox* temphb;
253 temphb = new QHBox( this ); 253 temphb = new QHBox( this );
254 new QLabel( i18n("I/O device: "), temphb ); 254 new QLabel( i18n("I/O device: "), temphb );
255 mPhoneDevice = new QLineEdit( temphb); 255 mPhoneDevice = new QLineEdit( temphb);
256 lay->addWidget( temphb ); 256 lay->addWidget( temphb );
257 temphb = new QHBox( this ); 257 temphb = new QHBox( this );
258 new QLabel( i18n("Connection: "), temphb ); 258 new QLabel( i18n("Connection: "), temphb );
259 mPhoneConnection = new QLineEdit( temphb); 259 mPhoneConnection = new QLineEdit( temphb);
260 lay->addWidget( temphb ); 260 lay->addWidget( temphb );
261 temphb = new QHBox( this ); 261 temphb = new QHBox( this );
262 new QLabel( i18n("Model(opt.): "), temphb ); 262 new QLabel( i18n("Model(opt.): "), temphb );
263 mPhoneModel = new QLineEdit( temphb); 263 mPhoneModel = new QLineEdit( temphb);
264 lay->addWidget( temphb ); 264 lay->addWidget( temphb );
265 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); 265 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this );
266 // lay->addWidget( mWriteToSim ); 266 // lay->addWidget( mWriteToSim );
267 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); 267 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) );
268 lab->setAlignment (AlignHCenter); 268 lab->setAlignment (AlignHCenter);
269 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 269 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
270 lay->addWidget( ok ); 270 lay->addWidget( ok );
271 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 271 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
272 lay->addWidget( cancel ); 272 lay->addWidget( cancel );
273 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 273 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
274 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 274 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
275 resize( 220, 240 ); 275 resize( 220, 240 );
276 276
277 } 277 }
278 278
279public: 279public:
280 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 280 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
281 QCheckBox* mWriteToSim; 281 QCheckBox* mWriteToSim;
282}; 282};
283 283
284 284
285bool pasteWithNewUid = true; 285bool pasteWithNewUid = true;
286 286
287#ifdef KAB_EMBEDDED 287#ifdef KAB_EMBEDDED
288KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) 288KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name )
289 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 289 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
290 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 290 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
291 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 291 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
292#else //KAB_EMBEDDED 292#else //KAB_EMBEDDED
293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
296 mReadWrite( readWrite ), mModified( false ) 296 mReadWrite( readWrite ), mModified( false )
297#endif //KAB_EMBEDDED 297#endif //KAB_EMBEDDED
298{ 298{
299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
300 // syncManager->setBlockSave(false); 300 // syncManager->setBlockSave(false);
301 mIncSearchWidget = 0; 301 mIncSearchWidget = 0;
302 mMiniSplitter = 0; 302 mMiniSplitter = 0;
303 mExtensionBarSplitter = 0; 303 mExtensionBarSplitter = 0;
304 mIsPart = !parent->inherits( "KAddressBookMain" ); 304 mIsPart = !parent->inherits( "KAddressBookMain" );
305 mAddressBook = KABC::StdAddressBook::self(); 305 mAddressBook = KABC::StdAddressBook::self();
306 KABC::StdAddressBook::setAutomaticSave( false ); 306 KABC::StdAddressBook::setAutomaticSave( false );
307 307
308#ifndef KAB_EMBEDDED 308#ifndef KAB_EMBEDDED
309 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 309 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
310#endif //KAB_EMBEDDED 310#endif //KAB_EMBEDDED
311 311
312 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 312 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
313 SLOT( addressBookChanged() ) ); 313 SLOT( addressBookChanged() ) );
314 314
315#if 0 315#if 0
316 // LR moved to addressbook init method 316 // LR moved to addressbook init method
317 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 317 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
318 "X-Department", "KADDRESSBOOK" ); 318 "X-Department", "KADDRESSBOOK" );
319 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 319 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
320 "X-Profession", "KADDRESSBOOK" ); 320 "X-Profession", "KADDRESSBOOK" );
321 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 321 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
322 "X-AssistantsName", "KADDRESSBOOK" ); 322 "X-AssistantsName", "KADDRESSBOOK" );
323 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 323 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
324 "X-ManagersName", "KADDRESSBOOK" ); 324 "X-ManagersName", "KADDRESSBOOK" );
325 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 325 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
326 "X-SpousesName", "KADDRESSBOOK" ); 326 "X-SpousesName", "KADDRESSBOOK" );
327 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 327 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
328 "X-Office", "KADDRESSBOOK" ); 328 "X-Office", "KADDRESSBOOK" );
329 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 329 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
330 "X-IMAddress", "KADDRESSBOOK" ); 330 "X-IMAddress", "KADDRESSBOOK" );
331 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 331 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
332 "X-Anniversary", "KADDRESSBOOK" ); 332 "X-Anniversary", "KADDRESSBOOK" );
333 333
334 //US added this field to become compatible with Opie/qtopia addressbook 334 //US added this field to become compatible with Opie/qtopia addressbook
335 // values can be "female" or "male" or "". An empty field represents undefined. 335 // values can be "female" or "male" or "". An empty field represents undefined.
336 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, 336 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
337 "X-Gender", "KADDRESSBOOK" ); 337 "X-Gender", "KADDRESSBOOK" );
338 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 338 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
339 "X-Children", "KADDRESSBOOK" ); 339 "X-Children", "KADDRESSBOOK" );
340 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 340 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
341 "X-FreeBusyUrl", "KADDRESSBOOK" ); 341 "X-FreeBusyUrl", "KADDRESSBOOK" );
342#endif 342#endif
343 initGUI(); 343 initGUI();
344 344
345 mIncSearchWidget->setFocus(); 345 mIncSearchWidget->setFocus();
346 346
347 347
348 connect( mViewManager, SIGNAL( selected( const QString& ) ), 348 connect( mViewManager, SIGNAL( selected( const QString& ) ),
349 SLOT( setContactSelected( const QString& ) ) ); 349 SLOT( setContactSelected( const QString& ) ) );
350 connect( mViewManager, SIGNAL( executed( const QString& ) ), 350 connect( mViewManager, SIGNAL( executed( const QString& ) ),
351 SLOT( executeContact( const QString& ) ) ); 351 SLOT( executeContact( const QString& ) ) );
352 352
353 connect( mViewManager, SIGNAL( deleteRequest( ) ), 353 connect( mViewManager, SIGNAL( deleteRequest( ) ),
354 SLOT( deleteContacts( ) ) ); 354 SLOT( deleteContacts( ) ) );
355 connect( mViewManager, SIGNAL( modified() ), 355 connect( mViewManager, SIGNAL( modified() ),
356 SLOT( setModified() ) ); 356 SLOT( setModified() ) );
357 357
358 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 358 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
359 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); 359 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
360 360
361 connect( mXXPortManager, SIGNAL( modified() ), 361 connect( mXXPortManager, SIGNAL( modified() ),
362 SLOT( setModified() ) ); 362 SLOT( setModified() ) );
363 363
364 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 364 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
365 SLOT( incrementalSearchJump( const QString& ) ) ); 365 SLOT( incrementalSearchJump( const QString& ) ) );
366 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 366 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
367 mJumpButtonBar, SLOT( recreateButtons() ) ); 367 mJumpButtonBar, SLOT( recreateButtons() ) );
368 368
369 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 369 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
370 SLOT( sendMail( const QString& ) ) ); 370 SLOT( sendMail( const QString& ) ) );
371 371
372 372
373 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); 373 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&)));
374 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 374 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
375 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); 375 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&)));
376 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); 376 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle()));
377 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); 377 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog()));
378 378
379 379
380#ifndef KAB_EMBEDDED 380#ifndef KAB_EMBEDDED
381 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 381 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
382 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 382 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
383 383
384 connect( mDetails, SIGNAL( browse( const QString& ) ), 384 connect( mDetails, SIGNAL( browse( const QString& ) ),
385 SLOT( browse( const QString& ) ) ); 385 SLOT( browse( const QString& ) ) );
386 386
387 387
388 mAddressBookService = new KAddressBookService( this ); 388 mAddressBookService = new KAddressBookService( this );
389 389
390#endif //KAB_EMBEDDED 390#endif //KAB_EMBEDDED
391 391
392 mMessageTimer = new QTimer( this ); 392 mMessageTimer = new QTimer( this );
393 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); 393 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
394 mEditorDialog = 0; 394 mEditorDialog = 0;
395 createAddresseeEditorDialog( this ); 395 createAddresseeEditorDialog( this );
396 setModified( false ); 396 setModified( false );
397 mBRdisabled = false; 397 mBRdisabled = false;
398#ifndef DESKTOP_VERSION 398#ifndef DESKTOP_VERSION
399 infrared = 0; 399 infrared = 0;
400#endif 400#endif
401 //toggleBeamReceive( ); 401 //toggleBeamReceive( );
402 mMainWindow->toolBar()->show(); 402 mMainWindow->toolBar()->show();
403 // we have a toolbar repainting error on the Zaurus when starting KA/Pi 403 // we have a toolbar repainting error on the Zaurus when starting KA/Pi
404 QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 404 QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
405} 405}
406 406
407void KABCore::updateToolBar() 407void KABCore::updateToolBar()
408{ 408{
409 static int iii = 0; 409 static int iii = 0;
410 ++iii; 410 ++iii;
411 mMainWindow->toolBar()->repaintMe(); 411 mMainWindow->toolBar()->repaintMe();
412 if ( iii < 4 ) 412 if ( iii < 4 )
413 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); 413 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar()));
414} 414}
415KABCore::~KABCore() 415KABCore::~KABCore()
416{ 416{
417 // save(); 417 // save();
418 //saveSettings(); 418 //saveSettings();
419 //KABPrefs::instance()->writeConfig(); 419 //KABPrefs::instance()->writeConfig();
420 delete AddresseeConfig::instance(); 420 delete AddresseeConfig::instance();
421 mAddressBook = 0; 421 mAddressBook = 0;
422 KABC::StdAddressBook::close(); 422 KABC::StdAddressBook::close();
423 423
424 delete syncManager; 424 delete syncManager;
425#ifndef DESKTOP_VERSION 425#ifndef DESKTOP_VERSION
426 if ( infrared ) 426 if ( infrared )
427 delete infrared; 427 delete infrared;
428#endif 428#endif
429} 429}
430void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 430void KABCore::receive( const QCString& cmsg, const QByteArray& data )
431{ 431{
432 //qDebug("KA: QCOP message received: %s ", cmsg.data() ); 432 //qDebug("KA: QCOP message received: %s ", cmsg.data() );
433 if ( cmsg == "setDocument(QString)" ) { 433 if ( cmsg == "setDocument(QString)" ) {
434 QDataStream stream( data, IO_ReadOnly ); 434 QDataStream stream( data, IO_ReadOnly );
435 QString fileName; 435 QString fileName;
436 stream >> fileName; 436 stream >> fileName;
437 recieve( fileName ); 437 recieve( fileName );
438 return; 438 return;
439 } 439 }
440} 440}
441void KABCore::toggleBeamReceive( ) 441void KABCore::toggleBeamReceive( )
442{ 442{
443 if ( mBRdisabled ) 443 if ( mBRdisabled )
444 return; 444 return;
445#ifndef DESKTOP_VERSION 445#ifndef DESKTOP_VERSION
446 if ( infrared ) { 446 if ( infrared ) {
447 qDebug("KA: AB disable BeamReceive "); 447 qDebug("KA: AB disable BeamReceive ");
448 delete infrared; 448 delete infrared;
449 infrared = 0; 449 infrared = 0;
450 mActionBR->setChecked(false); 450 mActionBR->setChecked(false);
451 return; 451 return;
452 } 452 }
453 qDebug("KA: AB enable BeamReceive "); 453 qDebug("KA: AB enable BeamReceive ");
454 mActionBR->setChecked(true); 454 mActionBR->setChecked(true);
455 455
456 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 456 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
457 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 457 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& )));
458#endif 458#endif
459} 459}
460 460
461 461
462void KABCore::disableBR(bool b) 462void KABCore::disableBR(bool b)
463{ 463{
464#ifndef DESKTOP_VERSION 464#ifndef DESKTOP_VERSION
465 if ( b ) { 465 if ( b ) {
466 if ( infrared ) { 466 if ( infrared ) {
467 toggleBeamReceive( ); 467 toggleBeamReceive( );
468 } 468 }
469 mBRdisabled = true; 469 mBRdisabled = true;
470 } else { 470 } else {
471 if ( mBRdisabled ) { 471 if ( mBRdisabled ) {
472 mBRdisabled = false; 472 mBRdisabled = false;
473 //toggleBeamReceive( ); 473 //toggleBeamReceive( );
474 } 474 }
475 } 475 }
476#endif 476#endif
477 477
478} 478}
479void KABCore::recieve( QString fn ) 479void KABCore::recieve( QString fn )
480{ 480{
481 //qDebug("KABCore::recieve "); 481 //qDebug("KABCore::recieve ");
482 int count = mAddressBook->importFromFile( fn, true ); 482 int count = mAddressBook->importFromFile( fn, true );
483 if ( count ) 483 if ( count )
484 setModified( true ); 484 setModified( true );
485 mViewManager->refreshView(); 485 mViewManager->refreshView();
486 message(i18n("%1 contact(s) received!").arg( count )); 486 message(i18n("%1 contact(s) received!").arg( count ));
487 topLevelWidget()->showMaximized(); 487 topLevelWidget()->showMaximized();
488 topLevelWidget()->raise(); 488 topLevelWidget()->raise();
489} 489}
490void KABCore::restoreSettings() 490void KABCore::restoreSettings()
491{ 491{
492 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; 492 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
493 493
494 bool state; 494 bool state;
495 495
496 if (mMultipleViewsAtOnce) 496 if (mMultipleViewsAtOnce)
497 state = KABPrefs::instance()->mDetailsPageVisible; 497 state = KABPrefs::instance()->mDetailsPageVisible;
498 else 498 else
499 state = false; 499 state = false;
500 500
501 mActionDetails->setChecked( state ); 501 mActionDetails->setChecked( state );
502 setDetailsVisible( state ); 502 setDetailsVisible( state );
503 503
504 state = KABPrefs::instance()->mJumpButtonBarVisible; 504 state = KABPrefs::instance()->mJumpButtonBarVisible;
505 505
506 mActionJumpBar->setChecked( state ); 506 mActionJumpBar->setChecked( state );
507 setJumpButtonBarVisible( state ); 507 setJumpButtonBarVisible( state );
508/*US 508/*US
509 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; 509 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
510 if ( splitterSize.count() == 0 ) { 510 if ( splitterSize.count() == 0 ) {
511 splitterSize.append( width() / 2 ); 511 splitterSize.append( width() / 2 );
512 splitterSize.append( width() / 2 ); 512 splitterSize.append( width() / 2 );
513 } 513 }
514 mMiniSplitter->setSizes( splitterSize ); 514 mMiniSplitter->setSizes( splitterSize );
515 if ( mExtensionBarSplitter ) { 515 if ( mExtensionBarSplitter ) {
516 splitterSize = KABPrefs::instance()->mExtensionsSplitter; 516 splitterSize = KABPrefs::instance()->mExtensionsSplitter;
517 if ( splitterSize.count() == 0 ) { 517 if ( splitterSize.count() == 0 ) {
518 splitterSize.append( width() / 2 ); 518 splitterSize.append( width() / 2 );
519 splitterSize.append( width() / 2 ); 519 splitterSize.append( width() / 2 );
520 } 520 }
521 mExtensionBarSplitter->setSizes( splitterSize ); 521 mExtensionBarSplitter->setSizes( splitterSize );
522 522
523 } 523 }
524*/ 524*/
525 mViewManager->restoreSettings(); 525 mViewManager->restoreSettings();
526 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); 526 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
527 mExtensionManager->restoreSettings(); 527 mExtensionManager->restoreSettings();
528#ifdef DESKTOP_VERSION 528#ifdef DESKTOP_VERSION
529 int wid = width(); 529 int wid = width();
530 if ( wid < 10 ) 530 if ( wid < 10 )
531 wid = 400; 531 wid = 400;
532#else 532#else
533 int wid = QApplication::desktop()->width(); 533 int wid = QApplication::desktop()->width();
534 if ( wid < 640 ) 534 if ( wid < 640 )
535 wid = QApplication::desktop()->height(); 535 wid = QApplication::desktop()->height();
536#endif 536#endif
537 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; 537 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter;
538 if ( true /*splitterSize.count() == 0*/ ) { 538 if ( true /*splitterSize.count() == 0*/ ) {
539 splitterSize.append( wid / 2 ); 539 splitterSize.append( wid / 2 );
540 splitterSize.append( wid / 2 ); 540 splitterSize.append( wid / 2 );
541 } 541 }
542 mMiniSplitter->setSizes( splitterSize ); 542 mMiniSplitter->setSizes( splitterSize );
543 if ( mExtensionBarSplitter ) { 543 if ( mExtensionBarSplitter ) {
544 //splitterSize = KABPrefs::instance()->mExtensionsSplitter; 544 //splitterSize = KABPrefs::instance()->mExtensionsSplitter;
545 if ( true /*splitterSize.count() == 0*/ ) { 545 if ( true /*splitterSize.count() == 0*/ ) {
546 splitterSize.append( wid / 2 ); 546 splitterSize.append( wid / 2 );
547 splitterSize.append( wid / 2 ); 547 splitterSize.append( wid / 2 );
548 } 548 }
549 mExtensionBarSplitter->setSizes( splitterSize ); 549 mExtensionBarSplitter->setSizes( splitterSize );
550 550
551 } 551 }
552 552
553 553
554} 554}
555 555
556void KABCore::saveSettings() 556void KABCore::saveSettings()
557{ 557{
558 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); 558 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked();
559 if ( mExtensionBarSplitter ) 559 if ( mExtensionBarSplitter )
560 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 560 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
561 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); 561 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked();
562 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); 562 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes();
563#ifndef KAB_EMBEDDED 563#ifndef KAB_EMBEDDED
564 564
565 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 565 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
566 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); 566 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
567#endif //KAB_EMBEDDED 567#endif //KAB_EMBEDDED
568 mExtensionManager->saveSettings(); 568 mExtensionManager->saveSettings();
569 mViewManager->saveSettings(); 569 mViewManager->saveSettings();
570 570
571 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); 571 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
572 KABPrefs::instance()->writeConfig(); 572 KABPrefs::instance()->writeConfig();
573 qDebug("KA: KABCore::saveSettings() "); 573 qDebug("KA: KABCore::saveSettings() ");
574} 574}
575 575
576KABC::AddressBook *KABCore::addressBook() const 576KABC::AddressBook *KABCore::addressBook() const
577{ 577{
578 return mAddressBook; 578 return mAddressBook;
579} 579}
580 580
581KConfig *KABCore::config() 581KConfig *KABCore::config()
582{ 582{
583#ifndef KAB_EMBEDDED 583#ifndef KAB_EMBEDDED
584 return KABPrefs::instance()->config(); 584 return KABPrefs::instance()->config();
585#else //KAB_EMBEDDED 585#else //KAB_EMBEDDED
586 return KABPrefs::instance()->getConfig(); 586 return KABPrefs::instance()->getConfig();
587#endif //KAB_EMBEDDED 587#endif //KAB_EMBEDDED
588} 588}
589 589
590KActionCollection *KABCore::actionCollection() const 590KActionCollection *KABCore::actionCollection() const
591{ 591{
592 return mGUIClient->actionCollection(); 592 return mGUIClient->actionCollection();
593} 593}
594 594
595KABC::Field *KABCore::currentSearchField() const 595KABC::Field *KABCore::currentSearchField() const
596{ 596{
597 if (mIncSearchWidget) 597 if (mIncSearchWidget)
598 return mIncSearchWidget->currentField(); 598 return mIncSearchWidget->currentField();
599 else 599 else
600 return 0; 600 return 0;
601} 601}
602 602
603QStringList KABCore::selectedUIDs() const 603QStringList KABCore::selectedUIDs() const
604{ 604{
605 return mViewManager->selectedUids(); 605 return mViewManager->selectedUids();
606} 606}
607 607
608KABC::Resource *KABCore::requestResource( QWidget *parent ) 608KABC::Resource *KABCore::requestResource( QWidget *parent )
609{ 609{
610 QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); 610 QPtrList<KABC::Resource> kabcResources = addressBook()->resources();
611 611
612 QPtrList<KRES::Resource> kresResources; 612 QPtrList<KRES::Resource> kresResources;
613 QPtrListIterator<KABC::Resource> resIt( kabcResources ); 613 QPtrListIterator<KABC::Resource> resIt( kabcResources );
614 KABC::Resource *resource; 614 KABC::Resource *resource;
615 while ( ( resource = resIt.current() ) != 0 ) { 615 while ( ( resource = resIt.current() ) != 0 ) {
616 ++resIt; 616 ++resIt;
617 if ( !resource->readOnly() ) { 617 if ( !resource->readOnly() ) {
618 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 618 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
619 if ( res ) 619 if ( res )
620 kresResources.append( res ); 620 kresResources.append( res );
621 } 621 }
622 } 622 }
623 623
624 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); 624 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent );
625 return static_cast<KABC::Resource*>( res ); 625 return static_cast<KABC::Resource*>( res );
626} 626}
627 627
628#ifndef KAB_EMBEDDED 628#ifndef KAB_EMBEDDED
629KAboutData *KABCore::createAboutData() 629KAboutData *KABCore::createAboutData()
630#else //KAB_EMBEDDED 630#else //KAB_EMBEDDED
631void KABCore::createAboutData() 631void KABCore::createAboutData()
632#endif //KAB_EMBEDDED 632#endif //KAB_EMBEDDED
633{ 633{
634#ifndef KAB_EMBEDDED 634#ifndef KAB_EMBEDDED
635 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), 635 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ),
636 "3.1", I18N_NOOP( "The KDE Address Book" ), 636 "3.1", I18N_NOOP( "The KDE Address Book" ),
637 KAboutData::License_GPL_V2, 637 KAboutData::License_GPL_V2,
638 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); 638 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) );
639 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); 639 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" );
640 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); 640 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) );
641 about->addAuthor( "Cornelius Schumacher", 641 about->addAuthor( "Cornelius Schumacher",
642 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), 642 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ),
643 "schumacher@kde.org" ); 643 "schumacher@kde.org" );
644 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), 644 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ),
645 "mpilone@slac.com" ); 645 "mpilone@slac.com" );
646 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); 646 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) );
647 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); 647 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) );
648 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), 648 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ),
649 "michel@klaralvdalens-datakonsult.se" ); 649 "michel@klaralvdalens-datakonsult.se" );
650 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), 650 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ),
651 "hansen@kde.org" ); 651 "hansen@kde.org" );
652 652
653 return about; 653 return about;
654#endif //KAB_EMBEDDED 654#endif //KAB_EMBEDDED
655 655
656 QString version; 656 QString version;
657#include <../version> 657#include <../version>
658 QMessageBox::about( this, "About KAddressbook/Pi", 658 QMessageBox::about( this, "About KAddressbook/Pi",
659 "KAddressbook/Platform-independent\n" 659 "KAddressbook/Platform-independent\n"
660 "(KA/Pi) " +version + " - " + 660 "(KA/Pi) " +version + " - " +
661#ifdef DESKTOP_VERSION 661#ifdef DESKTOP_VERSION
662 "Desktop Edition\n" 662 "Desktop Edition\n"
663#else 663#else
664 "PDA-Edition\n" 664 "PDA-Edition\n"
665 "for: Zaurus 5500 / 7x0 / 8x0\n" 665 "for: Zaurus 5500 / 7x0 / 8x0\n"
666#endif 666#endif
667 667
668 "(c) 2004 Ulf Schenk\n" 668 "(c) 2004 Ulf Schenk\n"
669 "(c) 2004 Lutz Rogowski\n" 669 "(c) 2004 Lutz Rogowski\n"
670 "(c) 1997-2003, The KDE PIM Team\n" 670 "(c) 1997-2003, The KDE PIM Team\n"
671 "Tobias Koenig Current maintainer\ntokoe@kde.org\n" 671 "Tobias Koenig Current maintainer\ntokoe@kde.org\n"
672 "Don Sanders Original author\n" 672 "Don Sanders Original author\n"
673 "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" 673 "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n"
674 "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" 674 "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n"
675 "Greg Stern DCOP interface\n" 675 "Greg Stern DCOP interface\n"
676 "Mark Westcot Contact pinning\n" 676 "Mark Westcot Contact pinning\n"
677 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" 677 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n"
678 "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" 678 "Steffen Hansen LDAP Lookup\nhansen@kde.org\n"
679#ifdef _WIN32_ 679#ifdef _WIN32_
680 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" 680 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n"
681#endif 681#endif
682 ); 682 );
683} 683}
684 684
685void KABCore::setContactSelected( const QString &uid ) 685void KABCore::setContactSelected( const QString &uid )
686{ 686{
687 KABC::Addressee addr = mAddressBook->findByUid( uid ); 687 KABC::Addressee addr = mAddressBook->findByUid( uid );
688 if ( !mDetails->isHidden() ) 688 if ( !mDetails->isHidden() )
689 mDetails->setAddressee( addr ); 689 mDetails->setAddressee( addr );
690 690
691 if ( !addr.isEmpty() ) { 691 if ( !addr.isEmpty() ) {
692 emit contactSelected( addr.formattedName() ); 692 emit contactSelected( addr.formattedName() );
693 KABC::Picture pic = addr.photo(); 693 KABC::Picture pic = addr.photo();
694 if ( pic.isIntern() ) { 694 if ( pic.isIntern() ) {
695//US emit contactSelected( pic.data() ); 695//US emit contactSelected( pic.data() );
696//US instead use: 696//US instead use:
697 QPixmap px; 697 QPixmap px;
698 if (pic.data().isNull() != true) 698 if (pic.data().isNull() != true)
699 { 699 {
700 px.convertFromImage(pic.data()); 700 px.convertFromImage(pic.data());
701 } 701 }
702 702
703 emit contactSelected( px ); 703 emit contactSelected( px );
704 } 704 }
705 } 705 }
706 706
707 707
708 mExtensionManager->setSelectionChanged(); 708 mExtensionManager->setSelectionChanged();
709 709
710 // update the actions 710 // update the actions
711 bool selected = !uid.isEmpty(); 711 bool selected = !uid.isEmpty();
712 712
713 if ( mReadWrite ) { 713 if ( mReadWrite ) {
714 mActionCut->setEnabled( selected ); 714 mActionCut->setEnabled( selected );
715 mActionPaste->setEnabled( selected ); 715 mActionPaste->setEnabled( selected );
716 } 716 }
717 717
718 mActionCopy->setEnabled( selected ); 718 mActionCopy->setEnabled( selected );
719 mActionDelete->setEnabled( selected ); 719 mActionDelete->setEnabled( selected );
720 mActionEditAddressee->setEnabled( selected ); 720 mActionEditAddressee->setEnabled( selected );
721 mActionMail->setEnabled( selected ); 721 mActionMail->setEnabled( selected );
722 mActionMailVCard->setEnabled( selected ); 722 mActionMailVCard->setEnabled( selected );
723 //if (mActionBeam) 723 //if (mActionBeam)
724 //mActionBeam->setEnabled( selected ); 724 //mActionBeam->setEnabled( selected );
725 mActionWhoAmI->setEnabled( selected ); 725 mActionWhoAmI->setEnabled( selected );
726} 726}
727 727
728void KABCore::sendMail() 728void KABCore::sendMail()
729{ 729{
730 sendMail( mViewManager->selectedEmails().join( ", " ) ); 730 sendMail( mViewManager->selectedEmails().join( ", " ) );
731} 731}
732 732
733void KABCore::sendMail( const QString& emaillist ) 733void KABCore::sendMail( const QString& emaillist )
734{ 734{
735 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " 735 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... "
736 if (emaillist.contains(",") > 0) 736 if (emaillist.contains(",") > 0)
737 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); 737 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null );
738 else 738 else
739 ExternalAppHandler::instance()->mailToOneContact( emaillist ); 739 ExternalAppHandler::instance()->mailToOneContact( emaillist );
740} 740}
741 741
742 742
743 743
744void KABCore::mailVCard() 744void KABCore::mailVCard()
745{ 745{
746 QStringList uids = mViewManager->selectedUids(); 746 QStringList uids = mViewManager->selectedUids();
747 if ( !uids.isEmpty() ) 747 if ( !uids.isEmpty() )
748 mailVCard( uids ); 748 mailVCard( uids );
749} 749}
750 750
751void KABCore::mailVCard( const QStringList& uids ) 751void KABCore::mailVCard( const QStringList& uids )
752{ 752{
753 QStringList urls; 753 QStringList urls;
754 754
755// QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); 755// QString tmpdir = locateLocal("tmp", KGlobal::getAppName());
756 756
757 QString dirName = "/tmp/" + KApplication::randomString( 8 ); 757 QString dirName = "/tmp/" + KApplication::randomString( 8 );
758 758
759 759
760 760
761 QDir().mkdir( dirName, true ); 761 QDir().mkdir( dirName, true );
762 762
763 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 763 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
764 KABC::Addressee a = mAddressBook->findByUid( *it ); 764 KABC::Addressee a = mAddressBook->findByUid( *it );
765 765
766 if ( a.isEmpty() ) 766 if ( a.isEmpty() )
767 continue; 767 continue;
768 768
769 QString name = a.givenName() + "_" + a.familyName() + ".vcf"; 769 QString name = a.givenName() + "_" + a.familyName() + ".vcf";
770 770
771 QString fileName = dirName + "/" + name; 771 QString fileName = dirName + "/" + name;
772 772
773 QFile outFile(fileName); 773 QFile outFile(fileName);
774 774
775 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully 775 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully
776 KABC::VCardConverter converter; 776 KABC::VCardConverter converter;
777 QString vcard; 777 QString vcard;
778 778
779 converter.addresseeToVCard( a, vcard ); 779 converter.addresseeToVCard( a, vcard );
780 780
781 QTextStream t( &outFile ); // use a text stream 781 QTextStream t( &outFile ); // use a text stream
782 t.setEncoding( QTextStream::UnicodeUTF8 ); 782 t.setEncoding( QTextStream::UnicodeUTF8 );
783 t << vcard; 783 t << vcard;
784 784
785 outFile.close(); 785 outFile.close();
786 786
787 urls.append( fileName ); 787 urls.append( fileName );
788 } 788 }
789 } 789 }
790 790
791 bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); 791 bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") );
792 792
793 793
794/*US 794/*US
795 kapp->invokeMailer( QString::null, QString::null, QString::null, 795 kapp->invokeMailer( QString::null, QString::null, QString::null,
796 QString::null, // subject 796 QString::null, // subject
797 QString::null, // body 797 QString::null, // body
798 QString::null, 798 QString::null,
799 urls ); // attachments 799 urls ); // attachments
800*/ 800*/
801 801
802} 802}
803 803
804/** 804/**
805 Beams the "WhoAmI contact. 805 Beams the "WhoAmI contact.
806*/ 806*/
807void KABCore::beamMySelf() 807void KABCore::beamMySelf()
808{ 808{
809 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); 809 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI();
810 if (!a.isEmpty()) 810 if (!a.isEmpty())
811 { 811 {
812 QStringList uids; 812 QStringList uids;
813 uids << a.uid(); 813 uids << a.uid();
814 814
815 beamVCard(uids); 815 beamVCard(uids);
816 } else { 816 } else {
817 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); 817 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
818 818
819 819
820 } 820 }
821} 821}
822void KABCore::updateMainWindow() 822void KABCore::updateMainWindow()
823{ 823{
824 mMainWindow->showMaximized(); 824 mMainWindow->showMaximized();
825 mMainWindow->update(); 825 mMainWindow->update();
826} 826}
827void KABCore::resizeEvent(QResizeEvent* e ) 827void KABCore::resizeEvent(QResizeEvent* e )
828{ 828{
829 if ( !mMiniSplitter ) 829 if ( !mMiniSplitter )
830 return; 830 return;
831 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); 831 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) ");
832 if ( QApplication::desktop()->width() >= 480 ) { 832 if ( QApplication::desktop()->width() >= 480 ) {
833 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 833 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480
834 if ( mMiniSplitter->orientation() == Qt::Vertical ) { 834 if ( mMiniSplitter->orientation() == Qt::Vertical ) {
835 mMiniSplitter->setOrientation( Qt::Horizontal); 835 mMiniSplitter->setOrientation( Qt::Horizontal);
836 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 836 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
837 } 837 }
838 if ( QApplication::desktop()->width() <= 640 ) { 838 if ( QApplication::desktop()->width() <= 640 ) {
839 mMainWindow->showMinimized(); 839 mMainWindow->showMinimized();
840 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 840 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
841 mViewManager->getFilterAction()->setComboWidth( 150 ); 841 mViewManager->getFilterAction()->setComboWidth( 150 );
842 if ( mIncSearchWidget ) 842 if ( mIncSearchWidget )
843 mIncSearchWidget->setSize(); 843 mIncSearchWidget->setSize();
844 QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); 844 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
845 } 845 }
846 846
847 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 847 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640
848 if ( mMiniSplitter->orientation() == Qt::Horizontal ) { 848 if ( mMiniSplitter->orientation() == Qt::Horizontal ) {
849 mMiniSplitter->setOrientation( Qt::Vertical ); 849 mMiniSplitter->setOrientation( Qt::Vertical );
850 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 850 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
851 } 851 }
852 if ( QApplication::desktop()->width() <= 640 ) { 852 if ( QApplication::desktop()->width() <= 640 ) {
853 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 853 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
854 mMainWindow->showMinimized(); 854 mMainWindow->showMinimized();
855 if ( KABPrefs::instance()->mHideSearchOnSwitch ) { 855 if ( KABPrefs::instance()->mHideSearchOnSwitch ) {
856 if ( mIncSearchWidget ) { 856 if ( mIncSearchWidget ) {
857 mIncSearchWidget->setSize(); 857 mIncSearchWidget->setSize();
858 } 858 }
859 } else { 859 } else {
860 mViewManager->getFilterAction()->setComboWidth( 0 ); 860 mViewManager->getFilterAction()->setComboWidth( 0 );
861 } 861 }
862 QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); 862 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
863 } 863 }
864 } 864 }
865 } 865 }
866 QWidget::resizeEvent( e ); 866 QWidget::resizeEvent( e );
867 867
868} 868}
869void KABCore::export2phone() 869void KABCore::export2phone()
870{ 870{
871 871
872 QStringList uids; 872 QStringList uids;
873 XXPortSelectDialog dlg( this, false, this ); 873 XXPortSelectDialog dlg( this, false, this );
874 if ( dlg.exec() ) 874 if ( dlg.exec() )
875 uids = dlg.uids(); 875 uids = dlg.uids();
876 else 876 else
877 return; 877 return;
878 if ( uids.isEmpty() ) 878 if ( uids.isEmpty() )
879 return; 879 return;
880 // qDebug("count %d ", uids.count()); 880 // qDebug("count %d ", uids.count());
881 881
882 KAex2phonePrefs ex2phone; 882 KAex2phonePrefs ex2phone;
883 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 883 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
884 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 884 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
885 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 885 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
886 886
887 if ( !ex2phone.exec() ) { 887 if ( !ex2phone.exec() ) {
888 return; 888 return;
889 } 889 }
890 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 890 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
891 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 891 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
892 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 892 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
893 893
894 894
895 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 895 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
896 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 896 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
897 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 897 KPimGlobalPrefs::instance()->mEx2PhoneModel );
898 898
899 QString fileName = getPhoneFile(); 899 QString fileName = getPhoneFile();
900 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) 900 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) )
901 return; 901 return;
902 902
903 message(i18n("Exporting to phone...")); 903 message(i18n("Exporting to phone..."));
904 QTimer::singleShot( 1, this , SLOT ( writeToPhone())); 904 QTimer::singleShot( 1, this , SLOT ( writeToPhone()));
905 905
906} 906}
907QString KABCore::getPhoneFile() 907QString KABCore::getPhoneFile()
908{ 908{
909#ifdef DESKTOP_VERSION 909#ifdef DESKTOP_VERSION
910 return locateLocal("tmp", "phonefile.vcf"); 910 return locateLocal("tmp", "phonefile.vcf");
911#else 911#else
912 return "/tmp/phonefile.vcf"; 912 return "/tmp/phonefile.vcf";
913#endif 913#endif
914 914
915} 915}
916void KABCore::writeToPhone( ) 916void KABCore::writeToPhone( )
917{ 917{
918 if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) 918 if ( PhoneAccess::writeToPhone( getPhoneFile() ) )
919 message(i18n("Export to phone finished!")); 919 message(i18n("Export to phone finished!"));
920 else 920 else
921 qDebug(i18n("KA: Error exporting to phone")); 921 qDebug(i18n("KA: Error exporting to phone"));
922} 922}
923void KABCore::beamVCard() 923void KABCore::beamVCard()
924{ 924{
925 QStringList uids; 925 QStringList uids;
926 XXPortSelectDialog dlg( this, false, this ); 926 XXPortSelectDialog dlg( this, false, this );
927 if ( dlg.exec() ) 927 if ( dlg.exec() )
928 uids = dlg.uids(); 928 uids = dlg.uids();
929 else 929 else
930 return; 930 return;
931 if ( uids.isEmpty() ) 931 if ( uids.isEmpty() )
932 return; 932 return;
933 beamVCard( uids ); 933 beamVCard( uids );
934} 934}
935 935
936 936
937void KABCore::beamVCard(const QStringList& uids) 937void KABCore::beamVCard(const QStringList& uids)
938{ 938{
939 939
940 // LR: we should use the /tmp dir on the Zaurus, 940 // LR: we should use the /tmp dir on the Zaurus,
941 // because: /tmp = RAM, (HOME)/kdepim = flash memory 941 // because: /tmp = RAM, (HOME)/kdepim = flash memory
942 942
943#ifdef DESKTOP_VERSION 943#ifdef DESKTOP_VERSION
944 QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); 944 QString fileName = locateLocal("tmp", "kapibeamfile.vcf");
945#else 945#else
946 QString fileName = "/tmp/kapibeamfile.vcf"; 946 QString fileName = "/tmp/kapibeamfile.vcf";
947#endif 947#endif
948 948
949 KABC::VCardConverter converter; 949 KABC::VCardConverter converter;
950 QString description; 950 QString description;
951 QString datastream; 951 QString datastream;
952 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 952 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
953 KABC::Addressee a = mAddressBook->findByUid( *it ); 953 KABC::Addressee a = mAddressBook->findByUid( *it );
954 954
955 if ( a.isEmpty() ) 955 if ( a.isEmpty() )
956 continue; 956 continue;
957 957
958 if (description.isEmpty()) 958 if (description.isEmpty())
959 description = a.formattedName(); 959 description = a.formattedName();
960 960
961 QString vcard; 961 QString vcard;
962 converter.addresseeToVCard( a, vcard ); 962 converter.addresseeToVCard( a, vcard );
963 int start = 0; 963 int start = 0;
964 int next; 964 int next;
965 while ( (next = vcard.find("TYPE=", start) )>= 0 ) { 965 while ( (next = vcard.find("TYPE=", start) )>= 0 ) {
966 int semi = vcard.find(";", next); 966 int semi = vcard.find(";", next);
967 int dopp = vcard.find(":", next); 967 int dopp = vcard.find(":", next);
968 int sep; 968 int sep;
969 if ( semi < dopp && semi >= 0 ) 969 if ( semi < dopp && semi >= 0 )
970 sep = semi ; 970 sep = semi ;
971 else 971 else
972 sep = dopp; 972 sep = dopp;
973 datastream +=vcard.mid( start, next - start); 973 datastream +=vcard.mid( start, next - start);
974 datastream +=vcard.mid( next+5,sep -next -5 ).upper(); 974 datastream +=vcard.mid( next+5,sep -next -5 ).upper();
975 start = sep; 975 start = sep;
976 } 976 }
977 datastream += vcard.mid( start,vcard.length() ); 977 datastream += vcard.mid( start,vcard.length() );
978 } 978 }
979#ifndef DESKTOP_VERSION 979#ifndef DESKTOP_VERSION
980 QFile outFile(fileName); 980 QFile outFile(fileName);
981 if ( outFile.open(IO_WriteOnly) ) { 981 if ( outFile.open(IO_WriteOnly) ) {
982 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 982 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
983 QTextStream t( &outFile ); // use a text stream 983 QTextStream t( &outFile ); // use a text stream
984 //t.setEncoding( QTextStream::UnicodeUTF8 ); 984 //t.setEncoding( QTextStream::UnicodeUTF8 );
985 t.setEncoding( QTextStream::Latin1 ); 985 t.setEncoding( QTextStream::Latin1 );
986 t <<datastream.latin1(); 986 t <<datastream.latin1();
987 outFile.close(); 987 outFile.close();
988 Ir *ir = new Ir( this ); 988 Ir *ir = new Ir( this );
989 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); 989 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
990 ir->send( fileName, description, "text/x-vCard" ); 990 ir->send( fileName, description, "text/x-vCard" );
991 } else { 991 } else {
992 qDebug("KA: Error open temp beam file "); 992 qDebug("KA: Error open temp beam file ");
993 return; 993 return;
994 } 994 }
995#endif 995#endif
996 996
997} 997}
998 998
999void KABCore::beamDone( Ir *ir ) 999void KABCore::beamDone( Ir *ir )
1000{ 1000{
1001#ifndef DESKTOP_VERSION 1001#ifndef DESKTOP_VERSION
1002 delete ir; 1002 delete ir;
1003#endif 1003#endif
1004 topLevelWidget()->raise(); 1004 topLevelWidget()->raise();
1005 message( i18n("Beaming finished!") ); 1005 message( i18n("Beaming finished!") );
1006} 1006}
1007 1007
1008 1008
1009void KABCore::browse( const QString& url ) 1009void KABCore::browse( const QString& url )
1010{ 1010{
1011#ifndef KAB_EMBEDDED 1011#ifndef KAB_EMBEDDED
1012 kapp->invokeBrowser( url ); 1012 kapp->invokeBrowser( url );
1013#else //KAB_EMBEDDED 1013#else //KAB_EMBEDDED
1014 qDebug("KABCore::browse must be fixed"); 1014 qDebug("KABCore::browse must be fixed");
1015#endif //KAB_EMBEDDED 1015#endif //KAB_EMBEDDED
1016} 1016}
1017 1017
1018void KABCore::selectAllContacts() 1018void KABCore::selectAllContacts()
1019{ 1019{
1020 mViewManager->setSelected( QString::null, true ); 1020 mViewManager->setSelected( QString::null, true );
1021} 1021}
1022 1022
1023void KABCore::deleteContacts() 1023void KABCore::deleteContacts()
1024{ 1024{
1025 QStringList uidList = mViewManager->selectedUids(); 1025 QStringList uidList = mViewManager->selectedUids();
1026 deleteContacts( uidList ); 1026 deleteContacts( uidList );
1027} 1027}
1028 1028
1029void KABCore::deleteContacts( const QStringList &uids ) 1029void KABCore::deleteContacts( const QStringList &uids )
1030{ 1030{
1031 if ( uids.count() > 0 ) { 1031 if ( uids.count() > 0 ) {
1032 PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); 1032 PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids );
1033 UndoStack::instance()->push( command ); 1033 UndoStack::instance()->push( command );
1034 RedoStack::instance()->clear(); 1034 RedoStack::instance()->clear();
1035 1035
1036 // now if we deleted anything, refresh 1036 // now if we deleted anything, refresh
1037 setContactSelected( QString::null ); 1037 setContactSelected( QString::null );
1038 setModified( true ); 1038 setModified( true );
1039 } 1039 }
1040} 1040}
1041 1041
1042void KABCore::copyContacts() 1042void KABCore::copyContacts()
1043{ 1043{
1044 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 1044 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
1045 1045
1046 QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); 1046 QString clipText = AddresseeUtil::addresseesToClipboard( addrList );
1047 1047
1048 kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; 1048 kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl;
1049 1049
1050 QClipboard *cb = QApplication::clipboard(); 1050 QClipboard *cb = QApplication::clipboard();
1051 cb->setText( clipText ); 1051 cb->setText( clipText );
1052} 1052}
1053 1053
1054void KABCore::cutContacts() 1054void KABCore::cutContacts()
1055{ 1055{
1056 QStringList uidList = mViewManager->selectedUids(); 1056 QStringList uidList = mViewManager->selectedUids();
1057 1057
1058//US if ( uidList.size() > 0 ) { 1058//US if ( uidList.size() > 0 ) {
1059 if ( uidList.count() > 0 ) { 1059 if ( uidList.count() > 0 ) {
1060 PwCutCommand *command = new PwCutCommand( mAddressBook, uidList ); 1060 PwCutCommand *command = new PwCutCommand( mAddressBook, uidList );
1061 UndoStack::instance()->push( command ); 1061 UndoStack::instance()->push( command );
1062 RedoStack::instance()->clear(); 1062 RedoStack::instance()->clear();
1063 1063
1064 setModified( true ); 1064 setModified( true );
1065 } 1065 }
1066} 1066}
1067 1067
1068void KABCore::pasteContacts() 1068void KABCore::pasteContacts()
1069{ 1069{
1070 QClipboard *cb = QApplication::clipboard(); 1070 QClipboard *cb = QApplication::clipboard();
1071 1071
1072 KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); 1072 KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() );
1073 1073
1074 pasteContacts( list ); 1074 pasteContacts( list );
1075} 1075}
1076 1076
1077void KABCore::pasteContacts( KABC::Addressee::List &list ) 1077void KABCore::pasteContacts( KABC::Addressee::List &list )
1078{ 1078{
1079 KABC::Resource *resource = requestResource( this ); 1079 KABC::Resource *resource = requestResource( this );
1080 KABC::Addressee::List::Iterator it; 1080 KABC::Addressee::List::Iterator it;
1081 for ( it = list.begin(); it != list.end(); ++it ) 1081 for ( it = list.begin(); it != list.end(); ++it )
1082 (*it).setResource( resource ); 1082 (*it).setResource( resource );
1083 1083
1084 PwPasteCommand *command = new PwPasteCommand( this, list ); 1084 PwPasteCommand *command = new PwPasteCommand( this, list );
1085 UndoStack::instance()->push( command ); 1085 UndoStack::instance()->push( command );
1086 RedoStack::instance()->clear(); 1086 RedoStack::instance()->clear();
1087 1087
1088 setModified( true ); 1088 setModified( true );
1089} 1089}
1090 1090
1091void KABCore::setWhoAmI() 1091void KABCore::setWhoAmI()
1092{ 1092{
1093 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 1093 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
1094 1094
1095 if ( addrList.count() > 1 ) { 1095 if ( addrList.count() > 1 ) {
1096 KMessageBox::sorry( this, i18n( "Please select only one contact." ) ); 1096 KMessageBox::sorry( this, i18n( "Please select only one contact." ) );
1097 return; 1097 return;
1098 } 1098 }
1099 1099
1100 QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) ); 1100 QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) );
1101 if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes ) 1101 if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes )
1102 static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); 1102 static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] );
1103} 1103}
1104void KABCore::editCategories() 1104void KABCore::editCategories()
1105{ 1105{
1106 KPIM::CategoryEditDialog dlg ( KABPrefs::instance(), this, "", true ); 1106 KPIM::CategoryEditDialog dlg ( KABPrefs::instance(), this, "", true );
1107 dlg.exec(); 1107 dlg.exec();
1108} 1108}
1109void KABCore::setCategories() 1109void KABCore::setCategories()
1110{ 1110{
1111 1111
1112 QStringList uids; 1112 QStringList uids;
1113 XXPortSelectDialog dlgx( this, false, this ); 1113 XXPortSelectDialog dlgx( this, false, this );
1114 if ( dlgx.exec() ) 1114 if ( dlgx.exec() )
1115 uids = dlgx.uids(); 1115 uids = dlgx.uids();
1116 else 1116 else
1117 return; 1117 return;
1118 if ( uids.isEmpty() ) 1118 if ( uids.isEmpty() )
1119 return; 1119 return;
1120 // qDebug("count %d ", uids.count()); 1120 // qDebug("count %d ", uids.count());
1121 1121
1122 1122
1123 KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); 1123 KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true );
1124 if ( !dlg.exec() ) { 1124 if ( !dlg.exec() ) {
1125 message( i18n("Setting categories cancelled") ); 1125 message( i18n("Setting categories cancelled") );
1126 return; 1126 return;
1127 } 1127 }
1128 bool merge = false; 1128 bool merge = false;
1129 QString msg = i18n( "Merge with existing categories?" ); 1129 QString msg = i18n( "Merge with existing categories?" );
1130 if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) 1130 if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes )
1131 merge = true; 1131 merge = true;
1132 1132
1133 message( i18n("Setting categories ... please wait!") ); 1133 message( i18n("Setting categories ... please wait!") );
1134 QStringList categories = dlg.selectedCategories(); 1134 QStringList categories = dlg.selectedCategories();
1135 1135
1136 //QStringList uids = mViewManager->selectedUids(); 1136 //QStringList uids = mViewManager->selectedUids();
1137 QStringList::Iterator it; 1137 QStringList::Iterator it;
1138 for ( it = uids.begin(); it != uids.end(); ++it ) { 1138 for ( it = uids.begin(); it != uids.end(); ++it ) {
1139 KABC::Addressee addr = mAddressBook->findByUid( *it ); 1139 KABC::Addressee addr = mAddressBook->findByUid( *it );
1140 if ( !addr.isEmpty() ) { 1140 if ( !addr.isEmpty() ) {
1141 if ( !merge ) 1141 if ( !merge )
1142 addr.setCategories( categories ); 1142 addr.setCategories( categories );
1143 else { 1143 else {
1144 QStringList addrCategories = addr.categories(); 1144 QStringList addrCategories = addr.categories();
1145 QStringList::Iterator catIt; 1145 QStringList::Iterator catIt;
1146 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { 1146 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) {
1147 if ( !addrCategories.contains( *catIt ) ) 1147 if ( !addrCategories.contains( *catIt ) )
1148 addrCategories.append( *catIt ); 1148 addrCategories.append( *catIt );
1149 } 1149 }
1150 addr.setCategories( addrCategories ); 1150 addr.setCategories( addrCategories );
1151 } 1151 }
1152 mAddressBook->insertAddressee( addr ); 1152 mAddressBook->insertAddressee( addr );
1153 } 1153 }
1154 } 1154 }
1155 1155
1156 if ( uids.count() > 0 ) 1156 if ( uids.count() > 0 )
1157 setModified( true ); 1157 setModified( true );
1158 message( i18n("Setting categories completed!") ); 1158 message( i18n("Setting categories completed!") );
1159} 1159}
1160 1160
1161void KABCore::setSearchFields( const KABC::Field::List &fields ) 1161void KABCore::setSearchFields( const KABC::Field::List &fields )
1162{ 1162{
1163 mIncSearchWidget->setFields( fields ); 1163 mIncSearchWidget->setFields( fields );
1164} 1164}
1165 1165
1166void KABCore::incrementalSearch( const QString& text ) 1166void KABCore::incrementalSearch( const QString& text )
1167{ 1167{
1168 QString stext; 1168 QString stext;
1169 if ( KABPrefs::instance()->mAutoSearchWithWildcard ) { 1169 if ( KABPrefs::instance()->mAutoSearchWithWildcard ) {
1170 stext = "*" + text; 1170 stext = "*" + text;
1171 } else { 1171 } else {
1172 stext = text; 1172 stext = text;
1173 } 1173 }
1174 mViewManager->doSearch( stext, mIncSearchWidget->currentField() ); 1174 mViewManager->doSearch( stext, mIncSearchWidget->currentField() );
1175} 1175}
1176void KABCore::incrementalSearchJump( const QString& text ) 1176void KABCore::incrementalSearchJump( const QString& text )
1177{ 1177{
1178 mViewManager->doSearch( text, mIncSearchWidget->currentField() ); 1178 mViewManager->doSearch( text, mIncSearchWidget->currentField() );
1179} 1179}
1180 1180
1181void KABCore::setModified() 1181void KABCore::setModified()
1182{ 1182{
1183 setModified( true ); 1183 setModified( true );
1184} 1184}
1185 1185
1186void KABCore::setModifiedWOrefresh() 1186void KABCore::setModifiedWOrefresh()
1187{ 1187{
1188 // qDebug("KABCore::setModifiedWOrefresh() "); 1188 // qDebug("KABCore::setModifiedWOrefresh() ");
1189 mModified = true; 1189 mModified = true;
1190 mActionSave->setEnabled( mModified ); 1190 mActionSave->setEnabled( mModified );
1191 1191
1192 1192
1193} 1193}
1194void KABCore::setModified( bool modified ) 1194void KABCore::setModified( bool modified )
1195{ 1195{
1196 mModified = modified; 1196 mModified = modified;
1197 mActionSave->setEnabled( mModified ); 1197 mActionSave->setEnabled( mModified );
1198 1198
1199 if ( modified ) 1199 if ( modified )
1200 mJumpButtonBar->recreateButtons(); 1200 mJumpButtonBar->recreateButtons();
1201 1201
1202 mViewManager->refreshView(); 1202 mViewManager->refreshView();
1203 1203
1204} 1204}
1205 1205
1206bool KABCore::modified() const 1206bool KABCore::modified() const
1207{ 1207{
1208 return mModified; 1208 return mModified;
1209} 1209}
1210 1210
1211void KABCore::contactModified( const KABC::Addressee &addr ) 1211void KABCore::contactModified( const KABC::Addressee &addr )
1212{ 1212{
1213 addrModified( addr ); 1213 addrModified( addr );
1214#if 0 // debug only 1214#if 0 // debug only
1215 KABC::Addressee ad = addr; 1215 KABC::Addressee ad = addr;
1216 ad.computeCsum( "123"); 1216 ad.computeCsum( "123");
1217#endif 1217#endif
1218} 1218}
1219 1219
1220void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) 1220void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails )
1221{ 1221{
1222 1222
1223 Command *command = 0; 1223 Command *command = 0;
1224 QString uid; 1224 QString uid;
1225 1225
1226 // check if it exists already 1226 // check if it exists already
1227 KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); 1227 KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() );
1228 if ( origAddr.isEmpty() ) 1228 if ( origAddr.isEmpty() )
1229 command = new PwNewCommand( mAddressBook, addr ); 1229 command = new PwNewCommand( mAddressBook, addr );
1230 else { 1230 else {
1231 command = new PwEditCommand( mAddressBook, origAddr, addr ); 1231 command = new PwEditCommand( mAddressBook, origAddr, addr );
1232 uid = addr.uid(); 1232 uid = addr.uid();
1233 } 1233 }
1234 1234
1235 UndoStack::instance()->push( command ); 1235 UndoStack::instance()->push( command );
1236 RedoStack::instance()->clear(); 1236 RedoStack::instance()->clear();
1237 if ( updateDetails ) 1237 if ( updateDetails )
1238 mDetails->setAddressee( addr ); 1238 mDetails->setAddressee( addr );
1239 setModified( true ); 1239 setModified( true );
1240} 1240}
1241 1241
1242void KABCore::newContact() 1242void KABCore::newContact()
1243{ 1243{
1244 1244
1245 1245
1246 QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); 1246 QPtrList<KABC::Resource> kabcResources = mAddressBook->resources();
1247 1247
1248 QPtrList<KRES::Resource> kresResources; 1248 QPtrList<KRES::Resource> kresResources;
1249 QPtrListIterator<KABC::Resource> it( kabcResources ); 1249 QPtrListIterator<KABC::Resource> it( kabcResources );
1250 KABC::Resource *resource; 1250 KABC::Resource *resource;
1251 while ( ( resource = it.current() ) != 0 ) { 1251 while ( ( resource = it.current() ) != 0 ) {
1252 ++it; 1252 ++it;
1253 if ( !resource->readOnly() ) { 1253 if ( !resource->readOnly() ) {
1254 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 1254 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
1255 if ( res ) 1255 if ( res )
1256 kresResources.append( res ); 1256 kresResources.append( res );
1257 } 1257 }
1258 } 1258 }
1259 1259
1260 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); 1260 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this );
1261 resource = static_cast<KABC::Resource*>( res ); 1261 resource = static_cast<KABC::Resource*>( res );
1262 1262
1263 if ( resource ) { 1263 if ( resource ) {
1264 KABC::Addressee addr; 1264 KABC::Addressee addr;
1265 addr.setResource( resource ); 1265 addr.setResource( resource );
1266 mEditorDialog->setAddressee( addr ); 1266 mEditorDialog->setAddressee( addr );
1267 mEditorDialog->setCaption( i18n("Edit new contact")); 1267 mEditorDialog->setCaption( i18n("Edit new contact"));
1268 KApplication::execDialog ( mEditorDialog ); 1268 KApplication::execDialog ( mEditorDialog );
1269 1269
1270 } else 1270 } else
1271 return; 1271 return;
1272 1272
1273 // mEditorDict.insert( dialog->addressee().uid(), dialog ); 1273 // mEditorDict.insert( dialog->addressee().uid(), dialog );
1274 1274
1275 1275
1276} 1276}
1277 1277
1278void KABCore::addEmail( QString aStr ) 1278void KABCore::addEmail( QString aStr )
1279{ 1279{
1280#ifndef KAB_EMBEDDED 1280#ifndef KAB_EMBEDDED
1281 QString fullName, email; 1281 QString fullName, email;
1282 1282
1283 KABC::Addressee::parseEmailAddress( aStr, fullName, email ); 1283 KABC::Addressee::parseEmailAddress( aStr, fullName, email );
1284 1284
1285 // Try to lookup the addressee matching the email address 1285 // Try to lookup the addressee matching the email address
1286 bool found = false; 1286 bool found = false;
1287 QStringList emailList; 1287 QStringList emailList;
1288 KABC::AddressBook::Iterator it; 1288 KABC::AddressBook::Iterator it;
1289 for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) { 1289 for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) {
1290 emailList = (*it).emails(); 1290 emailList = (*it).emails();
1291 if ( emailList.contains( email ) > 0 ) { 1291 if ( emailList.contains( email ) > 0 ) {
1292 found = true; 1292 found = true;
1293 (*it).setNameFromString( fullName ); 1293 (*it).setNameFromString( fullName );
1294 editContact( (*it).uid() ); 1294 editContact( (*it).uid() );
1295 } 1295 }
1296 } 1296 }
1297 1297
1298 if ( !found ) { 1298 if ( !found ) {
1299 KABC::Addressee addr; 1299 KABC::Addressee addr;
1300 addr.setNameFromString( fullName ); 1300 addr.setNameFromString( fullName );
1301 addr.insertEmail( email, true ); 1301 addr.insertEmail( email, true );
1302 1302
1303 mAddressBook->insertAddressee( addr ); 1303 mAddressBook->insertAddressee( addr );
1304 mViewManager->refreshView( addr.uid() ); 1304 mViewManager->refreshView( addr.uid() );
1305 editContact( addr.uid() ); 1305 editContact( addr.uid() );
1306 } 1306 }
1307#else //KAB_EMBEDDED 1307#else //KAB_EMBEDDED
1308 qDebug("KABCore::addEmail finsih method"); 1308 qDebug("KABCore::addEmail finsih method");
1309#endif //KAB_EMBEDDED 1309#endif //KAB_EMBEDDED
1310} 1310}
1311 1311
1312void KABCore::importVCard( const KURL &url, bool showPreview ) 1312void KABCore::importVCard( const KURL &url, bool showPreview )
1313{ 1313{
1314 mXXPortManager->importVCard( url, showPreview ); 1314 mXXPortManager->importVCard( url, showPreview );
1315} 1315}
1316void KABCore::importFromOL() 1316void KABCore::importFromOL()
1317{ 1317{
1318#ifdef _OL_IMPORT_ 1318#ifdef _OL_IMPORT_
1319 KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this ); 1319 KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this );
1320 idgl->exec(); 1320 idgl->exec();
1321 KABC::Addressee::List list = idgl->getAddressList(); 1321 KABC::Addressee::List list = idgl->getAddressList();
1322 if ( list.count() > 0 ) { 1322 if ( list.count() > 0 ) {
1323 KABC::Addressee::List listNew; 1323 KABC::Addressee::List listNew;
1324 KABC::Addressee::List listExisting; 1324 KABC::Addressee::List listExisting;
1325 KABC::Addressee::List::Iterator it; 1325 KABC::Addressee::List::Iterator it;
1326 KABC::AddressBook::Iterator iter; 1326 KABC::AddressBook::Iterator iter;
1327 for ( it = list.begin(); it != list.end(); ++it ) { 1327 for ( it = list.begin(); it != list.end(); ++it ) {
1328 if ( mAddressBook->findByUid((*it).uid() ).isEmpty()) 1328 if ( mAddressBook->findByUid((*it).uid() ).isEmpty())
1329 listNew.append( (*it) ); 1329 listNew.append( (*it) );
1330 else 1330 else
1331 listExisting.append( (*it) ); 1331 listExisting.append( (*it) );
1332 } 1332 }
1333 if ( listExisting.count() > 0 ) 1333 if ( listExisting.count() > 0 )
1334 KMessageBox::information( this, i18n("%1 contacts not added to addressbook\nbecause they were already in the addressbook!").arg( listExisting.count() )); 1334 KMessageBox::information( this, i18n("%1 contacts not added to addressbook\nbecause they were already in the addressbook!").arg( listExisting.count() ));
1335 if ( listNew.count() > 0 ) { 1335 if ( listNew.count() > 0 ) {
1336 pasteWithNewUid = false; 1336 pasteWithNewUid = false;
1337 pasteContacts( listNew ); 1337 pasteContacts( listNew );
1338 pasteWithNewUid = true; 1338 pasteWithNewUid = true;
1339 } 1339 }
1340 } 1340 }
1341 delete idgl; 1341 delete idgl;
1342#endif 1342#endif
1343} 1343}
1344 1344
1345void KABCore::importVCard( const QString &vCard, bool showPreview ) 1345void KABCore::importVCard( const QString &vCard, bool showPreview )
1346{ 1346{
1347 mXXPortManager->importVCard( vCard, showPreview ); 1347 mXXPortManager->importVCard( vCard, showPreview );
1348} 1348}
1349 1349
1350//US added a second method without defaultparameter 1350//US added a second method without defaultparameter
1351void KABCore::editContact2() { 1351void KABCore::editContact2() {
1352 editContact( QString::null ); 1352 editContact( QString::null );
1353} 1353}
1354 1354
1355void KABCore::editContact( const QString &uid ) 1355void KABCore::editContact( const QString &uid )
1356{ 1356{
1357 1357
1358 if ( mExtensionManager->isQuickEditVisible() ) 1358 if ( mExtensionManager->isQuickEditVisible() )
1359 return; 1359 return;
1360 1360
1361 // First, locate the contact entry 1361 // First, locate the contact entry
1362 QString localUID = uid; 1362 QString localUID = uid;
1363 if ( localUID.isNull() ) { 1363 if ( localUID.isNull() ) {
1364 QStringList uidList = mViewManager->selectedUids(); 1364 QStringList uidList = mViewManager->selectedUids();
1365 if ( uidList.count() > 0 ) 1365 if ( uidList.count() > 0 )
1366 localUID = *( uidList.at( 0 ) ); 1366 localUID = *( uidList.at( 0 ) );
1367 } 1367 }
1368 1368
1369 KABC::Addressee addr = mAddressBook->findByUid( localUID ); 1369 KABC::Addressee addr = mAddressBook->findByUid( localUID );
1370 if ( !addr.isEmpty() ) { 1370 if ( !addr.isEmpty() ) {
1371 mEditorDialog->setAddressee( addr ); 1371 mEditorDialog->setAddressee( addr );
1372 KApplication::execDialog ( mEditorDialog ); 1372 KApplication::execDialog ( mEditorDialog );
1373 } 1373 }
1374} 1374}
1375 1375
1376/** 1376/**
1377 Shows or edits the detail view for the given uid. If the uid is QString::null, 1377 Shows or edits the detail view for the given uid. If the uid is QString::null,
1378 the method will try to find a selected addressee in the view. 1378 the method will try to find a selected addressee in the view.
1379 */ 1379 */
1380void KABCore::executeContact( const QString &uid /*US = QString::null*/ ) 1380void KABCore::executeContact( const QString &uid /*US = QString::null*/ )
1381{ 1381{
1382 if ( mMultipleViewsAtOnce ) 1382 if ( mMultipleViewsAtOnce )
1383 { 1383 {
1384 editContact( uid ); 1384 editContact( uid );
1385 } 1385 }
1386 else 1386 else
1387 { 1387 {
1388 setDetailsVisible( true ); 1388 setDetailsVisible( true );
1389 mActionDetails->setChecked(true); 1389 mActionDetails->setChecked(true);
1390 } 1390 }
1391 1391
1392} 1392}
1393 1393
1394void KABCore::save() 1394void KABCore::save()
1395{ 1395{
1396 if (syncManager->blockSave()) 1396 if (syncManager->blockSave())
1397 return; 1397 return;
1398 if ( !mModified ) 1398 if ( !mModified )
1399 return; 1399 return;
1400 1400
1401 syncManager->setBlockSave(true); 1401 syncManager->setBlockSave(true);
1402 QString text = i18n( "There was an error while attempting to save\n the " 1402 QString text = i18n( "There was an error while attempting to save\n the "
1403 "address book. Please check that some \nother application is " 1403 "address book. Please check that some \nother application is "
1404 "not using it. " ); 1404 "not using it. " );
1405 message(i18n("Saving ... please wait! "), false); 1405 message(i18n("Saving ... please wait! "), false);
1406 //qApp->processEvents(); 1406 //qApp->processEvents();
1407#ifndef KAB_EMBEDDED 1407#ifndef KAB_EMBEDDED
1408 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); 1408 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook );
1409 if ( !b || !b->save() ) { 1409 if ( !b || !b->save() ) {
1410 KMessageBox::error( this, text, i18n( "Unable to Save" ) ); 1410 KMessageBox::error( this, text, i18n( "Unable to Save" ) );
1411 } 1411 }
1412#else //KAB_EMBEDDED 1412#else //KAB_EMBEDDED
1413 KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook ); 1413 KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook );
1414 if ( !b || !b->save() ) { 1414 if ( !b || !b->save() ) {
1415 QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok")); 1415 QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok"));
1416 } 1416 }
1417#endif //KAB_EMBEDDED 1417#endif //KAB_EMBEDDED
1418 1418
1419 message(i18n("Addressbook saved!")); 1419 message(i18n("Addressbook saved!"));
1420 setModified( false ); 1420 setModified( false );
1421 syncManager->setBlockSave(false); 1421 syncManager->setBlockSave(false);
1422} 1422}
1423 1423
1424 1424
1425void KABCore::undo() 1425void KABCore::undo()
1426{ 1426{
1427 UndoStack::instance()->undo(); 1427 UndoStack::instance()->undo();
1428 1428
1429 // Refresh the view 1429 // Refresh the view
1430 mViewManager->refreshView(); 1430 mViewManager->refreshView();
1431} 1431}
1432 1432
1433void KABCore::redo() 1433void KABCore::redo()
1434{ 1434{
1435 RedoStack::instance()->redo(); 1435 RedoStack::instance()->redo();
1436 1436
1437 // Refresh the view 1437 // Refresh the view
1438 mViewManager->refreshView(); 1438 mViewManager->refreshView();
1439} 1439}
1440void KABCore::setJumpButtonBar( bool visible ) 1440void KABCore::setJumpButtonBar( bool visible )
1441{ 1441{
1442 setJumpButtonBarVisible(visible ); 1442 setJumpButtonBarVisible(visible );
1443 saveSettings(); 1443 saveSettings();
1444} 1444}
1445void KABCore::setJumpButtonBarVisible( bool visible ) 1445void KABCore::setJumpButtonBarVisible( bool visible )
1446{ 1446{
1447 if (mMultipleViewsAtOnce) 1447 if (mMultipleViewsAtOnce)
1448 { 1448 {
1449 if ( visible ) 1449 if ( visible )
1450 mJumpButtonBar->show(); 1450 mJumpButtonBar->show();
1451 else 1451 else
1452 mJumpButtonBar->hide(); 1452 mJumpButtonBar->hide();
1453 } 1453 }
1454 else 1454 else
1455 { 1455 {
1456 // show the jumpbar only if "the details are hidden" == "viewmanager are shown" 1456 // show the jumpbar only if "the details are hidden" == "viewmanager are shown"
1457 if (mViewManager->isVisible()) 1457 if (mViewManager->isVisible())
1458 { 1458 {
1459 if ( visible ) 1459 if ( visible )
1460 mJumpButtonBar->show(); 1460 mJumpButtonBar->show();
1461 else 1461 else
1462 mJumpButtonBar->hide(); 1462 mJumpButtonBar->hide();
1463 } 1463 }
1464 else 1464 else
1465 { 1465 {
1466 mJumpButtonBar->hide(); 1466 mJumpButtonBar->hide();
1467 } 1467 }
1468 } 1468 }
1469 if ( visible ) { 1469 if ( visible ) {
1470 if ( mIncSearchWidget->currentItem() == 0 ) { 1470 if ( mIncSearchWidget->currentItem() == 0 ) {
1471 message( i18n("Change search field enable jump bar") ); 1471 message( i18n("Change search field enable jump bar") );
1472 } 1472 }
1473 } 1473 }
1474} 1474}
1475 1475
1476 1476
1477void KABCore::setDetailsToState() 1477void KABCore::setDetailsToState()
1478{ 1478{
1479 setDetailsVisible( mActionDetails->isChecked() ); 1479 setDetailsVisible( mActionDetails->isChecked() );
1480} 1480}
1481void KABCore::setDetailsToggle() 1481void KABCore::setDetailsToggle()
1482{ 1482{
1483 mActionDetails->setChecked( !mActionDetails->isChecked() ); 1483 mActionDetails->setChecked( !mActionDetails->isChecked() );
1484 setDetailsToState(); 1484 setDetailsToState();
1485} 1485}
1486 1486
1487 1487
1488 1488
1489void KABCore::setDetailsVisible( bool visible ) 1489void KABCore::setDetailsVisible( bool visible )
1490{ 1490{
1491 if (visible && mDetails->isHidden()) 1491 if (visible && mDetails->isHidden())
1492 { 1492 {
1493 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 1493 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
1494 if ( addrList.count() > 0 ) 1494 if ( addrList.count() > 0 )
1495 mDetails->setAddressee( addrList[ 0 ] ); 1495 mDetails->setAddressee( addrList[ 0 ] );
1496 } 1496 }
1497 1497
1498 // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between 1498 // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between
1499 // the listview and the detailview. We do that by changing the splitbar size. 1499 // the listview and the detailview. We do that by changing the splitbar size.
1500 if (mMultipleViewsAtOnce) 1500 if (mMultipleViewsAtOnce)
1501 { 1501 {
1502 if ( visible ) 1502 if ( visible )
1503 mDetails->show(); 1503 mDetails->show();
1504 else 1504 else
1505 mDetails->hide(); 1505 mDetails->hide();
1506 } 1506 }
1507 else 1507 else
1508 { 1508 {
1509 if ( visible ) { 1509 if ( visible ) {
1510 mViewManager->hide(); 1510 mViewManager->hide();
1511 mDetails->show(); 1511 mDetails->show();
1512 mIncSearchWidget->setFocus(); 1512 mIncSearchWidget->setFocus();
1513 } 1513 }
1514 else { 1514 else {
1515 mViewManager->show(); 1515 mViewManager->show();
1516 mDetails->hide(); 1516 mDetails->hide();
1517 mViewManager->setFocusAV(); 1517 mViewManager->setFocusAV();
1518 } 1518 }
1519 setJumpButtonBarVisible( !visible ); 1519 setJumpButtonBarVisible( !visible );
1520 } 1520 }
1521 1521
1522} 1522}
1523 1523
1524void KABCore::extensionChanged( int id ) 1524void KABCore::extensionChanged( int id )
1525{ 1525{
1526 //change the details view only for non desktop systems 1526 //change the details view only for non desktop systems
1527#ifndef DESKTOP_VERSION 1527#ifndef DESKTOP_VERSION
1528 1528
1529 if (id == 0) 1529 if (id == 0)
1530 { 1530 {
1531 //the user disabled the extension. 1531 //the user disabled the extension.
1532 1532
1533 if (mMultipleViewsAtOnce) 1533 if (mMultipleViewsAtOnce)
1534 { // enable detailsview again 1534 { // enable detailsview again
1535 setDetailsVisible( true ); 1535 setDetailsVisible( true );
1536 mActionDetails->setChecked( true ); 1536 mActionDetails->setChecked( true );
1537 } 1537 }
1538 else 1538 else
1539 { //go back to the listview 1539 { //go back to the listview
1540 setDetailsVisible( false ); 1540 setDetailsVisible( false );
1541 mActionDetails->setChecked( false ); 1541 mActionDetails->setChecked( false );
1542 mActionDetails->setEnabled(true); 1542 mActionDetails->setEnabled(true);
1543 } 1543 }
1544 1544
1545 } 1545 }
1546 else 1546 else
1547 { 1547 {
1548 //the user enabled the extension. 1548 //the user enabled the extension.
1549 setDetailsVisible( false ); 1549 setDetailsVisible( false );
1550 mActionDetails->setChecked( false ); 1550 mActionDetails->setChecked( false );
1551 1551
1552 if (!mMultipleViewsAtOnce) 1552 if (!mMultipleViewsAtOnce)
1553 { 1553 {
1554 mActionDetails->setEnabled(false); 1554 mActionDetails->setEnabled(false);
1555 } 1555 }
1556 1556
1557 mExtensionManager->setSelectionChanged(); 1557 mExtensionManager->setSelectionChanged();
1558 1558
1559 } 1559 }
1560 1560
1561#endif// DESKTOP_VERSION 1561#endif// DESKTOP_VERSION
1562 1562
1563} 1563}
1564 1564
1565 1565
1566void KABCore::extensionModified( const KABC::Addressee::List &list ) 1566void KABCore::extensionModified( const KABC::Addressee::List &list )
1567{ 1567{
1568 1568
1569 if ( list.count() != 0 ) { 1569 if ( list.count() != 0 ) {
1570 KABC::Addressee::List::ConstIterator it; 1570 KABC::Addressee::List::ConstIterator it;
1571 for ( it = list.begin(); it != list.end(); ++it ) 1571 for ( it = list.begin(); it != list.end(); ++it )
1572 mAddressBook->insertAddressee( *it ); 1572 mAddressBook->insertAddressee( *it );
1573 if ( list.count() > 1 ) 1573 if ( list.count() > 1 )
1574 setModified(); 1574 setModified();
1575 else 1575 else
1576 setModifiedWOrefresh(); 1576 setModifiedWOrefresh();
1577 } 1577 }
1578 if ( list.count() == 0 ) 1578 if ( list.count() == 0 )
1579 mViewManager->refreshView(); 1579 mViewManager->refreshView();
1580 else 1580 else
1581 mViewManager->refreshView( list[ 0 ].uid() ); 1581 mViewManager->refreshView( list[ 0 ].uid() );
1582 1582
1583 1583
1584 1584
1585} 1585}
1586 1586
1587QString KABCore::getNameByPhone( const QString &phone ) 1587QString KABCore::getNameByPhone( const QString &phone )
1588{ 1588{
1589#ifndef KAB_EMBEDDED 1589#ifndef KAB_EMBEDDED
1590 QRegExp r( "[/*/-/ ]" ); 1590 QRegExp r( "[/*/-/ ]" );
1591 QString localPhone( phone ); 1591 QString localPhone( phone );
1592 1592
1593 bool found = false; 1593 bool found = false;
1594 QString ownerName = ""; 1594 QString ownerName = "";
1595 KABC::AddressBook::Iterator iter; 1595 KABC::AddressBook::Iterator iter;
1596 KABC::PhoneNumber::List::Iterator phoneIter; 1596 KABC::PhoneNumber::List::Iterator phoneIter;
1597 KABC::PhoneNumber::List phoneList; 1597 KABC::PhoneNumber::List phoneList;
1598 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { 1598 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) {
1599 phoneList = (*iter).phoneNumbers(); 1599 phoneList = (*iter).phoneNumbers();
1600 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); 1600 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() );
1601 ++phoneIter) { 1601 ++phoneIter) {
1602 // Get rid of separator chars so just the numbers are compared. 1602 // Get rid of separator chars so just the numbers are compared.
1603 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { 1603 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) {
1604 ownerName = (*iter).formattedName(); 1604 ownerName = (*iter).formattedName();
1605 found = true; 1605 found = true;
1606 } 1606 }
1607 } 1607 }
1608 } 1608 }
1609 1609
1610 return ownerName; 1610 return ownerName;
1611#else //KAB_EMBEDDED 1611#else //KAB_EMBEDDED
1612 qDebug("KABCore::getNameByPhone finsih method"); 1612 qDebug("KABCore::getNameByPhone finsih method");
1613 return ""; 1613 return "";
1614#endif //KAB_EMBEDDED 1614#endif //KAB_EMBEDDED
1615 1615
1616} 1616}
1617 1617
1618void KABCore::openConfigDialog() 1618void KABCore::openConfigDialog()
1619{ 1619{
1620 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); 1620 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true );
1621 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); 1621 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" );
1622 ConfigureDialog->addModule(kabcfg ); 1622 ConfigureDialog->addModule(kabcfg );
1623 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); 1623 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" );
1624 ConfigureDialog->addModule(kdelibcfg ); 1624 ConfigureDialog->addModule(kdelibcfg );
1625 1625
1626 connect( ConfigureDialog, SIGNAL( applyClicked() ), 1626 connect( ConfigureDialog, SIGNAL( applyClicked() ),
1627 this, SLOT( configurationChanged() ) ); 1627 this, SLOT( configurationChanged() ) );
1628 connect( ConfigureDialog, SIGNAL( okClicked() ), 1628 connect( ConfigureDialog, SIGNAL( okClicked() ),
1629 this, SLOT( configurationChanged() ) ); 1629 this, SLOT( configurationChanged() ) );
1630 saveSettings(); 1630 saveSettings();
1631#ifndef DESKTOP_VERSION 1631#ifndef DESKTOP_VERSION
1632 ConfigureDialog->showMaximized(); 1632 ConfigureDialog->showMaximized();
1633#endif 1633#endif
1634 if ( ConfigureDialog->exec() ) 1634 if ( ConfigureDialog->exec() )
1635 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); 1635 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") );
1636 delete ConfigureDialog; 1636 delete ConfigureDialog;
1637} 1637}
1638 1638
1639void KABCore::openLDAPDialog() 1639void KABCore::openLDAPDialog()
1640{ 1640{
1641#ifndef KAB_EMBEDDED 1641#ifndef KAB_EMBEDDED
1642 if ( !mLdapSearchDialog ) { 1642 if ( !mLdapSearchDialog ) {
1643 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); 1643 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this );
1644 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, 1644 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager,
1645 SLOT( refreshView() ) ); 1645 SLOT( refreshView() ) );
1646 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, 1646 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this,
1647 SLOT( setModified() ) ); 1647 SLOT( setModified() ) );
1648 } else 1648 } else
1649 mLdapSearchDialog->restoreSettings(); 1649 mLdapSearchDialog->restoreSettings();
1650 1650
1651 if ( mLdapSearchDialog->isOK() ) 1651 if ( mLdapSearchDialog->isOK() )
1652 mLdapSearchDialog->exec(); 1652 mLdapSearchDialog->exec();
1653#else //KAB_EMBEDDED 1653#else //KAB_EMBEDDED
1654 qDebug("KABCore::openLDAPDialog() finsih method"); 1654 qDebug("KABCore::openLDAPDialog() finsih method");
1655#endif //KAB_EMBEDDED 1655#endif //KAB_EMBEDDED
1656} 1656}
1657 1657
1658void KABCore::print() 1658void KABCore::print()
1659{ 1659{
1660#ifndef KAB_EMBEDDED 1660#ifndef KAB_EMBEDDED
1661 KPrinter printer; 1661 KPrinter printer;
1662 if ( !printer.setup( this ) ) 1662 if ( !printer.setup( this ) )
1663 return; 1663 return;
1664 1664
1665 KABPrinting::PrintingWizard wizard( &printer, mAddressBook, 1665 KABPrinting::PrintingWizard wizard( &printer, mAddressBook,
1666 mViewManager->selectedUids(), this ); 1666 mViewManager->selectedUids(), this );
1667 1667
1668 wizard.exec(); 1668 wizard.exec();
1669#else //KAB_EMBEDDED 1669#else //KAB_EMBEDDED
1670 qDebug("KABCore::print() finsih method"); 1670 qDebug("KABCore::print() finsih method");
1671#endif //KAB_EMBEDDED 1671#endif //KAB_EMBEDDED
1672 1672
1673} 1673}
1674 1674
1675 1675
1676void KABCore::addGUIClient( KXMLGUIClient *client ) 1676void KABCore::addGUIClient( KXMLGUIClient *client )
1677{ 1677{
1678 if ( mGUIClient ) 1678 if ( mGUIClient )
1679 mGUIClient->insertChildClient( client ); 1679 mGUIClient->insertChildClient( client );
1680 else 1680 else
1681 KMessageBox::error( this, "no KXMLGUICLient"); 1681 KMessageBox::error( this, "no KXMLGUICLient");
1682} 1682}
1683 1683
1684 1684
1685void KABCore::configurationChanged() 1685void KABCore::configurationChanged()
1686{ 1686{
1687 mExtensionManager->reconfigure(); 1687 mExtensionManager->reconfigure();
1688} 1688}
1689 1689
1690void KABCore::addressBookChanged() 1690void KABCore::addressBookChanged()
1691{ 1691{
1692/*US 1692/*US
1693 QDictIterator<AddresseeEditorDialog> it( mEditorDict ); 1693 QDictIterator<AddresseeEditorDialog> it( mEditorDict );
1694 while ( it.current() ) { 1694 while ( it.current() ) {
1695 if ( it.current()->dirty() ) { 1695 if ( it.current()->dirty() ) {
1696 QString text = i18n( "Data has been changed externally. Unsaved " 1696 QString text = i18n( "Data has been changed externally. Unsaved "
1697 "changes will be lost." ); 1697 "changes will be lost." );
1698 KMessageBox::information( this, text ); 1698 KMessageBox::information( this, text );
1699 } 1699 }
1700 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); 1700 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) );
1701 ++it; 1701 ++it;
1702 } 1702 }
1703*/ 1703*/
1704 if (mEditorDialog) 1704 if (mEditorDialog)
1705 { 1705 {
1706 if (mEditorDialog->dirty()) 1706 if (mEditorDialog->dirty())
1707 { 1707 {
1708 QString text = i18n( "Data has been changed externally. Unsaved " 1708 QString text = i18n( "Data has been changed externally. Unsaved "
1709 "changes will be lost." ); 1709 "changes will be lost." );
1710 KMessageBox::information( this, text ); 1710 KMessageBox::information( this, text );
1711 } 1711 }
1712 QString currentuid = mEditorDialog->addressee().uid(); 1712 QString currentuid = mEditorDialog->addressee().uid();
1713 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); 1713 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) );
1714 } 1714 }
1715 mViewManager->refreshView(); 1715 mViewManager->refreshView();
1716 1716
1717 1717
1718} 1718}
1719 1719
1720AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, 1720AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1721 const char *name ) 1721 const char *name )
1722{ 1722{
1723 1723
1724 if ( mEditorDialog == 0 ) { 1724 if ( mEditorDialog == 0 ) {
1725 mEditorDialog = new AddresseeEditorDialog( this, parent, 1725 mEditorDialog = new AddresseeEditorDialog( this, parent,
1726 name ? name : "editorDialog" ); 1726 name ? name : "editorDialog" );
1727 1727
1728 1728
1729 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), 1729 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
1730 SLOT( contactModified( const KABC::Addressee& ) ) ); 1730 SLOT( contactModified( const KABC::Addressee& ) ) );
1731 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), 1731 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ),
1732 // SLOT( slotEditorDestroyed( const QString& ) ) ; 1732 // SLOT( slotEditorDestroyed( const QString& ) ) ;
1733 } 1733 }
1734 1734
1735 return mEditorDialog; 1735 return mEditorDialog;
1736} 1736}
1737 1737
1738void KABCore::slotEditorDestroyed( const QString &uid ) 1738void KABCore::slotEditorDestroyed( const QString &uid )
1739{ 1739{
1740 //mEditorDict.remove( uid ); 1740 //mEditorDict.remove( uid );
1741} 1741}
1742 1742
1743void KABCore::initGUI() 1743void KABCore::initGUI()
1744{ 1744{
1745#ifndef KAB_EMBEDDED 1745#ifndef KAB_EMBEDDED
1746 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1746 QHBoxLayout *topLayout = new QHBoxLayout( this );
1747 topLayout->setSpacing( KDialogBase::spacingHint() ); 1747 topLayout->setSpacing( KDialogBase::spacingHint() );
1748 1748
1749 mExtensionBarSplitter = new QSplitter( this ); 1749 mExtensionBarSplitter = new QSplitter( this );
1750 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1750 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1751 1751
1752 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1752 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1753 1753
1754 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1754 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1755 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1755 mIncSearchWidget = new IncSearchWidget( viewSpace );
1756 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1756 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1757 SLOT( incrementalSearch( const QString& ) ) ); 1757 SLOT( incrementalSearch( const QString& ) ) );
1758 1758
1759 mViewManager = new ViewManager( this, viewSpace ); 1759 mViewManager = new ViewManager( this, viewSpace );
1760 viewSpace->setStretchFactor( mViewManager, 1 ); 1760 viewSpace->setStretchFactor( mViewManager, 1 );
1761 1761
1762 mDetails = new ViewContainer( mDetailsSplitter ); 1762 mDetails = new ViewContainer( mDetailsSplitter );
1763 1763
1764 mJumpButtonBar = new JumpButtonBar( this, this ); 1764 mJumpButtonBar = new JumpButtonBar( this, this );
1765 1765
1766 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1766 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1767 1767
1768 topLayout->addWidget( mExtensionBarSplitter ); 1768 topLayout->addWidget( mExtensionBarSplitter );
1769 topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); 1769 topLayout->setStretchFactor( mExtensionBarSplitter, 100 );
1770 topLayout->addWidget( mJumpButtonBar ); 1770 topLayout->addWidget( mJumpButtonBar );
1771 //topLayout->setStretchFactor( mJumpButtonBar, 1 ); 1771 //topLayout->setStretchFactor( mJumpButtonBar, 1 );
1772 1772
1773 mXXPortManager = new XXPortManager( this, this ); 1773 mXXPortManager = new XXPortManager( this, this );
1774 1774
1775#else //KAB_EMBEDDED 1775#else //KAB_EMBEDDED
1776 //US initialize viewMenu before settingup viewmanager. 1776 //US initialize viewMenu before settingup viewmanager.
1777 // Viewmanager needs this menu to plugin submenues. 1777 // Viewmanager needs this menu to plugin submenues.
1778 viewMenu = new QPopupMenu( this ); 1778 viewMenu = new QPopupMenu( this );
1779 settingsMenu = new QPopupMenu( this ); 1779 settingsMenu = new QPopupMenu( this );
1780 //filterMenu = new QPopupMenu( this ); 1780 //filterMenu = new QPopupMenu( this );
1781 ImportMenu = new QPopupMenu( this ); 1781 ImportMenu = new QPopupMenu( this );
1782 ExportMenu = new QPopupMenu( this ); 1782 ExportMenu = new QPopupMenu( this );
1783 syncMenu = new QPopupMenu( this ); 1783 syncMenu = new QPopupMenu( this );
1784 changeMenu= new QPopupMenu( this ); 1784 changeMenu= new QPopupMenu( this );
1785 beamMenu= new QPopupMenu( this ); 1785 beamMenu= new QPopupMenu( this );
1786 1786
1787//US since we have no splitter for the embedded system, setup 1787//US since we have no splitter for the embedded system, setup
1788// a layout with two frames. One left and one right. 1788// a layout with two frames. One left and one right.
1789 1789
1790 QBoxLayout *topLayout; 1790 QBoxLayout *topLayout;
1791 1791
1792 // = new QHBoxLayout( this ); 1792 // = new QHBoxLayout( this );
1793// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1793// QBoxLayout *topLayout = (QBoxLayout*)layout();
1794 1794
1795// QWidget *mainBox = new QWidget( this ); 1795// QWidget *mainBox = new QWidget( this );
1796// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1796// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1797 1797
1798#ifdef DESKTOP_VERSION 1798#ifdef DESKTOP_VERSION
1799 topLayout = new QHBoxLayout( this ); 1799 topLayout = new QHBoxLayout( this );
1800 1800
1801 1801
1802 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1802 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1803 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1803 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1804 1804
1805 topLayout->addWidget(mMiniSplitter ); 1805 topLayout->addWidget(mMiniSplitter );
1806 1806
1807 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); 1807 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
1808 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1808 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1809 mViewManager = new ViewManager( this, mExtensionBarSplitter ); 1809 mViewManager = new ViewManager( this, mExtensionBarSplitter );
1810 mDetails = new ViewContainer( mMiniSplitter ); 1810 mDetails = new ViewContainer( mMiniSplitter );
1811 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1811 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1812#else 1812#else
1813 if ( QApplication::desktop()->width() > 480 ) { 1813 if ( QApplication::desktop()->width() > 480 ) {
1814 topLayout = new QHBoxLayout( this ); 1814 topLayout = new QHBoxLayout( this );
1815 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1815 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1816 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1816 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1817 } else { 1817 } else {
1818 1818
1819 topLayout = new QHBoxLayout( this ); 1819 topLayout = new QHBoxLayout( this );
1820 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1820 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
1821 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1821 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1822 } 1822 }
1823 1823
1824 topLayout->addWidget(mMiniSplitter ); 1824 topLayout->addWidget(mMiniSplitter );
1825 mViewManager = new ViewManager( this, mMiniSplitter ); 1825 mViewManager = new ViewManager( this, mMiniSplitter );
1826 mDetails = new ViewContainer( mMiniSplitter ); 1826 mDetails = new ViewContainer( mMiniSplitter );
1827 1827
1828 1828
1829 mExtensionManager = new ExtensionManager( this, mMiniSplitter ); 1829 mExtensionManager = new ExtensionManager( this, mMiniSplitter );
1830#endif 1830#endif
1831 //eh->hide(); 1831 //eh->hide();
1832 // topLayout->addWidget(mExtensionManager ); 1832 // topLayout->addWidget(mExtensionManager );
1833 1833
1834 1834
1835/*US 1835/*US
1836#ifndef KAB_NOSPLITTER 1836#ifndef KAB_NOSPLITTER
1837 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1837 QHBoxLayout *topLayout = new QHBoxLayout( this );
1838//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1838//US topLayout->setSpacing( KDialogBase::spacingHint() );
1839 topLayout->setSpacing( 10 ); 1839 topLayout->setSpacing( 10 );
1840 1840
1841 mDetailsSplitter = new QSplitter( this ); 1841 mDetailsSplitter = new QSplitter( this );
1842 1842
1843 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1843 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1844 1844
1845 mViewManager = new ViewManager( this, viewSpace ); 1845 mViewManager = new ViewManager( this, viewSpace );
1846 viewSpace->setStretchFactor( mViewManager, 1 ); 1846 viewSpace->setStretchFactor( mViewManager, 1 );
1847 1847
1848 mDetails = new ViewContainer( mDetailsSplitter ); 1848 mDetails = new ViewContainer( mDetailsSplitter );
1849 1849
1850 topLayout->addWidget( mDetailsSplitter ); 1850 topLayout->addWidget( mDetailsSplitter );
1851 topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1851 topLayout->setStretchFactor( mDetailsSplitter, 100 );
1852#else //KAB_NOSPLITTER 1852#else //KAB_NOSPLITTER
1853 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1853 QHBoxLayout *topLayout = new QHBoxLayout( this );
1854//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1854//US topLayout->setSpacing( KDialogBase::spacingHint() );
1855 topLayout->setSpacing( 10 ); 1855 topLayout->setSpacing( 10 );
1856 1856
1857// mDetailsSplitter = new QSplitter( this ); 1857// mDetailsSplitter = new QSplitter( this );
1858 1858
1859 QVBox *viewSpace = new QVBox( this ); 1859 QVBox *viewSpace = new QVBox( this );
1860 1860
1861 mViewManager = new ViewManager( this, viewSpace ); 1861 mViewManager = new ViewManager( this, viewSpace );
1862 viewSpace->setStretchFactor( mViewManager, 1 ); 1862 viewSpace->setStretchFactor( mViewManager, 1 );
1863 1863
1864 mDetails = new ViewContainer( this ); 1864 mDetails = new ViewContainer( this );
1865 1865
1866 topLayout->addWidget( viewSpace ); 1866 topLayout->addWidget( viewSpace );
1867// topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1867// topLayout->setStretchFactor( mDetailsSplitter, 100 );
1868 topLayout->addWidget( mDetails ); 1868 topLayout->addWidget( mDetails );
1869#endif //KAB_NOSPLITTER 1869#endif //KAB_NOSPLITTER
1870*/ 1870*/
1871 1871
1872 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 1872 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
1873 syncManager->setBlockSave(false); 1873 syncManager->setBlockSave(false);
1874 1874
1875 connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 1875 connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
1876 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 1876 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
1877 QString sync_file = sentSyncFile(); 1877 QString sync_file = sentSyncFile();
1878 //qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1()); 1878 //qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1());
1879 syncManager->setDefaultFileName( sync_file ); 1879 syncManager->setDefaultFileName( sync_file );
1880 //connect(syncManager , SIGNAL( ), this, SLOT( ) ); 1880 //connect(syncManager , SIGNAL( ), this, SLOT( ) );
1881 1881
1882#endif //KAB_EMBEDDED 1882#endif //KAB_EMBEDDED
1883 initActions(); 1883 initActions();
1884 1884
1885#ifdef KAB_EMBEDDED 1885#ifdef KAB_EMBEDDED
1886 addActionsManually(); 1886 addActionsManually();
1887 //US make sure the export and import menues are initialized before creating the xxPortManager. 1887 //US make sure the export and import menues are initialized before creating the xxPortManager.
1888 mXXPortManager = new XXPortManager( this, this ); 1888 mXXPortManager = new XXPortManager( this, this );
1889 1889
1890 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); 1890 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
1891 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); 1891 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
1892 // mActionQuit->plug ( mMainWindow->toolBar()); 1892 // mActionQuit->plug ( mMainWindow->toolBar());
1893 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); 1893 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() );
1894 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); 1894 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget);
1895 // mIncSearchWidget->hide(); 1895 // mIncSearchWidget->hide();
1896 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1896 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1897 SLOT( incrementalSearch( const QString& ) ) ); 1897 SLOT( incrementalSearch( const QString& ) ) );
1898 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); 1898 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) );
1899 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); 1899 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) );
1900 1900
1901 mJumpButtonBar = new JumpButtonBar( this, this ); 1901 mJumpButtonBar = new JumpButtonBar( this, this );
1902 1902
1903 topLayout->addWidget( mJumpButtonBar ); 1903 topLayout->addWidget( mJumpButtonBar );
1904//US topLayout->setStretchFactor( mJumpButtonBar, 10 ); 1904//US topLayout->setStretchFactor( mJumpButtonBar, 10 );
1905 1905
1906// mMainWindow->getIconToolBar()->raise(); 1906// mMainWindow->getIconToolBar()->raise();
1907 1907
1908#endif //KAB_EMBEDDED 1908#endif //KAB_EMBEDDED
1909 1909
1910} 1910}
1911void KABCore::initActions() 1911void KABCore::initActions()
1912{ 1912{
1913//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1913//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1914 1914
1915#ifndef KAB_EMBEDDED 1915#ifndef KAB_EMBEDDED
1916 connect( QApplication::clipboard(), SIGNAL( dataChanged() ), 1916 connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
1917 SLOT( clipboardDataChanged() ) ); 1917 SLOT( clipboardDataChanged() ) );
1918#endif //KAB_EMBEDDED 1918#endif //KAB_EMBEDDED
1919 1919
1920 // file menu 1920 // file menu
1921 1921
1922 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); 1922 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
1923 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 1923 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
1924 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, 1924 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager,
1925 SLOT( printView() ), actionCollection(), "kaddressbook_print" ); 1925 SLOT( printView() ), actionCollection(), "kaddressbook_print" );
1926 1926
1927 1927
1928 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, 1928 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails,
1929 SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); 1929 SLOT( printView() ), actionCollection(), "kaddressbook_print2" );
1930 1930
1931 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, 1931 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this,
1932 SLOT( save() ), actionCollection(), "file_sync" ); 1932 SLOT( save() ), actionCollection(), "file_sync" );
1933 1933
1934 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, 1934 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this,
1935 SLOT( newContact() ), actionCollection(), "file_new_contact" ); 1935 SLOT( newContact() ), actionCollection(), "file_new_contact" );
1936 1936
1937 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, 1937 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0,
1938 this, SLOT( mailVCard() ), 1938 this, SLOT( mailVCard() ),
1939 actionCollection(), "file_mail_vcard"); 1939 actionCollection(), "file_mail_vcard");
1940 1940
1941 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, 1941 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this,
1942 SLOT( export2phone() ), actionCollection(), 1942 SLOT( export2phone() ), actionCollection(),
1943 "kaddressbook_ex2phone" ); 1943 "kaddressbook_ex2phone" );
1944 1944
1945 mActionBeamVCard = 0; 1945 mActionBeamVCard = 0;
1946 mActionBeam = 0; 1946 mActionBeam = 0;
1947 1947
1948#ifndef DESKTOP_VERSION 1948#ifndef DESKTOP_VERSION
1949 if ( Ir::supported() ) { 1949 if ( Ir::supported() ) {
1950 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this, 1950 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this,
1951 SLOT( beamVCard() ), actionCollection(), 1951 SLOT( beamVCard() ), actionCollection(),
1952 "kaddressbook_beam_vcard" ); 1952 "kaddressbook_beam_vcard" );
1953 1953
1954 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, 1954 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
1955 SLOT( beamMySelf() ), actionCollection(), 1955 SLOT( beamMySelf() ), actionCollection(),
1956 "kaddressbook_beam_myself" ); 1956 "kaddressbook_beam_myself" );
1957 } 1957 }
1958#endif 1958#endif
1959 1959
1960 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, 1960 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
1961 this, SLOT( editContact2() ), 1961 this, SLOT( editContact2() ),
1962 actionCollection(), "file_properties" ); 1962 actionCollection(), "file_properties" );
1963 1963
1964#ifdef KAB_EMBEDDED 1964#ifdef KAB_EMBEDDED
1965 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); 1965 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() );
1966 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, 1966 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0,
1967 mMainWindow, SLOT( exit() ), 1967 mMainWindow, SLOT( exit() ),
1968 actionCollection(), "quit" ); 1968 actionCollection(), "quit" );
1969#endif //KAB_EMBEDDED 1969#endif //KAB_EMBEDDED
1970 1970
1971 // edit menu 1971 // edit menu
1972 if ( mIsPart ) { 1972 if ( mIsPart ) {
1973 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 1973 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this,
1974 SLOT( copyContacts() ), actionCollection(), 1974 SLOT( copyContacts() ), actionCollection(),
1975 "kaddressbook_copy" ); 1975 "kaddressbook_copy" );
1976 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 1976 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this,
1977 SLOT( cutContacts() ), actionCollection(), 1977 SLOT( cutContacts() ), actionCollection(),
1978 "kaddressbook_cut" ); 1978 "kaddressbook_cut" );
1979 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 1979 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this,
1980 SLOT( pasteContacts() ), actionCollection(), 1980 SLOT( pasteContacts() ), actionCollection(),
1981 "kaddressbook_paste" ); 1981 "kaddressbook_paste" );
1982 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 1982 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this,
1983 SLOT( selectAllContacts() ), actionCollection(), 1983 SLOT( selectAllContacts() ), actionCollection(),
1984 "kaddressbook_select_all" ); 1984 "kaddressbook_select_all" );
1985 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 1985 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this,
1986 SLOT( undo() ), actionCollection(), 1986 SLOT( undo() ), actionCollection(),
1987 "kaddressbook_undo" ); 1987 "kaddressbook_undo" );
1988 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 1988 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z,
1989 this, SLOT( redo() ), actionCollection(), 1989 this, SLOT( redo() ), actionCollection(),
1990 "kaddressbook_redo" ); 1990 "kaddressbook_redo" );
1991 } else { 1991 } else {
1992 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 1992 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
1993 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 1993 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
1994 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 1994 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
1995 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 1995 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
1996 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 1996 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
1997 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 1997 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
1998 } 1998 }
1999 1999
2000 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 2000 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
2001 Key_Delete, this, SLOT( deleteContacts() ), 2001 Key_Delete, this, SLOT( deleteContacts() ),
2002 actionCollection(), "edit_delete" ); 2002 actionCollection(), "edit_delete" );
2003 2003
2004 mActionUndo->setEnabled( false ); 2004 mActionUndo->setEnabled( false );
2005 mActionRedo->setEnabled( false ); 2005 mActionRedo->setEnabled( false );
2006 2006
2007 // settings menu 2007 // settings menu
2008#ifdef KAB_EMBEDDED 2008#ifdef KAB_EMBEDDED
2009//US special menuentry to configure the addressbook resources. On KDE 2009//US special menuentry to configure the addressbook resources. On KDE
2010// you do that through the control center !!! 2010// you do that through the control center !!!
2011 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 2011 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
2012 SLOT( configureResources() ), actionCollection(), 2012 SLOT( configureResources() ), actionCollection(),
2013 "kaddressbook_configure_resources" ); 2013 "kaddressbook_configure_resources" );
2014#endif //KAB_EMBEDDED 2014#endif //KAB_EMBEDDED
2015 2015
2016 if ( mIsPart ) { 2016 if ( mIsPart ) {
2017 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, 2017 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
2018 SLOT( openConfigDialog() ), actionCollection(), 2018 SLOT( openConfigDialog() ), actionCollection(),
2019 "kaddressbook_configure" ); 2019 "kaddressbook_configure" );
2020 2020
2021 //US not implemented yet 2021 //US not implemented yet
2022 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, 2022 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
2023 // this, SLOT( configureKeyBindings() ), actionCollection(), 2023 // this, SLOT( configureKeyBindings() ), actionCollection(),
2024 // "kaddressbook_configure_shortcuts" ); 2024 // "kaddressbook_configure_shortcuts" );
2025#ifdef KAB_EMBEDDED 2025#ifdef KAB_EMBEDDED
2026 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 2026 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
2027 mActionConfigureToolbars->setEnabled( false ); 2027 mActionConfigureToolbars->setEnabled( false );
2028#endif //KAB_EMBEDDED 2028#endif //KAB_EMBEDDED
2029 2029
2030 } else { 2030 } else {
2031 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 2031 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
2032 2032
2033 //US not implemented yet 2033 //US not implemented yet
2034 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 2034 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
2035 } 2035 }
2036 2036
2037 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 2037 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
2038 actionCollection(), "options_show_jump_bar" ); 2038 actionCollection(), "options_show_jump_bar" );
2039 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) ); 2039 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) );
2040 2040
2041 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 2041 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
2042 actionCollection(), "options_show_details" ); 2042 actionCollection(), "options_show_details" );
2043 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); 2043 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
2044 2044
2045 2045
2046 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, 2046 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this,
2047 SLOT( toggleBeamReceive() ), actionCollection(), 2047 SLOT( toggleBeamReceive() ), actionCollection(),
2048 "kaddressbook_beam_rec" ); 2048 "kaddressbook_beam_rec" );
2049 2049
2050 2050
2051 // misc 2051 // misc
2052 // only enable LDAP lookup if we can handle the protocol 2052 // only enable LDAP lookup if we can handle the protocol
2053#ifndef KAB_EMBEDDED 2053#ifndef KAB_EMBEDDED
2054 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { 2054 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
2055 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, 2055 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
2056 this, SLOT( openLDAPDialog() ), actionCollection(), 2056 this, SLOT( openLDAPDialog() ), actionCollection(),
2057 "ldap_lookup" ); 2057 "ldap_lookup" );
2058 } 2058 }
2059#else //KAB_EMBEDDED 2059#else //KAB_EMBEDDED
2060 //qDebug("KABCore::initActions() LDAP has to be implemented"); 2060 //qDebug("KABCore::initActions() LDAP has to be implemented");
2061#endif //KAB_EMBEDDED 2061#endif //KAB_EMBEDDED
2062 2062
2063 2063
2064 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 2064 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
2065 SLOT( setWhoAmI() ), actionCollection(), 2065 SLOT( setWhoAmI() ), actionCollection(),
2066 "set_personal" ); 2066 "set_personal" );
2067 2067
2068 2068
2069 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this, 2069 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this,
2070 SLOT( setCategories() ), actionCollection(), 2070 SLOT( setCategories() ), actionCollection(),
2071 "edit_set_categories" ); 2071 "edit_set_categories" );
2072 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this, 2072 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this,
2073 SLOT( editCategories() ), actionCollection(), 2073 SLOT( editCategories() ), actionCollection(),
2074 "edit__categories" ); 2074 "edit__categories" );
2075 2075
2076 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 2076 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
2077 SLOT( removeVoice() ), actionCollection(), 2077 SLOT( removeVoice() ), actionCollection(),
2078 "remove_voice" ); 2078 "remove_voice" );
2079 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this, 2079 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this,
2080 SLOT( setFormattedName() ), actionCollection(), 2080 SLOT( setFormattedName() ), actionCollection(),
2081 "set_formatted" ); 2081 "set_formatted" );
2082 2082
2083 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, 2083 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this,
2084 SLOT( manageCategories() ), actionCollection(), 2084 SLOT( manageCategories() ), actionCollection(),
2085 "remove_voice" ); 2085 "remove_voice" );
2086 2086
2087 2087
2088 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, 2088 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this,
2089 SLOT( importFromOL() ), actionCollection(), 2089 SLOT( importFromOL() ), actionCollection(),
2090 "import_OL" ); 2090 "import_OL" );
2091#ifdef KAB_EMBEDDED 2091#ifdef KAB_EMBEDDED
2092 mActionLicence = new KAction( i18n( "Licence" ), 0, 2092 mActionLicence = new KAction( i18n( "Licence" ), 0,
2093 this, SLOT( showLicence() ), actionCollection(), 2093 this, SLOT( showLicence() ), actionCollection(),
2094 "licence_about_data" ); 2094 "licence_about_data" );
2095 mActionFaq = new KAction( i18n( "Faq" ), 0, 2095 mActionFaq = new KAction( i18n( "Faq" ), 0,
2096 this, SLOT( faq() ), actionCollection(), 2096 this, SLOT( faq() ), actionCollection(),
2097 "faq_about_data" ); 2097 "faq_about_data" );
2098 mActionWN = new KAction( i18n( "What's New?" ), 0, 2098 mActionWN = new KAction( i18n( "What's New?" ), 0,
2099 this, SLOT( whatsnew() ), actionCollection(), 2099 this, SLOT( whatsnew() ), actionCollection(),
2100 "wn" ); 2100 "wn" );
2101 2101
2102 2102
2103 2103
2104 mActionStorageHowto = new KAction( i18n( "Storage HowTo" ), 0, 2104 mActionStorageHowto = new KAction( i18n( "Storage HowTo" ), 0,
2105 this, SLOT( storagehowto() ), actionCollection(), 2105 this, SLOT( storagehowto() ), actionCollection(),
2106 "storage" ); 2106 "storage" );
2107 2107
2108 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 2108 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
2109 this, SLOT( synchowto() ), actionCollection(), 2109 this, SLOT( synchowto() ), actionCollection(),
2110 "sync" ); 2110 "sync" );
2111 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, 2111 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0,
2112 this, SLOT( kdesynchowto() ), actionCollection(), 2112 this, SLOT( kdesynchowto() ), actionCollection(),
2113 "kdesync" ); 2113 "kdesync" );
2114 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, 2114 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0,
2115 this, SLOT( multisynchowto() ), actionCollection(), 2115 this, SLOT( multisynchowto() ), actionCollection(),
2116 "multisync" ); 2116 "multisync" );
2117 2117
2118 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 2118 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
2119 this, SLOT( createAboutData() ), actionCollection(), 2119 this, SLOT( createAboutData() ), actionCollection(),
2120 "kaddressbook_about_data" ); 2120 "kaddressbook_about_data" );
2121#endif //KAB_EMBEDDED 2121#endif //KAB_EMBEDDED
2122 2122
2123 clipboardDataChanged(); 2123 clipboardDataChanged();
2124 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2124 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2125 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2125 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2126} 2126}
2127 2127
2128//US we need this function, to plug all actions into the correct menues. 2128//US we need this function, to plug all actions into the correct menues.
2129// KDE uses a XML format to plug the actions, but we work her without this overhead. 2129// KDE uses a XML format to plug the actions, but we work her without this overhead.
2130void KABCore::addActionsManually() 2130void KABCore::addActionsManually()
2131{ 2131{
2132//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2132//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2133 2133
2134#ifdef KAB_EMBEDDED 2134#ifdef KAB_EMBEDDED
2135 QPopupMenu *fileMenu = new QPopupMenu( this ); 2135 QPopupMenu *fileMenu = new QPopupMenu( this );
2136 QPopupMenu *editMenu = new QPopupMenu( this ); 2136 QPopupMenu *editMenu = new QPopupMenu( this );
2137 QPopupMenu *helpMenu = new QPopupMenu( this ); 2137 QPopupMenu *helpMenu = new QPopupMenu( this );
2138 2138
2139 KToolBar* tb = mMainWindow->toolBar(); 2139 KToolBar* tb = mMainWindow->toolBar();
2140 mMainWindow->setToolBarsMovable (false ); 2140 mMainWindow->setToolBarsMovable (false );
2141#ifndef DESKTOP_VERSION 2141#ifndef DESKTOP_VERSION
2142 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2142 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2143#endif 2143#endif
2144 QMenuBar* mb = mMainWindow->menuBar(); 2144 QMenuBar* mb = mMainWindow->menuBar();
2145 2145
2146 //US setup menubar. 2146 //US setup menubar.
2147 //Disable the following block if you do not want to have a menubar. 2147 //Disable the following block if you do not want to have a menubar.
2148 mb->insertItem( i18n("&File"), fileMenu ); 2148 mb->insertItem( i18n("&File"), fileMenu );
2149 mb->insertItem( i18n("&Edit"), editMenu ); 2149 mb->insertItem( i18n("&Edit"), editMenu );
2150 mb->insertItem( i18n("&View"), viewMenu ); 2150 mb->insertItem( i18n("&View"), viewMenu );
2151 mb->insertItem( i18n("&Settings"), settingsMenu ); 2151 mb->insertItem( i18n("&Settings"), settingsMenu );
2152#ifdef DESKTOP_VERSION 2152#ifdef DESKTOP_VERSION
2153 mb->insertItem( i18n("Synchronize"), syncMenu ); 2153 mb->insertItem( i18n("Synchronize"), syncMenu );
2154#else 2154#else
2155 mb->insertItem( i18n("Sync"), syncMenu ); 2155 mb->insertItem( i18n("Sync"), syncMenu );
2156#endif 2156#endif
2157 //mb->insertItem( i18n("&Change"), changeMenu ); 2157 //mb->insertItem( i18n("&Change"), changeMenu );
2158 mb->insertItem( i18n("&Help"), helpMenu ); 2158 mb->insertItem( i18n("&Help"), helpMenu );
2159 mIncSearchWidget = new IncSearchWidget( tb ); 2159 mIncSearchWidget = new IncSearchWidget( tb );
2160 // tb->insertWidget(-1, 0, mIncSearchWidget); 2160 // tb->insertWidget(-1, 0, mIncSearchWidget);
2161#ifndef DESKTOP_VERSION 2161#ifndef DESKTOP_VERSION
2162 } else { 2162 } else {
2163 //US setup toolbar 2163 //US setup toolbar
2164 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2164 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2165 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2165 QPopupMenu *popupBarTB = new QPopupMenu( this );
2166 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); 2166 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
2167 tb->insertWidget(-1, 0, menuBarTB); 2167 tb->insertWidget(-1, 0, menuBarTB);
2168 mIncSearchWidget = new IncSearchWidget( tb ); 2168 mIncSearchWidget = new IncSearchWidget( tb );
2169 tb->enableMoving(false); 2169 tb->enableMoving(false);
2170 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2170 popupBarTB->insertItem( i18n("&File"), fileMenu );
2171 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2171 popupBarTB->insertItem( i18n("&Edit"), editMenu );
2172 popupBarTB->insertItem( i18n("&View"), viewMenu ); 2172 popupBarTB->insertItem( i18n("&View"), viewMenu );
2173 popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); 2173 popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
2174 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 2174 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
2175 mViewManager->getFilterAction()->plug ( popupBarTB); 2175 mViewManager->getFilterAction()->plug ( popupBarTB);
2176 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); 2176 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
2177 popupBarTB->insertItem( i18n("&Help"), helpMenu ); 2177 popupBarTB->insertItem( i18n("&Help"), helpMenu );
2178 if (QApplication::desktop()->width() > 320 ) { 2178 if (QApplication::desktop()->width() > 320 ) {
2179 // mViewManager->getFilterAction()->plug ( tb); 2179 // mViewManager->getFilterAction()->plug ( tb);
2180 } 2180 }
2181 } 2181 }
2182#endif 2182#endif
2183 mIncSearchWidget->setSize(); 2183 mIncSearchWidget->setSize();
2184 // mActionQuit->plug ( mMainWindow->toolBar()); 2184 // mActionQuit->plug ( mMainWindow->toolBar());
2185 2185
2186 2186
2187 2187
2188 //US Now connect the actions with the menue entries. 2188 //US Now connect the actions with the menue entries.
2189#ifdef DESKTOP_VERSION 2189#ifdef DESKTOP_VERSION
2190 mActionPrint->plug( fileMenu ); 2190 mActionPrint->plug( fileMenu );
2191 mActionPrintDetails->plug( fileMenu ); 2191 mActionPrintDetails->plug( fileMenu );
2192 fileMenu->insertSeparator(); 2192 fileMenu->insertSeparator();
2193#endif 2193#endif
2194 mActionMail->plug( fileMenu ); 2194 mActionMail->plug( fileMenu );
2195 fileMenu->insertSeparator(); 2195 fileMenu->insertSeparator();
2196 2196
2197 mActionNewContact->plug( editMenu ); 2197 mActionNewContact->plug( editMenu );
2198 mActionNewContact->plug( tb ); 2198 mActionNewContact->plug( tb );
2199 2199
2200 mActionEditAddressee->plug( editMenu ); 2200 mActionEditAddressee->plug( editMenu );
2201 editMenu->insertSeparator(); 2201 editMenu->insertSeparator();
2202 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 2202 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
2203 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 2203 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
2204 mActionEditAddressee->plug( tb ); 2204 mActionEditAddressee->plug( tb );
2205 2205
2206 // fileMenu->insertSeparator(); 2206 // fileMenu->insertSeparator();
2207 mActionSave->plug( fileMenu ); 2207 mActionSave->plug( fileMenu );
2208 fileMenu->insertItem( "&Import", ImportMenu ); 2208 fileMenu->insertItem( "&Import", ImportMenu );
2209 fileMenu->insertItem( "&Export", ExportMenu ); 2209 fileMenu->insertItem( "&Export", ExportMenu );
2210 editMenu->insertItem( i18n("&Change"), changeMenu ); 2210 editMenu->insertItem( i18n("&Change"), changeMenu );
2211 editMenu->insertSeparator(); 2211 editMenu->insertSeparator();
2212#ifndef DESKTOP_VERSION 2212#ifndef DESKTOP_VERSION
2213 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); 2213 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu );
2214#endif 2214#endif
2215#if 0 2215#if 0
2216 // PENDING fix MailVCard 2216 // PENDING fix MailVCard
2217 fileMenu->insertSeparator(); 2217 fileMenu->insertSeparator();
2218 mActionMailVCard->plug( fileMenu ); 2218 mActionMailVCard->plug( fileMenu );
2219#endif 2219#endif
2220#ifndef DESKTOP_VERSION 2220#ifndef DESKTOP_VERSION
2221 if ( Ir::supported() ) mActionBR->plug( beamMenu ); 2221 if ( Ir::supported() ) mActionBR->plug( beamMenu );
2222 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu ); 2222 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
2223 if ( Ir::supported() ) mActionBeam->plug( beamMenu ); 2223 if ( Ir::supported() ) mActionBeam->plug( beamMenu );
2224#endif 2224#endif
2225 fileMenu->insertSeparator(); 2225 fileMenu->insertSeparator();
2226 mActionQuit->plug( fileMenu ); 2226 mActionQuit->plug( fileMenu );
2227#ifdef _OL_IMPORT_ 2227#ifdef _OL_IMPORT_
2228 mActionImportOL->plug( ImportMenu ); 2228 mActionImportOL->plug( ImportMenu );
2229#endif 2229#endif
2230 // edit menu 2230 // edit menu
2231 mActionUndo->plug( editMenu ); 2231 mActionUndo->plug( editMenu );
2232 mActionRedo->plug( editMenu ); 2232 mActionRedo->plug( editMenu );
2233 editMenu->insertSeparator(); 2233 editMenu->insertSeparator();
2234 mActionCut->plug( editMenu ); 2234 mActionCut->plug( editMenu );
2235 mActionCopy->plug( editMenu ); 2235 mActionCopy->plug( editMenu );
2236 mActionPaste->plug( editMenu ); 2236 mActionPaste->plug( editMenu );
2237 mActionDelete->plug( editMenu ); 2237 mActionDelete->plug( editMenu );
2238 editMenu->insertSeparator(); 2238 editMenu->insertSeparator();
2239 mActionSelectAll->plug( editMenu ); 2239 mActionSelectAll->plug( editMenu );
2240 2240
2241 mActionSetFormattedName->plug( changeMenu ); 2241 mActionSetFormattedName->plug( changeMenu );
2242 mActionRemoveVoice->plug( changeMenu ); 2242 mActionRemoveVoice->plug( changeMenu );
2243 // settingsmings menu 2243 // settingsmings menu
2244//US special menuentry to configure the addressbook resources. On KDE 2244//US special menuentry to configure the addressbook resources. On KDE
2245// you do that through the control center !!! 2245// you do that through the control center !!!
2246 // settingsMenu->insertSeparator(); 2246 // settingsMenu->insertSeparator();
2247 2247
2248 mActionConfigKAddressbook->plug( settingsMenu, 0 ); 2248 mActionConfigKAddressbook->plug( settingsMenu, 0 );
2249 mActionConfigResources->plug( settingsMenu,1 ); 2249 mActionConfigResources->plug( settingsMenu,1 );
2250 settingsMenu->insertSeparator(2); 2250 settingsMenu->insertSeparator(2);
2251 2251
2252 if ( mIsPart ) { 2252 if ( mIsPart ) {
2253 //US not implemented yet 2253 //US not implemented yet
2254 //mActionConfigShortcuts->plug( settingsMenu ); 2254 //mActionConfigShortcuts->plug( settingsMenu );
2255 //mActionConfigureToolbars->plug( settingsMenu ); 2255 //mActionConfigureToolbars->plug( settingsMenu );
2256 2256
2257 } else { 2257 } else {
2258 //US not implemented yet 2258 //US not implemented yet
2259 //mActionKeyBindings->plug( settingsMenu ); 2259 //mActionKeyBindings->plug( settingsMenu );
2260 } 2260 }
2261 2261
2262 mActionEditCategories->plug( settingsMenu ); 2262 mActionEditCategories->plug( settingsMenu );
2263 mActionManageCategories->plug( settingsMenu ); 2263 mActionManageCategories->plug( settingsMenu );
2264 mActionJumpBar->plug( viewMenu,0 ); 2264 mActionJumpBar->plug( viewMenu,0 );
2265 mActionDetails->plug( viewMenu,0 ); 2265 mActionDetails->plug( viewMenu,0 );
2266 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 2266 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
2267 mActionDetails->plug( tb ); 2267 mActionDetails->plug( tb );
2268 settingsMenu->insertSeparator(); 2268 settingsMenu->insertSeparator();
2269#ifndef DESKTOP_VERSION 2269#ifndef DESKTOP_VERSION
2270 if ( Ir::supported() ) mActionBR->plug(settingsMenu ); 2270 if ( Ir::supported() ) mActionBR->plug(settingsMenu );
2271 settingsMenu->insertSeparator(); 2271 settingsMenu->insertSeparator();
2272#endif 2272#endif
2273 2273
2274 mActionWhoAmI->plug( settingsMenu ); 2274 mActionWhoAmI->plug( settingsMenu );
2275 //mActionEditCategories->plug( changeMenu ); 2275 //mActionEditCategories->plug( changeMenu );
2276 mActionCategories->plug( changeMenu ); 2276 mActionCategories->plug( changeMenu );
2277 //mActionManageCategories->plug( changeMenu ); 2277 //mActionManageCategories->plug( changeMenu );
2278 2278
2279 //mActionCategories->plug( settingsMenu ); 2279 //mActionCategories->plug( settingsMenu );
2280 2280
2281 2281
2282 mActionWN->plug( helpMenu ); 2282 mActionWN->plug( helpMenu );
2283 mActionStorageHowto->plug( helpMenu ); 2283 mActionStorageHowto->plug( helpMenu );
2284 mActionSyncHowto->plug( helpMenu ); 2284 mActionSyncHowto->plug( helpMenu );
2285 mActionKdeSyncHowto->plug( helpMenu ); 2285 mActionKdeSyncHowto->plug( helpMenu );
2286 mActionMultiSyncHowto->plug( helpMenu ); 2286 mActionMultiSyncHowto->plug( helpMenu );
2287 mActionFaq->plug( helpMenu ); 2287 mActionFaq->plug( helpMenu );
2288 mActionLicence->plug( helpMenu ); 2288 mActionLicence->plug( helpMenu );
2289 mActionAboutKAddressbook->plug( helpMenu ); 2289 mActionAboutKAddressbook->plug( helpMenu );
2290 2290
2291 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 2291 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
2292 2292
2293 mActionSave->plug( tb ); 2293 mActionSave->plug( tb );
2294 mViewManager->getFilterAction()->plug ( tb); 2294 mViewManager->getFilterAction()->plug ( tb);
2295 //LR hide filteraction on started in 480x640 2295 //LR hide filteraction on started in 480x640
2296 if (QApplication::desktop()->width() == 480 ) { 2296 if (QApplication::desktop()->width() == 480 ) {
2297 mViewManager->getFilterAction()->setComboWidth( 0 ); 2297 mViewManager->getFilterAction()->setComboWidth( 0 );
2298 } 2298 }
2299 mActionUndo->plug( tb ); 2299 mActionUndo->plug( tb );
2300 mActionDelete->plug( tb ); 2300 mActionDelete->plug( tb );
2301 mActionRedo->plug( tb ); 2301 mActionRedo->plug( tb );
2302 } else { 2302 } else {
2303 mActionSave->plug( tb ); 2303 mActionSave->plug( tb );
2304 tb->enableMoving(false); 2304 tb->enableMoving(false);
2305 } 2305 }
2306 //mActionQuit->plug ( tb ); 2306 //mActionQuit->plug ( tb );
2307 //tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2307 //tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2308 2308
2309 //US link the searchwidget first to this. 2309 //US link the searchwidget first to this.
2310 // The real linkage to the toolbar happens later. 2310 // The real linkage to the toolbar happens later.
2311//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2311//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2312//US tb->insertItem( mIncSearchWidget ); 2312//US tb->insertItem( mIncSearchWidget );
2313/*US 2313/*US
2314 mIncSearchWidget = new IncSearchWidget( tb ); 2314 mIncSearchWidget = new IncSearchWidget( tb );
2315 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 2315 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
2316 SLOT( incrementalSearch( const QString& ) ) ); 2316 SLOT( incrementalSearch( const QString& ) ) );
2317 2317
2318 mJumpButtonBar = new JumpButtonBar( this, this ); 2318 mJumpButtonBar = new JumpButtonBar( this, this );
2319 2319
2320//US topLayout->addWidget( mJumpButtonBar ); 2320//US topLayout->addWidget( mJumpButtonBar );
2321 this->layout()->add( mJumpButtonBar ); 2321 this->layout()->add( mJumpButtonBar );
2322*/ 2322*/
2323 2323
2324#endif //KAB_EMBEDDED 2324#endif //KAB_EMBEDDED
2325 2325
2326 mActionExport2phone->plug( ExportMenu ); 2326 mActionExport2phone->plug( ExportMenu );
2327 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 2327 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
2328 syncManager->fillSyncMenu(); 2328 syncManager->fillSyncMenu();
2329 2329
2330} 2330}
2331void KABCore::showLicence() 2331void KABCore::showLicence()
2332{ 2332{
2333 KApplication::showLicence(); 2333 KApplication::showLicence();
2334} 2334}
2335 2335
2336void KABCore::manageCategories( ) 2336void KABCore::manageCategories( )
2337{ 2337{
2338 KABCatPrefs* cp = new KABCatPrefs(); 2338 KABCatPrefs* cp = new KABCatPrefs();
2339 cp->show(); 2339 cp->show();
2340 int w =cp->sizeHint().width() ; 2340 int w =cp->sizeHint().width() ;
2341 int h = cp->sizeHint().height() ; 2341 int h = cp->sizeHint().height() ;
2342 int dw = QApplication::desktop()->width(); 2342 int dw = QApplication::desktop()->width();
2343 int dh = QApplication::desktop()->height(); 2343 int dh = QApplication::desktop()->height();
2344 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2344 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2345 if ( !cp->exec() ) { 2345 if ( !cp->exec() ) {
2346 delete cp; 2346 delete cp;
2347 return; 2347 return;
2348 } 2348 }
2349 int count = 0; 2349 int count = 0;
2350 int cc = 0; 2350 int cc = 0;
2351 message( i18n("Please wait, processing categories...")); 2351 message( i18n("Please wait, processing categories..."));
2352 if ( cp->addCat() ) { 2352 if ( cp->addCat() ) {
2353 KABC::AddressBook::Iterator it; 2353 KABC::AddressBook::Iterator it;
2354 QStringList catList = KABPrefs::instance()->mCustomCategories; 2354 QStringList catList = KABPrefs::instance()->mCustomCategories;
2355 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2355 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2356 ++cc; 2356 ++cc;
2357 if ( cc %10 == 0) 2357 if ( cc %10 == 0)
2358 message(i18n("Processing contact #%1").arg(cc)); 2358 message(i18n("Processing contact #%1").arg(cc));
2359 QStringList catIncList = (*it).categories(); 2359 QStringList catIncList = (*it).categories();
2360 int i; 2360 int i;
2361 for( i = 0; i< catIncList.count(); ++i ) { 2361 for( i = 0; i< catIncList.count(); ++i ) {
2362 if ( !catList.contains (catIncList[i])) { 2362 if ( !catList.contains (catIncList[i])) {
2363 catList.append( catIncList[i] ); 2363 catList.append( catIncList[i] );
2364 //qDebug("add cat %s ", catIncList[i].latin1()); 2364 //qDebug("add cat %s ", catIncList[i].latin1());
2365 ++count; 2365 ++count;
2366 } 2366 }
2367 } 2367 }
2368 } 2368 }
2369 catList.sort(); 2369 catList.sort();
2370 KABPrefs::instance()->mCustomCategories = catList; 2370 KABPrefs::instance()->mCustomCategories = catList;
2371 KABPrefs::instance()->writeConfig(); 2371 KABPrefs::instance()->writeConfig();
2372 message(QString::number( count )+ i18n(" categories added to list! ")); 2372 message(QString::number( count )+ i18n(" categories added to list! "));
2373 } else { 2373 } else {
2374 QStringList catList = KABPrefs::instance()->mCustomCategories; 2374 QStringList catList = KABPrefs::instance()->mCustomCategories;
2375 QStringList catIncList; 2375 QStringList catIncList;
2376 QStringList newCatList; 2376 QStringList newCatList;
2377 KABC::AddressBook::Iterator it; 2377 KABC::AddressBook::Iterator it;
2378 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2378 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2379 ++cc; 2379 ++cc;
2380 if ( cc %10 == 0) 2380 if ( cc %10 == 0)
2381 message(i18n("Processing contact #%1").arg(cc)); 2381 message(i18n("Processing contact #%1").arg(cc));
2382 QStringList catIncList = (*it).categories(); 2382 QStringList catIncList = (*it).categories();
2383 int i; 2383 int i;
2384 if ( catIncList.count() ) { 2384 if ( catIncList.count() ) {
2385 newCatList.clear(); 2385 newCatList.clear();
2386 for( i = 0; i< catIncList.count(); ++i ) { 2386 for( i = 0; i< catIncList.count(); ++i ) {
2387 if ( catList.contains (catIncList[i])) { 2387 if ( catList.contains (catIncList[i])) {
2388 newCatList.append( catIncList[i] ); 2388 newCatList.append( catIncList[i] );
2389 } 2389 }
2390 } 2390 }
2391 newCatList.sort(); 2391 newCatList.sort();
2392 (*it).setCategories( newCatList ); 2392 (*it).setCategories( newCatList );
2393 mAddressBook->insertAddressee( (*it) ); 2393 mAddressBook->insertAddressee( (*it) );
2394 } 2394 }
2395 } 2395 }
2396 setModified( true ); 2396 setModified( true );
2397 mViewManager->refreshView(); 2397 mViewManager->refreshView();
2398 message( i18n("Removing categories done!")); 2398 message( i18n("Removing categories done!"));
2399 } 2399 }
2400 delete cp; 2400 delete cp;
2401} 2401}
2402void KABCore::removeVoice() 2402void KABCore::removeVoice()
2403{ 2403{
2404 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No ) 2404 if ( KMessageBox::questionYesNo( this, i18n("After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as \"other\".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?") ) == KMessageBox::No )
2405 return; 2405 return;
2406 XXPortSelectDialog dlg( this, false, this ); 2406 XXPortSelectDialog dlg( this, false, this );
2407 if ( !dlg.exec() ) 2407 if ( !dlg.exec() )
2408 return; 2408 return;
2409 mAddressBook->setUntagged(); 2409 mAddressBook->setUntagged();
2410 dlg.tagSelected(); 2410 dlg.tagSelected();
2411 message(i18n("Removing voice..."), false ); 2411 message(i18n("Removing voice..."), false );
2412 KABC::AddressBook::Iterator it; 2412 KABC::AddressBook::Iterator it;
2413 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2413 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2414 if ( (*it).tagged() ) { 2414 if ( (*it).tagged() ) {
2415 (*it).removeVoice(); 2415 (*it).removeVoice();
2416 } 2416 }
2417 } 2417 }
2418 message(i18n("Refreshing view...") ); 2418 message(i18n("Refreshing view...") );
2419 qApp->processEvents(); 2419 qApp->processEvents();
2420 mViewManager->refreshView( "" ); 2420 mViewManager->refreshView( "" );
2421 Addressee add; 2421 Addressee add;
2422 mDetails->setAddressee( add ); 2422 mDetails->setAddressee( add );
2423 message(i18n("Remove voice completed!") ); 2423 message(i18n("Remove voice completed!") );
2424 2424
2425 2425
2426 2426
2427} 2427}
2428 2428
2429void KABCore::setFormattedName() 2429void KABCore::setFormattedName()
2430{ 2430{
2431 KABFormatPrefs setpref; 2431 KABFormatPrefs setpref;
2432 if ( !setpref.exec() ) { 2432 if ( !setpref.exec() ) {
2433 return; 2433 return;
2434 } 2434 }
2435 XXPortSelectDialog dlg( this, false, this ); 2435 XXPortSelectDialog dlg( this, false, this );
2436 if ( !dlg.exec() ) 2436 if ( !dlg.exec() )
2437 return; 2437 return;
2438 mAddressBook->setUntagged(); 2438 mAddressBook->setUntagged();
2439 dlg.tagSelected(); 2439 dlg.tagSelected();
2440 int count = 0; 2440 int count = 0;
2441 KABC::AddressBook::Iterator it; 2441 KABC::AddressBook::Iterator it;
2442 bool modified = false;
2442 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2443 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2443 if ( (*it).tagged() ) { 2444 if ( (*it).tagged() ) {
2445 if ( (*it).uid().left( 2 ) == "la" )
2446 if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") )
2447 continue;
2444 ++count; 2448 ++count;
2445 if ( count %10 == 0 ) 2449 if ( count %10 == 0 )
2446 message(i18n("Changing contact #%1").arg( count ) ); 2450 message(i18n("Changing contact #%1").arg( count ) );
2447 qApp->processEvents(); 2451 qApp->processEvents();
2448 QString fName; 2452 QString fName;
2449 if ( setpref.simple->isChecked() ) 2453 if ( setpref.simple->isChecked() )
2450 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); 2454 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName );
2451 else if ( setpref.full->isChecked() ) 2455 else if ( setpref.full->isChecked() )
2452 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); 2456 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName );
2453 else if ( setpref.reverse->isChecked() ) 2457 else if ( setpref.reverse->isChecked() )
2454 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); 2458 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName );
2455 else 2459 else
2456 fName = (*it).organization(); 2460 fName = (*it).organization();
2457 if ( setpref.setCompany->isChecked() ) 2461 if ( setpref.setCompany->isChecked() )
2458 if ( fName.isEmpty() || fName =="," ) 2462 if ( fName.isEmpty() || fName =="," )
2459 fName = (*it).organization(); 2463 fName = (*it).organization();
2460 (*it).setFormattedName( fName ); 2464 (*it).setFormattedName( fName );
2465 (*it).setChanged( true );
2466 modified = true;
2467 (*it).setRevision( QDateTime::currentDateTime() );
2461 } 2468 }
2462 } 2469 }
2463 message(i18n("Refreshing view...") ); 2470 message(i18n("Refreshing view...") );
2464 qApp->processEvents(); 2471 qApp->processEvents();
2465 mViewManager->refreshView( "" ); 2472 if ( modified )
2473 setModified( true );
2466 Addressee add; 2474 Addressee add;
2467 mDetails->setAddressee( add ); 2475 mDetails->setAddressee( add );
2468 message(i18n("Setting formatted name completed!") ); 2476 if ( count == 0 )
2477 message(i18n("No contact changed!") );
2478 else
2479 message(i18n("%1 contacts changed!").arg( count ) );
2469} 2480}
2470 2481
2471void KABCore::clipboardDataChanged() 2482void KABCore::clipboardDataChanged()
2472{ 2483{
2473 2484
2474 if ( mReadWrite ) 2485 if ( mReadWrite )
2475 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 2486 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
2476 2487
2477} 2488}
2478 2489
2479void KABCore::updateActionMenu() 2490void KABCore::updateActionMenu()
2480{ 2491{
2481 UndoStack *undo = UndoStack::instance(); 2492 UndoStack *undo = UndoStack::instance();
2482 RedoStack *redo = RedoStack::instance(); 2493 RedoStack *redo = RedoStack::instance();
2483 2494
2484 if ( undo->isEmpty() ) 2495 if ( undo->isEmpty() )
2485 mActionUndo->setText( i18n( "Undo" ) ); 2496 mActionUndo->setText( i18n( "Undo" ) );
2486 else 2497 else
2487 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 2498 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
2488 2499
2489 mActionUndo->setEnabled( !undo->isEmpty() ); 2500 mActionUndo->setEnabled( !undo->isEmpty() );
2490 2501
2491 if ( !redo->top() ) 2502 if ( !redo->top() )
2492 mActionRedo->setText( i18n( "Redo" ) ); 2503 mActionRedo->setText( i18n( "Redo" ) );
2493 else 2504 else
2494 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 2505 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
2495 2506
2496 mActionRedo->setEnabled( !redo->isEmpty() ); 2507 mActionRedo->setEnabled( !redo->isEmpty() );
2497} 2508}
2498 2509
2499void KABCore::configureKeyBindings() 2510void KABCore::configureKeyBindings()
2500{ 2511{
2501#ifndef KAB_EMBEDDED 2512#ifndef KAB_EMBEDDED
2502 KKeyDialog::configure( actionCollection(), true ); 2513 KKeyDialog::configure( actionCollection(), true );
2503#else //KAB_EMBEDDED 2514#else //KAB_EMBEDDED
2504 qDebug("KABCore::configureKeyBindings() not implemented"); 2515 qDebug("KABCore::configureKeyBindings() not implemented");
2505#endif //KAB_EMBEDDED 2516#endif //KAB_EMBEDDED
2506} 2517}
2507 2518
2508#ifdef KAB_EMBEDDED 2519#ifdef KAB_EMBEDDED
2509void KABCore::configureResources() 2520void KABCore::configureResources()
2510{ 2521{
2511 KRES::KCMKResources dlg( this, "" , 0 ); 2522 KRES::KCMKResources dlg( this, "" , 0 );
2512 2523
2513 if ( !dlg.exec() ) 2524 if ( !dlg.exec() )
2514 return; 2525 return;
2515 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2526 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2516} 2527}
2517#endif //KAB_EMBEDDED 2528#endif //KAB_EMBEDDED
2518 2529
2519 2530
2520/* this method will be called through the QCop interface from Ko/Pi to select addresses 2531/* this method will be called through the QCop interface from Ko/Pi to select addresses
2521 * for the attendees list of an event. 2532 * for the attendees list of an event.
2522 */ 2533 */
2523void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2534void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2524{ 2535{
2525 2536
2526 bool ok = false; 2537 bool ok = false;
2527 mEmailSourceChannel = sourceChannel; 2538 mEmailSourceChannel = sourceChannel;
2528 mEmailSourceUID = uid; 2539 mEmailSourceUID = uid;
2529 callContactdialog(); 2540 callContactdialog();
2530#if 0 2541#if 0
2531 int wid = uid.toInt( &ok ); 2542 int wid = uid.toInt( &ok );
2532 qDebug("UID %s ", uid.latin1()); 2543 qDebug("UID %s ", uid.latin1());
2533 if ( ok ) { 2544 if ( ok ) {
2534 if ( wid != QApplication::desktop()->width() ) { 2545 if ( wid != QApplication::desktop()->width() ) {
2535 qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); 2546 qDebug("KA/Pi: Request from different desktop geometry. Resizing ...");
2536 message( i18n("Resizing, please wait...") ); 2547 message( i18n("Resizing, please wait...") );
2537 mMainWindow->showMinimized(); 2548 mMainWindow->showMinimized();
2538 /* 2549 /*
2539 { 2550 {
2540 QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); 2551 QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
2541 } 2552 }
2542 */ 2553 */
2543 QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); 2554 QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) );
2544 return; 2555 return;
2545 } 2556 }
2546 2557
2547 } else { 2558 } else {
2548 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); 2559 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid ");
2549 } 2560 }
2550 callContactdialog(); 2561 callContactdialog();
2551 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); 2562 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
2552#endif 2563#endif
2553} 2564}
2554void KABCore::resizeAndCallContactdialog() 2565void KABCore::resizeAndCallContactdialog()
2555{ 2566{
2556 updateMainWindow(); 2567 updateMainWindow();
2557 QTimer::singleShot( 100,this, SLOT ( callContactdialog() ) ); 2568 QTimer::singleShot( 100,this, SLOT ( callContactdialog() ) );
2558} 2569}
2559 2570
2560void KABCore::callContactdialog() 2571void KABCore::callContactdialog()
2561{ 2572{
2562 QStringList nameList; 2573 QStringList nameList;
2563 QStringList emailList; 2574 QStringList emailList;
2564 QStringList uidList; 2575 QStringList uidList;
2565 qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() ); 2576 qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() );
2566 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2577 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2567 uint i=0; 2578 uint i=0;
2568 for (i=0; i < list.count(); i++) 2579 for (i=0; i < list.count(); i++)
2569 { 2580 {
2570 nameList.append(list[i].realName()); 2581 nameList.append(list[i].realName());
2571 emailList.append(list[i].preferredEmail()); 2582 emailList.append(list[i].preferredEmail());
2572 uidList.append(list[i].uid()); 2583 uidList.append(list[i].uid());
2573 } 2584 }
2574 QString uid = mEmailSourceUID; 2585 QString uid = mEmailSourceUID;
2575 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); 2586 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1());
2576 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); 2587 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList);
2577 2588
2578} 2589}
2579/* this method will be called through the QCop interface from Ko/Pi to select birthdays 2590/* this method will be called through the QCop interface from Ko/Pi to select birthdays
2580 * to put them into the calendar. 2591 * to put them into the calendar.
2581 */ 2592 */
2582void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) 2593void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
2583{ 2594{
2584 // qDebug("KABCore::requestForBirthdayList"); 2595 // qDebug("KABCore::requestForBirthdayList");
2585 QStringList birthdayList; 2596 QStringList birthdayList;
2586 QStringList anniversaryList; 2597 QStringList anniversaryList;
2587 QStringList realNameList; 2598 QStringList realNameList;
2588 QStringList preferredEmailList; 2599 QStringList preferredEmailList;
2589 QStringList assembledNameList; 2600 QStringList assembledNameList;
2590 QStringList uidList; 2601 QStringList uidList;
2591 2602
2592 KABC::AddressBook::Iterator it; 2603 KABC::AddressBook::Iterator it;
2593 2604
2594 int count = 0; 2605 int count = 0;
2595 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2606 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2596 ++count; 2607 ++count;
2597 } 2608 }
2598 QProgressBar bar(count,0 ); 2609 QProgressBar bar(count,0 );
2599 int w = 300; 2610 int w = 300;
2600 if ( QApplication::desktop()->width() < 320 ) 2611 if ( QApplication::desktop()->width() < 320 )
2601 w = 220; 2612 w = 220;
2602 int h = bar.sizeHint().height() ; 2613 int h = bar.sizeHint().height() ;
2603 int dw = QApplication::desktop()->width(); 2614 int dw = QApplication::desktop()->width();
2604 int dh = QApplication::desktop()->height(); 2615 int dh = QApplication::desktop()->height();
2605 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2616 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2606 bar.show(); 2617 bar.show();
2607 bar.setCaption (i18n("Collecting birthdays - close to abort!") ); 2618 bar.setCaption (i18n("Collecting birthdays - close to abort!") );
2608 qApp->processEvents(); 2619 qApp->processEvents();
2609 2620
2610 QDate bday; 2621 QDate bday;
2611 QString anni; 2622 QString anni;
2612 QString formattedbday; 2623 QString formattedbday;
2613 2624
2614 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) 2625 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it )
2615 { 2626 {
2616 if ( ! bar.isVisible() ) 2627 if ( ! bar.isVisible() )
2617 return; 2628 return;
2618 bar.setProgress( count++ ); 2629 bar.setProgress( count++ );
2619 qApp->processEvents(); 2630 qApp->processEvents();
2620 bday = (*it).birthday().date(); 2631 bday = (*it).birthday().date();
2621 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); 2632 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" );
2622 2633
2623 if ( bday.isValid() || !anni.isEmpty()) 2634 if ( bday.isValid() || !anni.isEmpty())
2624 { 2635 {
2625 if (bday.isValid()) 2636 if (bday.isValid())
2626 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); 2637 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate);
2627 else 2638 else
2628 formattedbday = "NOTVALID"; 2639 formattedbday = "NOTVALID";
2629 if (anni.isEmpty()) 2640 if (anni.isEmpty())
2630 anni = "INVALID"; 2641 anni = "INVALID";
2631 2642
2632 birthdayList.append(formattedbday); 2643 birthdayList.append(formattedbday);
2633 anniversaryList.append(anni); //should be ISODate 2644 anniversaryList.append(anni); //should be ISODate
2634 realNameList.append((*it).realName()); 2645 realNameList.append((*it).realName());
2635 preferredEmailList.append((*it).preferredEmail()); 2646 preferredEmailList.append((*it).preferredEmail());
2636 assembledNameList.append((*it).assembledName()); 2647 assembledNameList.append((*it).assembledName());
2637 uidList.append((*it).uid()); 2648 uidList.append((*it).uid());
2638 2649
2639 //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); 2650 //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() );
2640 } 2651 }
2641 } 2652 }
2642 2653
2643 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); 2654 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList);
2644 2655
2645} 2656}
2646 2657
2647/* this method will be called through the QCop interface from other apps to show details of a contact. 2658/* this method will be called through the QCop interface from other apps to show details of a contact.
2648 */ 2659 */
2649void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2660void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2650{ 2661{
2651 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2662 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2652 2663
2653 QString foundUid = QString::null; 2664 QString foundUid = QString::null;
2654 if ( ! uid.isEmpty() ) { 2665 if ( ! uid.isEmpty() ) {
2655 Addressee adrr = mAddressBook->findByUid( uid ); 2666 Addressee adrr = mAddressBook->findByUid( uid );
2656 if ( !adrr.isEmpty() ) { 2667 if ( !adrr.isEmpty() ) {
2657 foundUid = uid; 2668 foundUid = uid;
2658 } 2669 }
2659 if ( email == "sendbacklist" ) { 2670 if ( email == "sendbacklist" ) {
2660 //qDebug("ssssssssssssssssssssssend "); 2671 //qDebug("ssssssssssssssssssssssend ");
2661 QStringList nameList; 2672 QStringList nameList;
2662 QStringList emailList; 2673 QStringList emailList;
2663 QStringList uidList; 2674 QStringList uidList;
2664 nameList.append(adrr.realName()); 2675 nameList.append(adrr.realName());
2665 emailList = adrr.emails(); 2676 emailList = adrr.emails();
2666 uidList.append( adrr.preferredEmail()); 2677 uidList.append( adrr.preferredEmail());
2667 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 2678 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
2668 return; 2679 return;
2669 } 2680 }
2670 2681
2671 } 2682 }
2672 2683
2673 if ( email == "sendbacklist" ) 2684 if ( email == "sendbacklist" )
2674 return; 2685 return;
2675 if (foundUid.isEmpty()) 2686 if (foundUid.isEmpty())
2676 { 2687 {
2677 //find the uid of the person first 2688 //find the uid of the person first
2678 Addressee::List namelist; 2689 Addressee::List namelist;
2679 Addressee::List emaillist; 2690 Addressee::List emaillist;
2680 2691
2681 if (!name.isEmpty()) 2692 if (!name.isEmpty())
2682 namelist = mAddressBook->findByName( name ); 2693 namelist = mAddressBook->findByName( name );
2683 2694
2684 if (!email.isEmpty()) 2695 if (!email.isEmpty())
2685 emaillist = mAddressBook->findByEmail( email ); 2696 emaillist = mAddressBook->findByEmail( email );
2686 //qDebug("count %d %d ", namelist.count(),emaillist.count() ); 2697 //qDebug("count %d %d ", namelist.count(),emaillist.count() );
2687 //check if we have a match in Namelist and Emaillist 2698 //check if we have a match in Namelist and Emaillist
2688 if ((namelist.count() == 0) && (emaillist.count() > 0)) { 2699 if ((namelist.count() == 0) && (emaillist.count() > 0)) {
2689 foundUid = emaillist[0].uid(); 2700 foundUid = emaillist[0].uid();
2690 } 2701 }
2691 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2702 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2692 foundUid = namelist[0].uid(); 2703 foundUid = namelist[0].uid();
2693 else 2704 else
2694 { 2705 {
2695 for (int i = 0; i < namelist.count(); i++) 2706 for (int i = 0; i < namelist.count(); i++)
2696 { 2707 {
2697 for (int j = 0; j < emaillist.count(); j++) 2708 for (int j = 0; j < emaillist.count(); j++)
2698 { 2709 {
2699 if (namelist[i] == emaillist[j]) 2710 if (namelist[i] == emaillist[j])
2700 { 2711 {
2701 foundUid = namelist[i].uid(); 2712 foundUid = namelist[i].uid();
2702 } 2713 }
2703 } 2714 }
2704 } 2715 }
2705 } 2716 }
2706 } 2717 }
2707 else 2718 else
2708 { 2719 {
2709 foundUid = uid; 2720 foundUid = uid;
2710 } 2721 }
2711 2722
2712 if (!foundUid.isEmpty()) 2723 if (!foundUid.isEmpty())
2713 { 2724 {
2714 2725
2715 // raise Ka/Pi if it is in the background 2726 // raise Ka/Pi if it is in the background
2716#ifndef DESKTOP_VERSION 2727#ifndef DESKTOP_VERSION
2717#ifndef KORG_NODCOP 2728#ifndef KORG_NODCOP
2718 //QCopEnvelope e("QPE/Application/kapi", "raise()"); 2729 //QCopEnvelope e("QPE/Application/kapi", "raise()");
2719#endif 2730#endif
2720#endif 2731#endif
2721 2732
2722 mMainWindow->showMaximized(); 2733 mMainWindow->showMaximized();
2723 mMainWindow-> raise(); 2734 mMainWindow-> raise();
2724 2735
2725 mViewManager->setSelected( "", false); 2736 mViewManager->setSelected( "", false);
2726 mViewManager->refreshView( "" ); 2737 mViewManager->refreshView( "" );
2727 mViewManager->setSelected( foundUid, true ); 2738 mViewManager->setSelected( foundUid, true );
2728 mViewManager->refreshView( foundUid ); 2739 mViewManager->refreshView( foundUid );
2729 2740
2730 if ( !mMultipleViewsAtOnce ) 2741 if ( !mMultipleViewsAtOnce )
2731 { 2742 {
2732 setDetailsVisible( true ); 2743 setDetailsVisible( true );
2733 mActionDetails->setChecked(true); 2744 mActionDetails->setChecked(true);
2734 } 2745 }
2735 } 2746 }
2736} 2747}
2737void KABCore::storagehowto() 2748void KABCore::storagehowto()
2738{ 2749{
2739 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); 2750 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" );
2740} 2751}
2741void KABCore::whatsnew() 2752void KABCore::whatsnew()
2742{ 2753{
2743 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 2754 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
2744} 2755}
2745void KABCore::synchowto() 2756void KABCore::synchowto()
2746{ 2757{
2747 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 2758 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
2748} 2759}
2749void KABCore::kdesynchowto() 2760void KABCore::kdesynchowto()
2750{ 2761{
2751 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 2762 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
2752} 2763}
2753void KABCore::multisynchowto() 2764void KABCore::multisynchowto()
2754{ 2765{
2755 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 2766 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
2756} 2767}
2757void KABCore::faq() 2768void KABCore::faq()
2758{ 2769{
2759 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); 2770 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" );
2760} 2771}
2761 2772
2762#include <libkcal/syncdefines.h> 2773#include <libkcal/syncdefines.h>
2763 2774
2764KABC::Addressee KABCore::getLastSyncAddressee() 2775KABC::Addressee KABCore::getLastSyncAddressee()
2765{ 2776{
2766 Addressee lse; 2777 Addressee lse;
2767 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2778 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2768 2779
2769 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 2780 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
2770 lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2781 lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice );
2771 if (lse.isEmpty()) { 2782 if (lse.isEmpty()) {
2772 qDebug("KA: Creating new last-syncAddressee "); 2783 qDebug("KA: Creating new last-syncAddressee ");
2773 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2784 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice );
2774 QString sum = ""; 2785 QString sum = "";
2775 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 2786 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
2776 sum = "E: "; 2787 sum = "E: ";
2777 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); 2788 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event"));
2778 lse.setRevision( mLastAddressbookSync ); 2789 lse.setRevision( mLastAddressbookSync );
2779 lse.setCategories( i18n("SyncEvent") ); 2790 lse.setCategories( i18n("SyncEvent") );
2780 mAddressBook->insertAddressee( lse ); 2791 mAddressBook->insertAddressee( lse );
2781 } 2792 }
2782 return lse; 2793 return lse;
2783} 2794}
2784int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) 2795int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full )
2785{ 2796{
2786 2797
2787 //void setZaurusId(int id); 2798 //void setZaurusId(int id);
2788 // int zaurusId() const; 2799 // int zaurusId() const;
2789 // void setZaurusUid(int id); 2800 // void setZaurusUid(int id);
2790 // int zaurusUid() const; 2801 // int zaurusUid() const;
2791 // void setZaurusStat(int id); 2802 // void setZaurusStat(int id);
2792 // int zaurusStat() const; 2803 // int zaurusStat() const;
2793 // 0 equal 2804 // 0 equal
2794 // 1 take local 2805 // 1 take local
2795 // 2 take remote 2806 // 2 take remote
2796 // 3 cancel 2807 // 3 cancel
2797 QDateTime lastSync = mLastAddressbookSync; 2808 QDateTime lastSync = mLastAddressbookSync;
2798 QDateTime localMod = local->revision(); 2809 QDateTime localMod = local->revision();
2799 QDateTime remoteMod = remote->revision(); 2810 QDateTime remoteMod = remote->revision();
2800 2811
2801 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2812 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2802 2813
2803 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2814 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2804 bool remCh, locCh; 2815 bool remCh, locCh;
2805 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 2816 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
2806 //if ( remCh ) 2817 //if ( remCh )
2807 // qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); 2818 // qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
2808 locCh = ( localMod > mLastAddressbookSync ); 2819 locCh = ( localMod > mLastAddressbookSync );
2809 //qDebug("cahnged rem %d loc %d",remCh, locCh ); 2820 //qDebug("cahnged rem %d loc %d",remCh, locCh );
2810 if ( !remCh && ! locCh ) { 2821 if ( !remCh && ! locCh ) {
2811 //qDebug("both not changed "); 2822 //qDebug("both not changed ");
2812 lastSync = localMod.addDays(1); 2823 lastSync = localMod.addDays(1);
2813 if ( mode <= SYNC_PREF_ASK ) 2824 if ( mode <= SYNC_PREF_ASK )
2814 return 0; 2825 return 0;
2815 } else { 2826 } else {
2816 if ( locCh ) { 2827 if ( locCh ) {
2817 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); 2828 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1());
2818 lastSync = localMod.addDays( -1 ); 2829 lastSync = localMod.addDays( -1 );
2819 if ( !remCh ) 2830 if ( !remCh )
2820 remoteMod =( lastSync.addDays( -1 ) ); 2831 remoteMod =( lastSync.addDays( -1 ) );
2821 } else { 2832 } else {
2822 //qDebug(" not loc changed "); 2833 //qDebug(" not loc changed ");
2823 lastSync = localMod.addDays( 1 ); 2834 lastSync = localMod.addDays( 1 );
2824 if ( remCh ) { 2835 if ( remCh ) {
2825 //qDebug("rem changed "); 2836 //qDebug("rem changed ");
2826 remoteMod =( lastSync.addDays( 1 ) ); 2837 remoteMod =( lastSync.addDays( 1 ) );
2827 } 2838 }
2828 2839
2829 } 2840 }
2830 } 2841 }
2831 full = true; 2842 full = true;
2832 if ( mode < SYNC_PREF_ASK ) 2843 if ( mode < SYNC_PREF_ASK )
2833 mode = SYNC_PREF_ASK; 2844 mode = SYNC_PREF_ASK;
2834 } else { 2845 } else {
2835 if ( localMod == remoteMod ) 2846 if ( localMod == remoteMod )
2836 return 0; 2847 return 0;
2837 2848
2838 } 2849 }
2839 //qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec()); 2850 //qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec());
2840 //qDebug("lastsync %s ", lastSync.toString().latin1() ); 2851 //qDebug("lastsync %s ", lastSync.toString().latin1() );
2841 //full = true; //debug only 2852 //full = true; //debug only
2842 if ( full ) { 2853 if ( full ) {
2843 bool equ = ( (*local) == (*remote) ); 2854 bool equ = ( (*local) == (*remote) );
2844 if ( equ ) { 2855 if ( equ ) {
2845 //qDebug("equal "); 2856 //qDebug("equal ");
2846 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2857 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2847 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 2858 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
2848 } 2859 }
2849 if ( mode < SYNC_PREF_FORCE_LOCAL ) 2860 if ( mode < SYNC_PREF_FORCE_LOCAL )
2850 return 0; 2861 return 0;
2851 2862
2852 }//else //debug only 2863 }//else //debug only
2853 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 2864 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
2854 } 2865 }
2855 int result; 2866 int result;
2856 bool localIsNew; 2867 bool localIsNew;
2857 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() ); 2868 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , local->lastModified().toString().latin1() , remote->lastModified().toString().latin1() );
2858 2869
2859 if ( full && mode < SYNC_PREF_NEWEST ) 2870 if ( full && mode < SYNC_PREF_NEWEST )
2860 mode = SYNC_PREF_ASK; 2871 mode = SYNC_PREF_ASK;
2861 2872
2862 switch( mode ) { 2873 switch( mode ) {
2863 case SYNC_PREF_LOCAL: 2874 case SYNC_PREF_LOCAL:
2864 if ( lastSync > remoteMod ) 2875 if ( lastSync > remoteMod )
2865 return 1; 2876 return 1;
2866 if ( lastSync > localMod ) 2877 if ( lastSync > localMod )
2867 return 2; 2878 return 2;
2868 return 1; 2879 return 1;
2869 break; 2880 break;
2870 case SYNC_PREF_REMOTE: 2881 case SYNC_PREF_REMOTE:
2871 if ( lastSync > localMod ) 2882 if ( lastSync > localMod )
2872 return 2; 2883 return 2;
2873 if ( lastSync > remoteMod ) 2884 if ( lastSync > remoteMod )
2874 return 1; 2885 return 1;
2875 return 2; 2886 return 2;
2876 break; 2887 break;
2877 case SYNC_PREF_NEWEST: 2888 case SYNC_PREF_NEWEST:
2878 if ( localMod > remoteMod ) 2889 if ( localMod > remoteMod )
2879 return 1; 2890 return 1;
2880 else 2891 else
2881 return 2; 2892 return 2;
2882 break; 2893 break;
2883 case SYNC_PREF_ASK: 2894 case SYNC_PREF_ASK:
2884 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 2895 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
2885 if ( lastSync > remoteMod && lastSync > localMod) 2896 if ( lastSync > remoteMod && lastSync > localMod)
2886 return 0; 2897 return 0;
2887 if ( lastSync > remoteMod ) 2898 if ( lastSync > remoteMod )
2888 return 1; 2899 return 1;
2889 if ( lastSync > localMod ) { 2900 if ( lastSync > localMod ) {
2890 return 2; 2901 return 2;
2891 } 2902 }
2892 localIsNew = localMod >= remoteMod; 2903 localIsNew = localMod >= remoteMod;
2893 //qDebug("conflict! ************************************** "); 2904 //qDebug("conflict! ************************************** ");
2894 { 2905 {
2895 KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this ); 2906 KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this );
2896 result = acd.executeD(localIsNew); 2907 result = acd.executeD(localIsNew);
2897 return result; 2908 return result;
2898 } 2909 }
2899 break; 2910 break;
2900 case SYNC_PREF_FORCE_LOCAL: 2911 case SYNC_PREF_FORCE_LOCAL:
2901 return 1; 2912 return 1;
2902 break; 2913 break;
2903 case SYNC_PREF_FORCE_REMOTE: 2914 case SYNC_PREF_FORCE_REMOTE:
2904 return 2; 2915 return 2;
2905 break; 2916 break;
2906 2917
2907 default: 2918 default:
2908 // SYNC_PREF_TAKE_BOTH not implemented 2919 // SYNC_PREF_TAKE_BOTH not implemented
2909 break; 2920 break;
2910 } 2921 }
2911 return 0; 2922 return 0;
2912} 2923}
2913 2924
2914 2925
2915bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode) 2926bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode)
2916{ 2927{
2917 bool syncOK = true; 2928 bool syncOK = true;
2918 int addedAddressee = 0; 2929 int addedAddressee = 0;
2919 int addedAddresseeR = 0; 2930 int addedAddresseeR = 0;
2920 int deletedAddresseeR = 0; 2931 int deletedAddresseeR = 0;
2921 int deletedAddresseeL = 0; 2932 int deletedAddresseeL = 0;
2922 int changedLocal = 0; 2933 int changedLocal = 0;
2923 int changedRemote = 0; 2934 int changedRemote = 0;
2924 int filteredIN = 0; 2935 int filteredIN = 0;
2925 int filteredOUT = 0; 2936 int filteredOUT = 0;
2926 2937
2927 QString mCurrentSyncName = syncManager->getCurrentSyncName(); 2938 QString mCurrentSyncName = syncManager->getCurrentSyncName();
2928 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2939 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2929 2940
2930 //QPtrList<Addressee> el = local->rawAddressees(); 2941 //QPtrList<Addressee> el = local->rawAddressees();
2931 Addressee addresseeR; 2942 Addressee addresseeR;
2932 QString uid; 2943 QString uid;
2933 int take; 2944 int take;
2934 Addressee addresseeL; 2945 Addressee addresseeL;
2935 Addressee addresseeRSync; 2946 Addressee addresseeRSync;
2936 Addressee addresseeLSync; 2947 Addressee addresseeLSync;
2937 // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees(); 2948 // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees();
2938 //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); 2949 //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees();
2939 bool fullDateRange = false; 2950 bool fullDateRange = false;
2940 local->resetTempSyncStat(); 2951 local->resetTempSyncStat();
2941 mLastAddressbookSync = QDateTime::currentDateTime(); 2952 mLastAddressbookSync = QDateTime::currentDateTime();
2942 if ( syncManager->syncWithDesktop() ) { 2953 if ( syncManager->syncWithDesktop() ) {
2943 // remote->removeSyncInfo( QString());//remove all info 2954 // remote->removeSyncInfo( QString());//remove all info
2944 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 2955 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
2945 mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; 2956 mLastAddressbookSync = KSyncManager::mRequestedSyncEvent;
2946 qDebug("KA: using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); 2957 qDebug("KA: using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() );
2947 } else { 2958 } else {
2948 qDebug("KA: KSyncManager::mRequestedSyncEvent has invalid datatime "); 2959 qDebug("KA: KSyncManager::mRequestedSyncEvent has invalid datatime ");
2949 } 2960 }
2950 } 2961 }
2951 QDateTime modifiedCalendar = mLastAddressbookSync; 2962 QDateTime modifiedCalendar = mLastAddressbookSync;
2952 addresseeLSync = getLastSyncAddressee(); 2963 addresseeLSync = getLastSyncAddressee();
2953 qDebug("KA: Last Sync %s ", addresseeLSync.revision().toString().latin1()); 2964 qDebug("KA: Last Sync %s ", addresseeLSync.revision().toString().latin1());
2954 addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); 2965 addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName );
2955 if ( !addresseeR.isEmpty() ) { 2966 if ( !addresseeR.isEmpty() ) {
2956 addresseeRSync = addresseeR; 2967 addresseeRSync = addresseeR;
2957 remote->removeAddressee(addresseeR ); 2968 remote->removeAddressee(addresseeR );
2958 2969
2959 } else { 2970 } else {
2960 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2971 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2961 addresseeRSync = addresseeLSync ; 2972 addresseeRSync = addresseeLSync ;
2962 } else { 2973 } else {
2963 //qDebug("FULLDATE 1"); 2974 //qDebug("FULLDATE 1");
2964 fullDateRange = true; 2975 fullDateRange = true;
2965 Addressee newAdd; 2976 Addressee newAdd;
2966 addresseeRSync = newAdd; 2977 addresseeRSync = newAdd;
2967 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); 2978 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee"));
2968 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); 2979 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName );
2969 addresseeRSync.setRevision( mLastAddressbookSync ); 2980 addresseeRSync.setRevision( mLastAddressbookSync );
2970 addresseeRSync.setCategories( i18n("SyncAddressee") ); 2981 addresseeRSync.setCategories( i18n("SyncAddressee") );
2971 } 2982 }
2972 } 2983 }
2973 if ( addresseeLSync.revision() == mLastAddressbookSync ) { 2984 if ( addresseeLSync.revision() == mLastAddressbookSync ) {
2974 // qDebug("FULLDATE 2"); 2985 // qDebug("FULLDATE 2");
2975 fullDateRange = true; 2986 fullDateRange = true;
2976 } 2987 }
2977 if ( ! fullDateRange ) { 2988 if ( ! fullDateRange ) {
2978 if ( addresseeLSync.revision() != addresseeRSync.revision() ) { 2989 if ( addresseeLSync.revision() != addresseeRSync.revision() ) {
2979 2990
2980 // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() ); 2991 // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() );
2981 //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec()); 2992 //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec());
2982 fullDateRange = true; 2993 fullDateRange = true;
2983 //qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() ); 2994 //qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() );
2984 } 2995 }
2985 } 2996 }
2986 // fullDateRange = true; // debug only! 2997 // fullDateRange = true; // debug only!
2987 if ( fullDateRange ) 2998 if ( fullDateRange )
2988 mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365); 2999 mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365);
2989 else 3000 else
2990 mLastAddressbookSync = addresseeLSync.revision(); 3001 mLastAddressbookSync = addresseeLSync.revision();
2991 // for resyncing if own file has changed 3002 // for resyncing if own file has changed
2992 // PENDING fixme later when implemented 3003 // PENDING fixme later when implemented
2993#if 0 3004#if 0
2994 if ( mCurrentSyncDevice == "deleteaftersync" ) { 3005 if ( mCurrentSyncDevice == "deleteaftersync" ) {
2995 mLastAddressbookSync = loadedFileVersion; 3006 mLastAddressbookSync = loadedFileVersion;
2996 qDebug("setting mLastAddressbookSync "); 3007 qDebug("setting mLastAddressbookSync ");
2997 } 3008 }
2998#endif 3009#endif
2999 3010
3000 3011
3001 // ********** setting filters **************** 3012 // ********** setting filters ****************
3002 Filter filterIN = mViewManager->getFilterByName( syncManager->mFilterInAB ); 3013 Filter filterIN = mViewManager->getFilterByName( syncManager->mFilterInAB );
3003 Filter filterOUT = mViewManager->getFilterByName( syncManager->mFilterOutAB ); 3014 Filter filterOUT = mViewManager->getFilterByName( syncManager->mFilterOutAB );
3004 3015
3005 //qDebug("*************************** "); 3016 //qDebug("*************************** ");
3006 // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() ); 3017 // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() );
3007 QStringList er = remote->uidList(); 3018 QStringList er = remote->uidList();
3008 Addressee inR ;//= er.first(); 3019 Addressee inR ;//= er.first();
3009 Addressee inL; 3020 Addressee inL;
3010 3021
3011 syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count()); 3022 syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count());
3012 3023
3013 int modulo = (er.count()/10)+1; 3024 int modulo = (er.count()/10)+1;
3014 int incCounter = 0; 3025 int incCounter = 0;
3015 while ( incCounter < er.count()) { 3026 while ( incCounter < er.count()) {
3016 if (syncManager->isProgressBarCanceled()) 3027 if (syncManager->isProgressBarCanceled())
3017 return false; 3028 return false;
3018 if ( incCounter % modulo == 0 ) 3029 if ( incCounter % modulo == 0 )
3019 syncManager->showProgressBar(incCounter); 3030 syncManager->showProgressBar(incCounter);
3020 3031
3021 uid = er[ incCounter ]; 3032 uid = er[ incCounter ];
3022 bool skipIncidence = false; 3033 bool skipIncidence = false;
3023 if ( uid.left(19) == QString("last-syncAddressee-") ) 3034 if ( uid.left(19) == QString("last-syncAddressee-") )
3024 skipIncidence = true; 3035 skipIncidence = true;
3025 QString idS,OidS; 3036 QString idS,OidS;
3026 qApp->processEvents(); 3037 qApp->processEvents();
3027 if ( !skipIncidence ) { 3038 if ( !skipIncidence ) {
3028 inL = local->findByUid( uid ); 3039 inL = local->findByUid( uid );
3029 inR = remote->findByUid( uid ); 3040 inR = remote->findByUid( uid );
3030 //inL.setResource( 0 ); 3041 //inL.setResource( 0 );
3031 //inR.setResource( 0 ); 3042 //inR.setResource( 0 );
3032 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars 3043 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars
3033 if ( !inL.resource() || inL.resource()->includeInSync() ) { 3044 if ( !inL.resource() || inL.resource()->includeInSync() ) {
3034 if ( (take = takeAddressee( &inL, &inR, mode, fullDateRange )) ) { 3045 if ( (take = takeAddressee( &inL, &inR, mode, fullDateRange )) ) {
3035 //qDebug("take %d %s ", take, inL.summary().latin1()); 3046 //qDebug("take %d %s ", take, inL.summary().latin1());
3036 if ( take == 3 ) 3047 if ( take == 3 )
3037 return false; 3048 return false;
3038 if ( take == 1 ) {// take local ********************** 3049 if ( take == 1 ) {// take local **********************
3039 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3050 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3040 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 3051 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
3041 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 3052 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
3042 local->insertAddressee( inL, false ); 3053 local->insertAddressee( inL, false );
3043 idS = inR.externalUID(); 3054 idS = inR.externalUID();
3044 OidS = inR.originalExternalUID(); 3055 OidS = inR.originalExternalUID();
3045 } 3056 }
3046 else 3057 else
3047 idS = inR.IDStr(); 3058 idS = inR.IDStr();
3048 remote->removeAddressee( inR ); 3059 remote->removeAddressee( inR );
3049 inR = inL; 3060 inR = inL;
3050 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 3061 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
3051 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3062 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3052 inR.setOriginalExternalUID( OidS ); 3063 inR.setOriginalExternalUID( OidS );
3053 inR.setExternalUID( idS ); 3064 inR.setExternalUID( idS );
3054 if ( syncManager->syncWithDesktop() ) { 3065 if ( syncManager->syncWithDesktop() ) {
3055 inR.setIDStr("changed" ); 3066 inR.setIDStr("changed" );
3056 } 3067 }
3057 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); 3068 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" );
3058 } else { 3069 } else {
3059 inR.setIDStr( idS ); 3070 inR.setIDStr( idS );
3060 } 3071 }
3061 inR.setResource( 0 ); 3072 inR.setResource( 0 );
3062 remote->insertAddressee( inR , false); 3073 remote->insertAddressee( inR , false);
3063 ++changedRemote; 3074 ++changedRemote;
3064 } else { // take == 2 take remote ********************** 3075 } else { // take == 2 take remote **********************
3065 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3076 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3066 if ( inR.revision().date().year() < 2004 ) 3077 if ( inR.revision().date().year() < 2004 )
3067 inR.setRevision( modifiedCalendar ); 3078 inR.setRevision( modifiedCalendar );
3068 } 3079 }
3069 idS = inL.IDStr(); 3080 idS = inL.IDStr();
3070 local->removeAddressee( inL ); 3081 local->removeAddressee( inL );
3071 inL = inR; 3082 inL = inR;
3072 inL.setIDStr( idS ); 3083 inL.setIDStr( idS );
3073 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3084 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3074 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 3085 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
3075 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 3086 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
3076 } 3087 }
3077 inL.setResource( 0 ); 3088 inL.setResource( 0 );
3078 local->insertAddressee( inL , false ); 3089 local->insertAddressee( inL , false );
3079 ++changedLocal; 3090 ++changedLocal;
3080 } 3091 }
3081 } 3092 }
3082 } 3093 }
3083 } else { // no conflict ********** add or delete remote 3094 } else { // no conflict ********** add or delete remote
3084 if ( filterIN.name().isEmpty() || filterIN.filterAddressee( inR ) ) { 3095 if ( filterIN.name().isEmpty() || filterIN.filterAddressee( inR ) ) {
3085 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3096 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3086 QString des = addresseeLSync.note(); 3097 QString des = addresseeLSync.note();
3087 if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 3098 if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
3088 inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 3099 inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE );
3089 remote->insertAddressee( inR, false ); 3100 remote->insertAddressee( inR, false );
3090 ++deletedAddresseeR; 3101 ++deletedAddresseeR;
3091 } else { 3102 } else {
3092 inR.setRevision( modifiedCalendar ); 3103 inR.setRevision( modifiedCalendar );
3093 remote->insertAddressee( inR, false ); 3104 remote->insertAddressee( inR, false );
3094 inL = inR; 3105 inL = inR;
3095 inL.setIDStr( ":" ); 3106 inL.setIDStr( ":" );
3096 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 3107 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
3097 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 3108 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
3098 inL.setResource( 0 ); 3109 inL.setResource( 0 );
3099 local->insertAddressee( inL , false); 3110 local->insertAddressee( inL , false);
3100 ++addedAddressee; 3111 ++addedAddressee;
3101 } 3112 }
3102 } else { 3113 } else {
3103 if ( inR.revision() > mLastAddressbookSync || mode == 5 ) { 3114 if ( inR.revision() > mLastAddressbookSync || mode == 5 ) {
3104 inR.setRevision( modifiedCalendar ); 3115 inR.setRevision( modifiedCalendar );
3105 remote->insertAddressee( inR, false ); 3116 remote->insertAddressee( inR, false );
3106 inR.setResource( 0 ); 3117 inR.setResource( 0 );
3107 local->insertAddressee( inR, false ); 3118 local->insertAddressee( inR, false );
3108 ++addedAddressee; 3119 ++addedAddressee;
3109 } else { 3120 } else {
3110 // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); 3121 // pending checkExternSyncAddressee(addresseeRSyncSharp, inR);
3111 remote->removeAddressee( inR ); 3122 remote->removeAddressee( inR );
3112 ++deletedAddresseeR; 3123 ++deletedAddresseeR;
3113 } 3124 }
3114 } 3125 }
3115 } else { 3126 } else {
3116 ++filteredIN; 3127 ++filteredIN;
3117 } 3128 }
3118 } 3129 }
3119 } 3130 }
3120 ++incCounter; 3131 ++incCounter;
3121 } 3132 }
3122 er.clear(); 3133 er.clear();
3123 QStringList el = local->uidList(); 3134 QStringList el = local->uidList();
3124 modulo = (el.count()/10)+1; 3135 modulo = (el.count()/10)+1;
3125 3136
3126 syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); 3137 syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count());
3127 incCounter = 0; 3138 incCounter = 0;
3128 while ( incCounter < el.count()) { 3139 while ( incCounter < el.count()) {
3129 qApp->processEvents(); 3140 qApp->processEvents();
3130 if (syncManager->isProgressBarCanceled()) 3141 if (syncManager->isProgressBarCanceled())
3131 return false; 3142 return false;
3132 if ( incCounter % modulo == 0 ) 3143 if ( incCounter % modulo == 0 )
3133 syncManager->showProgressBar(incCounter); 3144 syncManager->showProgressBar(incCounter);
3134 uid = el[ incCounter ]; 3145 uid = el[ incCounter ];
3135 bool skipIncidence = false; 3146 bool skipIncidence = false;
3136 if ( uid.left(19) == QString("last-syncAddressee-") ) 3147 if ( uid.left(19) == QString("last-syncAddressee-") )
3137 skipIncidence = true; 3148 skipIncidence = true;
3138 if ( !skipIncidence ) { 3149 if ( !skipIncidence ) {
3139 inL = local->findByUid( uid ); 3150 inL = local->findByUid( uid );
3140 if ( !inL.resource() || inL.resource()->includeInSync() ) { 3151 if ( !inL.resource() || inL.resource()->includeInSync() ) {
3141 inR = remote->findByUid( uid ); 3152 inR = remote->findByUid( uid );
3142 if ( inR.isEmpty() ){ 3153 if ( inR.isEmpty() ){
3143 if ( filterOUT.name().isEmpty() || filterOUT.filterAddressee( inL ) ) { 3154 if ( filterOUT.name().isEmpty() || filterOUT.filterAddressee( inL ) ) {
3144 // no conflict ********** add or delete local 3155 // no conflict ********** add or delete local
3145 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3156 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3146 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 3157 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
3147 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 3158 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
3148 local->removeAddressee( inL ); 3159 local->removeAddressee( inL );
3149 ++deletedAddresseeL; 3160 ++deletedAddresseeL;
3150 } else { 3161 } else {
3151 if ( ! syncManager->mWriteBackExistingOnly ) { 3162 if ( ! syncManager->mWriteBackExistingOnly ) {
3152 inL.removeID(mCurrentSyncDevice ); 3163 inL.removeID(mCurrentSyncDevice );
3153 ++addedAddresseeR; 3164 ++addedAddresseeR;
3154 inL.setRevision( modifiedCalendar ); 3165 inL.setRevision( modifiedCalendar );
3155 local->insertAddressee( inL, false ); 3166 local->insertAddressee( inL, false );
3156 inR = inL; 3167 inR = inL;
3157 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); 3168 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL );
3158 inR.setResource( 0 ); 3169 inR.setResource( 0 );
3159 remote->insertAddressee( inR, false ); 3170 remote->insertAddressee( inR, false );
3160 } 3171 }
3161 } 3172 }
3162 } else { 3173 } else {
3163 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { 3174 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) {
3164 //qDebug("data %s ", inL.revision().toString().latin1()); 3175 //qDebug("data %s ", inL.revision().toString().latin1());
3165 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 3176 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
3166 local->removeAddressee( inL ); 3177 local->removeAddressee( inL );
3167 ++deletedAddresseeL; 3178 ++deletedAddresseeL;
3168 } else { 3179 } else {
3169 if ( ! syncManager->mWriteBackExistingOnly ) { 3180 if ( ! syncManager->mWriteBackExistingOnly ) {
3170 ++addedAddresseeR; 3181 ++addedAddresseeR;
3171 inL.setRevision( modifiedCalendar ); 3182 inL.setRevision( modifiedCalendar );
3172 local->insertAddressee( inL, false ); 3183 local->insertAddressee( inL, false );
3173 inR = inL; 3184 inR = inL;
3174 inR.setIDStr( ":" ); 3185 inR.setIDStr( ":" );
3175 inR.setResource( 0 ); 3186 inR.setResource( 0 );
3176 remote->insertAddressee( inR, false ); 3187 remote->insertAddressee( inR, false );
3177 } 3188 }
3178 } 3189 }
3179 } 3190 }
3180 } else { 3191 } else {
3181 ++filteredOUT; 3192 ++filteredOUT;
3182 } 3193 }
3183 } 3194 }
3184 } 3195 }
3185 } 3196 }
3186 ++incCounter; 3197 ++incCounter;
3187 } 3198 }
3188 el.clear(); 3199 el.clear();
3189 syncManager->hideProgressBar(); 3200 syncManager->hideProgressBar();
3190 mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); 3201 mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 );
3191 // get rid of micro seconds 3202 // get rid of micro seconds
3192 QTime t = mLastAddressbookSync.time(); 3203 QTime t = mLastAddressbookSync.time();
3193 mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 3204 mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) );
3194 addresseeLSync.setRevision( mLastAddressbookSync ); 3205 addresseeLSync.setRevision( mLastAddressbookSync );
3195 addresseeRSync.setRevision( mLastAddressbookSync ); 3206 addresseeRSync.setRevision( mLastAddressbookSync );
3196 addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; 3207 addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ;
3197 addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); 3208 addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName );
3198 addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; 3209 addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ;
3199 addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); 3210 addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") );
3200 addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; 3211 addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ;
3201 addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); 3212 addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() );
3202 addresseeRSync.setNote( "" ) ; 3213 addresseeRSync.setNote( "" ) ;
3203 addresseeLSync.setNote( "" ); 3214 addresseeLSync.setNote( "" );
3204 3215
3205 if ( mGlobalSyncMode == SYNC_MODE_NORMAL) 3216 if ( mGlobalSyncMode == SYNC_MODE_NORMAL)
3206 remote->insertAddressee( addresseeRSync, false ); 3217 remote->insertAddressee( addresseeRSync, false );
3207 local->insertAddressee( addresseeLSync, false ); 3218 local->insertAddressee( addresseeLSync, false );
3208 QString mes; 3219 QString mes;
3209 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT ); 3220 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT );
3210 qDebug( mes ); 3221 qDebug( mes );
3211 mes = i18n("Local addressbook changed!\n") +mes; 3222 mes = i18n("Local addressbook changed!\n") +mes;
3212 if ( syncManager->mShowSyncSummary ) { 3223 if ( syncManager->mShowSyncSummary ) {
3213 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 3224 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
3214 i18n("KA/Pi Synchronization"),i18n("Write back"))) { 3225 i18n("KA/Pi Synchronization"),i18n("Write back"))) {
3215 qDebug("KA: WB cancelled "); 3226 qDebug("KA: WB cancelled ");
3216 syncManager->mWriteBackFile = false; 3227 syncManager->mWriteBackFile = false;
3217 return syncOK; 3228 return syncOK;
3218 } 3229 }
3219 } 3230 }
3220 return syncOK; 3231 return syncOK;
3221} 3232}
3222 3233
3223 3234
3224//this is a overwritten callbackmethods from the syncinterface 3235//this is a overwritten callbackmethods from the syncinterface
3225bool KABCore::sync(KSyncManager* manager, QString filename, int mode) 3236bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
3226{ 3237{
3227 3238
3228 //pending prepare addresseeview for output 3239 //pending prepare addresseeview for output
3229 //pending detect, if remote file has REV field. if not switch to external sync 3240 //pending detect, if remote file has REV field. if not switch to external sync
3230 mGlobalSyncMode = SYNC_MODE_NORMAL; 3241 mGlobalSyncMode = SYNC_MODE_NORMAL;
3231 if ( manager != syncManager ) 3242 if ( manager != syncManager )
3232 qDebug("KABCore::sync:: ERROR! :: manager != syncManager "); 3243 qDebug("KABCore::sync:: ERROR! :: manager != syncManager ");
3233 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 3244 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
3234 3245
3235 AddressBook abLocal(filename,"syncContact"); 3246 AddressBook abLocal(filename,"syncContact");
3236 bool syncOK = false; 3247 bool syncOK = false;
3237 if ( abLocal.load() ) { 3248 if ( abLocal.load() ) {
3238 qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode ); 3249 qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode );
3239 bool external = false; 3250 bool external = false;
3240 bool isXML = false; 3251 bool isXML = false;
3241 if ( filename.right(4) == ".xml") { 3252 if ( filename.right(4) == ".xml") {
3242 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3253 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3243 isXML = true; 3254 isXML = true;
3244 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3255 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3245 } else { 3256 } else {
3246 external = !manager->mIsKapiFile; 3257 external = !manager->mIsKapiFile;
3247 if ( external ) { 3258 if ( external ) {
3248 qDebug("KA: Sync::Setting vcf mode to external "); 3259 qDebug("KA: Sync::Setting vcf mode to external ");
3249 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3260 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3250 AddressBook::Iterator it; 3261 AddressBook::Iterator it;
3251 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 3262 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
3252 (*it).setID( mCurrentSyncDevice, (*it).uid() ); 3263 (*it).setID( mCurrentSyncDevice, (*it).uid() );
3253 (*it).computeCsum( mCurrentSyncDevice ); 3264 (*it).computeCsum( mCurrentSyncDevice );
3254 } 3265 }
3255 } 3266 }
3256 } 3267 }
3257 //AddressBook::Iterator it; 3268 //AddressBook::Iterator it;
3258 //QStringList vcards; 3269 //QStringList vcards;
3259 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 3270 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
3260 // qDebug("Name %s ", (*it).familyName().latin1()); 3271 // qDebug("Name %s ", (*it).familyName().latin1());
3261 //} 3272 //}
3262 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); 3273 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode );
3263 syncManager->hideProgressBar(); 3274 syncManager->hideProgressBar();
3264 if ( syncOK ) { 3275 if ( syncOK ) {
3265 if ( syncManager->mWriteBackFile ) 3276 if ( syncManager->mWriteBackFile )
3266 { 3277 {
3267 if ( external ) 3278 if ( external )
3268 abLocal.removeSyncAddressees( !isXML); 3279 abLocal.removeSyncAddressees( !isXML);
3269 qDebug("KA: Sync::Saving remote AB "); 3280 qDebug("KA: Sync::Saving remote AB ");
3270 if ( ! abLocal.saveAB()) 3281 if ( ! abLocal.saveAB())
3271 qDebug("KA: sync::Error writing back AB to file "); 3282 qDebug("KA: sync::Error writing back AB to file ");
3272 if ( external ) { 3283 if ( external ) {
3273 // afterwrite processing 3284 // afterwrite processing
3274 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); 3285 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML);
3275 } 3286 }
3276 } 3287 }
3277 } 3288 }
3278 setModified(); 3289 setModified();
3279 3290
3280 } 3291 }
3281 abLocal.removeResources(); 3292 abLocal.removeResources();
3282 if ( syncOK ) 3293 if ( syncOK )
3283 mViewManager->refreshView(); 3294 mViewManager->refreshView();
3284 return syncOK; 3295 return syncOK;
3285 3296
3286} 3297}
3287void KABCore::removeSyncInfo( QString syncProfile) 3298void KABCore::removeSyncInfo( QString syncProfile)
3288{ 3299{
3289 qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1()); 3300 qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1());
3290 mAddressBook->removeSyncInfo( syncProfile ); 3301 mAddressBook->removeSyncInfo( syncProfile );
3291 setModified(); 3302 setModified();
3292} 3303}
3293 3304
3294 3305
3295//this is a overwritten callbackmethods from the syncinterface 3306//this is a overwritten callbackmethods from the syncinterface
3296bool KABCore::syncExternal(KSyncManager* manager, QString resource) 3307bool KABCore::syncExternal(KSyncManager* manager, QString resource)
3297{ 3308{
3298 if ( resource == "phone" ) 3309 if ( resource == "phone" )
3299 return syncPhone(); 3310 return syncPhone();
3300 disableBR( true ); 3311 disableBR( true );
3301 if ( manager != syncManager ) 3312 if ( manager != syncManager )
3302 qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); 3313 qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager ");
3303 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 3314 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
3304 3315
3305 AddressBook abLocal( resource,"syncContact"); 3316 AddressBook abLocal( resource,"syncContact");
3306 bool syncOK = false; 3317 bool syncOK = false;
3307 message(i18n("Loading DTM address data..."), false); 3318 message(i18n("Loading DTM address data..."), false);
3308 if ( abLocal.load() ) { 3319 if ( abLocal.load() ) {
3309 qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3320 qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
3310 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3321 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3311 message(i18n("Sync preprocessing..."),false); 3322 message(i18n("Sync preprocessing..."),false);
3312 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); 3323 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false );
3313 message(i18n("Synchronizing..."),false); 3324 message(i18n("Synchronizing..."),false);
3314 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3325 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3315 syncManager->hideProgressBar(); 3326 syncManager->hideProgressBar();
3316 if ( syncOK ) { 3327 if ( syncOK ) {
3317 if ( syncManager->mWriteBackFile ) { 3328 if ( syncManager->mWriteBackFile ) {
3318 abLocal.removeSyncAddressees( false ); 3329 abLocal.removeSyncAddressees( false );
3319 message(i18n("Saving DTM address data..."),false); 3330 message(i18n("Saving DTM address data..."),false);
3320 abLocal.saveAB(); 3331 abLocal.saveAB();
3321 message(i18n("Sync postprocessing..."),false); 3332 message(i18n("Sync postprocessing..."),false);
3322 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3333 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3323 } 3334 }
3324 } else 3335 } else
3325 message( i18n("Sync cancelled or failed.") ); 3336 message( i18n("Sync cancelled or failed.") );
3326 setModified(); 3337 setModified();
3327 } 3338 }
3328 abLocal.removeResources(); 3339 abLocal.removeResources();
3329 if ( syncOK ) { 3340 if ( syncOK ) {
3330 mViewManager->refreshView(); 3341 mViewManager->refreshView();
3331 message(i18n("DTM syncing finished.")); 3342 message(i18n("DTM syncing finished."));
3332 } 3343 }
3333 disableBR( false ); 3344 disableBR( false );
3334 return syncOK; 3345 return syncOK;
3335 3346
3336} 3347}
3337void KABCore::message( QString m, bool startTimer) 3348void KABCore::message( QString m, bool startTimer)
3338{ 3349{
3339 topLevelWidget()->setCaption( m ); 3350 topLevelWidget()->setCaption( m );
3340 qApp->processEvents(); 3351 qApp->processEvents();
3341 if ( startTimer ) 3352 if ( startTimer )
3342 mMessageTimer->start( 15000, true ); 3353 mMessageTimer->start( 15000, true );
3343 else 3354 else
3344 mMessageTimer->stop(); 3355 mMessageTimer->stop();
3345} 3356}
3346bool KABCore::syncPhone() 3357bool KABCore::syncPhone()
3347{ 3358{
3348 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 3359 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
3349 QString fileName = getPhoneFile(); 3360 QString fileName = getPhoneFile();
3350 if ( !PhoneAccess::readFromPhone( fileName) ) { 3361 if ( !PhoneAccess::readFromPhone( fileName) ) {
3351 message(i18n("Phone access failed!")); 3362 message(i18n("Phone access failed!"));
3352 return false; 3363 return false;
3353 } 3364 }
3354 AddressBook abLocal( fileName,"syncContact"); 3365 AddressBook abLocal( fileName,"syncContact");
3355 bool syncOK = false; 3366 bool syncOK = false;
3356 { 3367 {
3357 abLocal.importFromFile( fileName ); 3368 abLocal.importFromFile( fileName );
3358 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3369 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
3359 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3370 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3360 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 3371 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
3361 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3372 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3362 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3373 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3363 syncManager->hideProgressBar(); 3374 syncManager->hideProgressBar();
3364 if ( syncOK ) { 3375 if ( syncOK ) {
3365 if ( syncManager->mWriteBackFile ) { 3376 if ( syncManager->mWriteBackFile ) {
3366 abLocal.removeSyncAddressees( true ); 3377 abLocal.removeSyncAddressees( true );
3367 abLocal.saveABphone( fileName ); 3378 abLocal.saveABphone( fileName );
3368 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 3379 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
3369 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 3380 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
3370 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3381 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3371 } 3382 }
3372 } 3383 }
3373 setModified(); 3384 setModified();
3374 } 3385 }
3375 abLocal.removeResources(); 3386 abLocal.removeResources();
3376 if ( syncOK ) 3387 if ( syncOK )
3377 mViewManager->refreshView(); 3388 mViewManager->refreshView();
3378 return syncOK; 3389 return syncOK;
3379} 3390}
3380void KABCore::getFile( bool success ) 3391void KABCore::getFile( bool success )
3381{ 3392{
3382 if ( ! success ) { 3393 if ( ! success ) {
3383 message( i18n("Error receiving file. Nothing changed!") ); 3394 message( i18n("Error receiving file. Nothing changed!") );
3384 return; 3395 return;
3385 } 3396 }
3386 int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); 3397 int count = mAddressBook->importFromFile( sentSyncFile() , false, true );
3387 if ( count ) 3398 if ( count )
3388 setModified( true ); 3399 setModified( true );
3389 message( i18n("Pi-Sync successful!") ); 3400 message( i18n("Pi-Sync successful!") );
3390 mViewManager->refreshView(); 3401 mViewManager->refreshView();
3391} 3402}
3392void KABCore::syncFileRequest() 3403void KABCore::syncFileRequest()
3393{ 3404{
3394 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { 3405 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) {
3395 syncManager->slotSyncMenu( 999 ); 3406 syncManager->slotSyncMenu( 999 );
3396 } 3407 }
3397 mAddressBook->export2File( sentSyncFile() ); 3408 mAddressBook->export2File( sentSyncFile() );
3398} 3409}
3399QString KABCore::sentSyncFile() 3410QString KABCore::sentSyncFile()
3400{ 3411{
3401#ifdef DESKTOP_VERSION 3412#ifdef DESKTOP_VERSION
3402 return locateLocal( "tmp", "copysyncab.vcf" ); 3413 return locateLocal( "tmp", "copysyncab.vcf" );
3403#else 3414#else
3404 return QString( "/tmp/copysyncab.vcf" ); 3415 return QString( "/tmp/copysyncab.vcf" );
3405#endif 3416#endif
3406} 3417}
3407 3418
3408void KABCore::setCaptionBack() 3419void KABCore::setCaptionBack()
3409{ 3420{
3410 mMessageTimer->stop(); 3421 mMessageTimer->stop();
3411 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); 3422 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") );
3412} 3423}