-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 6 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 24 |
2 files changed, 18 insertions, 12 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index d767757..75df50f 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt | |||
@@ -1,533 +1,539 @@ | |||
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","Hinzufügen" }, | 108 | { "Add","Hinzufügen" }, |
109 | { "Remove","Entfernen" }, | 109 | { "Remove","Entfernen" }, |
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","Wähle Kategorien" }, | 145 | { "Set Categories","Wähle Kategorien" }, |
146 | { "Edit Categories","Editiere Kategorien" }, | 146 | { "Edit Categories","Editiere Kategorien" }, |
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","Mehrfach Sync" }, | 158 | { "Multiple sync","Mehrfach 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 | { "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" }, | 190 | { "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" }, |
191 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, | 191 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, |
192 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, | 192 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, |
193 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, | 193 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, |
194 | { "Write back file","Schreibe Datei zurück" }, | 194 | { "Write back file","Schreibe Datei zurück" }, |
195 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, | 195 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, |
196 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, | 196 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, |
197 | { "Local device name:","Name dieses Gerätes:" }, | 197 | { "Local device name:","Name dieses Gerätes:" }, |
198 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, | 198 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, |
199 | { "Sync preferences","Synchronisations Einstellungen" }, | 199 | { "Sync preferences","Synchronisations Einstellungen" }, |
200 | { "Profile kind","Profil Art" }, | 200 | { "Profile kind","Profil Art" }, |
201 | { "Local file","Lokale Datei" }, | 201 | { "Local file","Lokale Datei" }, |
202 | { "Local file:","Lokale Datei:" }, | 202 | { "Local file:","Lokale Datei:" }, |
203 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, | 203 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, |
204 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, | 204 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, |
205 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, | 205 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, |
206 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, | 206 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, |
207 | { "Device","Gerät:" }, | 207 | { "Device","Gerät:" }, |
208 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, | 208 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, |
209 | { "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 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" }, |
210 | { "Synchronization successful","Synchronisation erfolgreich" }, | 210 | { "Synchronization successful","Synchronisation erfolgreich" }, |
211 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, | 211 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, |
212 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, | 212 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, |
213 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, | 213 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, |
214 | { "Enter password","Passwort eingeben" }, | 214 | { "Enter password","Passwort eingeben" }, |
215 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, | 215 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, |
216 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, | 216 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, |
217 | { "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 | { "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" }, |
218 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, | 218 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, |
219 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, | 219 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, |
220 | { "Used %1 Client","Benutzter %1 Client" }, | 220 | { "Used %1 Client","Benutzter %1 Client" }, |
221 | { "No email client installed","Kein Email Klient installiert" }, | 221 | { "No email client installed","Kein Email Klient installiert" }, |
222 | { "Userdefined email client","Benutzerdef. Email Klient" }, | 222 | { "Userdefined email client","Benutzerdef. Email Klient" }, |
223 | { "OM/Pi email client","OM/Pi Email Klient" }, | 223 | { "OM/Pi email client","OM/Pi Email Klient" }, |
224 | { "Include in multiple ","Beziehe in multiple " }, | 224 | { "Include in multiple ","Beziehe in multiple " }, |
225 | { "calendar ","Kalender " }, | 225 | { "calendar ","Kalender " }, |
226 | { "addressbook ","Adressbuch " }, | 226 | { "addressbook ","Adressbuch " }, |
227 | { "pwmanager","PWmanager" }, | 227 | { "pwmanager","PWmanager" }, |
228 | { " sync"," Sync ein" }, | 228 | { " sync"," Sync ein" }, |
229 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, | 229 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, |
230 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, | 230 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, |
231 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, | 231 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, |
232 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, | 232 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, |
233 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, | 233 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, |
234 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, | 234 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, |
235 | { "Help...","Hilfe..." }, | 235 | { "Help...","Hilfe..." }, |
236 | { "Local file Cal:","Lokale Datei Kal:" }, | 236 | { "Local file Cal:","Lokale Datei Kal:" }, |
237 | { "Local file ABook:","Lokale Datei ABuch:" }, | 237 | { "Local file ABook:","Lokale Datei ABuch:" }, |
238 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, | 238 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, |
239 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, | 239 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, |
240 | { "Calendar:","Kalender:" }, | 240 | { "Calendar:","Kalender:" }, |
241 | { "AddressBook:","AdressBuch:" }, | 241 | { "AddressBook:","AdressBuch:" }, |
242 | { "PWManager:","PWManager:" }, | 242 | { "PWManager:","PWManager:" }, |
243 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, | 243 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, |
244 | { "ssh/scp","ssh/scp" }, | 244 | { "ssh/scp","ssh/scp" }, |
245 | { "ftp","ftp" }, | 245 | { "ftp","ftp" }, |
246 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, | 246 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, |
247 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, | 247 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, |
248 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, | 248 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, |
249 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, | 249 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, |
250 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, | 250 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, |
251 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, | 251 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, |
252 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, | 252 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, |
253 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, | 253 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, |
254 | { "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 | { "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" }, |
255 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, | 255 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, |
256 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, | 256 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, |
257 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, | 257 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, |
258 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, | 258 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, |
259 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, | 259 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, |
260 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, | 260 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, |
261 | { "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 | { "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!" }, |
262 | { "KDE-Pim Sync","KDE-Pim Sync" }, | 262 | { "KDE-Pim Sync","KDE-Pim Sync" }, |
263 | { "Multiple profiles","Multi-Sync Profile" }, | 263 | { "Multiple profiles","Multi-Sync Profile" }, |
264 | { "Device: ","Gerät: " }, | 264 | { "Device: ","Gerät: " }, |
265 | { "Multiple sync started.","Multi-Sync gestartet." }, | 265 | { "Multiple sync started.","Multi-Sync gestartet." }, |
266 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, | 266 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, |
267 | { "KDE-Pim sync config","KDE-Pim Sync Konfig" }, | 267 | { "KDE-Pim sync config","KDE-Pim Sync Konfig" }, |
268 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein, z.B.:\n" }, | 268 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein, z.B.:\n" }, |
269 | { "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 | { "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" }, |
270 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, | 270 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, |
271 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, | 271 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, |
272 | { "Edit Address Book Filters","Editiere Addressbuch Filter" }, | 272 | { "Edit Address Book Filters","Editiere Addressbuch Filter" }, |
273 | { "&Add...","Hinzufügen..." }, | 273 | { "&Add...","Hinzufügen..." }, |
274 | { "&Edit...","B&earbeiten..." }, | 274 | { "&Edit...","B&earbeiten..." }, |
275 | { "&Remove","Entfe&rne" }, | 275 | { "&Remove","Entfe&rne" }, |
276 | { "Modify View: ","Ansicht ändern: " }, | 276 | { "Modify View: ","Ansicht ändern: " }, |
277 | { "Fields","Felder" }, | 277 | { "Fields","Felder" }, |
278 | { "Select Fields to Display","Wähle anzuzeigende Felder" }, | 278 | { "Select Fields to Display","Wähle anzuzeigende Felder" }, |
279 | { "All","Alles" }, | 279 | { "All","Alles" }, |
280 | { "Frequent","Frequent" }, | 280 | { "Frequent","Frequent" }, |
281 | { "Address","Adresse" }, | 281 | { "Address","Adresse" }, |
282 | { "Email","E-Mail" }, | 282 | { "Email","E-Mail" }, |
283 | { "Personal","Persönl." }, | 283 | { "Personal","Persönl." }, |
284 | { "Organization","Organisation" }, | 284 | { "Organization","Organisation" }, |
285 | { "Custom","Benutzerdefiniert" }, | 285 | { "Custom","Benutzerdefiniert" }, |
286 | { "&Selected\nfields:","&Selectierte\nFelder:" }, | 286 | { "&Selected\nfields:","&Selectierte\nFelder:" }, |
287 | { "Formatted Name","Format. Name" }, | 287 | { "Formatted Name","Format. Name" }, |
288 | { "Additional Names","Mittelname" }, | 288 | { "Additional Names","Mittelname" }, |
289 | { "Honorific Prefixes","Namen Prefix" }, | 289 | { "Honorific Prefixes","Namen Prefix" }, |
290 | { "Honorific Suffixes","Namen Suffix" }, | 290 | { "Honorific Suffixes","Namen Suffix" }, |
291 | { "Nick Name","Sptitzname" }, | 291 | { "Nick Name","Sptitzname" }, |
292 | { "Birthday","Geburtstag" }, | 292 | { "Birthday","Geburtstag" }, |
293 | { "Home Address Street","Privat Adresse Strasse" }, | 293 | { "Home Address Street","Privat Adresse Strasse" }, |
294 | { "Home Address Locality","Privat Adresse Stadt" }, | 294 | { "Home Address Locality","Privat Adresse Stadt" }, |
295 | { "Home Address Region","Privat Adresse Bundesland" }, | 295 | { "Home Address Region","Privat Adresse Bundesland" }, |
296 | { "Home Address Postal Code","Privat Adresse PLZ" }, | 296 | { "Home Address Postal Code","Privat Adresse PLZ" }, |
297 | { "Home Address Country","Privat Adresse Land" }, | 297 | { "Home Address Country","Privat Adresse Land" }, |
298 | { "Home Address Label","Privat Adresse Label" }, | 298 | { "Home Address Label","Privat Adresse Label" }, |
299 | { "Business Address Street","Büro Adresse Strasse" }, | 299 | { "Business Address Street","Büro Adresse Strasse" }, |
300 | { "Business Address Locality","Büro Adresse Stadt" }, | 300 | { "Business Address Locality","Büro Adresse Stadt" }, |
301 | { "Business Address Region","Büro Adresse Bundesland" }, | 301 | { "Business Address Region","Büro Adresse Bundesland" }, |
302 | { "Business Address Postal Code","Büro Adresse PLZ" }, | 302 | { "Business Address Postal Code","Büro Adresse PLZ" }, |
303 | { "Business Address Country","Büro Adresse Land" }, | 303 | { "Business Address Country","Büro Adresse Land" }, |
304 | { "Business Address Label","Büro Adresse Label" }, | 304 | { "Business Address Label","Büro Adresse Label" }, |
305 | { "Home Phone","Privat Telefon" }, | 305 | { "Home Phone","Privat Telefon" }, |
306 | { "Business Phone","Büro Telefon" }, | 306 | { "Business Phone","Büro Telefon" }, |
307 | { "Mobile Phone","Handy" }, | 307 | { "Mobile Phone","Handy" }, |
308 | { "Home Fax","Privat Fax" }, | 308 | { "Home Fax","Privat Fax" }, |
309 | { "Business Fax","Büro Fax" }, | 309 | { "Business Fax","Büro Fax" }, |
310 | { "Car Phone","Autotelefon" }, | 310 | { "Car Phone","Autotelefon" }, |
311 | { "ISDN","ISDN" }, | 311 | { "ISDN","ISDN" }, |
312 | { "Pager","Pager" }, | 312 | { "Pager","Pager" }, |
313 | { "Mail Client","Mail Client" }, | 313 | { "Mail Client","Mail Client" }, |
314 | { "Title","Titel" }, | 314 | { "Title","Titel" }, |
315 | { "Role","Rolle" }, | 315 | { "Role","Rolle" }, |
316 | { "Note","Notiz" }, | 316 | { "Note","Notiz" }, |
317 | { "URL","URL" }, | 317 | { "URL","URL" }, |
318 | { "Resource","Resource" }, | 318 | { "Resource","Resource" }, |
319 | { "SIP","SIP" }, | 319 | { "SIP","SIP" }, |
320 | { "Default Filter","Default Filter" }, | 320 | { "Default Filter","Default Filter" }, |
321 | { "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 | { "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." }, |
322 | { "No default filter","Kein default Filter" }, | 322 | { "No default filter","Kein default Filter" }, |
323 | { "Use last active filter","Nutze letzen aktiven Filter" }, | 323 | { "Use last active filter","Nutze letzen aktiven Filter" }, |
324 | { "Use filter:","Nutze Filter:" }, | 324 | { "Use filter:","Nutze Filter:" }, |
325 | { "Look & Feel","Look & Feel" }, | 325 | { "Look & Feel","Look & Feel" }, |
326 | { "Row Separator","Reihen Separator" }, | 326 | { "Row Separator","Reihen Separator" }, |
327 | { "Alternating backgrounds","Abwechselnder Hintergrund" }, | 327 | { "Alternating backgrounds","Abwechselnder Hintergrund" }, |
328 | { "Single line","Einzelne Zeile" }, | 328 | { "Single line","Einzelne Zeile" }, |
329 | { "Enable background image:","Hintergrundbild:" }, | 329 | { "Enable background image:","Hintergrundbild:" }, |
330 | { "Enable contact tooltips","Contact Tooltips" }, | 330 | { "Enable contact tooltips","Contact Tooltips" }, |
331 | { "&Enable custom Colors","Benutzerdef. Farben" }, | 331 | { "&Enable custom Colors","Benutzerdef. Farben" }, |
332 | { "&Colors","Farben" }, | 332 | { "&Colors","Farben" }, |
333 | { "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 | { "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." }, |
334 | { "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 | { "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." }, |
335 | { "&Enable custom fonts","B&enutzerdefinierte Schriften" }, | 335 | { "&Enable custom fonts","B&enutzerdefinierte Schriften" }, |
336 | { "&Text font:","Textschriftart:" }, | 336 | { "&Text font:","Textschriftart:" }, |
337 | { "&Header font:","Titelschriftart:" }, | 337 | { "&Header font:","Titelschriftart:" }, |
338 | { "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 | { "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." }, |
339 | { "&Fonts","Schri&ften" }, | 339 | { "&Fonts","Schri&ften" }, |
340 | { "Background Color","Hintergrundfarbe" }, | 340 | { "Background Color","Hintergrundfarbe" }, |
341 | { "Text Color","Textfarbe" }, | 341 | { "Text Color","Textfarbe" }, |
342 | { "Header Background Color","Titel Hintergrundfarbe" }, | 342 | { "Header Background Color","Titel Hintergrundfarbe" }, |
343 | { "Header Text Color","Titel Farbe" }, | 343 | { "Header Text Color","Titel Farbe" }, |
344 | { "Highlight Color","Auswahlfarbe" }, | 344 | { "Highlight Color","Auswahlfarbe" }, |
345 | { "Highlighted Text Color","Auswahltextfarbe" }, | 345 | { "Highlighted Text Color","Auswahltextfarbe" }, |
346 | { "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, | 346 | { "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, |
347 | { "Postal","Post" }, | 347 | { "Postal","Post" }, |
348 | { "Dr.","Dr." }, | 348 | { "Dr.","Dr." }, |
349 | { "Miss","Frl." }, | 349 | { "Miss","Frl." }, |
350 | { "Mr.","Herr" }, | 350 | { "Mr.","Herr" }, |
351 | { "Mrs.","Frau" }, | 351 | { "Mrs.","Frau" }, |
352 | { "Ms.","Frau" }, | 352 | { "Ms.","Frau" }, |
353 | { "Prof.","Prof." }, | 353 | { "Prof.","Prof." }, |
354 | { "I","I" }, | 354 | { "I","I" }, |
355 | { "II","II" }, | 355 | { "II","II" }, |
356 | { "III","III" }, | 356 | { "III","III" }, |
357 | { "Jr.","Jr." }, | 357 | { "Jr.","Jr." }, |
358 | { "Sr.","Sr." }, | 358 | { "Sr.","Sr." }, |
359 | { "Name:","Name:" }, | 359 | { "Name:","Name:" }, |
360 | { "Documents","Dokumente" }, | 360 | { "Documents","Dokumente" }, |
361 | { "Files","Dateien" }, | 361 | { "Files","Dateien" }, |
362 | { "All Files","Alle Dateien" }, | 362 | { "All Files","Alle Dateien" }, |
363 | { "Name","Name" }, | 363 | { "Name","Name" }, |
364 | { "Size","Größe" }, | 364 | { "Size","Größe" }, |
365 | { "Date","Datum" }, | 365 | { "Date","Datum" }, |
366 | { "Mime Type","Mime Typ" }, | 366 | { "Mime Type","Mime Typ" }, |
367 | { "Geo Data Input","Geo Dateneingabe" }, | 367 | { "Geo Data Input","Geo Dateneingabe" }, |
368 | { "Sexagesimal","Sexagesimal" }, | 368 | { "Sexagesimal","Sexagesimal" }, |
369 | { "North","Nord" }, | 369 | { "North","Nord" }, |
370 | { "South","Süd" }, | 370 | { "South","Süd" }, |
371 | { "East","Ost" }, | 371 | { "East","Ost" }, |
372 | { "West","West" }, | 372 | { "West","West" }, |
373 | { "Undefined","Unbestimmt" }, | 373 | { "Undefined","Unbestimmt" }, |
374 | { "Edit Address","Bearbeite Adresse" }, | 374 | { "Edit Address","Bearbeite Adresse" }, |
375 | { "Street:","Strasse:" }, | 375 | { "Street:","Strasse:" }, |
376 | { "Post office box:","PLZ:" }, | 376 | { "Post office box:","PLZ:" }, |
377 | { "Locality:","Stadt:" }, | 377 | { "Locality:","Stadt:" }, |
378 | { "Region:","Region:" }, | 378 | { "Region:","Region:" }, |
379 | { "Postal code:","PLZ:" }, | 379 | { "Postal code:","PLZ:" }, |
380 | { "Country:","Staat:" }, | 380 | { "Country:","Staat:" }, |
381 | { "This is the preferred address","Dies ist die bevorzugte Adresse" }, | 381 | { "This is the preferred address","Dies ist die bevorzugte Adresse" }, |
382 | { "New...","Neu..." }, | 382 | { "New...","Neu..." }, |
383 | { "Change Type","Ändere Art" }, | 383 | { "Change Type","Ändere Art" }, |
384 | { "Edit Address Type","Ändere Address Art" }, | 384 | { "Edit Address Type","Ändere Address Art" }, |
385 | { "Address Types","Address Art" }, | 385 | { "Address Types","Address Art" }, |
386 | { "Domestic","Inland" }, | 386 | { "Domestic","Inland" }, |
387 | { "International","International" }, | 387 | { "International","International" }, |
388 | { "Parcel","Paket" }, | 388 | { "Parcel","Paket" }, |
389 | { "Edit Contact Name","Ändere Kontakt Name" }, | 389 | { "Edit Contact Name","Ändere Kontakt Name" }, |
390 | { "Honorific prefixes:","Namensprefixes:" }, | 390 | { "Honorific prefixes:","Namensprefixes:" }, |
391 | { "Given name:","Vorname:" }, | 391 | { "Given name:","Vorname:" }, |
392 | { "Additional names:","Mittelnamen:" }, | 392 | { "Additional names:","Mittelnamen:" }, |
393 | { "Family names:","Nachname:" }, | 393 | { "Family names:","Nachname:" }, |
394 | { "Honorific suffixes:","Namenssuffixe:" }, | 394 | { "Honorific suffixes:","Namenssuffixe:" }, |
395 | { "Parse name automatically","Setze Namen automatisch" }, | 395 | { "Parse name automatically","Setze Namen automatisch" }, |
396 | { "Edit Phone Numbers","Bearbeite Telefonnummern" }, | 396 | { "Edit Phone Numbers","Bearbeite Telefonnummern" }, |
397 | { "Number","Nummer" }, | 397 | { "Number","Nummer" }, |
398 | { "Type","Typ" }, | 398 | { "Type","Typ" }, |
399 | { "Edit Phone Number","Bearbeite Telefonnummer" }, | 399 | { "Edit Phone Number","Bearbeite Telefonnummer" }, |
400 | { "Number:","Nummer:" }, | 400 | { "Number:","Nummer:" }, |
401 | { "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, | 401 | { "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, |
402 | { "Types","Typen" }, | 402 | { "Types","Typen" }, |
403 | { "Messenger","Messenger" }, | 403 | { "Messenger","Messenger" }, |
404 | { "Other","Anderes" }, | 404 | { "Other","Anderes" }, |
405 | { "Video","Video" }, | 405 | { "Video","Video" }, |
406 | { "Mailbox","Mailbox" }, | 406 | { "Mailbox","Mailbox" }, |
407 | { "Modem","Modem" }, | 407 | { "Modem","Modem" }, |
408 | { "Car","Auto" }, | 408 | { "Car","Auto" }, |
409 | { "PCS","PCS" }, | 409 | { "PCS","PCS" }, |
410 | { "Category","Kategorie" }, | 410 | { "Category","Kategorie" }, |
411 | { "Select Categories","Wähle Kategorien" }, | 411 | { "Select Categories","Wähle Kategorien" }, |
412 | { " &Deselect All "," &Deselektiere alle " }, | 412 | { " &Deselect All "," &Deselektiere alle " }, |
413 | { " &Edit Categories "," B&earbeite Kategorien " }, | 413 | { " &Edit Categories "," B&earbeite Kategorien " }, |
414 | { "&OK","&OK" }, | 414 | { "&OK","&OK" }, |
415 | { "&Cancel","Abbre&chen" }, | 415 | { "&Cancel","Abbre&chen" }, |
416 | { "Configure","Konfiguriere" }, | 416 | { "Configure","Konfiguriere" }, |
417 | { "Default","Voreinstellungen" }, | 417 | { "Default","Voreinstellungen" }, |
418 | { "Addressbook","Adressbuch" }, | 418 | { "Addressbook","Adressbuch" }, |
419 | { "Details view font","Schriftart Detailansicht" }, | 419 | { "Details view font","Schriftart Detailansicht" }, |
420 | { "phone:123","phone:123" }, | 420 | { "phone:123","phone:123" }, |
421 | { "Search only after <return> key pressed","Suche nur nach <return> Taste" }, | 421 | { "Search only after <return> key pressed","Suche nur nach <return> Taste" }, |
422 | { "Honor KDE single click","Benutze KDE Einzelklick" }, | 422 | { "Honor KDE single click","Benutze KDE Einzelklick" }, |
423 | { "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" }, | 423 | { "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" }, |
424 | { "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, | 424 | { "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, |
425 | { "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, | 425 | { "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, |
426 | { "General","Algemein" }, | 426 | { "General","Algemein" }, |
427 | { "Extensions (restart)","Extensions (restart)" }, | 427 | { "Extensions (restart)","Extensions (restart)" }, |
428 | { "Description","Beschreibungen" }, | 428 | { "Description","Beschreibungen" }, |
429 | { "Extensions","Extensions" }, | 429 | { "Extensions","Extensions" }, |
430 | { "Prefixes","Prefixe" }, | 430 | { "Prefixes","Prefixe" }, |
431 | { "Inclusions","Inclusions" }, | 431 | { "Inclusions","Inclusions" }, |
432 | { "Suffixes","Suffixe" }, | 432 | { "Suffixes","Suffixe" }, |
433 | { "Default formatted name:","Default format. Name:" }, | 433 | { "Default formatted name:","Default format. Name:" }, |
434 | { "Empty","Leer" }, | 434 | { "Empty","Leer" }, |
435 | { "Simple Name","Einfacher Name" }, | 435 | { "Simple Name","Einfacher Name" }, |
436 | { "Full Name","Voller Name" }, | 436 | { "Full Name","Voller Name" }, |
437 | { "Reverse Name","Namen umdrehen" }, | 437 | { "Reverse Name","Namen umdrehen" }, |
438 | { "Contact","Kontakt" }, | 438 | { "Contact","Kontakt" }, |
439 | { "Global","Allgemein" }, | 439 | { "Global","Allgemein" }, |
440 | { "Phone","Telefon" }, | 440 | { "Phone","Telefon" }, |
441 | { "SMS","SMS" }, | 441 | { "SMS","SMS" }, |
442 | { "Language:(needs restart)","Sprache:(Neustart)" }, | 442 | { "Language:(needs restart)","Sprache:(Neustart)" }, |
443 | { "English","English" }, | 443 | { "English","English" }, |
444 | { "German","Deutsch" }, | 444 | { "German","Deutsch" }, |
445 | { "French","Französisch" }, | 445 | { "French","Französisch" }, |
446 | { "Italian","Italienisch" }, | 446 | { "Italian","Italienisch" }, |
447 | { "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" }, | 447 | { "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" }, |
448 | { "Time Format(nr):","Zeit Format(nr):" }, | 448 | { "Time Format(nr):","Zeit Format(nr):" }, |
449 | { "24:00","24:00" }, | 449 | { "24:00","24:00" }, |
450 | { "12:00am","12:00am" }, | 450 | { "12:00am","12:00am" }, |
451 | { "Week starts on Sunday","Woche beginnt Sonntags" }, | 451 | { "Week starts on Sunday","Woche beginnt Sonntags" }, |
452 | { "Locale","Locale" }, | 452 | { "Locale","Locale" }, |
453 | { "Date Format:","Datums Format:" }, | 453 | { "Date Format:","Datums Format:" }, |
454 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, | 454 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, |
455 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, | 455 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, |
456 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, | 456 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, |
457 | { "User defined","Benutzerdefiniert" }, | 457 | { "User defined","Benutzerdefiniert" }, |
458 | { "User long date:","Format langes Datum:" }, | 458 | { "User long date:","Format langes Datum:" }, |
459 | { "User short date:","Format kurzes Datum:" }, | 459 | { "User short date:","Format kurzes Datum:" }, |
460 | { "Daylight start:","Sommerzeit Beginn:" }, | 460 | { "Daylight start:","Sommerzeit Beginn:" }, |
461 | { "Daylight end:","Sommerzeit Ende:" }, | 461 | { "Daylight end:","Sommerzeit Ende:" }, |
462 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, | 462 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, |
463 | { "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" }, | 463 | { "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" }, |
464 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, | 464 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, |
465 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, | 465 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, |
466 | { "Date Format","Datums Format" }, | 466 | { "Date Format","Datums Format" }, |
467 | { "Timezone:","Zeitzone:" }, | 467 | { "Timezone:","Zeitzone:" }, |
468 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, | 468 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, |
469 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, | 469 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, |
470 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, | 470 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, |
471 | { "Used Mail Client","Benutzter Mail Client" }, | 471 | { "Used Mail Client","Benutzter Mail Client" }, |
472 | { "Channel:","Channel:" }, | 472 | { "Channel:","Channel:" }, |
473 | { "Message:","Message:" }, | 473 | { "Message:","Message:" }, |
474 | { "Parameters:","Parameter:" }, | 474 | { "Parameters:","Parameter:" }, |
475 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, | 475 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, |
476 | { "extra Message:","extra Message:" }, | 476 | { "extra Message:","extra Message:" }, |
477 | { "extra Parameters:","extra Parameter:" }, | 477 | { "extra Parameters:","extra Parameter:" }, |
478 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, | 478 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, |
479 | { "External Apps.","Externe Appl." }, | 479 | { "External Apps.","Externe Appl." }, |
480 | { "Used %1 Client","Benutzer %1 Client" }, | 480 | { "Used %1 Client","Benutzer %1 Client" }, |
481 | { "No email client installed","Keine Email Client installiert" }, | 481 | { "No email client installed","Keine Email Client installiert" }, |
482 | { "Userdefined email client","Benutzerdef. Email Client" }, | 482 | { "Userdefined email client","Benutzerdef. Email Client" }, |
483 | { "OM/Pi email client","OM/Pi Email Client" }, | 483 | { "OM/Pi email client","OM/Pi Email Client" }, |
484 | { "Close KA/Pi?","Schließe KA/Pi?" }, | 484 | { "Close KA/Pi?","Schließe KA/Pi?" }, |
485 | { "\nChanges will be saved!","\nÄnderungen werden gespeichert!" }, | 485 | { "\nChanges will be saved!","\nÄnderungen werden gespeichert!" }, |
486 | { "Yes!","Ja!" }, | 486 | { "Yes!","Ja!" }, |
487 | { "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 | { "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. " }, |
488 | { "Saving addressbook ... ","Speichere Adressbuch ... " }, | 488 | { "Saving addressbook ... ","Speichere Adressbuch ... " }, |
489 | { "Addressbook saved!","Adressbuch gespeichert!" }, | 489 | { "Addressbook saved!","Adressbuch gespeichert!" }, |
490 | { "Default Table View","Default Tabellenansicht" }, | 490 | { "Default Table View","Default Tabellenansicht" }, |
491 | { "Merge and Remove","Zusammenfügen/entfernen" }, | 491 | { "Merge and Remove","Zusammenfügen/entfernen" }, |
492 | { "Merge","Zusammenfügen" }, | 492 | { "Merge","Zusammenfügen" }, |
493 | { "Merge Contacts Editor","Contact-Zusammenfüge-Editor" }, | 493 | { "Merge Contacts Editor","Contact-Zusammenfüge-Editor" }, |
494 | { "New List...","Neue Liste..." }, | 494 | { "New List...","Neue Liste..." }, |
495 | { "Rename List...","Ändere Namen..." }, | 495 | { "Rename List...","Ändere Namen..." }, |
496 | { "Remove List","Lösche Liste" }, | 496 | { "Remove List","Lösche Liste" }, |
497 | { "Add Contact","Kontakt hinzu" }, | 497 | { "Add Contact","Kontakt hinzu" }, |
498 | { "Change Email...","Ändere Email..." }, | 498 | { "Change Email...","Ändere Email..." }, |
499 | { "Remove Contact","Entferne Kontakt" }, | 499 | { "Remove Contact","Entferne Kontakt" }, |
500 | { "Use Preferred","Nutze Preferred" }, | 500 | { "Use Preferred","Nutze Preferred" }, |
501 | { "Distribution List Editor","Distribution List Editor" }, | 501 | { "Distribution List Editor","Distribution List Editor" }, |
502 | { "Choose which contacts to export","Wähle Kontakte zum Exportieren" }, | 502 | { "Choose which contacts to export","Wähle Kontakte zum Exportieren" }, |
503 | { "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" }, | 503 | { "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" }, |
504 | { "Contact Selection","Kontaktauswahl" }, | 504 | { "Contact Selection","Kontaktauswahl" }, |
505 | { "&All","&Alle" }, | 505 | { "&All","&Alle" }, |
506 | { "Export the entire address book","Exportiere das komplette Addressbuch" }, | 506 | { "Export the entire address book","Exportiere das komplette Addressbuch" }, |
507 | { "&Selected","Au&sgewählte" }, | 507 | { "&Selected","Au&sgewählte" }, |
508 | { "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 | { "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." }, |
509 | { "By matching &filter","Zutreffender &Filter" }, | 509 | { "By matching &filter","Zutreffender &Filter" }, |
510 | { "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 | { "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" }, |
511 | { "By Cate&gories","Kategorien" }, | 511 | { "By Cate&gories","Kategorien" }, |
512 | { "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 | { "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." }, |
513 | { "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." }, | 513 | { "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." }, |
514 | { "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." }, | 514 | { "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." }, |
515 | { "Sorting","Sortieren" }, | 515 | { "Sorting","Sortieren" }, |
516 | { "Criterion:","Merkmal:" }, | 516 | { "Criterion:","Merkmal:" }, |
517 | { "Order:","Reihenfolge:" }, | 517 | { "Order:","Reihenfolge:" }, |
518 | { "Ascending","Aufsteigend" }, | 518 | { "Ascending","Aufsteigend" }, |
519 | { "Descending","Absteigend" }, | 519 | { "Descending","Absteigend" }, |
520 | { "Save file","Datei speichern" }, | 520 | { "Save file","Datei speichern" }, |
521 | { "Error","Fehler" }, | 521 | { "Error","Fehler" }, |
522 | { "Unable to export contacts.","Exportieren der Kontakte geht nicht." }, | 522 | { "Unable to export contacts.","Exportieren der Kontakte geht nicht." }, |
523 | { "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" }, | 523 | { "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" }, |
524 | { "Manage new categories...","Verwalte neue Kategorien..." }, | 524 | { "Manage new categories...","Verwalte neue Kategorien..." }, |
525 | { "&File","Datei" }, | ||
526 | { "&Edit","Bearbeite" }, | ||
527 | { "&View","Ansichten" }, | ||
528 | { "&Settings","Konfiguration" }, | ||
529 | { "&Change selected","Ändere Selekt." }, | ||
530 | { "&Help","Hilfe" }, | ||
525 | { "","" }, | 531 | { "","" }, |
526 | { "","" }, | 532 | { "","" }, |
527 | { "","" }, | 533 | { "","" }, |
528 | { "","" }, | 534 | { "","" }, |
529 | { "","" }, | 535 | { "","" }, |
530 | { "","" }, | 536 | { "","" }, |
531 | { "","" }, | 537 | { "","" }, |
532 | { "","" }, | 538 | { "","" }, |
533 | { "","" }, \ No newline at end of file | 539 | { "","" }, \ No newline at end of file |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 9505a23..4445310 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1,3089 +1,3089 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressbook. | 2 | This file is part of KAddressbook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /*s | 24 | /*s |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "kabcore.h" | 31 | #include "kabcore.h" |
32 | 32 | ||
33 | #include <stdaddressbook.h> | 33 | #include <stdaddressbook.h> |
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | #include <kfiledialog.h> | 35 | #include <kfiledialog.h> |
36 | #include <qtimer.h> | 36 | #include <qtimer.h> |
37 | #include <qlabel.h> | 37 | #include <qlabel.h> |
38 | #include <qregexp.h> | 38 | #include <qregexp.h> |
39 | #include <qlineedit.h> | 39 | #include <qlineedit.h> |
40 | #include <qcheckbox.h> | 40 | #include <qcheckbox.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qprogressbar.h> | 42 | #include <qprogressbar.h> |
43 | #include <libkdepim/phoneaccess.h> | 43 | #include <libkdepim/phoneaccess.h> |
44 | 44 | ||
45 | #ifndef KAB_EMBEDDED | 45 | #ifndef KAB_EMBEDDED |
46 | #include <qclipboard.h> | 46 | #include <qclipboard.h> |
47 | #include <qdir.h> | 47 | #include <qdir.h> |
48 | #include <qfile.h> | 48 | #include <qfile.h> |
49 | #include <qapplicaton.h> | 49 | #include <qapplicaton.h> |
50 | #include <qprogressbar.h> | 50 | #include <qprogressbar.h> |
51 | #include <qlayout.h> | 51 | #include <qlayout.h> |
52 | #include <qregexp.h> | 52 | #include <qregexp.h> |
53 | #include <qvbox.h> | 53 | #include <qvbox.h> |
54 | #include <kabc/addresseelist.h> | 54 | #include <kabc/addresseelist.h> |
55 | #include <kabc/errorhandler.h> | 55 | #include <kabc/errorhandler.h> |
56 | #include <kabc/resource.h> | 56 | #include <kabc/resource.h> |
57 | #include <kabc/vcardconverter.h> | 57 | #include <kabc/vcardconverter.h> |
58 | #include <kapplication.h> | 58 | #include <kapplication.h> |
59 | #include <kactionclasses.h> | 59 | #include <kactionclasses.h> |
60 | #include <kcmultidialog.h> | 60 | #include <kcmultidialog.h> |
61 | #include <kdebug.h> | 61 | #include <kdebug.h> |
62 | #include <kdeversion.h> | 62 | #include <kdeversion.h> |
63 | #include <kkeydialog.h> | 63 | #include <kkeydialog.h> |
64 | #include <kmessagebox.h> | 64 | #include <kmessagebox.h> |
65 | #include <kprinter.h> | 65 | #include <kprinter.h> |
66 | #include <kprotocolinfo.h> | 66 | #include <kprotocolinfo.h> |
67 | #include <kresources/selectdialog.h> | 67 | #include <kresources/selectdialog.h> |
68 | #include <kstandarddirs.h> | 68 | #include <kstandarddirs.h> |
69 | #include <ktempfile.h> | 69 | #include <ktempfile.h> |
70 | #include <kxmlguiclient.h> | 70 | #include <kxmlguiclient.h> |
71 | #include <kaboutdata.h> | 71 | #include <kaboutdata.h> |
72 | #include <libkdepim/categoryselectdialog.h> | 72 | #include <libkdepim/categoryselectdialog.h> |
73 | 73 | ||
74 | #include "addresseeutil.h" | 74 | #include "addresseeutil.h" |
75 | #include "addresseeeditordialog.h" | 75 | #include "addresseeeditordialog.h" |
76 | #include "extensionmanager.h" | 76 | #include "extensionmanager.h" |
77 | #include "kstdaction.h" | 77 | #include "kstdaction.h" |
78 | #include "kaddressbookservice.h" | 78 | #include "kaddressbookservice.h" |
79 | #include "ldapsearchdialog.h" | 79 | #include "ldapsearchdialog.h" |
80 | #include "printing/printingwizard.h" | 80 | #include "printing/printingwizard.h" |
81 | #else // KAB_EMBEDDED | 81 | #else // KAB_EMBEDDED |
82 | 82 | ||
83 | #include <kapplication.h> | 83 | #include <kapplication.h> |
84 | #include "KDGanttMinimizeSplitter.h" | 84 | #include "KDGanttMinimizeSplitter.h" |
85 | #include "kaddressbookmain.h" | 85 | #include "kaddressbookmain.h" |
86 | #include "kactioncollection.h" | 86 | #include "kactioncollection.h" |
87 | #include "addresseedialog.h" | 87 | #include "addresseedialog.h" |
88 | //US | 88 | //US |
89 | #include <addresseeview.h> | 89 | #include <addresseeview.h> |
90 | 90 | ||
91 | #include <qapp.h> | 91 | #include <qapp.h> |
92 | #include <qmenubar.h> | 92 | #include <qmenubar.h> |
93 | //#include <qtoolbar.h> | 93 | //#include <qtoolbar.h> |
94 | #include <qmessagebox.h> | 94 | #include <qmessagebox.h> |
95 | #include <kdebug.h> | 95 | #include <kdebug.h> |
96 | #include <kiconloader.h> // needed for SmallIcon | 96 | #include <kiconloader.h> // needed for SmallIcon |
97 | #include <kresources/kcmkresources.h> | 97 | #include <kresources/kcmkresources.h> |
98 | #include <ktoolbar.h> | 98 | #include <ktoolbar.h> |
99 | 99 | ||
100 | 100 | ||
101 | //#include <qlabel.h> | 101 | //#include <qlabel.h> |
102 | 102 | ||
103 | 103 | ||
104 | #ifndef DESKTOP_VERSION | 104 | #ifndef DESKTOP_VERSION |
105 | #include <qpe/ir.h> | 105 | #include <qpe/ir.h> |
106 | #include <qpe/qpemenubar.h> | 106 | #include <qpe/qpemenubar.h> |
107 | #include <qtopia/qcopenvelope_qws.h> | 107 | #include <qtopia/qcopenvelope_qws.h> |
108 | #else | 108 | #else |
109 | 109 | ||
110 | #include <qmenubar.h> | 110 | #include <qmenubar.h> |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | #endif // KAB_EMBEDDED | 113 | #endif // KAB_EMBEDDED |
114 | #include "kcmconfigs/kcmkabconfig.h" | 114 | #include "kcmconfigs/kcmkabconfig.h" |
115 | #include "kcmconfigs/kcmkdepimconfig.h" | 115 | #include "kcmconfigs/kcmkdepimconfig.h" |
116 | #include "kpimglobalprefs.h" | 116 | #include "kpimglobalprefs.h" |
117 | #include "externalapphandler.h" | 117 | #include "externalapphandler.h" |
118 | 118 | ||
119 | 119 | ||
120 | #include <kresources/selectdialog.h> | 120 | #include <kresources/selectdialog.h> |
121 | #include <kmessagebox.h> | 121 | #include <kmessagebox.h> |
122 | 122 | ||
123 | #include <picture.h> | 123 | #include <picture.h> |
124 | #include <resource.h> | 124 | #include <resource.h> |
125 | 125 | ||
126 | //US#include <qsplitter.h> | 126 | //US#include <qsplitter.h> |
127 | #include <qmap.h> | 127 | #include <qmap.h> |
128 | #include <qdir.h> | 128 | #include <qdir.h> |
129 | #include <qfile.h> | 129 | #include <qfile.h> |
130 | #include <qvbox.h> | 130 | #include <qvbox.h> |
131 | #include <qlayout.h> | 131 | #include <qlayout.h> |
132 | #include <qclipboard.h> | 132 | #include <qclipboard.h> |
133 | #include <qtextstream.h> | 133 | #include <qtextstream.h> |
134 | #include <qradiobutton.h> | 134 | #include <qradiobutton.h> |
135 | #include <qbuttongroup.h> | 135 | #include <qbuttongroup.h> |
136 | 136 | ||
137 | #include <libkdepim/categoryselectdialog.h> | 137 | #include <libkdepim/categoryselectdialog.h> |
138 | #include <libkdepim/categoryeditdialog.h> | 138 | #include <libkdepim/categoryeditdialog.h> |
139 | #include <kabc/vcardconverter.h> | 139 | #include <kabc/vcardconverter.h> |
140 | 140 | ||
141 | 141 | ||
142 | #include "addresseeutil.h" | 142 | #include "addresseeutil.h" |
143 | #include "undocmds.h" | 143 | #include "undocmds.h" |
144 | #include "addresseeeditordialog.h" | 144 | #include "addresseeeditordialog.h" |
145 | #include "viewmanager.h" | 145 | #include "viewmanager.h" |
146 | #include "details/detailsviewcontainer.h" | 146 | #include "details/detailsviewcontainer.h" |
147 | #include "kabprefs.h" | 147 | #include "kabprefs.h" |
148 | #include "xxportmanager.h" | 148 | #include "xxportmanager.h" |
149 | #include "incsearchwidget.h" | 149 | #include "incsearchwidget.h" |
150 | #include "jumpbuttonbar.h" | 150 | #include "jumpbuttonbar.h" |
151 | #include "extensionmanager.h" | 151 | #include "extensionmanager.h" |
152 | #include "addresseeconfig.h" | 152 | #include "addresseeconfig.h" |
153 | #include <kcmultidialog.h> | 153 | #include <kcmultidialog.h> |
154 | 154 | ||
155 | #ifdef _WIN32_ | 155 | #ifdef _WIN32_ |
156 | 156 | ||
157 | #include "kaimportoldialog.h" | 157 | #include "kaimportoldialog.h" |
158 | #else | 158 | #else |
159 | #include <unistd.h> | 159 | #include <unistd.h> |
160 | #endif | 160 | #endif |
161 | // sync includes | 161 | // sync includes |
162 | #include <libkdepim/ksyncprofile.h> | 162 | #include <libkdepim/ksyncprofile.h> |
163 | #include <libkdepim/ksyncprefsdialog.h> | 163 | #include <libkdepim/ksyncprefsdialog.h> |
164 | 164 | ||
165 | 165 | ||
166 | class KABCatPrefs : public QDialog | 166 | class KABCatPrefs : public QDialog |
167 | { | 167 | { |
168 | public: | 168 | public: |
169 | KABCatPrefs( QWidget *parent=0, const char *name=0 ) : | 169 | KABCatPrefs( QWidget *parent=0, const char *name=0 ) : |
170 | QDialog( parent, name, true ) | 170 | QDialog( parent, name, true ) |
171 | { | 171 | { |
172 | setCaption( i18n("Manage new Categories") ); | 172 | setCaption( i18n("Manage new Categories") ); |
173 | QVBoxLayout* lay = new QVBoxLayout( this ); | 173 | QVBoxLayout* lay = new QVBoxLayout( this ); |
174 | lay->setSpacing( 3 ); | 174 | lay->setSpacing( 3 ); |
175 | lay->setMargin( 3 ); | 175 | lay->setMargin( 3 ); |
176 | 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 ); | 176 | 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 ); |
177 | lay->addWidget( lab ); | 177 | lay->addWidget( lab ); |
178 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); | 178 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); |
179 | lay->addWidget( format ); | 179 | lay->addWidget( format ); |
180 | format->setExclusive ( true ) ; | 180 | format->setExclusive ( true ) ; |
181 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); | 181 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); |
182 | new QRadioButton(i18n("Remove from addressees"), format ); | 182 | new QRadioButton(i18n("Remove from addressees"), format ); |
183 | addCatBut->setChecked( true ); | 183 | addCatBut->setChecked( true ); |
184 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 184 | QPushButton * ok = new QPushButton( i18n("OK"), this ); |
185 | lay->addWidget( ok ); | 185 | lay->addWidget( ok ); |
186 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 186 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
187 | lay->addWidget( cancel ); | 187 | lay->addWidget( cancel ); |
188 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 188 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
189 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 189 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
190 | resize( 200, 200 ); | 190 | resize( 200, 200 ); |
191 | } | 191 | } |
192 | 192 | ||
193 | bool addCat() { return addCatBut->isChecked(); } | 193 | bool addCat() { return addCatBut->isChecked(); } |
194 | private: | 194 | private: |
195 | QRadioButton* addCatBut; | 195 | QRadioButton* addCatBut; |
196 | }; | 196 | }; |
197 | 197 | ||
198 | 198 | ||
199 | 199 | ||
200 | class KAex2phonePrefs : public QDialog | 200 | class KAex2phonePrefs : public QDialog |
201 | { | 201 | { |
202 | public: | 202 | public: |
203 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 203 | KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
204 | QDialog( parent, name, true ) | 204 | QDialog( parent, name, true ) |
205 | { | 205 | { |
206 | setCaption( i18n("Export to phone options") ); | 206 | setCaption( i18n("Export to phone options") ); |
207 | QVBoxLayout* lay = new QVBoxLayout( this ); | 207 | QVBoxLayout* lay = new QVBoxLayout( this ); |
208 | lay->setSpacing( 3 ); | 208 | lay->setSpacing( 3 ); |
209 | lay->setMargin( 3 ); | 209 | lay->setMargin( 3 ); |
210 | QLabel *lab; | 210 | QLabel *lab; |
211 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 211 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
212 | lab->setAlignment (AlignHCenter ); | 212 | lab->setAlignment (AlignHCenter ); |
213 | QHBox* temphb; | 213 | QHBox* temphb; |
214 | temphb = new QHBox( this ); | 214 | temphb = new QHBox( this ); |
215 | new QLabel( i18n("I/O device: "), temphb ); | 215 | new QLabel( i18n("I/O device: "), temphb ); |
216 | mPhoneDevice = new QLineEdit( temphb); | 216 | mPhoneDevice = new QLineEdit( temphb); |
217 | lay->addWidget( temphb ); | 217 | lay->addWidget( temphb ); |
218 | temphb = new QHBox( this ); | 218 | temphb = new QHBox( this ); |
219 | new QLabel( i18n("Connection: "), temphb ); | 219 | new QLabel( i18n("Connection: "), temphb ); |
220 | mPhoneConnection = new QLineEdit( temphb); | 220 | mPhoneConnection = new QLineEdit( temphb); |
221 | lay->addWidget( temphb ); | 221 | lay->addWidget( temphb ); |
222 | temphb = new QHBox( this ); | 222 | temphb = new QHBox( this ); |
223 | new QLabel( i18n("Model(opt.): "), temphb ); | 223 | new QLabel( i18n("Model(opt.): "), temphb ); |
224 | mPhoneModel = new QLineEdit( temphb); | 224 | mPhoneModel = new QLineEdit( temphb); |
225 | lay->addWidget( temphb ); | 225 | lay->addWidget( temphb ); |
226 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); | 226 | // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); |
227 | // lay->addWidget( mWriteToSim ); | 227 | // lay->addWidget( mWriteToSim ); |
228 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); | 228 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); |
229 | lab->setAlignment (AlignHCenter ); | 229 | lab->setAlignment (AlignHCenter ); |
230 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 230 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
231 | lay->addWidget( ok ); | 231 | lay->addWidget( ok ); |
232 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 232 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
233 | lay->addWidget( cancel ); | 233 | lay->addWidget( cancel ); |
234 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 234 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
235 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 235 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
236 | resize( 220, 240 ); | 236 | resize( 220, 240 ); |
237 | 237 | ||
238 | } | 238 | } |
239 | 239 | ||
240 | public: | 240 | public: |
241 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 241 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
242 | QCheckBox* mWriteToSim; | 242 | QCheckBox* mWriteToSim; |
243 | }; | 243 | }; |
244 | 244 | ||
245 | 245 | ||
246 | bool pasteWithNewUid = true; | 246 | bool pasteWithNewUid = true; |
247 | 247 | ||
248 | #ifdef KAB_EMBEDDED | 248 | #ifdef KAB_EMBEDDED |
249 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) | 249 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) |
250 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), | 250 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), |
251 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ | 251 | mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ |
252 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) | 252 | mReadWrite( readWrite ), mModified( false ), mMainWindow(client) |
253 | #else //KAB_EMBEDDED | 253 | #else //KAB_EMBEDDED |
254 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) | 254 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) |
255 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), | 255 | : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), |
256 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), | 256 | mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), |
257 | mReadWrite( readWrite ), mModified( false ) | 257 | mReadWrite( readWrite ), mModified( false ) |
258 | #endif //KAB_EMBEDDED | 258 | #endif //KAB_EMBEDDED |
259 | { | 259 | { |
260 | // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); | 260 | // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); |
261 | // syncManager->setBlockSave(false); | 261 | // syncManager->setBlockSave(false); |
262 | mExtensionBarSplitter = 0; | 262 | mExtensionBarSplitter = 0; |
263 | mIsPart = !parent->inherits( "KAddressBookMain" ); | 263 | mIsPart = !parent->inherits( "KAddressBookMain" ); |
264 | mAddressBook = KABC::StdAddressBook::self(); | 264 | mAddressBook = KABC::StdAddressBook::self(); |
265 | KABC::StdAddressBook::setAutomaticSave( false ); | 265 | KABC::StdAddressBook::setAutomaticSave( false ); |
266 | 266 | ||
267 | #ifndef KAB_EMBEDDED | 267 | #ifndef KAB_EMBEDDED |
268 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); | 268 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); |
269 | #endif //KAB_EMBEDDED | 269 | #endif //KAB_EMBEDDED |
270 | 270 | ||
271 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), | 271 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), |
272 | SLOT( addressBookChanged() ) ); | 272 | SLOT( addressBookChanged() ) ); |
273 | 273 | ||
274 | #if 0 | 274 | #if 0 |
275 | // LP moved to addressbook init method | 275 | // LP moved to addressbook init method |
276 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, | 276 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, |
277 | "X-Department", "KADDRESSBOOK" ); | 277 | "X-Department", "KADDRESSBOOK" ); |
278 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, | 278 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, |
279 | "X-Profession", "KADDRESSBOOK" ); | 279 | "X-Profession", "KADDRESSBOOK" ); |
280 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, | 280 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, |
281 | "X-AssistantsName", "KADDRESSBOOK" ); | 281 | "X-AssistantsName", "KADDRESSBOOK" ); |
282 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, | 282 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, |
283 | "X-ManagersName", "KADDRESSBOOK" ); | 283 | "X-ManagersName", "KADDRESSBOOK" ); |
284 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, | 284 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, |
285 | "X-SpousesName", "KADDRESSBOOK" ); | 285 | "X-SpousesName", "KADDRESSBOOK" ); |
286 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, | 286 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, |
287 | "X-Office", "KADDRESSBOOK" ); | 287 | "X-Office", "KADDRESSBOOK" ); |
288 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, | 288 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, |
289 | "X-IMAddress", "KADDRESSBOOK" ); | 289 | "X-IMAddress", "KADDRESSBOOK" ); |
290 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, | 290 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, |
291 | "X-Anniversary", "KADDRESSBOOK" ); | 291 | "X-Anniversary", "KADDRESSBOOK" ); |
292 | 292 | ||
293 | //US added this field to become compatible with Opie/qtopia addressbook | 293 | //US added this field to become compatible with Opie/qtopia addressbook |
294 | // values can be "female" or "male" or "". An empty field represents undefined. | 294 | // values can be "female" or "male" or "". An empty field represents undefined. |
295 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, | 295 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, |
296 | "X-Gender", "KADDRESSBOOK" ); | 296 | "X-Gender", "KADDRESSBOOK" ); |
297 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, | 297 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, |
298 | "X-Children", "KADDRESSBOOK" ); | 298 | "X-Children", "KADDRESSBOOK" ); |
299 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, | 299 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, |
300 | "X-FreeBusyUrl", "KADDRESSBOOK" ); | 300 | "X-FreeBusyUrl", "KADDRESSBOOK" ); |
301 | #endif | 301 | #endif |
302 | initGUI(); | 302 | initGUI(); |
303 | 303 | ||
304 | mIncSearchWidget->setFocus(); | 304 | mIncSearchWidget->setFocus(); |
305 | 305 | ||
306 | 306 | ||
307 | connect( mViewManager, SIGNAL( selected( const QString& ) ), | 307 | connect( mViewManager, SIGNAL( selected( const QString& ) ), |
308 | SLOT( setContactSelected( const QString& ) ) ); | 308 | SLOT( setContactSelected( const QString& ) ) ); |
309 | connect( mViewManager, SIGNAL( executed( const QString& ) ), | 309 | connect( mViewManager, SIGNAL( executed( const QString& ) ), |
310 | SLOT( executeContact( const QString& ) ) ); | 310 | SLOT( executeContact( const QString& ) ) ); |
311 | 311 | ||
312 | connect( mViewManager, SIGNAL( deleteRequest( ) ), | 312 | connect( mViewManager, SIGNAL( deleteRequest( ) ), |
313 | SLOT( deleteContacts( ) ) ); | 313 | SLOT( deleteContacts( ) ) ); |
314 | connect( mViewManager, SIGNAL( modified() ), | 314 | connect( mViewManager, SIGNAL( modified() ), |
315 | SLOT( setModified() ) ); | 315 | SLOT( setModified() ) ); |
316 | 316 | ||
317 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); | 317 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); |
318 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); | 318 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); |
319 | 319 | ||
320 | connect( mXXPortManager, SIGNAL( modified() ), | 320 | connect( mXXPortManager, SIGNAL( modified() ), |
321 | SLOT( setModified() ) ); | 321 | SLOT( setModified() ) ); |
322 | 322 | ||
323 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), | 323 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), |
324 | SLOT( incrementalSearch( const QString& ) ) ); | 324 | SLOT( incrementalSearch( const QString& ) ) ); |
325 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), | 325 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), |
326 | mJumpButtonBar, SLOT( recreateButtons() ) ); | 326 | mJumpButtonBar, SLOT( recreateButtons() ) ); |
327 | 327 | ||
328 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 328 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
329 | SLOT( sendMail( const QString& ) ) ); | 329 | SLOT( sendMail( const QString& ) ) ); |
330 | 330 | ||
331 | 331 | ||
332 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); | 332 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
333 | 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&))); | 333 | 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&))); |
334 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); | 334 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); |
335 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); | 335 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); |
336 | 336 | ||
337 | 337 | ||
338 | #ifndef KAB_EMBEDDED | 338 | #ifndef KAB_EMBEDDED |
339 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 339 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
340 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 340 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
341 | 341 | ||
342 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 342 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
343 | SLOT( browse( const QString& ) ) ); | 343 | SLOT( browse( const QString& ) ) ); |
344 | 344 | ||
345 | 345 | ||
346 | mAddressBookService = new KAddressBookService( this ); | 346 | mAddressBookService = new KAddressBookService( this ); |
347 | 347 | ||
348 | #endif //KAB_EMBEDDED | 348 | #endif //KAB_EMBEDDED |
349 | 349 | ||
350 | mMessageTimer = new QTimer( this ); | 350 | mMessageTimer = new QTimer( this ); |
351 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); | 351 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); |
352 | mEditorDialog = 0; | 352 | mEditorDialog = 0; |
353 | createAddresseeEditorDialog( this ); | 353 | createAddresseeEditorDialog( this ); |
354 | setModified( false ); | 354 | setModified( false ); |
355 | mBRdisabled = false; | 355 | mBRdisabled = false; |
356 | #ifndef DESKTOP_VERSION | 356 | #ifndef DESKTOP_VERSION |
357 | infrared = 0; | 357 | infrared = 0; |
358 | #endif | 358 | #endif |
359 | //toggleBeamReceive( ); | 359 | //toggleBeamReceive( ); |
360 | } | 360 | } |
361 | 361 | ||
362 | KABCore::~KABCore() | 362 | KABCore::~KABCore() |
363 | { | 363 | { |
364 | // save(); | 364 | // save(); |
365 | //saveSettings(); | 365 | //saveSettings(); |
366 | //KABPrefs::instance()->writeConfig(); | 366 | //KABPrefs::instance()->writeConfig(); |
367 | delete AddresseeConfig::instance(); | 367 | delete AddresseeConfig::instance(); |
368 | mAddressBook = 0; | 368 | mAddressBook = 0; |
369 | KABC::StdAddressBook::close(); | 369 | KABC::StdAddressBook::close(); |
370 | 370 | ||
371 | delete syncManager; | 371 | delete syncManager; |
372 | #ifndef DESKTOP_VERSION | 372 | #ifndef DESKTOP_VERSION |
373 | if ( infrared ) | 373 | if ( infrared ) |
374 | delete infrared; | 374 | delete infrared; |
375 | #endif | 375 | #endif |
376 | } | 376 | } |
377 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 377 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) |
378 | { | 378 | { |
379 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); | 379 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); |
380 | if ( cmsg == "setDocument(QString)" ) { | 380 | if ( cmsg == "setDocument(QString)" ) { |
381 | QDataStream stream( data, IO_ReadOnly ); | 381 | QDataStream stream( data, IO_ReadOnly ); |
382 | QString fileName; | 382 | QString fileName; |
383 | stream >> fileName; | 383 | stream >> fileName; |
384 | recieve( fileName ); | 384 | recieve( fileName ); |
385 | return; | 385 | return; |
386 | } | 386 | } |
387 | } | 387 | } |
388 | void KABCore::toggleBeamReceive( ) | 388 | void KABCore::toggleBeamReceive( ) |
389 | { | 389 | { |
390 | if ( mBRdisabled ) | 390 | if ( mBRdisabled ) |
391 | return; | 391 | return; |
392 | #ifndef DESKTOP_VERSION | 392 | #ifndef DESKTOP_VERSION |
393 | if ( infrared ) { | 393 | if ( infrared ) { |
394 | qDebug("AB disable BeamReceive "); | 394 | qDebug("AB disable BeamReceive "); |
395 | delete infrared; | 395 | delete infrared; |
396 | infrared = 0; | 396 | infrared = 0; |
397 | mActionBR->setChecked(false); | 397 | mActionBR->setChecked(false); |
398 | return; | 398 | return; |
399 | } | 399 | } |
400 | qDebug("AB enable BeamReceive "); | 400 | qDebug("AB enable BeamReceive "); |
401 | mActionBR->setChecked(true); | 401 | mActionBR->setChecked(true); |
402 | 402 | ||
403 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 403 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
404 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); | 404 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); |
405 | #endif | 405 | #endif |
406 | } | 406 | } |
407 | 407 | ||
408 | 408 | ||
409 | void KABCore::disableBR(bool b) | 409 | void KABCore::disableBR(bool b) |
410 | { | 410 | { |
411 | #ifndef DESKTOP_VERSION | 411 | #ifndef DESKTOP_VERSION |
412 | if ( b ) { | 412 | if ( b ) { |
413 | if ( infrared ) { | 413 | if ( infrared ) { |
414 | toggleBeamReceive( ); | 414 | toggleBeamReceive( ); |
415 | } | 415 | } |
416 | mBRdisabled = true; | 416 | mBRdisabled = true; |
417 | } else { | 417 | } else { |
418 | if ( mBRdisabled ) { | 418 | if ( mBRdisabled ) { |
419 | mBRdisabled = false; | 419 | mBRdisabled = false; |
420 | //toggleBeamReceive( ); | 420 | //toggleBeamReceive( ); |
421 | } | 421 | } |
422 | } | 422 | } |
423 | #endif | 423 | #endif |
424 | 424 | ||
425 | } | 425 | } |
426 | void KABCore::recieve( QString fn ) | 426 | void KABCore::recieve( QString fn ) |
427 | { | 427 | { |
428 | //qDebug("KABCore::recieve "); | 428 | //qDebug("KABCore::recieve "); |
429 | int count = mAddressBook->importFromFile( fn, true ); | 429 | int count = mAddressBook->importFromFile( fn, true ); |
430 | if ( count ) | 430 | if ( count ) |
431 | setModified( true ); | 431 | setModified( true ); |
432 | mViewManager->refreshView(); | 432 | mViewManager->refreshView(); |
433 | message(i18n("%1 contact(s) received!").arg( count )); | 433 | message(i18n("%1 contact(s) received!").arg( count )); |
434 | topLevelWidget()->showMaximized(); | 434 | topLevelWidget()->showMaximized(); |
435 | topLevelWidget()->raise(); | 435 | topLevelWidget()->raise(); |
436 | } | 436 | } |
437 | void KABCore::restoreSettings() | 437 | void KABCore::restoreSettings() |
438 | { | 438 | { |
439 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 439 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
440 | 440 | ||
441 | bool state; | 441 | bool state; |
442 | 442 | ||
443 | if (mMultipleViewsAtOnce) | 443 | if (mMultipleViewsAtOnce) |
444 | state = KABPrefs::instance()->mDetailsPageVisible; | 444 | state = KABPrefs::instance()->mDetailsPageVisible; |
445 | else | 445 | else |
446 | state = false; | 446 | state = false; |
447 | 447 | ||
448 | mActionDetails->setChecked( state ); | 448 | mActionDetails->setChecked( state ); |
449 | setDetailsVisible( state ); | 449 | setDetailsVisible( state ); |
450 | 450 | ||
451 | state = KABPrefs::instance()->mJumpButtonBarVisible; | 451 | state = KABPrefs::instance()->mJumpButtonBarVisible; |
452 | 452 | ||
453 | mActionJumpBar->setChecked( state ); | 453 | mActionJumpBar->setChecked( state ); |
454 | setJumpButtonBarVisible( state ); | 454 | setJumpButtonBarVisible( state ); |
455 | /*US | 455 | /*US |
456 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 456 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
457 | if ( splitterSize.count() == 0 ) { | 457 | if ( splitterSize.count() == 0 ) { |
458 | splitterSize.append( width() / 2 ); | 458 | splitterSize.append( width() / 2 ); |
459 | splitterSize.append( width() / 2 ); | 459 | splitterSize.append( width() / 2 ); |
460 | } | 460 | } |
461 | mMiniSplitter->setSizes( splitterSize ); | 461 | mMiniSplitter->setSizes( splitterSize ); |
462 | if ( mExtensionBarSplitter ) { | 462 | if ( mExtensionBarSplitter ) { |
463 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 463 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
464 | if ( splitterSize.count() == 0 ) { | 464 | if ( splitterSize.count() == 0 ) { |
465 | splitterSize.append( width() / 2 ); | 465 | splitterSize.append( width() / 2 ); |
466 | splitterSize.append( width() / 2 ); | 466 | splitterSize.append( width() / 2 ); |
467 | } | 467 | } |
468 | mExtensionBarSplitter->setSizes( splitterSize ); | 468 | mExtensionBarSplitter->setSizes( splitterSize ); |
469 | 469 | ||
470 | } | 470 | } |
471 | */ | 471 | */ |
472 | mViewManager->restoreSettings(); | 472 | mViewManager->restoreSettings(); |
473 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 473 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
474 | mExtensionManager->restoreSettings(); | 474 | mExtensionManager->restoreSettings(); |
475 | #ifdef DESKTOP_VERSION | 475 | #ifdef DESKTOP_VERSION |
476 | int wid = width(); | 476 | int wid = width(); |
477 | if ( wid < 10 ) | 477 | if ( wid < 10 ) |
478 | wid = 400; | 478 | wid = 400; |
479 | #else | 479 | #else |
480 | int wid = QApplication::desktop()->width(); | 480 | int wid = QApplication::desktop()->width(); |
481 | if ( wid < 640 ) | 481 | if ( wid < 640 ) |
482 | wid = QApplication::desktop()->height(); | 482 | wid = QApplication::desktop()->height(); |
483 | #endif | 483 | #endif |
484 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; | 484 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; |
485 | if ( true /*splitterSize.count() == 0*/ ) { | 485 | if ( true /*splitterSize.count() == 0*/ ) { |
486 | splitterSize.append( wid / 2 ); | 486 | splitterSize.append( wid / 2 ); |
487 | splitterSize.append( wid / 2 ); | 487 | splitterSize.append( wid / 2 ); |
488 | } | 488 | } |
489 | mMiniSplitter->setSizes( splitterSize ); | 489 | mMiniSplitter->setSizes( splitterSize ); |
490 | if ( mExtensionBarSplitter ) { | 490 | if ( mExtensionBarSplitter ) { |
491 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 491 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
492 | if ( true /*splitterSize.count() == 0*/ ) { | 492 | if ( true /*splitterSize.count() == 0*/ ) { |
493 | splitterSize.append( wid / 2 ); | 493 | splitterSize.append( wid / 2 ); |
494 | splitterSize.append( wid / 2 ); | 494 | splitterSize.append( wid / 2 ); |
495 | } | 495 | } |
496 | mExtensionBarSplitter->setSizes( splitterSize ); | 496 | mExtensionBarSplitter->setSizes( splitterSize ); |
497 | 497 | ||
498 | } | 498 | } |
499 | 499 | ||
500 | 500 | ||
501 | } | 501 | } |
502 | 502 | ||
503 | void KABCore::saveSettings() | 503 | void KABCore::saveSettings() |
504 | { | 504 | { |
505 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); | 505 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); |
506 | if ( mExtensionBarSplitter ) | 506 | if ( mExtensionBarSplitter ) |
507 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 507 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
508 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); | 508 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); |
509 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); | 509 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); |
510 | #ifndef KAB_EMBEDDED | 510 | #ifndef KAB_EMBEDDED |
511 | 511 | ||
512 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 512 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
513 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 513 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
514 | #endif //KAB_EMBEDDED | 514 | #endif //KAB_EMBEDDED |
515 | mExtensionManager->saveSettings(); | 515 | mExtensionManager->saveSettings(); |
516 | mViewManager->saveSettings(); | 516 | mViewManager->saveSettings(); |
517 | 517 | ||
518 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 518 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
519 | } | 519 | } |
520 | 520 | ||
521 | KABC::AddressBook *KABCore::addressBook() const | 521 | KABC::AddressBook *KABCore::addressBook() const |
522 | { | 522 | { |
523 | return mAddressBook; | 523 | return mAddressBook; |
524 | } | 524 | } |
525 | 525 | ||
526 | KConfig *KABCore::config() | 526 | KConfig *KABCore::config() |
527 | { | 527 | { |
528 | #ifndef KAB_EMBEDDED | 528 | #ifndef KAB_EMBEDDED |
529 | return KABPrefs::instance()->config(); | 529 | return KABPrefs::instance()->config(); |
530 | #else //KAB_EMBEDDED | 530 | #else //KAB_EMBEDDED |
531 | return KABPrefs::instance()->getConfig(); | 531 | return KABPrefs::instance()->getConfig(); |
532 | #endif //KAB_EMBEDDED | 532 | #endif //KAB_EMBEDDED |
533 | } | 533 | } |
534 | 534 | ||
535 | KActionCollection *KABCore::actionCollection() const | 535 | KActionCollection *KABCore::actionCollection() const |
536 | { | 536 | { |
537 | return mGUIClient->actionCollection(); | 537 | return mGUIClient->actionCollection(); |
538 | } | 538 | } |
539 | 539 | ||
540 | KABC::Field *KABCore::currentSearchField() const | 540 | KABC::Field *KABCore::currentSearchField() const |
541 | { | 541 | { |
542 | if (mIncSearchWidget) | 542 | if (mIncSearchWidget) |
543 | return mIncSearchWidget->currentField(); | 543 | return mIncSearchWidget->currentField(); |
544 | else | 544 | else |
545 | return 0; | 545 | return 0; |
546 | } | 546 | } |
547 | 547 | ||
548 | QStringList KABCore::selectedUIDs() const | 548 | QStringList KABCore::selectedUIDs() const |
549 | { | 549 | { |
550 | return mViewManager->selectedUids(); | 550 | return mViewManager->selectedUids(); |
551 | } | 551 | } |
552 | 552 | ||
553 | KABC::Resource *KABCore::requestResource( QWidget *parent ) | 553 | KABC::Resource *KABCore::requestResource( QWidget *parent ) |
554 | { | 554 | { |
555 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); | 555 | QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); |
556 | 556 | ||
557 | QPtrList<KRES::Resource> kresResources; | 557 | QPtrList<KRES::Resource> kresResources; |
558 | QPtrListIterator<KABC::Resource> resIt( kabcResources ); | 558 | QPtrListIterator<KABC::Resource> resIt( kabcResources ); |
559 | KABC::Resource *resource; | 559 | KABC::Resource *resource; |
560 | while ( ( resource = resIt.current() ) != 0 ) { | 560 | while ( ( resource = resIt.current() ) != 0 ) { |
561 | ++resIt; | 561 | ++resIt; |
562 | if ( !resource->readOnly() ) { | 562 | if ( !resource->readOnly() ) { |
563 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); | 563 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); |
564 | if ( res ) | 564 | if ( res ) |
565 | kresResources.append( res ); | 565 | kresResources.append( res ); |
566 | } | 566 | } |
567 | } | 567 | } |
568 | 568 | ||
569 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); | 569 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); |
570 | return static_cast<KABC::Resource*>( res ); | 570 | return static_cast<KABC::Resource*>( res ); |
571 | } | 571 | } |
572 | 572 | ||
573 | #ifndef KAB_EMBEDDED | 573 | #ifndef KAB_EMBEDDED |
574 | KAboutData *KABCore::createAboutData() | 574 | KAboutData *KABCore::createAboutData() |
575 | #else //KAB_EMBEDDED | 575 | #else //KAB_EMBEDDED |
576 | void KABCore::createAboutData() | 576 | void KABCore::createAboutData() |
577 | #endif //KAB_EMBEDDED | 577 | #endif //KAB_EMBEDDED |
578 | { | 578 | { |
579 | #ifndef KAB_EMBEDDED | 579 | #ifndef KAB_EMBEDDED |
580 | KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), | 580 | KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), |
581 | "3.1", I18N_NOOP( "The KDE Address Book" ), | 581 | "3.1", I18N_NOOP( "The KDE Address Book" ), |
582 | KAboutData::License_GPL_V2, | 582 | KAboutData::License_GPL_V2, |
583 | I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); | 583 | I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); |
584 | about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); | 584 | about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); |
585 | about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); | 585 | about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); |
586 | about->addAuthor( "Cornelius Schumacher", | 586 | about->addAuthor( "Cornelius Schumacher", |
587 | I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), | 587 | I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), |
588 | "schumacher@kde.org" ); | 588 | "schumacher@kde.org" ); |
589 | about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), | 589 | about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), |
590 | "mpilone@slac.com" ); | 590 | "mpilone@slac.com" ); |
591 | about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); | 591 | about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); |
592 | about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); | 592 | about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); |
593 | about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), | 593 | about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), |
594 | "michel@klaralvdalens-datakonsult.se" ); | 594 | "michel@klaralvdalens-datakonsult.se" ); |
595 | about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), | 595 | about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), |
596 | "hansen@kde.org" ); | 596 | "hansen@kde.org" ); |
597 | 597 | ||
598 | return about; | 598 | return about; |
599 | #endif //KAB_EMBEDDED | 599 | #endif //KAB_EMBEDDED |
600 | 600 | ||
601 | QString version; | 601 | QString version; |
602 | #include <../version> | 602 | #include <../version> |
603 | QMessageBox::about( this, "About KAddressbook/Pi", | 603 | QMessageBox::about( this, "About KAddressbook/Pi", |
604 | "KAddressbook/Platform-independent\n" | 604 | "KAddressbook/Platform-independent\n" |
605 | "(KA/Pi) " +version + " - " + | 605 | "(KA/Pi) " +version + " - " + |
606 | #ifdef DESKTOP_VERSION | 606 | #ifdef DESKTOP_VERSION |
607 | "Desktop Edition\n" | 607 | "Desktop Edition\n" |
608 | #else | 608 | #else |
609 | "PDA-Edition\n" | 609 | "PDA-Edition\n" |
610 | "for: Zaurus 5500 / 7x0 / 8x0\n" | 610 | "for: Zaurus 5500 / 7x0 / 8x0\n" |
611 | #endif | 611 | #endif |
612 | 612 | ||
613 | "(c) 2004 Ulf Schenk\n" | 613 | "(c) 2004 Ulf Schenk\n" |
614 | "(c) 2004 Lutz Rogowski\n" | 614 | "(c) 2004 Lutz Rogowski\n" |
615 | "(c) 1997-2003, The KDE PIM Team\n" | 615 | "(c) 1997-2003, The KDE PIM Team\n" |
616 | "Tobias Koenig Current maintainer\ntokoe@kde.org\n" | 616 | "Tobias Koenig Current maintainer\ntokoe@kde.org\n" |
617 | "Don Sanders Original author\n" | 617 | "Don Sanders Original author\n" |
618 | "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" | 618 | "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" |
619 | "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" | 619 | "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" |
620 | "Greg Stern DCOP interface\n" | 620 | "Greg Stern DCOP interface\n" |
621 | "Mark Westcot Contact pinning\n" | 621 | "Mark Westcot Contact pinning\n" |
622 | "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" | 622 | "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" |
623 | "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" | 623 | "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" |
624 | #ifdef _WIN32_ | 624 | #ifdef _WIN32_ |
625 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" | 625 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" |
626 | #endif | 626 | #endif |
627 | ); | 627 | ); |
628 | } | 628 | } |
629 | 629 | ||
630 | void KABCore::setContactSelected( const QString &uid ) | 630 | void KABCore::setContactSelected( const QString &uid ) |
631 | { | 631 | { |
632 | KABC::Addressee addr = mAddressBook->findByUid( uid ); | 632 | KABC::Addressee addr = mAddressBook->findByUid( uid ); |
633 | if ( !mDetails->isHidden() ) | 633 | if ( !mDetails->isHidden() ) |
634 | mDetails->setAddressee( addr ); | 634 | mDetails->setAddressee( addr ); |
635 | 635 | ||
636 | if ( !addr.isEmpty() ) { | 636 | if ( !addr.isEmpty() ) { |
637 | emit contactSelected( addr.formattedName() ); | 637 | emit contactSelected( addr.formattedName() ); |
638 | KABC::Picture pic = addr.photo(); | 638 | KABC::Picture pic = addr.photo(); |
639 | if ( pic.isIntern() ) { | 639 | if ( pic.isIntern() ) { |
640 | //US emit contactSelected( pic.data() ); | 640 | //US emit contactSelected( pic.data() ); |
641 | //US instead use: | 641 | //US instead use: |
642 | QPixmap px; | 642 | QPixmap px; |
643 | if (pic.data().isNull() != true) | 643 | if (pic.data().isNull() != true) |
644 | { | 644 | { |
645 | px.convertFromImage(pic.data()); | 645 | px.convertFromImage(pic.data()); |
646 | } | 646 | } |
647 | 647 | ||
648 | emit contactSelected( px ); | 648 | emit contactSelected( px ); |
649 | } | 649 | } |
650 | } | 650 | } |
651 | 651 | ||
652 | 652 | ||
653 | mExtensionManager->setSelectionChanged(); | 653 | mExtensionManager->setSelectionChanged(); |
654 | 654 | ||
655 | // update the actions | 655 | // update the actions |
656 | bool selected = !uid.isEmpty(); | 656 | bool selected = !uid.isEmpty(); |
657 | 657 | ||
658 | if ( mReadWrite ) { | 658 | if ( mReadWrite ) { |
659 | mActionCut->setEnabled( selected ); | 659 | mActionCut->setEnabled( selected ); |
660 | mActionPaste->setEnabled( selected ); | 660 | mActionPaste->setEnabled( selected ); |
661 | } | 661 | } |
662 | 662 | ||
663 | mActionCopy->setEnabled( selected ); | 663 | mActionCopy->setEnabled( selected ); |
664 | mActionDelete->setEnabled( selected ); | 664 | mActionDelete->setEnabled( selected ); |
665 | mActionEditAddressee->setEnabled( selected ); | 665 | mActionEditAddressee->setEnabled( selected ); |
666 | mActionMail->setEnabled( selected ); | 666 | mActionMail->setEnabled( selected ); |
667 | mActionMailVCard->setEnabled( selected ); | 667 | mActionMailVCard->setEnabled( selected ); |
668 | //if (mActionBeam) | 668 | //if (mActionBeam) |
669 | //mActionBeam->setEnabled( selected ); | 669 | //mActionBeam->setEnabled( selected ); |
670 | 670 | ||
671 | if (mActionBeamVCard) | 671 | if (mActionBeamVCard) |
672 | mActionBeamVCard->setEnabled( selected ); | 672 | mActionBeamVCard->setEnabled( selected ); |
673 | 673 | ||
674 | mActionExport2phone->setEnabled( selected ); | 674 | mActionExport2phone->setEnabled( selected ); |
675 | mActionWhoAmI->setEnabled( selected ); | 675 | mActionWhoAmI->setEnabled( selected ); |
676 | mActionCategories->setEnabled( selected ); | 676 | mActionCategories->setEnabled( selected ); |
677 | } | 677 | } |
678 | 678 | ||
679 | void KABCore::sendMail() | 679 | void KABCore::sendMail() |
680 | { | 680 | { |
681 | sendMail( mViewManager->selectedEmails().join( ", " ) ); | 681 | sendMail( mViewManager->selectedEmails().join( ", " ) ); |
682 | } | 682 | } |
683 | 683 | ||
684 | void KABCore::sendMail( const QString& emaillist ) | 684 | void KABCore::sendMail( const QString& emaillist ) |
685 | { | 685 | { |
686 | // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " | 686 | // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " |
687 | if (emaillist.contains(",") > 0) | 687 | if (emaillist.contains(",") > 0) |
688 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); | 688 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); |
689 | else | 689 | else |
690 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); | 690 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); |
691 | } | 691 | } |
692 | 692 | ||
693 | 693 | ||
694 | 694 | ||
695 | void KABCore::mailVCard() | 695 | void KABCore::mailVCard() |
696 | { | 696 | { |
697 | QStringList uids = mViewManager->selectedUids(); | 697 | QStringList uids = mViewManager->selectedUids(); |
698 | if ( !uids.isEmpty() ) | 698 | if ( !uids.isEmpty() ) |
699 | mailVCard( uids ); | 699 | mailVCard( uids ); |
700 | } | 700 | } |
701 | 701 | ||
702 | void KABCore::mailVCard( const QStringList& uids ) | 702 | void KABCore::mailVCard( const QStringList& uids ) |
703 | { | 703 | { |
704 | QStringList urls; | 704 | QStringList urls; |
705 | 705 | ||
706 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); | 706 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); |
707 | 707 | ||
708 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); | 708 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); |
709 | 709 | ||
710 | 710 | ||
711 | 711 | ||
712 | QDir().mkdir( dirName, true ); | 712 | QDir().mkdir( dirName, true ); |
713 | 713 | ||
714 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 714 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
715 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 715 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
716 | 716 | ||
717 | if ( a.isEmpty() ) | 717 | if ( a.isEmpty() ) |
718 | continue; | 718 | continue; |
719 | 719 | ||
720 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; | 720 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; |
721 | 721 | ||
722 | QString fileName = dirName + "/" + name; | 722 | QString fileName = dirName + "/" + name; |
723 | 723 | ||
724 | QFile outFile(fileName); | 724 | QFile outFile(fileName); |
725 | 725 | ||
726 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully | 726 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully |
727 | KABC::VCardConverter converter; | 727 | KABC::VCardConverter converter; |
728 | QString vcard; | 728 | QString vcard; |
729 | 729 | ||
730 | converter.addresseeToVCard( a, vcard ); | 730 | converter.addresseeToVCard( a, vcard ); |
731 | 731 | ||
732 | QTextStream t( &outFile ); // use a text stream | 732 | QTextStream t( &outFile ); // use a text stream |
733 | t.setEncoding( QTextStream::UnicodeUTF8 ); | 733 | t.setEncoding( QTextStream::UnicodeUTF8 ); |
734 | t << vcard; | 734 | t << vcard; |
735 | 735 | ||
736 | outFile.close(); | 736 | outFile.close(); |
737 | 737 | ||
738 | urls.append( fileName ); | 738 | urls.append( fileName ); |
739 | } | 739 | } |
740 | } | 740 | } |
741 | 741 | ||
742 | bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); | 742 | bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); |
743 | 743 | ||
744 | 744 | ||
745 | /*US | 745 | /*US |
746 | kapp->invokeMailer( QString::null, QString::null, QString::null, | 746 | kapp->invokeMailer( QString::null, QString::null, QString::null, |
747 | QString::null, // subject | 747 | QString::null, // subject |
748 | QString::null, // body | 748 | QString::null, // body |
749 | QString::null, | 749 | QString::null, |
750 | urls ); // attachments | 750 | urls ); // attachments |
751 | */ | 751 | */ |
752 | 752 | ||
753 | } | 753 | } |
754 | 754 | ||
755 | /** | 755 | /** |
756 | Beams the "WhoAmI contact. | 756 | Beams the "WhoAmI contact. |
757 | */ | 757 | */ |
758 | void KABCore::beamMySelf() | 758 | void KABCore::beamMySelf() |
759 | { | 759 | { |
760 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); | 760 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); |
761 | if (!a.isEmpty()) | 761 | if (!a.isEmpty()) |
762 | { | 762 | { |
763 | QStringList uids; | 763 | QStringList uids; |
764 | uids << a.uid(); | 764 | uids << a.uid(); |
765 | 765 | ||
766 | beamVCard(uids); | 766 | beamVCard(uids); |
767 | } else { | 767 | } else { |
768 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); | 768 | KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); |
769 | 769 | ||
770 | 770 | ||
771 | } | 771 | } |
772 | } | 772 | } |
773 | 773 | ||
774 | void KABCore::export2phone() | 774 | void KABCore::export2phone() |
775 | { | 775 | { |
776 | 776 | ||
777 | KAex2phonePrefs ex2phone; | 777 | KAex2phonePrefs ex2phone; |
778 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 778 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
779 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 779 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
780 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 780 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
781 | 781 | ||
782 | if ( !ex2phone.exec() ) { | 782 | if ( !ex2phone.exec() ) { |
783 | return; | 783 | return; |
784 | } | 784 | } |
785 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 785 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
786 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 786 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
787 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 787 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
788 | 788 | ||
789 | 789 | ||
790 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 790 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
791 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 791 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
792 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 792 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
793 | 793 | ||
794 | QStringList uids = mViewManager->selectedUids(); | 794 | QStringList uids = mViewManager->selectedUids(); |
795 | if ( uids.isEmpty() ) | 795 | if ( uids.isEmpty() ) |
796 | return; | 796 | return; |
797 | 797 | ||
798 | QString fileName = getPhoneFile(); | 798 | QString fileName = getPhoneFile(); |
799 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) | 799 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) |
800 | return; | 800 | return; |
801 | 801 | ||
802 | message(i18n("Exporting to phone...")); | 802 | message(i18n("Exporting to phone...")); |
803 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); | 803 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); |
804 | 804 | ||
805 | } | 805 | } |
806 | QString KABCore::getPhoneFile() | 806 | QString KABCore::getPhoneFile() |
807 | { | 807 | { |
808 | #ifdef DESKTOP_VERSION | 808 | #ifdef DESKTOP_VERSION |
809 | return locateLocal("tmp", "phonefile.vcf"); | 809 | return locateLocal("tmp", "phonefile.vcf"); |
810 | #else | 810 | #else |
811 | return "/tmp/phonefile.vcf"; | 811 | return "/tmp/phonefile.vcf"; |
812 | #endif | 812 | #endif |
813 | 813 | ||
814 | } | 814 | } |
815 | void KABCore::writeToPhone( ) | 815 | void KABCore::writeToPhone( ) |
816 | { | 816 | { |
817 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) | 817 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) |
818 | message(i18n("Export to phone finished!")); | 818 | message(i18n("Export to phone finished!")); |
819 | else | 819 | else |
820 | qDebug(i18n("Error exporting to phone")); | 820 | qDebug(i18n("Error exporting to phone")); |
821 | } | 821 | } |
822 | void KABCore::beamVCard() | 822 | void KABCore::beamVCard() |
823 | { | 823 | { |
824 | QStringList uids = mViewManager->selectedUids(); | 824 | QStringList uids = mViewManager->selectedUids(); |
825 | if ( !uids.isEmpty() ) | 825 | if ( !uids.isEmpty() ) |
826 | beamVCard( uids ); | 826 | beamVCard( uids ); |
827 | } | 827 | } |
828 | 828 | ||
829 | 829 | ||
830 | void KABCore::beamVCard(const QStringList& uids) | 830 | void KABCore::beamVCard(const QStringList& uids) |
831 | { | 831 | { |
832 | 832 | ||
833 | // LR: we should use the /tmp dir on the Zaurus, | 833 | // LR: we should use the /tmp dir on the Zaurus, |
834 | // because: /tmp = RAM, (HOME)/kdepim = flash memory | 834 | // because: /tmp = RAM, (HOME)/kdepim = flash memory |
835 | 835 | ||
836 | #ifdef DESKTOP_VERSION | 836 | #ifdef DESKTOP_VERSION |
837 | QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); | 837 | QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); |
838 | #else | 838 | #else |
839 | QString fileName = "/tmp/kapibeamfile.vcf"; | 839 | QString fileName = "/tmp/kapibeamfile.vcf"; |
840 | #endif | 840 | #endif |
841 | 841 | ||
842 | KABC::VCardConverter converter; | 842 | KABC::VCardConverter converter; |
843 | QString description; | 843 | QString description; |
844 | QString datastream; | 844 | QString datastream; |
845 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 845 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
846 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 846 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
847 | 847 | ||
848 | if ( a.isEmpty() ) | 848 | if ( a.isEmpty() ) |
849 | continue; | 849 | continue; |
850 | 850 | ||
851 | if (description.isEmpty()) | 851 | if (description.isEmpty()) |
852 | description = a.formattedName(); | 852 | description = a.formattedName(); |
853 | 853 | ||
854 | QString vcard; | 854 | QString vcard; |
855 | converter.addresseeToVCard( a, vcard ); | 855 | converter.addresseeToVCard( a, vcard ); |
856 | int start = 0; | 856 | int start = 0; |
857 | int next; | 857 | int next; |
858 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { | 858 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { |
859 | int semi = vcard.find(";", next); | 859 | int semi = vcard.find(";", next); |
860 | int dopp = vcard.find(":", next); | 860 | int dopp = vcard.find(":", next); |
861 | int sep; | 861 | int sep; |
862 | if ( semi < dopp && semi >= 0 ) | 862 | if ( semi < dopp && semi >= 0 ) |
863 | sep = semi ; | 863 | sep = semi ; |
864 | else | 864 | else |
865 | sep = dopp; | 865 | sep = dopp; |
866 | datastream +=vcard.mid( start, next - start); | 866 | datastream +=vcard.mid( start, next - start); |
867 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); | 867 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); |
868 | start = sep; | 868 | start = sep; |
869 | } | 869 | } |
870 | datastream += vcard.mid( start,vcard.length() ); | 870 | datastream += vcard.mid( start,vcard.length() ); |
871 | } | 871 | } |
872 | #ifndef DESKTOP_VERSION | 872 | #ifndef DESKTOP_VERSION |
873 | QFile outFile(fileName); | 873 | QFile outFile(fileName); |
874 | if ( outFile.open(IO_WriteOnly) ) { | 874 | if ( outFile.open(IO_WriteOnly) ) { |
875 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); | 875 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); |
876 | QTextStream t( &outFile ); // use a text stream | 876 | QTextStream t( &outFile ); // use a text stream |
877 | //t.setEncoding( QTextStream::UnicodeUTF8 ); | 877 | //t.setEncoding( QTextStream::UnicodeUTF8 ); |
878 | t.setEncoding( QTextStream::Latin1 ); | 878 | t.setEncoding( QTextStream::Latin1 ); |
879 | t <<datastream.latin1(); | 879 | t <<datastream.latin1(); |
880 | outFile.close(); | 880 | outFile.close(); |
881 | Ir *ir = new Ir( this ); | 881 | Ir *ir = new Ir( this ); |
882 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); | 882 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); |
883 | ir->send( fileName, description, "text/x-vCard" ); | 883 | ir->send( fileName, description, "text/x-vCard" ); |
884 | } else { | 884 | } else { |
885 | qDebug("Error open temp beam file "); | 885 | qDebug("Error open temp beam file "); |
886 | return; | 886 | return; |
887 | } | 887 | } |
888 | #endif | 888 | #endif |
889 | 889 | ||
890 | } | 890 | } |
891 | 891 | ||
892 | void KABCore::beamDone( Ir *ir ) | 892 | void KABCore::beamDone( Ir *ir ) |
893 | { | 893 | { |
894 | #ifndef DESKTOP_VERSION | 894 | #ifndef DESKTOP_VERSION |
895 | delete ir; | 895 | delete ir; |
896 | #endif | 896 | #endif |
897 | topLevelWidget()->raise(); | 897 | topLevelWidget()->raise(); |
898 | message( i18n("Beaming finished!") ); | 898 | message( i18n("Beaming finished!") ); |
899 | } | 899 | } |
900 | 900 | ||
901 | 901 | ||
902 | void KABCore::browse( const QString& url ) | 902 | void KABCore::browse( const QString& url ) |
903 | { | 903 | { |
904 | #ifndef KAB_EMBEDDED | 904 | #ifndef KAB_EMBEDDED |
905 | kapp->invokeBrowser( url ); | 905 | kapp->invokeBrowser( url ); |
906 | #else //KAB_EMBEDDED | 906 | #else //KAB_EMBEDDED |
907 | qDebug("KABCore::browse must be fixed"); | 907 | qDebug("KABCore::browse must be fixed"); |
908 | #endif //KAB_EMBEDDED | 908 | #endif //KAB_EMBEDDED |
909 | } | 909 | } |
910 | 910 | ||
911 | void KABCore::selectAllContacts() | 911 | void KABCore::selectAllContacts() |
912 | { | 912 | { |
913 | mViewManager->setSelected( QString::null, true ); | 913 | mViewManager->setSelected( QString::null, true ); |
914 | } | 914 | } |
915 | 915 | ||
916 | void KABCore::deleteContacts() | 916 | void KABCore::deleteContacts() |
917 | { | 917 | { |
918 | QStringList uidList = mViewManager->selectedUids(); | 918 | QStringList uidList = mViewManager->selectedUids(); |
919 | deleteContacts( uidList ); | 919 | deleteContacts( uidList ); |
920 | } | 920 | } |
921 | 921 | ||
922 | void KABCore::deleteContacts( const QStringList &uids ) | 922 | void KABCore::deleteContacts( const QStringList &uids ) |
923 | { | 923 | { |
924 | if ( uids.count() > 0 ) { | 924 | if ( uids.count() > 0 ) { |
925 | PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); | 925 | PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); |
926 | UndoStack::instance()->push( command ); | 926 | UndoStack::instance()->push( command ); |
927 | RedoStack::instance()->clear(); | 927 | RedoStack::instance()->clear(); |
928 | 928 | ||
929 | // now if we deleted anything, refresh | 929 | // now if we deleted anything, refresh |
930 | setContactSelected( QString::null ); | 930 | setContactSelected( QString::null ); |
931 | setModified( true ); | 931 | setModified( true ); |
932 | } | 932 | } |
933 | } | 933 | } |
934 | 934 | ||
935 | void KABCore::copyContacts() | 935 | void KABCore::copyContacts() |
936 | { | 936 | { |
937 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); | 937 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); |
938 | 938 | ||
939 | QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); | 939 | QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); |
940 | 940 | ||
941 | kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; | 941 | kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; |
942 | 942 | ||
943 | QClipboard *cb = QApplication::clipboard(); | 943 | QClipboard *cb = QApplication::clipboard(); |
944 | cb->setText( clipText ); | 944 | cb->setText( clipText ); |
945 | } | 945 | } |
946 | 946 | ||
947 | void KABCore::cutContacts() | 947 | void KABCore::cutContacts() |
948 | { | 948 | { |
949 | QStringList uidList = mViewManager->selectedUids(); | 949 | QStringList uidList = mViewManager->selectedUids(); |
950 | 950 | ||
951 | //US if ( uidList.size() > 0 ) { | 951 | //US if ( uidList.size() > 0 ) { |
952 | if ( uidList.count() > 0 ) { | 952 | if ( uidList.count() > 0 ) { |
953 | PwCutCommand *command = new PwCutCommand( mAddressBook, uidList ); | 953 | PwCutCommand *command = new PwCutCommand( mAddressBook, uidList ); |
954 | UndoStack::instance()->push( command ); | 954 | UndoStack::instance()->push( command ); |
955 | RedoStack::instance()->clear(); | 955 | RedoStack::instance()->clear(); |
956 | 956 | ||
957 | setModified( true ); | 957 | setModified( true ); |
958 | } | 958 | } |
959 | } | 959 | } |
960 | 960 | ||
961 | void KABCore::pasteContacts() | 961 | void KABCore::pasteContacts() |
962 | { | 962 | { |
963 | QClipboard *cb = QApplication::clipboard(); | 963 | QClipboard *cb = QApplication::clipboard(); |
964 | 964 | ||
965 | KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); | 965 | KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); |
966 | 966 | ||
967 | pasteContacts( list ); | 967 | pasteContacts( list ); |
968 | } | 968 | } |
969 | 969 | ||
970 | void KABCore::pasteContacts( KABC::Addressee::List &list ) | 970 | void KABCore::pasteContacts( KABC::Addressee::List &list ) |
971 | { | 971 | { |
972 | KABC::Resource *resource = requestResource( this ); | 972 | KABC::Resource *resource = requestResource( this ); |
973 | KABC::Addressee::List::Iterator it; | 973 | KABC::Addressee::List::Iterator it; |
974 | for ( it = list.begin(); it != list.end(); ++it ) | 974 | for ( it = list.begin(); it != list.end(); ++it ) |
975 | (*it).setResource( resource ); | 975 | (*it).setResource( resource ); |
976 | 976 | ||
977 | PwPasteCommand *command = new PwPasteCommand( this, list ); | 977 | PwPasteCommand *command = new PwPasteCommand( this, list ); |
978 | UndoStack::instance()->push( command ); | 978 | UndoStack::instance()->push( command ); |
979 | RedoStack::instance()->clear(); | 979 | RedoStack::instance()->clear(); |
980 | 980 | ||
981 | setModified( true ); | 981 | setModified( true ); |
982 | } | 982 | } |
983 | 983 | ||
984 | void KABCore::setWhoAmI() | 984 | void KABCore::setWhoAmI() |
985 | { | 985 | { |
986 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); | 986 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); |
987 | 987 | ||
988 | if ( addrList.count() > 1 ) { | 988 | if ( addrList.count() > 1 ) { |
989 | KMessageBox::sorry( this, i18n( "Please select only one contact." ) ); | 989 | KMessageBox::sorry( this, i18n( "Please select only one contact." ) ); |
990 | return; | 990 | return; |
991 | } | 991 | } |
992 | 992 | ||
993 | QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) ); | 993 | QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) ); |
994 | if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes ) | 994 | if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes ) |
995 | static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); | 995 | static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); |
996 | } | 996 | } |
997 | void KABCore::editCategories() | 997 | void KABCore::editCategories() |
998 | { | 998 | { |
999 | KPIM::CategoryEditDialog dlg ( KABPrefs::instance(), this, "", true ); | 999 | KPIM::CategoryEditDialog dlg ( KABPrefs::instance(), this, "", true ); |
1000 | dlg.exec(); | 1000 | dlg.exec(); |
1001 | } | 1001 | } |
1002 | void KABCore::setCategories() | 1002 | void KABCore::setCategories() |
1003 | { | 1003 | { |
1004 | KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); | 1004 | KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); |
1005 | if ( !dlg.exec() ) { | 1005 | if ( !dlg.exec() ) { |
1006 | message( i18n("Setting categories cancelled") ); | 1006 | message( i18n("Setting categories cancelled") ); |
1007 | return; | 1007 | return; |
1008 | } | 1008 | } |
1009 | bool merge = false; | 1009 | bool merge = false; |
1010 | QString msg = i18n( "Merge with existing categories?" ); | 1010 | QString msg = i18n( "Merge with existing categories?" ); |
1011 | if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) | 1011 | if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) |
1012 | merge = true; | 1012 | merge = true; |
1013 | 1013 | ||
1014 | message( i18n("Setting categories ... please wait!") ); | 1014 | message( i18n("Setting categories ... please wait!") ); |
1015 | QStringList categories = dlg.selectedCategories(); | 1015 | QStringList categories = dlg.selectedCategories(); |
1016 | 1016 | ||
1017 | QStringList uids = mViewManager->selectedUids(); | 1017 | QStringList uids = mViewManager->selectedUids(); |
1018 | QStringList::Iterator it; | 1018 | QStringList::Iterator it; |
1019 | for ( it = uids.begin(); it != uids.end(); ++it ) { | 1019 | for ( it = uids.begin(); it != uids.end(); ++it ) { |
1020 | KABC::Addressee addr = mAddressBook->findByUid( *it ); | 1020 | KABC::Addressee addr = mAddressBook->findByUid( *it ); |
1021 | if ( !addr.isEmpty() ) { | 1021 | if ( !addr.isEmpty() ) { |
1022 | if ( !merge ) | 1022 | if ( !merge ) |
1023 | addr.setCategories( categories ); | 1023 | addr.setCategories( categories ); |
1024 | else { | 1024 | else { |
1025 | QStringList addrCategories = addr.categories(); | 1025 | QStringList addrCategories = addr.categories(); |
1026 | QStringList::Iterator catIt; | 1026 | QStringList::Iterator catIt; |
1027 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { | 1027 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { |
1028 | if ( !addrCategories.contains( *catIt ) ) | 1028 | if ( !addrCategories.contains( *catIt ) ) |
1029 | addrCategories.append( *catIt ); | 1029 | addrCategories.append( *catIt ); |
1030 | } | 1030 | } |
1031 | addr.setCategories( addrCategories ); | 1031 | addr.setCategories( addrCategories ); |
1032 | } | 1032 | } |
1033 | mAddressBook->insertAddressee( addr ); | 1033 | mAddressBook->insertAddressee( addr ); |
1034 | } | 1034 | } |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | if ( uids.count() > 0 ) | 1037 | if ( uids.count() > 0 ) |
1038 | setModified( true ); | 1038 | setModified( true ); |
1039 | message( i18n("Setting categories completed!") ); | 1039 | message( i18n("Setting categories completed!") ); |
1040 | } | 1040 | } |
1041 | 1041 | ||
1042 | void KABCore::setSearchFields( const KABC::Field::List &fields ) | 1042 | void KABCore::setSearchFields( const KABC::Field::List &fields ) |
1043 | { | 1043 | { |
1044 | mIncSearchWidget->setFields( fields ); | 1044 | mIncSearchWidget->setFields( fields ); |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | void KABCore::incrementalSearch( const QString& text ) | 1047 | void KABCore::incrementalSearch( const QString& text ) |
1048 | { | 1048 | { |
1049 | mViewManager->doSearch( text, mIncSearchWidget->currentField() ); | 1049 | mViewManager->doSearch( text, mIncSearchWidget->currentField() ); |
1050 | } | 1050 | } |
1051 | 1051 | ||
1052 | void KABCore::setModified() | 1052 | void KABCore::setModified() |
1053 | { | 1053 | { |
1054 | setModified( true ); | 1054 | setModified( true ); |
1055 | } | 1055 | } |
1056 | 1056 | ||
1057 | void KABCore::setModifiedWOrefresh() | 1057 | void KABCore::setModifiedWOrefresh() |
1058 | { | 1058 | { |
1059 | // qDebug("KABCore::setModifiedWOrefresh() "); | 1059 | // qDebug("KABCore::setModifiedWOrefresh() "); |
1060 | mModified = true; | 1060 | mModified = true; |
1061 | mActionSave->setEnabled( mModified ); | 1061 | mActionSave->setEnabled( mModified ); |
1062 | #ifdef DESKTOP_VERSION | 1062 | #ifdef DESKTOP_VERSION |
1063 | mDetails->refreshView(); | 1063 | mDetails->refreshView(); |
1064 | #endif | 1064 | #endif |
1065 | 1065 | ||
1066 | } | 1066 | } |
1067 | void KABCore::setModified( bool modified ) | 1067 | void KABCore::setModified( bool modified ) |
1068 | { | 1068 | { |
1069 | mModified = modified; | 1069 | mModified = modified; |
1070 | mActionSave->setEnabled( mModified ); | 1070 | mActionSave->setEnabled( mModified ); |
1071 | 1071 | ||
1072 | if ( modified ) | 1072 | if ( modified ) |
1073 | mJumpButtonBar->recreateButtons(); | 1073 | mJumpButtonBar->recreateButtons(); |
1074 | 1074 | ||
1075 | mViewManager->refreshView(); | 1075 | mViewManager->refreshView(); |
1076 | mDetails->refreshView(); | 1076 | mDetails->refreshView(); |
1077 | 1077 | ||
1078 | } | 1078 | } |
1079 | 1079 | ||
1080 | bool KABCore::modified() const | 1080 | bool KABCore::modified() const |
1081 | { | 1081 | { |
1082 | return mModified; | 1082 | return mModified; |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | void KABCore::contactModified( const KABC::Addressee &addr ) | 1085 | void KABCore::contactModified( const KABC::Addressee &addr ) |
1086 | { | 1086 | { |
1087 | 1087 | ||
1088 | Command *command = 0; | 1088 | Command *command = 0; |
1089 | QString uid; | 1089 | QString uid; |
1090 | 1090 | ||
1091 | // check if it exists already | 1091 | // check if it exists already |
1092 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); | 1092 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); |
1093 | if ( origAddr.isEmpty() ) | 1093 | if ( origAddr.isEmpty() ) |
1094 | command = new PwNewCommand( mAddressBook, addr ); | 1094 | command = new PwNewCommand( mAddressBook, addr ); |
1095 | else { | 1095 | else { |
1096 | command = new PwEditCommand( mAddressBook, origAddr, addr ); | 1096 | command = new PwEditCommand( mAddressBook, origAddr, addr ); |
1097 | uid = addr.uid(); | 1097 | uid = addr.uid(); |
1098 | } | 1098 | } |
1099 | 1099 | ||
1100 | UndoStack::instance()->push( command ); | 1100 | UndoStack::instance()->push( command ); |
1101 | RedoStack::instance()->clear(); | 1101 | RedoStack::instance()->clear(); |
1102 | 1102 | ||
1103 | setModified( true ); | 1103 | setModified( true ); |
1104 | } | 1104 | } |
1105 | 1105 | ||
1106 | void KABCore::newContact() | 1106 | void KABCore::newContact() |
1107 | { | 1107 | { |
1108 | 1108 | ||
1109 | 1109 | ||
1110 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); | 1110 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); |
1111 | 1111 | ||
1112 | QPtrList<KRES::Resource> kresResources; | 1112 | QPtrList<KRES::Resource> kresResources; |
1113 | QPtrListIterator<KABC::Resource> it( kabcResources ); | 1113 | QPtrListIterator<KABC::Resource> it( kabcResources ); |
1114 | KABC::Resource *resource; | 1114 | KABC::Resource *resource; |
1115 | while ( ( resource = it.current() ) != 0 ) { | 1115 | while ( ( resource = it.current() ) != 0 ) { |
1116 | ++it; | 1116 | ++it; |
1117 | if ( !resource->readOnly() ) { | 1117 | if ( !resource->readOnly() ) { |
1118 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); | 1118 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); |
1119 | if ( res ) | 1119 | if ( res ) |
1120 | kresResources.append( res ); | 1120 | kresResources.append( res ); |
1121 | } | 1121 | } |
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); | 1124 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); |
1125 | resource = static_cast<KABC::Resource*>( res ); | 1125 | resource = static_cast<KABC::Resource*>( res ); |
1126 | 1126 | ||
1127 | if ( resource ) { | 1127 | if ( resource ) { |
1128 | KABC::Addressee addr; | 1128 | KABC::Addressee addr; |
1129 | addr.setResource( resource ); | 1129 | addr.setResource( resource ); |
1130 | mEditorDialog->setAddressee( addr ); | 1130 | mEditorDialog->setAddressee( addr ); |
1131 | KApplication::execDialog ( mEditorDialog ); | 1131 | KApplication::execDialog ( mEditorDialog ); |
1132 | 1132 | ||
1133 | } else | 1133 | } else |
1134 | return; | 1134 | return; |
1135 | 1135 | ||
1136 | // mEditorDict.insert( dialog->addressee().uid(), dialog ); | 1136 | // mEditorDict.insert( dialog->addressee().uid(), dialog ); |
1137 | 1137 | ||
1138 | 1138 | ||
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | void KABCore::addEmail( QString aStr ) | 1141 | void KABCore::addEmail( QString aStr ) |
1142 | { | 1142 | { |
1143 | #ifndef KAB_EMBEDDED | 1143 | #ifndef KAB_EMBEDDED |
1144 | QString fullName, email; | 1144 | QString fullName, email; |
1145 | 1145 | ||
1146 | KABC::Addressee::parseEmailAddress( aStr, fullName, email ); | 1146 | KABC::Addressee::parseEmailAddress( aStr, fullName, email ); |
1147 | 1147 | ||
1148 | // Try to lookup the addressee matching the email address | 1148 | // Try to lookup the addressee matching the email address |
1149 | bool found = false; | 1149 | bool found = false; |
1150 | QStringList emailList; | 1150 | QStringList emailList; |
1151 | KABC::AddressBook::Iterator it; | 1151 | KABC::AddressBook::Iterator it; |
1152 | for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) { | 1152 | for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) { |
1153 | emailList = (*it).emails(); | 1153 | emailList = (*it).emails(); |
1154 | if ( emailList.contains( email ) > 0 ) { | 1154 | if ( emailList.contains( email ) > 0 ) { |
1155 | found = true; | 1155 | found = true; |
1156 | (*it).setNameFromString( fullName ); | 1156 | (*it).setNameFromString( fullName ); |
1157 | editContact( (*it).uid() ); | 1157 | editContact( (*it).uid() ); |
1158 | } | 1158 | } |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | if ( !found ) { | 1161 | if ( !found ) { |
1162 | KABC::Addressee addr; | 1162 | KABC::Addressee addr; |
1163 | addr.setNameFromString( fullName ); | 1163 | addr.setNameFromString( fullName ); |
1164 | addr.insertEmail( email, true ); | 1164 | addr.insertEmail( email, true ); |
1165 | 1165 | ||
1166 | mAddressBook->insertAddressee( addr ); | 1166 | mAddressBook->insertAddressee( addr ); |
1167 | mViewManager->refreshView( addr.uid() ); | 1167 | mViewManager->refreshView( addr.uid() ); |
1168 | editContact( addr.uid() ); | 1168 | editContact( addr.uid() ); |
1169 | } | 1169 | } |
1170 | #else //KAB_EMBEDDED | 1170 | #else //KAB_EMBEDDED |
1171 | qDebug("KABCore::addEmail finsih method"); | 1171 | qDebug("KABCore::addEmail finsih method"); |
1172 | #endif //KAB_EMBEDDED | 1172 | #endif //KAB_EMBEDDED |
1173 | } | 1173 | } |
1174 | 1174 | ||
1175 | void KABCore::importVCard( const KURL &url, bool showPreview ) | 1175 | void KABCore::importVCard( const KURL &url, bool showPreview ) |
1176 | { | 1176 | { |
1177 | mXXPortManager->importVCard( url, showPreview ); | 1177 | mXXPortManager->importVCard( url, showPreview ); |
1178 | } | 1178 | } |
1179 | void KABCore::importFromOL() | 1179 | void KABCore::importFromOL() |
1180 | { | 1180 | { |
1181 | #ifdef _WIN32_ | 1181 | #ifdef _WIN32_ |
1182 | KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this ); | 1182 | KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this ); |
1183 | idgl->exec(); | 1183 | idgl->exec(); |
1184 | KABC::Addressee::List list = idgl->getAddressList(); | 1184 | KABC::Addressee::List list = idgl->getAddressList(); |
1185 | if ( list.count() > 0 ) { | 1185 | if ( list.count() > 0 ) { |
1186 | KABC::Addressee::List listNew; | 1186 | KABC::Addressee::List listNew; |
1187 | KABC::Addressee::List listExisting; | 1187 | KABC::Addressee::List listExisting; |
1188 | KABC::Addressee::List::Iterator it; | 1188 | KABC::Addressee::List::Iterator it; |
1189 | KABC::AddressBook::Iterator iter; | 1189 | KABC::AddressBook::Iterator iter; |
1190 | for ( it = list.begin(); it != list.end(); ++it ) { | 1190 | for ( it = list.begin(); it != list.end(); ++it ) { |
1191 | if ( mAddressBook->findByUid((*it).uid() ).isEmpty()) | 1191 | if ( mAddressBook->findByUid((*it).uid() ).isEmpty()) |
1192 | listNew.append( (*it) ); | 1192 | listNew.append( (*it) ); |
1193 | else | 1193 | else |
1194 | listExisting.append( (*it) ); | 1194 | listExisting.append( (*it) ); |
1195 | } | 1195 | } |
1196 | if ( listExisting.count() > 0 ) | 1196 | if ( listExisting.count() > 0 ) |
1197 | KMessageBox::information( this, i18n("%1 contacts not added to addressbook\nbecause they were already in the addressbook!").arg( listExisting.count() )); | 1197 | KMessageBox::information( this, i18n("%1 contacts not added to addressbook\nbecause they were already in the addressbook!").arg( listExisting.count() )); |
1198 | if ( listNew.count() > 0 ) { | 1198 | if ( listNew.count() > 0 ) { |
1199 | pasteWithNewUid = false; | 1199 | pasteWithNewUid = false; |
1200 | pasteContacts( listNew ); | 1200 | pasteContacts( listNew ); |
1201 | pasteWithNewUid = true; | 1201 | pasteWithNewUid = true; |
1202 | } | 1202 | } |
1203 | } | 1203 | } |
1204 | delete idgl; | 1204 | delete idgl; |
1205 | #endif | 1205 | #endif |
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | void KABCore::importVCard( const QString &vCard, bool showPreview ) | 1208 | void KABCore::importVCard( const QString &vCard, bool showPreview ) |
1209 | { | 1209 | { |
1210 | mXXPortManager->importVCard( vCard, showPreview ); | 1210 | mXXPortManager->importVCard( vCard, showPreview ); |
1211 | } | 1211 | } |
1212 | 1212 | ||
1213 | //US added a second method without defaultparameter | 1213 | //US added a second method without defaultparameter |
1214 | void KABCore::editContact2() { | 1214 | void KABCore::editContact2() { |
1215 | editContact( QString::null ); | 1215 | editContact( QString::null ); |
1216 | } | 1216 | } |
1217 | 1217 | ||
1218 | void KABCore::editContact( const QString &uid ) | 1218 | void KABCore::editContact( const QString &uid ) |
1219 | { | 1219 | { |
1220 | 1220 | ||
1221 | if ( mExtensionManager->isQuickEditVisible() ) | 1221 | if ( mExtensionManager->isQuickEditVisible() ) |
1222 | return; | 1222 | return; |
1223 | 1223 | ||
1224 | // First, locate the contact entry | 1224 | // First, locate the contact entry |
1225 | QString localUID = uid; | 1225 | QString localUID = uid; |
1226 | if ( localUID.isNull() ) { | 1226 | if ( localUID.isNull() ) { |
1227 | QStringList uidList = mViewManager->selectedUids(); | 1227 | QStringList uidList = mViewManager->selectedUids(); |
1228 | if ( uidList.count() > 0 ) | 1228 | if ( uidList.count() > 0 ) |
1229 | localUID = *( uidList.at( 0 ) ); | 1229 | localUID = *( uidList.at( 0 ) ); |
1230 | } | 1230 | } |
1231 | 1231 | ||
1232 | KABC::Addressee addr = mAddressBook->findByUid( localUID ); | 1232 | KABC::Addressee addr = mAddressBook->findByUid( localUID ); |
1233 | if ( !addr.isEmpty() ) { | 1233 | if ( !addr.isEmpty() ) { |
1234 | mEditorDialog->setAddressee( addr ); | 1234 | mEditorDialog->setAddressee( addr ); |
1235 | KApplication::execDialog ( mEditorDialog ); | 1235 | KApplication::execDialog ( mEditorDialog ); |
1236 | } | 1236 | } |
1237 | } | 1237 | } |
1238 | 1238 | ||
1239 | /** | 1239 | /** |
1240 | Shows or edits the detail view for the given uid. If the uid is QString::null, | 1240 | Shows or edits the detail view for the given uid. If the uid is QString::null, |
1241 | the method will try to find a selected addressee in the view. | 1241 | the method will try to find a selected addressee in the view. |
1242 | */ | 1242 | */ |
1243 | void KABCore::executeContact( const QString &uid /*US = QString::null*/ ) | 1243 | void KABCore::executeContact( const QString &uid /*US = QString::null*/ ) |
1244 | { | 1244 | { |
1245 | if ( mMultipleViewsAtOnce ) | 1245 | if ( mMultipleViewsAtOnce ) |
1246 | { | 1246 | { |
1247 | editContact( uid ); | 1247 | editContact( uid ); |
1248 | } | 1248 | } |
1249 | else | 1249 | else |
1250 | { | 1250 | { |
1251 | setDetailsVisible( true ); | 1251 | setDetailsVisible( true ); |
1252 | mActionDetails->setChecked(true); | 1252 | mActionDetails->setChecked(true); |
1253 | } | 1253 | } |
1254 | 1254 | ||
1255 | } | 1255 | } |
1256 | 1256 | ||
1257 | void KABCore::save() | 1257 | void KABCore::save() |
1258 | { | 1258 | { |
1259 | if (syncManager->blockSave()) | 1259 | if (syncManager->blockSave()) |
1260 | return; | 1260 | return; |
1261 | if ( !mModified ) | 1261 | if ( !mModified ) |
1262 | return; | 1262 | return; |
1263 | 1263 | ||
1264 | syncManager->setBlockSave(true); | 1264 | syncManager->setBlockSave(true); |
1265 | QString text = i18n( "There was an error while attempting to save\n the " | 1265 | QString text = i18n( "There was an error while attempting to save\n the " |
1266 | "address book. Please check that some \nother application is " | 1266 | "address book. Please check that some \nother application is " |
1267 | "not using it. " ); | 1267 | "not using it. " ); |
1268 | message(i18n("Saving addressbook ... ")); | 1268 | message(i18n("Saving addressbook ... ")); |
1269 | #ifndef KAB_EMBEDDED | 1269 | #ifndef KAB_EMBEDDED |
1270 | KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); | 1270 | KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); |
1271 | if ( !b || !b->save() ) { | 1271 | if ( !b || !b->save() ) { |
1272 | KMessageBox::error( this, text, i18n( "Unable to Save" ) ); | 1272 | KMessageBox::error( this, text, i18n( "Unable to Save" ) ); |
1273 | } | 1273 | } |
1274 | #else //KAB_EMBEDDED | 1274 | #else //KAB_EMBEDDED |
1275 | KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook ); | 1275 | KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook ); |
1276 | if ( !b || !b->save() ) { | 1276 | if ( !b || !b->save() ) { |
1277 | QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok")); | 1277 | QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok")); |
1278 | } | 1278 | } |
1279 | #endif //KAB_EMBEDDED | 1279 | #endif //KAB_EMBEDDED |
1280 | 1280 | ||
1281 | message(i18n("Addressbook saved!")); | 1281 | message(i18n("Addressbook saved!")); |
1282 | setModified( false ); | 1282 | setModified( false ); |
1283 | syncManager->setBlockSave(false); | 1283 | syncManager->setBlockSave(false); |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | 1286 | ||
1287 | void KABCore::undo() | 1287 | void KABCore::undo() |
1288 | { | 1288 | { |
1289 | UndoStack::instance()->undo(); | 1289 | UndoStack::instance()->undo(); |
1290 | 1290 | ||
1291 | // Refresh the view | 1291 | // Refresh the view |
1292 | mViewManager->refreshView(); | 1292 | mViewManager->refreshView(); |
1293 | } | 1293 | } |
1294 | 1294 | ||
1295 | void KABCore::redo() | 1295 | void KABCore::redo() |
1296 | { | 1296 | { |
1297 | RedoStack::instance()->redo(); | 1297 | RedoStack::instance()->redo(); |
1298 | 1298 | ||
1299 | // Refresh the view | 1299 | // Refresh the view |
1300 | mViewManager->refreshView(); | 1300 | mViewManager->refreshView(); |
1301 | } | 1301 | } |
1302 | 1302 | ||
1303 | void KABCore::setJumpButtonBarVisible( bool visible ) | 1303 | void KABCore::setJumpButtonBarVisible( bool visible ) |
1304 | { | 1304 | { |
1305 | if (mMultipleViewsAtOnce) | 1305 | if (mMultipleViewsAtOnce) |
1306 | { | 1306 | { |
1307 | if ( visible ) | 1307 | if ( visible ) |
1308 | mJumpButtonBar->show(); | 1308 | mJumpButtonBar->show(); |
1309 | else | 1309 | else |
1310 | mJumpButtonBar->hide(); | 1310 | mJumpButtonBar->hide(); |
1311 | } | 1311 | } |
1312 | else | 1312 | else |
1313 | { | 1313 | { |
1314 | // show the jumpbar only if "the details are hidden" == "viewmanager are shown" | 1314 | // show the jumpbar only if "the details are hidden" == "viewmanager are shown" |
1315 | if (mViewManager->isVisible()) | 1315 | if (mViewManager->isVisible()) |
1316 | { | 1316 | { |
1317 | if ( visible ) | 1317 | if ( visible ) |
1318 | mJumpButtonBar->show(); | 1318 | mJumpButtonBar->show(); |
1319 | else | 1319 | else |
1320 | mJumpButtonBar->hide(); | 1320 | mJumpButtonBar->hide(); |
1321 | } | 1321 | } |
1322 | else | 1322 | else |
1323 | { | 1323 | { |
1324 | mJumpButtonBar->hide(); | 1324 | mJumpButtonBar->hide(); |
1325 | } | 1325 | } |
1326 | } | 1326 | } |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | 1329 | ||
1330 | void KABCore::setDetailsToState() | 1330 | void KABCore::setDetailsToState() |
1331 | { | 1331 | { |
1332 | setDetailsVisible( mActionDetails->isChecked() ); | 1332 | setDetailsVisible( mActionDetails->isChecked() ); |
1333 | } | 1333 | } |
1334 | void KABCore::setDetailsToggle() | 1334 | void KABCore::setDetailsToggle() |
1335 | { | 1335 | { |
1336 | mActionDetails->setChecked( !mActionDetails->isChecked() ); | 1336 | mActionDetails->setChecked( !mActionDetails->isChecked() ); |
1337 | setDetailsToState(); | 1337 | setDetailsToState(); |
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | 1340 | ||
1341 | 1341 | ||
1342 | void KABCore::setDetailsVisible( bool visible ) | 1342 | void KABCore::setDetailsVisible( bool visible ) |
1343 | { | 1343 | { |
1344 | if (visible && mDetails->isHidden()) | 1344 | if (visible && mDetails->isHidden()) |
1345 | { | 1345 | { |
1346 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); | 1346 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); |
1347 | if ( addrList.count() > 0 ) | 1347 | if ( addrList.count() > 0 ) |
1348 | mDetails->setAddressee( addrList[ 0 ] ); | 1348 | mDetails->setAddressee( addrList[ 0 ] ); |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between | 1351 | // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between |
1352 | // the listview and the detailview. We do that by changing the splitbar size. | 1352 | // the listview and the detailview. We do that by changing the splitbar size. |
1353 | if (mMultipleViewsAtOnce) | 1353 | if (mMultipleViewsAtOnce) |
1354 | { | 1354 | { |
1355 | if ( visible ) | 1355 | if ( visible ) |
1356 | mDetails->show(); | 1356 | mDetails->show(); |
1357 | else | 1357 | else |
1358 | mDetails->hide(); | 1358 | mDetails->hide(); |
1359 | } | 1359 | } |
1360 | else | 1360 | else |
1361 | { | 1361 | { |
1362 | if ( visible ) { | 1362 | if ( visible ) { |
1363 | mViewManager->hide(); | 1363 | mViewManager->hide(); |
1364 | mDetails->show(); | 1364 | mDetails->show(); |
1365 | mIncSearchWidget->setFocus(); | 1365 | mIncSearchWidget->setFocus(); |
1366 | } | 1366 | } |
1367 | else { | 1367 | else { |
1368 | mViewManager->show(); | 1368 | mViewManager->show(); |
1369 | mDetails->hide(); | 1369 | mDetails->hide(); |
1370 | mViewManager->setFocusAV(); | 1370 | mViewManager->setFocusAV(); |
1371 | } | 1371 | } |
1372 | setJumpButtonBarVisible( !visible ); | 1372 | setJumpButtonBarVisible( !visible ); |
1373 | } | 1373 | } |
1374 | 1374 | ||
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | void KABCore::extensionChanged( int id ) | 1377 | void KABCore::extensionChanged( int id ) |
1378 | { | 1378 | { |
1379 | //change the details view only for non desktop systems | 1379 | //change the details view only for non desktop systems |
1380 | #ifndef DESKTOP_VERSION | 1380 | #ifndef DESKTOP_VERSION |
1381 | 1381 | ||
1382 | if (id == 0) | 1382 | if (id == 0) |
1383 | { | 1383 | { |
1384 | //the user disabled the extension. | 1384 | //the user disabled the extension. |
1385 | 1385 | ||
1386 | if (mMultipleViewsAtOnce) | 1386 | if (mMultipleViewsAtOnce) |
1387 | { // enable detailsview again | 1387 | { // enable detailsview again |
1388 | setDetailsVisible( true ); | 1388 | setDetailsVisible( true ); |
1389 | mActionDetails->setChecked( true ); | 1389 | mActionDetails->setChecked( true ); |
1390 | } | 1390 | } |
1391 | else | 1391 | else |
1392 | { //go back to the listview | 1392 | { //go back to the listview |
1393 | setDetailsVisible( false ); | 1393 | setDetailsVisible( false ); |
1394 | mActionDetails->setChecked( false ); | 1394 | mActionDetails->setChecked( false ); |
1395 | mActionDetails->setEnabled(true); | 1395 | mActionDetails->setEnabled(true); |
1396 | } | 1396 | } |
1397 | 1397 | ||
1398 | } | 1398 | } |
1399 | else | 1399 | else |
1400 | { | 1400 | { |
1401 | //the user enabled the extension. | 1401 | //the user enabled the extension. |
1402 | setDetailsVisible( false ); | 1402 | setDetailsVisible( false ); |
1403 | mActionDetails->setChecked( false ); | 1403 | mActionDetails->setChecked( false ); |
1404 | 1404 | ||
1405 | if (!mMultipleViewsAtOnce) | 1405 | if (!mMultipleViewsAtOnce) |
1406 | { | 1406 | { |
1407 | mActionDetails->setEnabled(false); | 1407 | mActionDetails->setEnabled(false); |
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | mExtensionManager->setSelectionChanged(); | 1410 | mExtensionManager->setSelectionChanged(); |
1411 | 1411 | ||
1412 | } | 1412 | } |
1413 | 1413 | ||
1414 | #endif// DESKTOP_VERSION | 1414 | #endif// DESKTOP_VERSION |
1415 | 1415 | ||
1416 | } | 1416 | } |
1417 | 1417 | ||
1418 | 1418 | ||
1419 | void KABCore::extensionModified( const KABC::Addressee::List &list ) | 1419 | void KABCore::extensionModified( const KABC::Addressee::List &list ) |
1420 | { | 1420 | { |
1421 | 1421 | ||
1422 | if ( list.count() != 0 ) { | 1422 | if ( list.count() != 0 ) { |
1423 | KABC::Addressee::List::ConstIterator it; | 1423 | KABC::Addressee::List::ConstIterator it; |
1424 | for ( it = list.begin(); it != list.end(); ++it ) | 1424 | for ( it = list.begin(); it != list.end(); ++it ) |
1425 | mAddressBook->insertAddressee( *it ); | 1425 | mAddressBook->insertAddressee( *it ); |
1426 | if ( list.count() > 1 ) | 1426 | if ( list.count() > 1 ) |
1427 | setModified(); | 1427 | setModified(); |
1428 | else | 1428 | else |
1429 | setModifiedWOrefresh(); | 1429 | setModifiedWOrefresh(); |
1430 | } | 1430 | } |
1431 | if ( list.count() == 0 ) | 1431 | if ( list.count() == 0 ) |
1432 | mViewManager->refreshView(); | 1432 | mViewManager->refreshView(); |
1433 | else | 1433 | else |
1434 | mViewManager->refreshView( list[ 0 ].uid() ); | 1434 | mViewManager->refreshView( list[ 0 ].uid() ); |
1435 | 1435 | ||
1436 | 1436 | ||
1437 | 1437 | ||
1438 | } | 1438 | } |
1439 | 1439 | ||
1440 | QString KABCore::getNameByPhone( const QString &phone ) | 1440 | QString KABCore::getNameByPhone( const QString &phone ) |
1441 | { | 1441 | { |
1442 | #ifndef KAB_EMBEDDED | 1442 | #ifndef KAB_EMBEDDED |
1443 | QRegExp r( "[/*/-/ ]" ); | 1443 | QRegExp r( "[/*/-/ ]" ); |
1444 | QString localPhone( phone ); | 1444 | QString localPhone( phone ); |
1445 | 1445 | ||
1446 | bool found = false; | 1446 | bool found = false; |
1447 | QString ownerName = ""; | 1447 | QString ownerName = ""; |
1448 | KABC::AddressBook::Iterator iter; | 1448 | KABC::AddressBook::Iterator iter; |
1449 | KABC::PhoneNumber::List::Iterator phoneIter; | 1449 | KABC::PhoneNumber::List::Iterator phoneIter; |
1450 | KABC::PhoneNumber::List phoneList; | 1450 | KABC::PhoneNumber::List phoneList; |
1451 | for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { | 1451 | for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { |
1452 | phoneList = (*iter).phoneNumbers(); | 1452 | phoneList = (*iter).phoneNumbers(); |
1453 | for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); | 1453 | for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); |
1454 | ++phoneIter) { | 1454 | ++phoneIter) { |
1455 | // Get rid of separator chars so just the numbers are compared. | 1455 | // Get rid of separator chars so just the numbers are compared. |
1456 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { | 1456 | if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { |
1457 | ownerName = (*iter).formattedName(); | 1457 | ownerName = (*iter).formattedName(); |
1458 | found = true; | 1458 | found = true; |
1459 | } | 1459 | } |
1460 | } | 1460 | } |
1461 | } | 1461 | } |
1462 | 1462 | ||
1463 | return ownerName; | 1463 | return ownerName; |
1464 | #else //KAB_EMBEDDED | 1464 | #else //KAB_EMBEDDED |
1465 | qDebug("KABCore::getNameByPhone finsih method"); | 1465 | qDebug("KABCore::getNameByPhone finsih method"); |
1466 | return ""; | 1466 | return ""; |
1467 | #endif //KAB_EMBEDDED | 1467 | #endif //KAB_EMBEDDED |
1468 | 1468 | ||
1469 | } | 1469 | } |
1470 | 1470 | ||
1471 | void KABCore::openConfigDialog() | 1471 | void KABCore::openConfigDialog() |
1472 | { | 1472 | { |
1473 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); | 1473 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); |
1474 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); | 1474 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); |
1475 | ConfigureDialog->addModule(kabcfg ); | 1475 | ConfigureDialog->addModule(kabcfg ); |
1476 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); | 1476 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); |
1477 | ConfigureDialog->addModule(kdelibcfg ); | 1477 | ConfigureDialog->addModule(kdelibcfg ); |
1478 | 1478 | ||
1479 | connect( ConfigureDialog, SIGNAL( applyClicked() ), | 1479 | connect( ConfigureDialog, SIGNAL( applyClicked() ), |
1480 | this, SLOT( configurationChanged() ) ); | 1480 | this, SLOT( configurationChanged() ) ); |
1481 | connect( ConfigureDialog, SIGNAL( okClicked() ), | 1481 | connect( ConfigureDialog, SIGNAL( okClicked() ), |
1482 | this, SLOT( configurationChanged() ) ); | 1482 | this, SLOT( configurationChanged() ) ); |
1483 | saveSettings(); | 1483 | saveSettings(); |
1484 | #ifndef DESKTOP_VERSION | 1484 | #ifndef DESKTOP_VERSION |
1485 | ConfigureDialog->showMaximized(); | 1485 | ConfigureDialog->showMaximized(); |
1486 | #endif | 1486 | #endif |
1487 | if ( ConfigureDialog->exec() ) | 1487 | if ( ConfigureDialog->exec() ) |
1488 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); | 1488 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); |
1489 | delete ConfigureDialog; | 1489 | delete ConfigureDialog; |
1490 | } | 1490 | } |
1491 | 1491 | ||
1492 | void KABCore::openLDAPDialog() | 1492 | void KABCore::openLDAPDialog() |
1493 | { | 1493 | { |
1494 | #ifndef KAB_EMBEDDED | 1494 | #ifndef KAB_EMBEDDED |
1495 | if ( !mLdapSearchDialog ) { | 1495 | if ( !mLdapSearchDialog ) { |
1496 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); | 1496 | mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); |
1497 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, | 1497 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, |
1498 | SLOT( refreshView() ) ); | 1498 | SLOT( refreshView() ) ); |
1499 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, | 1499 | connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, |
1500 | SLOT( setModified() ) ); | 1500 | SLOT( setModified() ) ); |
1501 | } else | 1501 | } else |
1502 | mLdapSearchDialog->restoreSettings(); | 1502 | mLdapSearchDialog->restoreSettings(); |
1503 | 1503 | ||
1504 | if ( mLdapSearchDialog->isOK() ) | 1504 | if ( mLdapSearchDialog->isOK() ) |
1505 | mLdapSearchDialog->exec(); | 1505 | mLdapSearchDialog->exec(); |
1506 | #else //KAB_EMBEDDED | 1506 | #else //KAB_EMBEDDED |
1507 | qDebug("KABCore::openLDAPDialog() finsih method"); | 1507 | qDebug("KABCore::openLDAPDialog() finsih method"); |
1508 | #endif //KAB_EMBEDDED | 1508 | #endif //KAB_EMBEDDED |
1509 | } | 1509 | } |
1510 | 1510 | ||
1511 | void KABCore::print() | 1511 | void KABCore::print() |
1512 | { | 1512 | { |
1513 | #ifndef KAB_EMBEDDED | 1513 | #ifndef KAB_EMBEDDED |
1514 | KPrinter printer; | 1514 | KPrinter printer; |
1515 | if ( !printer.setup( this ) ) | 1515 | if ( !printer.setup( this ) ) |
1516 | return; | 1516 | return; |
1517 | 1517 | ||
1518 | KABPrinting::PrintingWizard wizard( &printer, mAddressBook, | 1518 | KABPrinting::PrintingWizard wizard( &printer, mAddressBook, |
1519 | mViewManager->selectedUids(), this ); | 1519 | mViewManager->selectedUids(), this ); |
1520 | 1520 | ||
1521 | wizard.exec(); | 1521 | wizard.exec(); |
1522 | #else //KAB_EMBEDDED | 1522 | #else //KAB_EMBEDDED |
1523 | qDebug("KABCore::print() finsih method"); | 1523 | qDebug("KABCore::print() finsih method"); |
1524 | #endif //KAB_EMBEDDED | 1524 | #endif //KAB_EMBEDDED |
1525 | 1525 | ||
1526 | } | 1526 | } |
1527 | 1527 | ||
1528 | 1528 | ||
1529 | void KABCore::addGUIClient( KXMLGUIClient *client ) | 1529 | void KABCore::addGUIClient( KXMLGUIClient *client ) |
1530 | { | 1530 | { |
1531 | if ( mGUIClient ) | 1531 | if ( mGUIClient ) |
1532 | mGUIClient->insertChildClient( client ); | 1532 | mGUIClient->insertChildClient( client ); |
1533 | else | 1533 | else |
1534 | KMessageBox::error( this, "no KXMLGUICLient"); | 1534 | KMessageBox::error( this, "no KXMLGUICLient"); |
1535 | } | 1535 | } |
1536 | 1536 | ||
1537 | 1537 | ||
1538 | void KABCore::configurationChanged() | 1538 | void KABCore::configurationChanged() |
1539 | { | 1539 | { |
1540 | mExtensionManager->reconfigure(); | 1540 | mExtensionManager->reconfigure(); |
1541 | } | 1541 | } |
1542 | 1542 | ||
1543 | void KABCore::addressBookChanged() | 1543 | void KABCore::addressBookChanged() |
1544 | { | 1544 | { |
1545 | /*US | 1545 | /*US |
1546 | QDictIterator<AddresseeEditorDialog> it( mEditorDict ); | 1546 | QDictIterator<AddresseeEditorDialog> it( mEditorDict ); |
1547 | while ( it.current() ) { | 1547 | while ( it.current() ) { |
1548 | if ( it.current()->dirty() ) { | 1548 | if ( it.current()->dirty() ) { |
1549 | QString text = i18n( "Data has been changed externally. Unsaved " | 1549 | QString text = i18n( "Data has been changed externally. Unsaved " |
1550 | "changes will be lost." ); | 1550 | "changes will be lost." ); |
1551 | KMessageBox::information( this, text ); | 1551 | KMessageBox::information( this, text ); |
1552 | } | 1552 | } |
1553 | it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); | 1553 | it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); |
1554 | ++it; | 1554 | ++it; |
1555 | } | 1555 | } |
1556 | */ | 1556 | */ |
1557 | if (mEditorDialog) | 1557 | if (mEditorDialog) |
1558 | { | 1558 | { |
1559 | if (mEditorDialog->dirty()) | 1559 | if (mEditorDialog->dirty()) |
1560 | { | 1560 | { |
1561 | QString text = i18n( "Data has been changed externally. Unsaved " | 1561 | QString text = i18n( "Data has been changed externally. Unsaved " |
1562 | "changes will be lost." ); | 1562 | "changes will be lost." ); |
1563 | KMessageBox::information( this, text ); | 1563 | KMessageBox::information( this, text ); |
1564 | } | 1564 | } |
1565 | QString currentuid = mEditorDialog->addressee().uid(); | 1565 | QString currentuid = mEditorDialog->addressee().uid(); |
1566 | mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); | 1566 | mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); |
1567 | } | 1567 | } |
1568 | mViewManager->refreshView(); | 1568 | mViewManager->refreshView(); |
1569 | // mDetails->refreshView(); | 1569 | // mDetails->refreshView(); |
1570 | 1570 | ||
1571 | 1571 | ||
1572 | } | 1572 | } |
1573 | 1573 | ||
1574 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, | 1574 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, |
1575 | const char *name ) | 1575 | const char *name ) |
1576 | { | 1576 | { |
1577 | 1577 | ||
1578 | if ( mEditorDialog == 0 ) { | 1578 | if ( mEditorDialog == 0 ) { |
1579 | mEditorDialog = new AddresseeEditorDialog( this, parent, | 1579 | mEditorDialog = new AddresseeEditorDialog( this, parent, |
1580 | name ? name : "editorDialog" ); | 1580 | name ? name : "editorDialog" ); |
1581 | 1581 | ||
1582 | 1582 | ||
1583 | connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), | 1583 | connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), |
1584 | SLOT( contactModified( const KABC::Addressee& ) ) ); | 1584 | SLOT( contactModified( const KABC::Addressee& ) ) ); |
1585 | //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), | 1585 | //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), |
1586 | // SLOT( slotEditorDestroyed( const QString& ) ) ; | 1586 | // SLOT( slotEditorDestroyed( const QString& ) ) ; |
1587 | } | 1587 | } |
1588 | 1588 | ||
1589 | return mEditorDialog; | 1589 | return mEditorDialog; |
1590 | } | 1590 | } |
1591 | 1591 | ||
1592 | void KABCore::slotEditorDestroyed( const QString &uid ) | 1592 | void KABCore::slotEditorDestroyed( const QString &uid ) |
1593 | { | 1593 | { |
1594 | //mEditorDict.remove( uid ); | 1594 | //mEditorDict.remove( uid ); |
1595 | } | 1595 | } |
1596 | 1596 | ||
1597 | void KABCore::initGUI() | 1597 | void KABCore::initGUI() |
1598 | { | 1598 | { |
1599 | #ifndef KAB_EMBEDDED | 1599 | #ifndef KAB_EMBEDDED |
1600 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1600 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1601 | topLayout->setSpacing( KDialogBase::spacingHint() ); | 1601 | topLayout->setSpacing( KDialogBase::spacingHint() ); |
1602 | 1602 | ||
1603 | mExtensionBarSplitter = new QSplitter( this ); | 1603 | mExtensionBarSplitter = new QSplitter( this ); |
1604 | mExtensionBarSplitter->setOrientation( Qt::Vertical ); | 1604 | mExtensionBarSplitter->setOrientation( Qt::Vertical ); |
1605 | 1605 | ||
1606 | mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); | 1606 | mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); |
1607 | 1607 | ||
1608 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); | 1608 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); |
1609 | mIncSearchWidget = new IncSearchWidget( viewSpace ); | 1609 | mIncSearchWidget = new IncSearchWidget( viewSpace ); |
1610 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1610 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1611 | SLOT( incrementalSearch( const QString& ) ) ); | 1611 | SLOT( incrementalSearch( const QString& ) ) ); |
1612 | 1612 | ||
1613 | mViewManager = new ViewManager( this, viewSpace ); | 1613 | mViewManager = new ViewManager( this, viewSpace ); |
1614 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1614 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1615 | 1615 | ||
1616 | mDetails = new ViewContainer( mDetailsSplitter ); | 1616 | mDetails = new ViewContainer( mDetailsSplitter ); |
1617 | 1617 | ||
1618 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1618 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1619 | 1619 | ||
1620 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); | 1620 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); |
1621 | 1621 | ||
1622 | topLayout->addWidget( mExtensionBarSplitter ); | 1622 | topLayout->addWidget( mExtensionBarSplitter ); |
1623 | topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); | 1623 | topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); |
1624 | topLayout->addWidget( mJumpButtonBar ); | 1624 | topLayout->addWidget( mJumpButtonBar ); |
1625 | topLayout->setStretchFactor( mJumpButtonBar, 1 ); | 1625 | topLayout->setStretchFactor( mJumpButtonBar, 1 ); |
1626 | 1626 | ||
1627 | mXXPortManager = new XXPortManager( this, this ); | 1627 | mXXPortManager = new XXPortManager( this, this ); |
1628 | 1628 | ||
1629 | #else //KAB_EMBEDDED | 1629 | #else //KAB_EMBEDDED |
1630 | //US initialize viewMenu before settingup viewmanager. | 1630 | //US initialize viewMenu before settingup viewmanager. |
1631 | // Viewmanager needs this menu to plugin submenues. | 1631 | // Viewmanager needs this menu to plugin submenues. |
1632 | viewMenu = new QPopupMenu( this ); | 1632 | viewMenu = new QPopupMenu( this ); |
1633 | settingsMenu = new QPopupMenu( this ); | 1633 | settingsMenu = new QPopupMenu( this ); |
1634 | //filterMenu = new QPopupMenu( this ); | 1634 | //filterMenu = new QPopupMenu( this ); |
1635 | ImportMenu = new QPopupMenu( this ); | 1635 | ImportMenu = new QPopupMenu( this ); |
1636 | ExportMenu = new QPopupMenu( this ); | 1636 | ExportMenu = new QPopupMenu( this ); |
1637 | syncMenu = new QPopupMenu( this ); | 1637 | syncMenu = new QPopupMenu( this ); |
1638 | changeMenu= new QPopupMenu( this ); | 1638 | changeMenu= new QPopupMenu( this ); |
1639 | 1639 | ||
1640 | //US since we have no splitter for the embedded system, setup | 1640 | //US since we have no splitter for the embedded system, setup |
1641 | // a layout with two frames. One left and one right. | 1641 | // a layout with two frames. One left and one right. |
1642 | 1642 | ||
1643 | QBoxLayout *topLayout; | 1643 | QBoxLayout *topLayout; |
1644 | 1644 | ||
1645 | // = new QHBoxLayout( this ); | 1645 | // = new QHBoxLayout( this ); |
1646 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); | 1646 | // QBoxLayout *topLayout = (QBoxLayout*)layout(); |
1647 | 1647 | ||
1648 | // QWidget *mainBox = new QWidget( this ); | 1648 | // QWidget *mainBox = new QWidget( this ); |
1649 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); | 1649 | // QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); |
1650 | 1650 | ||
1651 | #ifdef DESKTOP_VERSION | 1651 | #ifdef DESKTOP_VERSION |
1652 | topLayout = new QHBoxLayout( this ); | 1652 | topLayout = new QHBoxLayout( this ); |
1653 | 1653 | ||
1654 | 1654 | ||
1655 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 1655 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
1656 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 1656 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
1657 | 1657 | ||
1658 | topLayout->addWidget(mMiniSplitter ); | 1658 | topLayout->addWidget(mMiniSplitter ); |
1659 | 1659 | ||
1660 | mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); | 1660 | mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); |
1661 | mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 1661 | mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
1662 | mViewManager = new ViewManager( this, mExtensionBarSplitter ); | 1662 | mViewManager = new ViewManager( this, mExtensionBarSplitter ); |
1663 | mDetails = new ViewContainer( mMiniSplitter ); | 1663 | mDetails = new ViewContainer( mMiniSplitter ); |
1664 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); | 1664 | mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); |
1665 | #else | 1665 | #else |
1666 | if ( QApplication::desktop()->width() > 480 ) { | 1666 | if ( QApplication::desktop()->width() > 480 ) { |
1667 | topLayout = new QHBoxLayout( this ); | 1667 | topLayout = new QHBoxLayout( this ); |
1668 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 1668 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
1669 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 1669 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
1670 | } else { | 1670 | } else { |
1671 | 1671 | ||
1672 | topLayout = new QHBoxLayout( this ); | 1672 | topLayout = new QHBoxLayout( this ); |
1673 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 1673 | mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
1674 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 1674 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
1675 | } | 1675 | } |
1676 | 1676 | ||
1677 | topLayout->addWidget(mMiniSplitter ); | 1677 | topLayout->addWidget(mMiniSplitter ); |
1678 | mViewManager = new ViewManager( this, mMiniSplitter ); | 1678 | mViewManager = new ViewManager( this, mMiniSplitter ); |
1679 | mDetails = new ViewContainer( mMiniSplitter ); | 1679 | mDetails = new ViewContainer( mMiniSplitter ); |
1680 | 1680 | ||
1681 | 1681 | ||
1682 | mExtensionManager = new ExtensionManager( this, mMiniSplitter ); | 1682 | mExtensionManager = new ExtensionManager( this, mMiniSplitter ); |
1683 | #endif | 1683 | #endif |
1684 | //eh->hide(); | 1684 | //eh->hide(); |
1685 | // topLayout->addWidget(mExtensionManager ); | 1685 | // topLayout->addWidget(mExtensionManager ); |
1686 | 1686 | ||
1687 | 1687 | ||
1688 | /*US | 1688 | /*US |
1689 | #ifndef KAB_NOSPLITTER | 1689 | #ifndef KAB_NOSPLITTER |
1690 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1690 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1691 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); | 1691 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); |
1692 | topLayout->setSpacing( 10 ); | 1692 | topLayout->setSpacing( 10 ); |
1693 | 1693 | ||
1694 | mDetailsSplitter = new QSplitter( this ); | 1694 | mDetailsSplitter = new QSplitter( this ); |
1695 | 1695 | ||
1696 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); | 1696 | QVBox *viewSpace = new QVBox( mDetailsSplitter ); |
1697 | 1697 | ||
1698 | mViewManager = new ViewManager( this, viewSpace ); | 1698 | mViewManager = new ViewManager( this, viewSpace ); |
1699 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1699 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1700 | 1700 | ||
1701 | mDetails = new ViewContainer( mDetailsSplitter ); | 1701 | mDetails = new ViewContainer( mDetailsSplitter ); |
1702 | 1702 | ||
1703 | topLayout->addWidget( mDetailsSplitter ); | 1703 | topLayout->addWidget( mDetailsSplitter ); |
1704 | topLayout->setStretchFactor( mDetailsSplitter, 100 ); | 1704 | topLayout->setStretchFactor( mDetailsSplitter, 100 ); |
1705 | #else //KAB_NOSPLITTER | 1705 | #else //KAB_NOSPLITTER |
1706 | QHBoxLayout *topLayout = new QHBoxLayout( this ); | 1706 | QHBoxLayout *topLayout = new QHBoxLayout( this ); |
1707 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); | 1707 | //US topLayout->setSpacing( KDialogBase::spacingHint() ); |
1708 | topLayout->setSpacing( 10 ); | 1708 | topLayout->setSpacing( 10 ); |
1709 | 1709 | ||
1710 | // mDetailsSplitter = new QSplitter( this ); | 1710 | // mDetailsSplitter = new QSplitter( this ); |
1711 | 1711 | ||
1712 | QVBox *viewSpace = new QVBox( this ); | 1712 | QVBox *viewSpace = new QVBox( this ); |
1713 | 1713 | ||
1714 | mViewManager = new ViewManager( this, viewSpace ); | 1714 | mViewManager = new ViewManager( this, viewSpace ); |
1715 | viewSpace->setStretchFactor( mViewManager, 1 ); | 1715 | viewSpace->setStretchFactor( mViewManager, 1 ); |
1716 | 1716 | ||
1717 | mDetails = new ViewContainer( this ); | 1717 | mDetails = new ViewContainer( this ); |
1718 | 1718 | ||
1719 | topLayout->addWidget( viewSpace ); | 1719 | topLayout->addWidget( viewSpace ); |
1720 | // topLayout->setStretchFactor( mDetailsSplitter, 100 ); | 1720 | // topLayout->setStretchFactor( mDetailsSplitter, 100 ); |
1721 | topLayout->addWidget( mDetails ); | 1721 | topLayout->addWidget( mDetails ); |
1722 | #endif //KAB_NOSPLITTER | 1722 | #endif //KAB_NOSPLITTER |
1723 | */ | 1723 | */ |
1724 | 1724 | ||
1725 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); | 1725 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); |
1726 | syncManager->setBlockSave(false); | 1726 | syncManager->setBlockSave(false); |
1727 | 1727 | ||
1728 | connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 1728 | connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
1729 | connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 1729 | connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
1730 | syncManager->setDefaultFileName( sentSyncFile()); | 1730 | syncManager->setDefaultFileName( sentSyncFile()); |
1731 | //connect(syncManager , SIGNAL( ), this, SLOT( ) ); | 1731 | //connect(syncManager , SIGNAL( ), this, SLOT( ) ); |
1732 | 1732 | ||
1733 | #endif //KAB_EMBEDDED | 1733 | #endif //KAB_EMBEDDED |
1734 | initActions(); | 1734 | initActions(); |
1735 | 1735 | ||
1736 | #ifdef KAB_EMBEDDED | 1736 | #ifdef KAB_EMBEDDED |
1737 | addActionsManually(); | 1737 | addActionsManually(); |
1738 | //US make sure the export and import menues are initialized before creating the xxPortManager. | 1738 | //US make sure the export and import menues are initialized before creating the xxPortManager. |
1739 | mXXPortManager = new XXPortManager( this, this ); | 1739 | mXXPortManager = new XXPortManager( this, this ); |
1740 | 1740 | ||
1741 | // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); | 1741 | // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); |
1742 | //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); | 1742 | //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); |
1743 | // mActionQuit->plug ( mMainWindow->toolBar()); | 1743 | // mActionQuit->plug ( mMainWindow->toolBar()); |
1744 | //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); | 1744 | //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); |
1745 | //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); | 1745 | //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); |
1746 | // mIncSearchWidget->hide(); | 1746 | // mIncSearchWidget->hide(); |
1747 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 1747 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
1748 | SLOT( incrementalSearch( const QString& ) ) ); | 1748 | SLOT( incrementalSearch( const QString& ) ) ); |
1749 | connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); | 1749 | connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); |
1750 | connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); | 1750 | connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); |
1751 | 1751 | ||
1752 | mJumpButtonBar = new JumpButtonBar( this, this ); | 1752 | mJumpButtonBar = new JumpButtonBar( this, this ); |
1753 | 1753 | ||
1754 | topLayout->addWidget( mJumpButtonBar ); | 1754 | topLayout->addWidget( mJumpButtonBar ); |
1755 | //US topLayout->setStretchFactor( mJumpButtonBar, 10 ); | 1755 | //US topLayout->setStretchFactor( mJumpButtonBar, 10 ); |
1756 | 1756 | ||
1757 | // mMainWindow->getIconToolBar()->raise(); | 1757 | // mMainWindow->getIconToolBar()->raise(); |
1758 | 1758 | ||
1759 | #endif //KAB_EMBEDDED | 1759 | #endif //KAB_EMBEDDED |
1760 | 1760 | ||
1761 | } | 1761 | } |
1762 | void KABCore::initActions() | 1762 | void KABCore::initActions() |
1763 | { | 1763 | { |
1764 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1764 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1765 | 1765 | ||
1766 | #ifndef KAB_EMBEDDED | 1766 | #ifndef KAB_EMBEDDED |
1767 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), | 1767 | connect( QApplication::clipboard(), SIGNAL( dataChanged() ), |
1768 | SLOT( clipboardDataChanged() ) ); | 1768 | SLOT( clipboardDataChanged() ) ); |
1769 | #endif //KAB_EMBEDDED | 1769 | #endif //KAB_EMBEDDED |
1770 | 1770 | ||
1771 | // file menu | 1771 | // file menu |
1772 | if ( mIsPart ) { | 1772 | if ( mIsPart ) { |
1773 | mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, | 1773 | mActionMail = new KAction( i18n( "&Mail" ), "mail_generic", 0, this, |
1774 | SLOT( sendMail() ), actionCollection(), | 1774 | SLOT( sendMail() ), actionCollection(), |
1775 | "kaddressbook_mail" ); | 1775 | "kaddressbook_mail" ); |
1776 | mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, | 1776 | mActionPrint = new KAction( i18n( "&Print" ), "fileprint", CTRL + Key_P, this, |
1777 | SLOT( print() ), actionCollection(), "kaddressbook_print" ); | 1777 | SLOT( print() ), actionCollection(), "kaddressbook_print" ); |
1778 | 1778 | ||
1779 | } else { | 1779 | } else { |
1780 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); | 1780 | mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); |
1781 | mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); | 1781 | mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); |
1782 | } | 1782 | } |
1783 | 1783 | ||
1784 | 1784 | ||
1785 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, | 1785 | mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, |
1786 | SLOT( save() ), actionCollection(), "file_sync" ); | 1786 | SLOT( save() ), actionCollection(), "file_sync" ); |
1787 | 1787 | ||
1788 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, | 1788 | mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, |
1789 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); | 1789 | SLOT( newContact() ), actionCollection(), "file_new_contact" ); |
1790 | 1790 | ||
1791 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, | 1791 | mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, |
1792 | this, SLOT( mailVCard() ), | 1792 | this, SLOT( mailVCard() ), |
1793 | actionCollection(), "file_mail_vcard"); | 1793 | actionCollection(), "file_mail_vcard"); |
1794 | 1794 | ||
1795 | mActionExport2phone = new KAction( i18n( "Selected to phone" ), "ex2phone", 0, this, | 1795 | mActionExport2phone = new KAction( i18n( "Selected to phone" ), "ex2phone", 0, this, |
1796 | SLOT( export2phone() ), actionCollection(), | 1796 | SLOT( export2phone() ), actionCollection(), |
1797 | "kaddressbook_ex2phone" ); | 1797 | "kaddressbook_ex2phone" ); |
1798 | 1798 | ||
1799 | mActionBeamVCard = 0; | 1799 | mActionBeamVCard = 0; |
1800 | mActionBeam = 0; | 1800 | mActionBeam = 0; |
1801 | 1801 | ||
1802 | #ifndef DESKTOP_VERSION | 1802 | #ifndef DESKTOP_VERSION |
1803 | if ( Ir::supported() ) { | 1803 | if ( Ir::supported() ) { |
1804 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, | 1804 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, |
1805 | SLOT( beamVCard() ), actionCollection(), | 1805 | SLOT( beamVCard() ), actionCollection(), |
1806 | "kaddressbook_beam_vcard" ); | 1806 | "kaddressbook_beam_vcard" ); |
1807 | 1807 | ||
1808 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, | 1808 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, |
1809 | SLOT( beamMySelf() ), actionCollection(), | 1809 | SLOT( beamMySelf() ), actionCollection(), |
1810 | "kaddressbook_beam_myself" ); | 1810 | "kaddressbook_beam_myself" ); |
1811 | } | 1811 | } |
1812 | #endif | 1812 | #endif |
1813 | 1813 | ||
1814 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, | 1814 | mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, |
1815 | this, SLOT( editContact2() ), | 1815 | this, SLOT( editContact2() ), |
1816 | actionCollection(), "file_properties" ); | 1816 | actionCollection(), "file_properties" ); |
1817 | 1817 | ||
1818 | #ifdef KAB_EMBEDDED | 1818 | #ifdef KAB_EMBEDDED |
1819 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); | 1819 | // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); |
1820 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, | 1820 | mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, |
1821 | mMainWindow, SLOT( exit() ), | 1821 | mMainWindow, SLOT( exit() ), |
1822 | actionCollection(), "quit" ); | 1822 | actionCollection(), "quit" ); |
1823 | #endif //KAB_EMBEDDED | 1823 | #endif //KAB_EMBEDDED |
1824 | 1824 | ||
1825 | // edit menu | 1825 | // edit menu |
1826 | if ( mIsPart ) { | 1826 | if ( mIsPart ) { |
1827 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, | 1827 | mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, |
1828 | SLOT( copyContacts() ), actionCollection(), | 1828 | SLOT( copyContacts() ), actionCollection(), |
1829 | "kaddressbook_copy" ); | 1829 | "kaddressbook_copy" ); |
1830 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, | 1830 | mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, |
1831 | SLOT( cutContacts() ), actionCollection(), | 1831 | SLOT( cutContacts() ), actionCollection(), |
1832 | "kaddressbook_cut" ); | 1832 | "kaddressbook_cut" ); |
1833 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, | 1833 | mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, |
1834 | SLOT( pasteContacts() ), actionCollection(), | 1834 | SLOT( pasteContacts() ), actionCollection(), |
1835 | "kaddressbook_paste" ); | 1835 | "kaddressbook_paste" ); |
1836 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, | 1836 | mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, |
1837 | SLOT( selectAllContacts() ), actionCollection(), | 1837 | SLOT( selectAllContacts() ), actionCollection(), |
1838 | "kaddressbook_select_all" ); | 1838 | "kaddressbook_select_all" ); |
1839 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, | 1839 | mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, |
1840 | SLOT( undo() ), actionCollection(), | 1840 | SLOT( undo() ), actionCollection(), |
1841 | "kaddressbook_undo" ); | 1841 | "kaddressbook_undo" ); |
1842 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, | 1842 | mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, |
1843 | this, SLOT( redo() ), actionCollection(), | 1843 | this, SLOT( redo() ), actionCollection(), |
1844 | "kaddressbook_redo" ); | 1844 | "kaddressbook_redo" ); |
1845 | } else { | 1845 | } else { |
1846 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); | 1846 | mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); |
1847 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); | 1847 | mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); |
1848 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); | 1848 | mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); |
1849 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); | 1849 | mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); |
1850 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); | 1850 | mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); |
1851 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); | 1851 | mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); |
1852 | } | 1852 | } |
1853 | 1853 | ||
1854 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", | 1854 | mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", |
1855 | Key_Delete, this, SLOT( deleteContacts() ), | 1855 | Key_Delete, this, SLOT( deleteContacts() ), |
1856 | actionCollection(), "edit_delete" ); | 1856 | actionCollection(), "edit_delete" ); |
1857 | 1857 | ||
1858 | mActionUndo->setEnabled( false ); | 1858 | mActionUndo->setEnabled( false ); |
1859 | mActionRedo->setEnabled( false ); | 1859 | mActionRedo->setEnabled( false ); |
1860 | 1860 | ||
1861 | // settings menu | 1861 | // settings menu |
1862 | #ifdef KAB_EMBEDDED | 1862 | #ifdef KAB_EMBEDDED |
1863 | //US special menuentry to configure the addressbook resources. On KDE | 1863 | //US special menuentry to configure the addressbook resources. On KDE |
1864 | // you do that through the control center !!! | 1864 | // you do that through the control center !!! |
1865 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, | 1865 | mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, |
1866 | SLOT( configureResources() ), actionCollection(), | 1866 | SLOT( configureResources() ), actionCollection(), |
1867 | "kaddressbook_configure_resources" ); | 1867 | "kaddressbook_configure_resources" ); |
1868 | #endif //KAB_EMBEDDED | 1868 | #endif //KAB_EMBEDDED |
1869 | 1869 | ||
1870 | if ( mIsPart ) { | 1870 | if ( mIsPart ) { |
1871 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, | 1871 | mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, |
1872 | SLOT( openConfigDialog() ), actionCollection(), | 1872 | SLOT( openConfigDialog() ), actionCollection(), |
1873 | "kaddressbook_configure" ); | 1873 | "kaddressbook_configure" ); |
1874 | 1874 | ||
1875 | //US not implemented yet | 1875 | //US not implemented yet |
1876 | //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, | 1876 | //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, |
1877 | // this, SLOT( configureKeyBindings() ), actionCollection(), | 1877 | // this, SLOT( configureKeyBindings() ), actionCollection(), |
1878 | // "kaddressbook_configure_shortcuts" ); | 1878 | // "kaddressbook_configure_shortcuts" ); |
1879 | #ifdef KAB_EMBEDDED | 1879 | #ifdef KAB_EMBEDDED |
1880 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); | 1880 | mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); |
1881 | mActionConfigureToolbars->setEnabled( false ); | 1881 | mActionConfigureToolbars->setEnabled( false ); |
1882 | #endif //KAB_EMBEDDED | 1882 | #endif //KAB_EMBEDDED |
1883 | 1883 | ||
1884 | } else { | 1884 | } else { |
1885 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); | 1885 | mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); |
1886 | 1886 | ||
1887 | //US not implemented yet | 1887 | //US not implemented yet |
1888 | //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); | 1888 | //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); |
1889 | } | 1889 | } |
1890 | 1890 | ||
1891 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, | 1891 | mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, |
1892 | actionCollection(), "options_show_jump_bar" ); | 1892 | actionCollection(), "options_show_jump_bar" ); |
1893 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); | 1893 | connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBarVisible( bool ) ) ); |
1894 | 1894 | ||
1895 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, | 1895 | mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, |
1896 | actionCollection(), "options_show_details" ); | 1896 | actionCollection(), "options_show_details" ); |
1897 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); | 1897 | connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); |
1898 | 1898 | ||
1899 | 1899 | ||
1900 | mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, | 1900 | mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, |
1901 | SLOT( toggleBeamReceive() ), actionCollection(), | 1901 | SLOT( toggleBeamReceive() ), actionCollection(), |
1902 | "kaddressbook_beam_rec" ); | 1902 | "kaddressbook_beam_rec" ); |
1903 | 1903 | ||
1904 | 1904 | ||
1905 | // misc | 1905 | // misc |
1906 | // only enable LDAP lookup if we can handle the protocol | 1906 | // only enable LDAP lookup if we can handle the protocol |
1907 | #ifndef KAB_EMBEDDED | 1907 | #ifndef KAB_EMBEDDED |
1908 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { | 1908 | if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { |
1909 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, | 1909 | new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, |
1910 | this, SLOT( openLDAPDialog() ), actionCollection(), | 1910 | this, SLOT( openLDAPDialog() ), actionCollection(), |
1911 | "ldap_lookup" ); | 1911 | "ldap_lookup" ); |
1912 | } | 1912 | } |
1913 | #else //KAB_EMBEDDED | 1913 | #else //KAB_EMBEDDED |
1914 | //qDebug("KABCore::initActions() LDAP has to be implemented"); | 1914 | //qDebug("KABCore::initActions() LDAP has to be implemented"); |
1915 | #endif //KAB_EMBEDDED | 1915 | #endif //KAB_EMBEDDED |
1916 | 1916 | ||
1917 | 1917 | ||
1918 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1918 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1919 | SLOT( setWhoAmI() ), actionCollection(), | 1919 | SLOT( setWhoAmI() ), actionCollection(), |
1920 | "set_personal" ); | 1920 | "set_personal" ); |
1921 | 1921 | ||
1922 | 1922 | ||
1923 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1923 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1924 | SLOT( setCategories() ), actionCollection(), | 1924 | SLOT( setCategories() ), actionCollection(), |
1925 | "edit_set_categories" ); | 1925 | "edit_set_categories" ); |
1926 | mActionEditCategories = new KAction( i18n( "Edit Categories" ), 0, this, | 1926 | mActionEditCategories = new KAction( i18n( "Edit Categories" ), 0, this, |
1927 | SLOT( editCategories() ), actionCollection(), | 1927 | SLOT( editCategories() ), actionCollection(), |
1928 | "edit__categories" ); | 1928 | "edit__categories" ); |
1929 | 1929 | ||
1930 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, | 1930 | mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, |
1931 | SLOT( removeVoice() ), actionCollection(), | 1931 | SLOT( removeVoice() ), actionCollection(), |
1932 | "remove_voice" ); | 1932 | "remove_voice" ); |
1933 | 1933 | ||
1934 | mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, | 1934 | mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, |
1935 | SLOT( manageCategories() ), actionCollection(), | 1935 | SLOT( manageCategories() ), actionCollection(), |
1936 | "remove_voice" ); | 1936 | "remove_voice" ); |
1937 | 1937 | ||
1938 | 1938 | ||
1939 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, | 1939 | mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, |
1940 | SLOT( importFromOL() ), actionCollection(), | 1940 | SLOT( importFromOL() ), actionCollection(), |
1941 | "import_OL" ); | 1941 | "import_OL" ); |
1942 | #ifdef KAB_EMBEDDED | 1942 | #ifdef KAB_EMBEDDED |
1943 | mActionLicence = new KAction( i18n( "Licence" ), 0, | 1943 | mActionLicence = new KAction( i18n( "Licence" ), 0, |
1944 | this, SLOT( showLicence() ), actionCollection(), | 1944 | this, SLOT( showLicence() ), actionCollection(), |
1945 | "licence_about_data" ); | 1945 | "licence_about_data" ); |
1946 | mActionFaq = new KAction( i18n( "Faq" ), 0, | 1946 | mActionFaq = new KAction( i18n( "Faq" ), 0, |
1947 | this, SLOT( faq() ), actionCollection(), | 1947 | this, SLOT( faq() ), actionCollection(), |
1948 | "faq_about_data" ); | 1948 | "faq_about_data" ); |
1949 | mActionWN = new KAction( i18n( "What's New?" ), 0, | 1949 | mActionWN = new KAction( i18n( "What's New?" ), 0, |
1950 | this, SLOT( whatsnew() ), actionCollection(), | 1950 | this, SLOT( whatsnew() ), actionCollection(), |
1951 | "wn" ); | 1951 | "wn" ); |
1952 | mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, | 1952 | mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, |
1953 | this, SLOT( synchowto() ), actionCollection(), | 1953 | this, SLOT( synchowto() ), actionCollection(), |
1954 | "sync" ); | 1954 | "sync" ); |
1955 | mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, | 1955 | mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, |
1956 | this, SLOT( kdesynchowto() ), actionCollection(), | 1956 | this, SLOT( kdesynchowto() ), actionCollection(), |
1957 | "kdesync" ); | 1957 | "kdesync" ); |
1958 | mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, | 1958 | mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, |
1959 | this, SLOT( multisynchowto() ), actionCollection(), | 1959 | this, SLOT( multisynchowto() ), actionCollection(), |
1960 | "multisync" ); | 1960 | "multisync" ); |
1961 | 1961 | ||
1962 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, | 1962 | mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, |
1963 | this, SLOT( createAboutData() ), actionCollection(), | 1963 | this, SLOT( createAboutData() ), actionCollection(), |
1964 | "kaddressbook_about_data" ); | 1964 | "kaddressbook_about_data" ); |
1965 | #endif //KAB_EMBEDDED | 1965 | #endif //KAB_EMBEDDED |
1966 | 1966 | ||
1967 | clipboardDataChanged(); | 1967 | clipboardDataChanged(); |
1968 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1968 | connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1969 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); | 1969 | connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); |
1970 | } | 1970 | } |
1971 | 1971 | ||
1972 | //US we need this function, to plug all actions into the correct menues. | 1972 | //US we need this function, to plug all actions into the correct menues. |
1973 | // KDE uses a XML format to plug the actions, but we work her without this overhead. | 1973 | // KDE uses a XML format to plug the actions, but we work her without this overhead. |
1974 | void KABCore::addActionsManually() | 1974 | void KABCore::addActionsManually() |
1975 | { | 1975 | { |
1976 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); | 1976 | //US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); |
1977 | 1977 | ||
1978 | #ifdef KAB_EMBEDDED | 1978 | #ifdef KAB_EMBEDDED |
1979 | QPopupMenu *fileMenu = new QPopupMenu( this ); | 1979 | QPopupMenu *fileMenu = new QPopupMenu( this ); |
1980 | QPopupMenu *editMenu = new QPopupMenu( this ); | 1980 | QPopupMenu *editMenu = new QPopupMenu( this ); |
1981 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 1981 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
1982 | 1982 | ||
1983 | KToolBar* tb = mMainWindow->toolBar(); | 1983 | KToolBar* tb = mMainWindow->toolBar(); |
1984 | 1984 | ||
1985 | #ifndef DESKTOP_VERSION | 1985 | #ifndef DESKTOP_VERSION |
1986 | if ( KABPrefs::instance()->mFullMenuBarVisible ) { | 1986 | if ( KABPrefs::instance()->mFullMenuBarVisible ) { |
1987 | #endif | 1987 | #endif |
1988 | QMenuBar* mb = mMainWindow->menuBar(); | 1988 | QMenuBar* mb = mMainWindow->menuBar(); |
1989 | 1989 | ||
1990 | //US setup menubar. | 1990 | //US setup menubar. |
1991 | //Disable the following block if you do not want to have a menubar. | 1991 | //Disable the following block if you do not want to have a menubar. |
1992 | mb->insertItem( "&File", fileMenu ); | 1992 | mb->insertItem( i18n("&File"), fileMenu ); |
1993 | mb->insertItem( "&Edit", editMenu ); | 1993 | mb->insertItem( i18n("&Edit"), editMenu ); |
1994 | mb->insertItem( "&View", viewMenu ); | 1994 | mb->insertItem( i18n("&View"), viewMenu ); |
1995 | mb->insertItem( "&Settings", settingsMenu ); | 1995 | mb->insertItem( i18n("&Settings"), settingsMenu ); |
1996 | mb->insertItem( i18n("Synchronize"), syncMenu ); | 1996 | mb->insertItem( i18n("Synchronize"), syncMenu ); |
1997 | mb->insertItem( "&Change selected", changeMenu ); | 1997 | mb->insertItem( i18n("&Change selected"), changeMenu ); |
1998 | mb->insertItem( "&Help", helpMenu ); | 1998 | mb->insertItem( i18n("&Help"), helpMenu ); |
1999 | mIncSearchWidget = new IncSearchWidget( tb ); | 1999 | mIncSearchWidget = new IncSearchWidget( tb ); |
2000 | // tb->insertWidget(-1, 0, mIncSearchWidget); | 2000 | // tb->insertWidget(-1, 0, mIncSearchWidget); |
2001 | #ifndef DESKTOP_VERSION | 2001 | #ifndef DESKTOP_VERSION |
2002 | } else { | 2002 | } else { |
2003 | //US setup toolbar | 2003 | //US setup toolbar |
2004 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); | 2004 | QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); |
2005 | QPopupMenu *popupBarTB = new QPopupMenu( this ); | 2005 | QPopupMenu *popupBarTB = new QPopupMenu( this ); |
2006 | menuBarTB->insertItem( "ME", popupBarTB); | 2006 | menuBarTB->insertItem( "ME", popupBarTB); |
2007 | tb->insertWidget(-1, 0, menuBarTB); | 2007 | tb->insertWidget(-1, 0, menuBarTB); |
2008 | mIncSearchWidget = new IncSearchWidget( tb ); | 2008 | mIncSearchWidget = new IncSearchWidget( tb ); |
2009 | 2009 | ||
2010 | tb->enableMoving(false); | 2010 | tb->enableMoving(false); |
2011 | popupBarTB->insertItem( "&File", fileMenu ); | 2011 | popupBarTB->insertItem( i18n("&File"), fileMenu ); |
2012 | popupBarTB->insertItem( "&Edit", editMenu ); | 2012 | popupBarTB->insertItem( i18n("&Edit"), editMenu ); |
2013 | popupBarTB->insertItem( "&View", viewMenu ); | 2013 | popupBarTB->insertItem( i18n("&View"), viewMenu ); |
2014 | popupBarTB->insertItem( "&Settings", settingsMenu ); | 2014 | popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); |
2015 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); | 2015 | popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); |
2016 | mViewManager->getFilterAction()->plug ( popupBarTB); | 2016 | mViewManager->getFilterAction()->plug ( popupBarTB); |
2017 | popupBarTB->insertItem( "&Change selected", changeMenu ); | 2017 | popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); |
2018 | popupBarTB->insertItem( "&Help", helpMenu ); | 2018 | popupBarTB->insertItem( i18n("&Help"), helpMenu ); |
2019 | if (QApplication::desktop()->width() > 320 ) { | 2019 | if (QApplication::desktop()->width() > 320 ) { |
2020 | // mViewManager->getFilterAction()->plug ( tb); | 2020 | // mViewManager->getFilterAction()->plug ( tb); |
2021 | } | 2021 | } |
2022 | } | 2022 | } |
2023 | #endif | 2023 | #endif |
2024 | // mActionQuit->plug ( mMainWindow->toolBar()); | 2024 | // mActionQuit->plug ( mMainWindow->toolBar()); |
2025 | 2025 | ||
2026 | 2026 | ||
2027 | 2027 | ||
2028 | //US Now connect the actions with the menue entries. | 2028 | //US Now connect the actions with the menue entries. |
2029 | mActionPrint->plug( fileMenu ); | 2029 | mActionPrint->plug( fileMenu ); |
2030 | mActionMail->plug( fileMenu ); | 2030 | mActionMail->plug( fileMenu ); |
2031 | fileMenu->insertSeparator(); | 2031 | fileMenu->insertSeparator(); |
2032 | 2032 | ||
2033 | mActionNewContact->plug( fileMenu ); | 2033 | mActionNewContact->plug( fileMenu ); |
2034 | mActionNewContact->plug( tb ); | 2034 | mActionNewContact->plug( tb ); |
2035 | 2035 | ||
2036 | mActionEditAddressee->plug( fileMenu ); | 2036 | mActionEditAddressee->plug( fileMenu ); |
2037 | // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || | 2037 | // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || |
2038 | // (!KABPrefs::instance()->mMultipleViewsAtOnce )) | 2038 | // (!KABPrefs::instance()->mMultipleViewsAtOnce )) |
2039 | mActionEditAddressee->plug( tb ); | 2039 | mActionEditAddressee->plug( tb ); |
2040 | 2040 | ||
2041 | fileMenu->insertSeparator(); | 2041 | fileMenu->insertSeparator(); |
2042 | mActionSave->plug( fileMenu ); | 2042 | mActionSave->plug( fileMenu ); |
2043 | fileMenu->insertItem( "&Import", ImportMenu ); | 2043 | fileMenu->insertItem( "&Import", ImportMenu ); |
2044 | fileMenu->insertItem( "&Export", ExportMenu ); | 2044 | fileMenu->insertItem( "&Export", ExportMenu ); |
2045 | fileMenu->insertSeparator(); | 2045 | fileMenu->insertSeparator(); |
2046 | mActionMailVCard->plug( fileMenu ); | 2046 | mActionMailVCard->plug( fileMenu ); |
2047 | #ifndef DESKTOP_VERSION | 2047 | #ifndef DESKTOP_VERSION |
2048 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); | 2048 | if ( Ir::supported() ) mActionBeamVCard->plug( fileMenu ); |
2049 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); | 2049 | if ( Ir::supported() ) mActionBeam->plug(fileMenu ); |
2050 | #endif | 2050 | #endif |
2051 | fileMenu->insertSeparator(); | 2051 | fileMenu->insertSeparator(); |
2052 | mActionQuit->plug( fileMenu ); | 2052 | mActionQuit->plug( fileMenu ); |
2053 | #ifdef _WIN32_ | 2053 | #ifdef _WIN32_ |
2054 | mActionImportOL->plug( ImportMenu ); | 2054 | mActionImportOL->plug( ImportMenu ); |
2055 | #endif | 2055 | #endif |
2056 | // edit menu | 2056 | // edit menu |
2057 | mActionUndo->plug( editMenu ); | 2057 | mActionUndo->plug( editMenu ); |
2058 | mActionRedo->plug( editMenu ); | 2058 | mActionRedo->plug( editMenu ); |
2059 | editMenu->insertSeparator(); | 2059 | editMenu->insertSeparator(); |
2060 | mActionCut->plug( editMenu ); | 2060 | mActionCut->plug( editMenu ); |
2061 | mActionCopy->plug( editMenu ); | 2061 | mActionCopy->plug( editMenu ); |
2062 | mActionPaste->plug( editMenu ); | 2062 | mActionPaste->plug( editMenu ); |
2063 | mActionDelete->plug( editMenu ); | 2063 | mActionDelete->plug( editMenu ); |
2064 | editMenu->insertSeparator(); | 2064 | editMenu->insertSeparator(); |
2065 | mActionSelectAll->plug( editMenu ); | 2065 | mActionSelectAll->plug( editMenu ); |
2066 | 2066 | ||
2067 | mActionRemoveVoice->plug( changeMenu ); | 2067 | mActionRemoveVoice->plug( changeMenu ); |
2068 | // settings menu | 2068 | // settings menu |
2069 | //US special menuentry to configure the addressbook resources. On KDE | 2069 | //US special menuentry to configure the addressbook resources. On KDE |
2070 | // you do that through the control center !!! | 2070 | // you do that through the control center !!! |
2071 | mActionConfigResources->plug( settingsMenu ); | 2071 | mActionConfigResources->plug( settingsMenu ); |
2072 | settingsMenu->insertSeparator(); | 2072 | settingsMenu->insertSeparator(); |
2073 | 2073 | ||
2074 | mActionConfigKAddressbook->plug( settingsMenu ); | 2074 | mActionConfigKAddressbook->plug( settingsMenu ); |
2075 | 2075 | ||
2076 | if ( mIsPart ) { | 2076 | if ( mIsPart ) { |
2077 | //US not implemented yet | 2077 | //US not implemented yet |
2078 | //mActionConfigShortcuts->plug( settingsMenu ); | 2078 | //mActionConfigShortcuts->plug( settingsMenu ); |
2079 | //mActionConfigureToolbars->plug( settingsMenu ); | 2079 | //mActionConfigureToolbars->plug( settingsMenu ); |
2080 | 2080 | ||
2081 | } else { | 2081 | } else { |
2082 | //US not implemented yet | 2082 | //US not implemented yet |
2083 | //mActionKeyBindings->plug( settingsMenu ); | 2083 | //mActionKeyBindings->plug( settingsMenu ); |
2084 | } | 2084 | } |
2085 | 2085 | ||
2086 | settingsMenu->insertSeparator(); | 2086 | settingsMenu->insertSeparator(); |
2087 | 2087 | ||
2088 | mActionJumpBar->plug( settingsMenu ); | 2088 | mActionJumpBar->plug( settingsMenu ); |
2089 | mActionDetails->plug( settingsMenu ); | 2089 | mActionDetails->plug( settingsMenu ); |
2090 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) | 2090 | //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) |
2091 | mActionDetails->plug( tb ); | 2091 | mActionDetails->plug( tb ); |
2092 | settingsMenu->insertSeparator(); | 2092 | settingsMenu->insertSeparator(); |
2093 | mActionBR->plug(settingsMenu ); | 2093 | mActionBR->plug(settingsMenu ); |
2094 | settingsMenu->insertSeparator(); | 2094 | settingsMenu->insertSeparator(); |
2095 | 2095 | ||
2096 | mActionWhoAmI->plug( settingsMenu ); | 2096 | mActionWhoAmI->plug( settingsMenu ); |
2097 | mActionEditCategories->plug( settingsMenu ); | 2097 | mActionEditCategories->plug( settingsMenu ); |
2098 | mActionCategories->plug( settingsMenu ); | 2098 | mActionCategories->plug( settingsMenu ); |
2099 | mActionManageCategories->plug( settingsMenu ); | 2099 | mActionManageCategories->plug( settingsMenu ); |
2100 | 2100 | ||
2101 | 2101 | ||
2102 | mActionWN->plug( helpMenu ); | 2102 | mActionWN->plug( helpMenu ); |
2103 | mActionSyncHowto->plug( helpMenu ); | 2103 | mActionSyncHowto->plug( helpMenu ); |
2104 | mActionKdeSyncHowto->plug( helpMenu ); | 2104 | mActionKdeSyncHowto->plug( helpMenu ); |
2105 | mActionMultiSyncHowto->plug( helpMenu ); | 2105 | mActionMultiSyncHowto->plug( helpMenu ); |
2106 | mActionFaq->plug( helpMenu ); | 2106 | mActionFaq->plug( helpMenu ); |
2107 | mActionLicence->plug( helpMenu ); | 2107 | mActionLicence->plug( helpMenu ); |
2108 | mActionAboutKAddressbook->plug( helpMenu ); | 2108 | mActionAboutKAddressbook->plug( helpMenu ); |
2109 | 2109 | ||
2110 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { | 2110 | if (KGlobal::getDesktopSize() > KGlobal::Small ) { |
2111 | 2111 | ||
2112 | mActionSave->plug( tb ); | 2112 | mActionSave->plug( tb ); |
2113 | mViewManager->getFilterAction()->plug ( tb); | 2113 | mViewManager->getFilterAction()->plug ( tb); |
2114 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { | 2114 | if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { |
2115 | mActionUndo->plug( tb ); | 2115 | mActionUndo->plug( tb ); |
2116 | mActionDelete->plug( tb ); | 2116 | mActionDelete->plug( tb ); |
2117 | mActionRedo->plug( tb ); | 2117 | mActionRedo->plug( tb ); |
2118 | } | 2118 | } |
2119 | } else { | 2119 | } else { |
2120 | mActionSave->plug( tb ); | 2120 | mActionSave->plug( tb ); |
2121 | tb->enableMoving(false); | 2121 | tb->enableMoving(false); |
2122 | } | 2122 | } |
2123 | //mActionQuit->plug ( tb ); | 2123 | //mActionQuit->plug ( tb ); |
2124 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); | 2124 | // tb->insertWidget(-1, 0, mIncSearchWidget, 6); |
2125 | 2125 | ||
2126 | //US link the searchwidget first to this. | 2126 | //US link the searchwidget first to this. |
2127 | // The real linkage to the toolbar happens later. | 2127 | // The real linkage to the toolbar happens later. |
2128 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); | 2128 | //US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); |
2129 | //US tb->insertItem( mIncSearchWidget ); | 2129 | //US tb->insertItem( mIncSearchWidget ); |
2130 | /*US | 2130 | /*US |
2131 | mIncSearchWidget = new IncSearchWidget( tb ); | 2131 | mIncSearchWidget = new IncSearchWidget( tb ); |
2132 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), | 2132 | connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), |
2133 | SLOT( incrementalSearch( const QString& ) ) ); | 2133 | SLOT( incrementalSearch( const QString& ) ) ); |
2134 | 2134 | ||
2135 | mJumpButtonBar = new JumpButtonBar( this, this ); | 2135 | mJumpButtonBar = new JumpButtonBar( this, this ); |
2136 | 2136 | ||
2137 | //US topLayout->addWidget( mJumpButtonBar ); | 2137 | //US topLayout->addWidget( mJumpButtonBar ); |
2138 | this->layout()->add( mJumpButtonBar ); | 2138 | this->layout()->add( mJumpButtonBar ); |
2139 | */ | 2139 | */ |
2140 | 2140 | ||
2141 | #endif //KAB_EMBEDDED | 2141 | #endif //KAB_EMBEDDED |
2142 | 2142 | ||
2143 | mActionExport2phone->plug( ExportMenu ); | 2143 | mActionExport2phone->plug( ExportMenu ); |
2144 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); | 2144 | connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); |
2145 | syncManager->fillSyncMenu(); | 2145 | syncManager->fillSyncMenu(); |
2146 | 2146 | ||
2147 | } | 2147 | } |
2148 | void KABCore::showLicence() | 2148 | void KABCore::showLicence() |
2149 | { | 2149 | { |
2150 | KApplication::showLicence(); | 2150 | KApplication::showLicence(); |
2151 | } | 2151 | } |
2152 | 2152 | ||
2153 | void KABCore::manageCategories( ) | 2153 | void KABCore::manageCategories( ) |
2154 | { | 2154 | { |
2155 | KABCatPrefs* cp = new KABCatPrefs(); | 2155 | KABCatPrefs* cp = new KABCatPrefs(); |
2156 | cp->show(); | 2156 | cp->show(); |
2157 | int w =cp->sizeHint().width() ; | 2157 | int w =cp->sizeHint().width() ; |
2158 | int h = cp->sizeHint().height() ; | 2158 | int h = cp->sizeHint().height() ; |
2159 | int dw = QApplication::desktop()->width(); | 2159 | int dw = QApplication::desktop()->width(); |
2160 | int dh = QApplication::desktop()->height(); | 2160 | int dh = QApplication::desktop()->height(); |
2161 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2161 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2162 | if ( !cp->exec() ) { | 2162 | if ( !cp->exec() ) { |
2163 | delete cp; | 2163 | delete cp; |
2164 | return; | 2164 | return; |
2165 | } | 2165 | } |
2166 | int count = 0; | 2166 | int count = 0; |
2167 | message( i18n("Please wait, processing categories...")); | 2167 | message( i18n("Please wait, processing categories...")); |
2168 | if ( cp->addCat() ) { | 2168 | if ( cp->addCat() ) { |
2169 | KABC::AddressBook::Iterator it; | 2169 | KABC::AddressBook::Iterator it; |
2170 | QStringList catList = KABPrefs::instance()->mCustomCategories; | 2170 | QStringList catList = KABPrefs::instance()->mCustomCategories; |
2171 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2171 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2172 | QStringList catIncList = (*it).categories(); | 2172 | QStringList catIncList = (*it).categories(); |
2173 | int i; | 2173 | int i; |
2174 | for( i = 0; i< catIncList.count(); ++i ) { | 2174 | for( i = 0; i< catIncList.count(); ++i ) { |
2175 | if ( !catList.contains (catIncList[i])) { | 2175 | if ( !catList.contains (catIncList[i])) { |
2176 | catList.append( catIncList[i] ); | 2176 | catList.append( catIncList[i] ); |
2177 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2177 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2178 | ++count; | 2178 | ++count; |
2179 | } | 2179 | } |
2180 | } | 2180 | } |
2181 | } | 2181 | } |
2182 | catList.sort(); | 2182 | catList.sort(); |
2183 | KABPrefs::instance()->mCustomCategories = catList; | 2183 | KABPrefs::instance()->mCustomCategories = catList; |
2184 | KABPrefs::instance()->writeConfig(); | 2184 | KABPrefs::instance()->writeConfig(); |
2185 | message(QString::number( count )+ i18n(" categories added to list! ")); | 2185 | message(QString::number( count )+ i18n(" categories added to list! ")); |
2186 | } else { | 2186 | } else { |
2187 | QStringList catList = KABPrefs::instance()->mCustomCategories; | 2187 | QStringList catList = KABPrefs::instance()->mCustomCategories; |
2188 | QStringList catIncList; | 2188 | QStringList catIncList; |
2189 | QStringList newCatList; | 2189 | QStringList newCatList; |
2190 | KABC::AddressBook::Iterator it; | 2190 | KABC::AddressBook::Iterator it; |
2191 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2191 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2192 | QStringList catIncList = (*it).categories(); | 2192 | QStringList catIncList = (*it).categories(); |
2193 | int i; | 2193 | int i; |
2194 | if ( catIncList.count() ) { | 2194 | if ( catIncList.count() ) { |
2195 | newCatList.clear(); | 2195 | newCatList.clear(); |
2196 | for( i = 0; i< catIncList.count(); ++i ) { | 2196 | for( i = 0; i< catIncList.count(); ++i ) { |
2197 | if ( catList.contains (catIncList[i])) { | 2197 | if ( catList.contains (catIncList[i])) { |
2198 | newCatList.append( catIncList[i] ); | 2198 | newCatList.append( catIncList[i] ); |
2199 | } | 2199 | } |
2200 | } | 2200 | } |
2201 | newCatList.sort(); | 2201 | newCatList.sort(); |
2202 | (*it).setCategories( newCatList ); | 2202 | (*it).setCategories( newCatList ); |
2203 | mAddressBook->insertAddressee( (*it) ); | 2203 | mAddressBook->insertAddressee( (*it) ); |
2204 | } | 2204 | } |
2205 | } | 2205 | } |
2206 | setModified( true ); | 2206 | setModified( true ); |
2207 | mViewManager->refreshView(); | 2207 | mViewManager->refreshView(); |
2208 | mDetails->refreshView(); | 2208 | mDetails->refreshView(); |
2209 | message( i18n("Removing categories done!")); | 2209 | message( i18n("Removing categories done!")); |
2210 | } | 2210 | } |
2211 | delete cp; | 2211 | delete cp; |
2212 | } | 2212 | } |
2213 | void KABCore::removeVoice() | 2213 | void KABCore::removeVoice() |
2214 | { | 2214 | { |
2215 | 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 ) | 2215 | 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 ) |
2216 | return; | 2216 | return; |
2217 | KABC::Addressee::List list = mViewManager->selectedAddressees(); | 2217 | KABC::Addressee::List list = mViewManager->selectedAddressees(); |
2218 | KABC::Addressee::List::Iterator it; | 2218 | KABC::Addressee::List::Iterator it; |
2219 | for ( it = list.begin(); it != list.end(); ++it ) { | 2219 | for ( it = list.begin(); it != list.end(); ++it ) { |
2220 | 2220 | ||
2221 | if ( (*it).removeVoice() ) | 2221 | if ( (*it).removeVoice() ) |
2222 | contactModified((*it) ); | 2222 | contactModified((*it) ); |
2223 | } | 2223 | } |
2224 | } | 2224 | } |
2225 | 2225 | ||
2226 | 2226 | ||
2227 | 2227 | ||
2228 | void KABCore::clipboardDataChanged() | 2228 | void KABCore::clipboardDataChanged() |
2229 | { | 2229 | { |
2230 | 2230 | ||
2231 | if ( mReadWrite ) | 2231 | if ( mReadWrite ) |
2232 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 2232 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
2233 | 2233 | ||
2234 | } | 2234 | } |
2235 | 2235 | ||
2236 | void KABCore::updateActionMenu() | 2236 | void KABCore::updateActionMenu() |
2237 | { | 2237 | { |
2238 | UndoStack *undo = UndoStack::instance(); | 2238 | UndoStack *undo = UndoStack::instance(); |
2239 | RedoStack *redo = RedoStack::instance(); | 2239 | RedoStack *redo = RedoStack::instance(); |
2240 | 2240 | ||
2241 | if ( undo->isEmpty() ) | 2241 | if ( undo->isEmpty() ) |
2242 | mActionUndo->setText( i18n( "Undo" ) ); | 2242 | mActionUndo->setText( i18n( "Undo" ) ); |
2243 | else | 2243 | else |
2244 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); | 2244 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); |
2245 | 2245 | ||
2246 | mActionUndo->setEnabled( !undo->isEmpty() ); | 2246 | mActionUndo->setEnabled( !undo->isEmpty() ); |
2247 | 2247 | ||
2248 | if ( !redo->top() ) | 2248 | if ( !redo->top() ) |
2249 | mActionRedo->setText( i18n( "Redo" ) ); | 2249 | mActionRedo->setText( i18n( "Redo" ) ); |
2250 | else | 2250 | else |
2251 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); | 2251 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); |
2252 | 2252 | ||
2253 | mActionRedo->setEnabled( !redo->isEmpty() ); | 2253 | mActionRedo->setEnabled( !redo->isEmpty() ); |
2254 | } | 2254 | } |
2255 | 2255 | ||
2256 | void KABCore::configureKeyBindings() | 2256 | void KABCore::configureKeyBindings() |
2257 | { | 2257 | { |
2258 | #ifndef KAB_EMBEDDED | 2258 | #ifndef KAB_EMBEDDED |
2259 | KKeyDialog::configure( actionCollection(), true ); | 2259 | KKeyDialog::configure( actionCollection(), true ); |
2260 | #else //KAB_EMBEDDED | 2260 | #else //KAB_EMBEDDED |
2261 | qDebug("KABCore::configureKeyBindings() not implemented"); | 2261 | qDebug("KABCore::configureKeyBindings() not implemented"); |
2262 | #endif //KAB_EMBEDDED | 2262 | #endif //KAB_EMBEDDED |
2263 | } | 2263 | } |
2264 | 2264 | ||
2265 | #ifdef KAB_EMBEDDED | 2265 | #ifdef KAB_EMBEDDED |
2266 | void KABCore::configureResources() | 2266 | void KABCore::configureResources() |
2267 | { | 2267 | { |
2268 | KRES::KCMKResources dlg( this, "" , 0 ); | 2268 | KRES::KCMKResources dlg( this, "" , 0 ); |
2269 | 2269 | ||
2270 | if ( !dlg.exec() ) | 2270 | if ( !dlg.exec() ) |
2271 | return; | 2271 | return; |
2272 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 2272 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
2273 | } | 2273 | } |
2274 | #endif //KAB_EMBEDDED | 2274 | #endif //KAB_EMBEDDED |
2275 | 2275 | ||
2276 | 2276 | ||
2277 | /* this method will be called through the QCop interface from Ko/Pi to select addresses | 2277 | /* this method will be called through the QCop interface from Ko/Pi to select addresses |
2278 | * for the attendees list of an event. | 2278 | * for the attendees list of an event. |
2279 | */ | 2279 | */ |
2280 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) | 2280 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) |
2281 | { | 2281 | { |
2282 | QStringList nameList; | 2282 | QStringList nameList; |
2283 | QStringList emailList; | 2283 | QStringList emailList; |
2284 | QStringList uidList; | 2284 | QStringList uidList; |
2285 | 2285 | ||
2286 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 2286 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
2287 | uint i=0; | 2287 | uint i=0; |
2288 | for (i=0; i < list.count(); i++) | 2288 | for (i=0; i < list.count(); i++) |
2289 | { | 2289 | { |
2290 | nameList.append(list[i].realName()); | 2290 | nameList.append(list[i].realName()); |
2291 | emailList.append(list[i].preferredEmail()); | 2291 | emailList.append(list[i].preferredEmail()); |
2292 | uidList.append(list[i].uid()); | 2292 | uidList.append(list[i].uid()); |
2293 | } | 2293 | } |
2294 | 2294 | ||
2295 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); | 2295 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); |
2296 | 2296 | ||
2297 | } | 2297 | } |
2298 | 2298 | ||
2299 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays | 2299 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays |
2300 | * to put them into the calendar. | 2300 | * to put them into the calendar. |
2301 | */ | 2301 | */ |
2302 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) | 2302 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) |
2303 | { | 2303 | { |
2304 | // qDebug("KABCore::requestForBirthdayList"); | 2304 | // qDebug("KABCore::requestForBirthdayList"); |
2305 | QStringList birthdayList; | 2305 | QStringList birthdayList; |
2306 | QStringList anniversaryList; | 2306 | QStringList anniversaryList; |
2307 | QStringList realNameList; | 2307 | QStringList realNameList; |
2308 | QStringList preferredEmailList; | 2308 | QStringList preferredEmailList; |
2309 | QStringList assembledNameList; | 2309 | QStringList assembledNameList; |
2310 | QStringList uidList; | 2310 | QStringList uidList; |
2311 | 2311 | ||
2312 | KABC::AddressBook::Iterator it; | 2312 | KABC::AddressBook::Iterator it; |
2313 | 2313 | ||
2314 | int count = 0; | 2314 | int count = 0; |
2315 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2315 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2316 | ++count; | 2316 | ++count; |
2317 | } | 2317 | } |
2318 | QProgressBar bar(count,0 ); | 2318 | QProgressBar bar(count,0 ); |
2319 | int w = 300; | 2319 | int w = 300; |
2320 | if ( QApplication::desktop()->width() < 320 ) | 2320 | if ( QApplication::desktop()->width() < 320 ) |
2321 | w = 220; | 2321 | w = 220; |
2322 | int h = bar.sizeHint().height() ; | 2322 | int h = bar.sizeHint().height() ; |
2323 | int dw = QApplication::desktop()->width(); | 2323 | int dw = QApplication::desktop()->width(); |
2324 | int dh = QApplication::desktop()->height(); | 2324 | int dh = QApplication::desktop()->height(); |
2325 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2325 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2326 | bar.show(); | 2326 | bar.show(); |
2327 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); | 2327 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); |
2328 | qApp->processEvents(); | 2328 | qApp->processEvents(); |
2329 | 2329 | ||
2330 | QDate bday; | 2330 | QDate bday; |
2331 | QString anni; | 2331 | QString anni; |
2332 | QString formattedbday; | 2332 | QString formattedbday; |
2333 | 2333 | ||
2334 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) | 2334 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) |
2335 | { | 2335 | { |
2336 | if ( ! bar.isVisible() ) | 2336 | if ( ! bar.isVisible() ) |
2337 | return; | 2337 | return; |
2338 | bar.setProgress( count++ ); | 2338 | bar.setProgress( count++ ); |
2339 | qApp->processEvents(); | 2339 | qApp->processEvents(); |
2340 | bday = (*it).birthday().date(); | 2340 | bday = (*it).birthday().date(); |
2341 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); | 2341 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); |
2342 | 2342 | ||
2343 | if ( bday.isValid() || !anni.isEmpty()) | 2343 | if ( bday.isValid() || !anni.isEmpty()) |
2344 | { | 2344 | { |
2345 | if (bday.isValid()) | 2345 | if (bday.isValid()) |
2346 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); | 2346 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); |
2347 | else | 2347 | else |
2348 | formattedbday = "NOTVALID"; | 2348 | formattedbday = "NOTVALID"; |
2349 | if (anni.isEmpty()) | 2349 | if (anni.isEmpty()) |
2350 | anni = "INVALID"; | 2350 | anni = "INVALID"; |
2351 | 2351 | ||
2352 | birthdayList.append(formattedbday); | 2352 | birthdayList.append(formattedbday); |
2353 | anniversaryList.append(anni); //should be ISODate | 2353 | anniversaryList.append(anni); //should be ISODate |
2354 | realNameList.append((*it).realName()); | 2354 | realNameList.append((*it).realName()); |
2355 | preferredEmailList.append((*it).preferredEmail()); | 2355 | preferredEmailList.append((*it).preferredEmail()); |
2356 | assembledNameList.append((*it).assembledName()); | 2356 | assembledNameList.append((*it).assembledName()); |
2357 | uidList.append((*it).uid()); | 2357 | uidList.append((*it).uid()); |
2358 | 2358 | ||
2359 | //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() ); | 2359 | //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() ); |
2360 | } | 2360 | } |
2361 | } | 2361 | } |
2362 | 2362 | ||
2363 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); | 2363 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); |
2364 | 2364 | ||
2365 | } | 2365 | } |
2366 | 2366 | ||
2367 | /* this method will be called through the QCop interface from other apps to show details of a contact. | 2367 | /* this method will be called through the QCop interface from other apps to show details of a contact. |
2368 | */ | 2368 | */ |
2369 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) | 2369 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) |
2370 | { | 2370 | { |
2371 | //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); | 2371 | //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); |
2372 | 2372 | ||
2373 | QString foundUid = QString::null; | 2373 | QString foundUid = QString::null; |
2374 | if ( ! uid.isEmpty() ) { | 2374 | if ( ! uid.isEmpty() ) { |
2375 | Addressee adrr = mAddressBook->findByUid( uid ); | 2375 | Addressee adrr = mAddressBook->findByUid( uid ); |
2376 | if ( !adrr.isEmpty() ) { | 2376 | if ( !adrr.isEmpty() ) { |
2377 | foundUid = uid; | 2377 | foundUid = uid; |
2378 | } | 2378 | } |
2379 | if ( email == "sendbacklist" ) { | 2379 | if ( email == "sendbacklist" ) { |
2380 | //qDebug("ssssssssssssssssssssssend "); | 2380 | //qDebug("ssssssssssssssssssssssend "); |
2381 | QStringList nameList; | 2381 | QStringList nameList; |
2382 | QStringList emailList; | 2382 | QStringList emailList; |
2383 | QStringList uidList; | 2383 | QStringList uidList; |
2384 | nameList.append(adrr.realName()); | 2384 | nameList.append(adrr.realName()); |
2385 | emailList = adrr.emails(); | 2385 | emailList = adrr.emails(); |
2386 | uidList.append( adrr.preferredEmail()); | 2386 | uidList.append( adrr.preferredEmail()); |
2387 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); | 2387 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); |
2388 | return; | 2388 | return; |
2389 | } | 2389 | } |
2390 | 2390 | ||
2391 | } | 2391 | } |
2392 | 2392 | ||
2393 | if ( email == "sendbacklist" ) | 2393 | if ( email == "sendbacklist" ) |
2394 | return; | 2394 | return; |
2395 | if (foundUid.isEmpty()) | 2395 | if (foundUid.isEmpty()) |
2396 | { | 2396 | { |
2397 | //find the uid of the person first | 2397 | //find the uid of the person first |
2398 | Addressee::List namelist; | 2398 | Addressee::List namelist; |
2399 | Addressee::List emaillist; | 2399 | Addressee::List emaillist; |
2400 | 2400 | ||
2401 | if (!name.isEmpty()) | 2401 | if (!name.isEmpty()) |
2402 | namelist = mAddressBook->findByName( name ); | 2402 | namelist = mAddressBook->findByName( name ); |
2403 | 2403 | ||
2404 | if (!email.isEmpty()) | 2404 | if (!email.isEmpty()) |
2405 | emaillist = mAddressBook->findByEmail( email ); | 2405 | emaillist = mAddressBook->findByEmail( email ); |
2406 | //qDebug("count %d %d ", namelist.count(),emaillist.count() ); | 2406 | //qDebug("count %d %d ", namelist.count(),emaillist.count() ); |
2407 | //check if we have a match in Namelist and Emaillist | 2407 | //check if we have a match in Namelist and Emaillist |
2408 | if ((namelist.count() == 0) && (emaillist.count() > 0)) { | 2408 | if ((namelist.count() == 0) && (emaillist.count() > 0)) { |
2409 | foundUid = emaillist[0].uid(); | 2409 | foundUid = emaillist[0].uid(); |
2410 | } | 2410 | } |
2411 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) | 2411 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) |
2412 | foundUid = namelist[0].uid(); | 2412 | foundUid = namelist[0].uid(); |
2413 | else | 2413 | else |
2414 | { | 2414 | { |
2415 | for (int i = 0; i < namelist.count(); i++) | 2415 | for (int i = 0; i < namelist.count(); i++) |
2416 | { | 2416 | { |
2417 | for (int j = 0; j < emaillist.count(); j++) | 2417 | for (int j = 0; j < emaillist.count(); j++) |
2418 | { | 2418 | { |
2419 | if (namelist[i] == emaillist[j]) | 2419 | if (namelist[i] == emaillist[j]) |
2420 | { | 2420 | { |
2421 | foundUid = namelist[i].uid(); | 2421 | foundUid = namelist[i].uid(); |
2422 | } | 2422 | } |
2423 | } | 2423 | } |
2424 | } | 2424 | } |
2425 | } | 2425 | } |
2426 | } | 2426 | } |
2427 | else | 2427 | else |
2428 | { | 2428 | { |
2429 | foundUid = uid; | 2429 | foundUid = uid; |
2430 | } | 2430 | } |
2431 | 2431 | ||
2432 | if (!foundUid.isEmpty()) | 2432 | if (!foundUid.isEmpty()) |
2433 | { | 2433 | { |
2434 | 2434 | ||
2435 | // raise Ka/Pi if it is in the background | 2435 | // raise Ka/Pi if it is in the background |
2436 | #ifndef DESKTOP_VERSION | 2436 | #ifndef DESKTOP_VERSION |
2437 | #ifndef KORG_NODCOP | 2437 | #ifndef KORG_NODCOP |
2438 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); | 2438 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); |
2439 | #endif | 2439 | #endif |
2440 | #endif | 2440 | #endif |
2441 | 2441 | ||
2442 | mMainWindow->showMaximized(); | 2442 | mMainWindow->showMaximized(); |
2443 | mMainWindow-> raise(); | 2443 | mMainWindow-> raise(); |
2444 | 2444 | ||
2445 | mViewManager->setSelected( "", false); | 2445 | mViewManager->setSelected( "", false); |
2446 | mViewManager->refreshView( "" ); | 2446 | mViewManager->refreshView( "" ); |
2447 | mViewManager->setSelected( foundUid, true ); | 2447 | mViewManager->setSelected( foundUid, true ); |
2448 | mViewManager->refreshView( foundUid ); | 2448 | mViewManager->refreshView( foundUid ); |
2449 | 2449 | ||
2450 | if ( !mMultipleViewsAtOnce ) | 2450 | if ( !mMultipleViewsAtOnce ) |
2451 | { | 2451 | { |
2452 | setDetailsVisible( true ); | 2452 | setDetailsVisible( true ); |
2453 | mActionDetails->setChecked(true); | 2453 | mActionDetails->setChecked(true); |
2454 | } | 2454 | } |
2455 | } | 2455 | } |
2456 | } | 2456 | } |
2457 | 2457 | ||
2458 | void KABCore::whatsnew() | 2458 | void KABCore::whatsnew() |
2459 | { | 2459 | { |
2460 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 2460 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
2461 | } | 2461 | } |
2462 | void KABCore::synchowto() | 2462 | void KABCore::synchowto() |
2463 | { | 2463 | { |
2464 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 2464 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
2465 | } | 2465 | } |
2466 | void KABCore::kdesynchowto() | 2466 | void KABCore::kdesynchowto() |
2467 | { | 2467 | { |
2468 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 2468 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
2469 | } | 2469 | } |
2470 | void KABCore::multisynchowto() | 2470 | void KABCore::multisynchowto() |
2471 | { | 2471 | { |
2472 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 2472 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
2473 | } | 2473 | } |
2474 | void KABCore::faq() | 2474 | void KABCore::faq() |
2475 | { | 2475 | { |
2476 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); | 2476 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); |
2477 | } | 2477 | } |
2478 | 2478 | ||
2479 | #include <libkcal/syncdefines.h> | 2479 | #include <libkcal/syncdefines.h> |
2480 | 2480 | ||
2481 | KABC::Addressee KABCore::getLastSyncAddressee() | 2481 | KABC::Addressee KABCore::getLastSyncAddressee() |
2482 | { | 2482 | { |
2483 | Addressee lse; | 2483 | Addressee lse; |
2484 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2484 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2485 | 2485 | ||
2486 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); | 2486 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); |
2487 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2487 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2488 | if (lse.isEmpty()) { | 2488 | if (lse.isEmpty()) { |
2489 | qDebug("Creating new last-syncAddressee "); | 2489 | qDebug("Creating new last-syncAddressee "); |
2490 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2490 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2491 | QString sum = ""; | 2491 | QString sum = ""; |
2492 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 2492 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
2493 | sum = "E: "; | 2493 | sum = "E: "; |
2494 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); | 2494 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); |
2495 | lse.setRevision( mLastAddressbookSync ); | 2495 | lse.setRevision( mLastAddressbookSync ); |
2496 | lse.setCategories( i18n("SyncEvent") ); | 2496 | lse.setCategories( i18n("SyncEvent") ); |
2497 | mAddressBook->insertAddressee( lse ); | 2497 | mAddressBook->insertAddressee( lse ); |
2498 | } | 2498 | } |
2499 | return lse; | 2499 | return lse; |
2500 | } | 2500 | } |
2501 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) | 2501 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) |
2502 | { | 2502 | { |
2503 | 2503 | ||
2504 | //void setZaurusId(int id); | 2504 | //void setZaurusId(int id); |
2505 | // int zaurusId() const; | 2505 | // int zaurusId() const; |
2506 | // void setZaurusUid(int id); | 2506 | // void setZaurusUid(int id); |
2507 | // int zaurusUid() const; | 2507 | // int zaurusUid() const; |
2508 | // void setZaurusStat(int id); | 2508 | // void setZaurusStat(int id); |
2509 | // int zaurusStat() const; | 2509 | // int zaurusStat() const; |
2510 | // 0 equal | 2510 | // 0 equal |
2511 | // 1 take local | 2511 | // 1 take local |
2512 | // 2 take remote | 2512 | // 2 take remote |
2513 | // 3 cancel | 2513 | // 3 cancel |
2514 | QDateTime lastSync = mLastAddressbookSync; | 2514 | QDateTime lastSync = mLastAddressbookSync; |
2515 | QDateTime localMod = local->revision(); | 2515 | QDateTime localMod = local->revision(); |
2516 | QDateTime remoteMod = remote->revision(); | 2516 | QDateTime remoteMod = remote->revision(); |
2517 | 2517 | ||
2518 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2518 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2519 | 2519 | ||
2520 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2520 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2521 | bool remCh, locCh; | 2521 | bool remCh, locCh; |
2522 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); | 2522 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); |
2523 | //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); | 2523 | //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); |
2524 | locCh = ( localMod > mLastAddressbookSync ); | 2524 | locCh = ( localMod > mLastAddressbookSync ); |
2525 | if ( !remCh && ! locCh ) { | 2525 | if ( !remCh && ! locCh ) { |
2526 | //qDebug("both not changed "); | 2526 | //qDebug("both not changed "); |
2527 | lastSync = localMod.addDays(1); | 2527 | lastSync = localMod.addDays(1); |
2528 | if ( mode <= SYNC_PREF_ASK ) | 2528 | if ( mode <= SYNC_PREF_ASK ) |
2529 | return 0; | 2529 | return 0; |
2530 | } else { | 2530 | } else { |
2531 | if ( locCh ) { | 2531 | if ( locCh ) { |
2532 | //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); | 2532 | //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); |
2533 | lastSync = localMod.addDays( -1 ); | 2533 | lastSync = localMod.addDays( -1 ); |
2534 | if ( !remCh ) | 2534 | if ( !remCh ) |
2535 | remoteMod =( lastSync.addDays( -1 ) ); | 2535 | remoteMod =( lastSync.addDays( -1 ) ); |
2536 | } else { | 2536 | } else { |
2537 | //qDebug(" not loc changed "); | 2537 | //qDebug(" not loc changed "); |
2538 | lastSync = localMod.addDays( 1 ); | 2538 | lastSync = localMod.addDays( 1 ); |
2539 | if ( remCh ) { | 2539 | if ( remCh ) { |
2540 | //qDebug("rem changed "); | 2540 | //qDebug("rem changed "); |
2541 | remoteMod =( lastSync.addDays( 1 ) ); | 2541 | remoteMod =( lastSync.addDays( 1 ) ); |
2542 | } | 2542 | } |
2543 | 2543 | ||
2544 | } | 2544 | } |
2545 | } | 2545 | } |
2546 | full = true; | 2546 | full = true; |
2547 | if ( mode < SYNC_PREF_ASK ) | 2547 | if ( mode < SYNC_PREF_ASK ) |
2548 | mode = SYNC_PREF_ASK; | 2548 | mode = SYNC_PREF_ASK; |
2549 | } else { | 2549 | } else { |
2550 | if ( localMod == remoteMod ) | 2550 | if ( localMod == remoteMod ) |
2551 | return 0; | 2551 | return 0; |
2552 | 2552 | ||
2553 | } | 2553 | } |
2554 | //qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec()); | 2554 | //qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec()); |
2555 | //qDebug("lastsync %s ", lastSync.toString().latin1() ); | 2555 | //qDebug("lastsync %s ", lastSync.toString().latin1() ); |
2556 | //full = true; //debug only | 2556 | //full = true; //debug only |
2557 | if ( full ) { | 2557 | if ( full ) { |
2558 | bool equ = ( (*local) == (*remote) ); | 2558 | bool equ = ( (*local) == (*remote) ); |
2559 | if ( equ ) { | 2559 | if ( equ ) { |
2560 | //qDebug("equal "); | 2560 | //qDebug("equal "); |
2561 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2561 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2562 | local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); | 2562 | local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); |
2563 | } | 2563 | } |
2564 | if ( mode < SYNC_PREF_FORCE_LOCAL ) | 2564 | if ( mode < SYNC_PREF_FORCE_LOCAL ) |
2565 | return 0; | 2565 | return 0; |
2566 | 2566 | ||
2567 | }//else //debug only | 2567 | }//else //debug only |
2568 | //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); | 2568 | //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); |
2569 | } | 2569 | } |
2570 | int result; | 2570 | int result; |
2571 | bool localIsNew; | 2571 | bool localIsNew; |
2572 | //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() ); | 2572 | //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() ); |
2573 | 2573 | ||
2574 | if ( full && mode < SYNC_PREF_NEWEST ) | 2574 | if ( full && mode < SYNC_PREF_NEWEST ) |
2575 | mode = SYNC_PREF_ASK; | 2575 | mode = SYNC_PREF_ASK; |
2576 | 2576 | ||
2577 | switch( mode ) { | 2577 | switch( mode ) { |
2578 | case SYNC_PREF_LOCAL: | 2578 | case SYNC_PREF_LOCAL: |
2579 | if ( lastSync > remoteMod ) | 2579 | if ( lastSync > remoteMod ) |
2580 | return 1; | 2580 | return 1; |
2581 | if ( lastSync > localMod ) | 2581 | if ( lastSync > localMod ) |
2582 | return 2; | 2582 | return 2; |
2583 | return 1; | 2583 | return 1; |
2584 | break; | 2584 | break; |
2585 | case SYNC_PREF_REMOTE: | 2585 | case SYNC_PREF_REMOTE: |
2586 | if ( lastSync > remoteMod ) | 2586 | if ( lastSync > remoteMod ) |
2587 | return 1; | 2587 | return 1; |
2588 | if ( lastSync > localMod ) | 2588 | if ( lastSync > localMod ) |
2589 | return 2; | 2589 | return 2; |
2590 | return 2; | 2590 | return 2; |
2591 | break; | 2591 | break; |
2592 | case SYNC_PREF_NEWEST: | 2592 | case SYNC_PREF_NEWEST: |
2593 | if ( localMod > remoteMod ) | 2593 | if ( localMod > remoteMod ) |
2594 | return 1; | 2594 | return 1; |
2595 | else | 2595 | else |
2596 | return 2; | 2596 | return 2; |
2597 | break; | 2597 | break; |
2598 | case SYNC_PREF_ASK: | 2598 | case SYNC_PREF_ASK: |
2599 | //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); | 2599 | //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); |
2600 | if ( lastSync > remoteMod ) | 2600 | if ( lastSync > remoteMod ) |
2601 | return 1; | 2601 | return 1; |
2602 | if ( lastSync > localMod ) | 2602 | if ( lastSync > localMod ) |
2603 | return 2; | 2603 | return 2; |
2604 | localIsNew = localMod >= remoteMod; | 2604 | localIsNew = localMod >= remoteMod; |
2605 | //qDebug("conflict! ************************************** "); | 2605 | //qDebug("conflict! ************************************** "); |
2606 | { | 2606 | { |
2607 | KPIM::AddresseeChooser acd ( *local,*remote, localIsNew , this ); | 2607 | KPIM::AddresseeChooser acd ( *local,*remote, localIsNew , this ); |
2608 | result = acd.executeD(localIsNew); | 2608 | result = acd.executeD(localIsNew); |
2609 | return result; | 2609 | return result; |
2610 | } | 2610 | } |
2611 | break; | 2611 | break; |
2612 | case SYNC_PREF_FORCE_LOCAL: | 2612 | case SYNC_PREF_FORCE_LOCAL: |
2613 | return 1; | 2613 | return 1; |
2614 | break; | 2614 | break; |
2615 | case SYNC_PREF_FORCE_REMOTE: | 2615 | case SYNC_PREF_FORCE_REMOTE: |
2616 | return 2; | 2616 | return 2; |
2617 | break; | 2617 | break; |
2618 | 2618 | ||
2619 | default: | 2619 | default: |
2620 | // SYNC_PREF_TAKE_BOTH not implemented | 2620 | // SYNC_PREF_TAKE_BOTH not implemented |
2621 | break; | 2621 | break; |
2622 | } | 2622 | } |
2623 | return 0; | 2623 | return 0; |
2624 | } | 2624 | } |
2625 | 2625 | ||
2626 | 2626 | ||
2627 | bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode) | 2627 | bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode) |
2628 | { | 2628 | { |
2629 | bool syncOK = true; | 2629 | bool syncOK = true; |
2630 | int addedAddressee = 0; | 2630 | int addedAddressee = 0; |
2631 | int addedAddresseeR = 0; | 2631 | int addedAddresseeR = 0; |
2632 | int deletedAddresseeR = 0; | 2632 | int deletedAddresseeR = 0; |
2633 | int deletedAddresseeL = 0; | 2633 | int deletedAddresseeL = 0; |
2634 | int changedLocal = 0; | 2634 | int changedLocal = 0; |
2635 | int changedRemote = 0; | 2635 | int changedRemote = 0; |
2636 | 2636 | ||
2637 | QString mCurrentSyncName = syncManager->getCurrentSyncName(); | 2637 | QString mCurrentSyncName = syncManager->getCurrentSyncName(); |
2638 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2638 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2639 | 2639 | ||
2640 | //QPtrList<Addressee> el = local->rawAddressees(); | 2640 | //QPtrList<Addressee> el = local->rawAddressees(); |
2641 | Addressee addresseeR; | 2641 | Addressee addresseeR; |
2642 | QString uid; | 2642 | QString uid; |
2643 | int take; | 2643 | int take; |
2644 | Addressee addresseeL; | 2644 | Addressee addresseeL; |
2645 | Addressee addresseeRSync; | 2645 | Addressee addresseeRSync; |
2646 | Addressee addresseeLSync; | 2646 | Addressee addresseeLSync; |
2647 | // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees(); | 2647 | // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees(); |
2648 | //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); | 2648 | //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); |
2649 | bool fullDateRange = false; | 2649 | bool fullDateRange = false; |
2650 | local->resetTempSyncStat(); | 2650 | local->resetTempSyncStat(); |
2651 | mLastAddressbookSync = QDateTime::currentDateTime(); | 2651 | mLastAddressbookSync = QDateTime::currentDateTime(); |
2652 | if ( syncManager->syncWithDesktop() ) { | 2652 | if ( syncManager->syncWithDesktop() ) { |
2653 | // remote->removeSyncInfo( QString());//remove all info | 2653 | // remote->removeSyncInfo( QString());//remove all info |
2654 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { | 2654 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { |
2655 | mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; | 2655 | mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; |
2656 | qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); | 2656 | qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); |
2657 | } else { | 2657 | } else { |
2658 | qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); | 2658 | qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); |
2659 | } | 2659 | } |
2660 | } | 2660 | } |
2661 | QDateTime modifiedCalendar = mLastAddressbookSync; | 2661 | QDateTime modifiedCalendar = mLastAddressbookSync; |
2662 | addresseeLSync = getLastSyncAddressee(); | 2662 | addresseeLSync = getLastSyncAddressee(); |
2663 | qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1()); | 2663 | qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1()); |
2664 | addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); | 2664 | addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); |
2665 | if ( !addresseeR.isEmpty() ) { | 2665 | if ( !addresseeR.isEmpty() ) { |
2666 | addresseeRSync = addresseeR; | 2666 | addresseeRSync = addresseeR; |
2667 | remote->removeAddressee(addresseeR ); | 2667 | remote->removeAddressee(addresseeR ); |
2668 | 2668 | ||
2669 | } else { | 2669 | } else { |
2670 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2670 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2671 | addresseeRSync = addresseeLSync ; | 2671 | addresseeRSync = addresseeLSync ; |
2672 | } else { | 2672 | } else { |
2673 | //qDebug("FULLDATE 1"); | 2673 | //qDebug("FULLDATE 1"); |
2674 | fullDateRange = true; | 2674 | fullDateRange = true; |
2675 | Addressee newAdd; | 2675 | Addressee newAdd; |
2676 | addresseeRSync = newAdd; | 2676 | addresseeRSync = newAdd; |
2677 | addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); | 2677 | addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); |
2678 | addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); | 2678 | addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); |
2679 | addresseeRSync.setRevision( mLastAddressbookSync ); | 2679 | addresseeRSync.setRevision( mLastAddressbookSync ); |
2680 | addresseeRSync.setCategories( i18n("SyncAddressee") ); | 2680 | addresseeRSync.setCategories( i18n("SyncAddressee") ); |
2681 | } | 2681 | } |
2682 | } | 2682 | } |
2683 | if ( addresseeLSync.revision() == mLastAddressbookSync ) { | 2683 | if ( addresseeLSync.revision() == mLastAddressbookSync ) { |
2684 | // qDebug("FULLDATE 2"); | 2684 | // qDebug("FULLDATE 2"); |
2685 | fullDateRange = true; | 2685 | fullDateRange = true; |
2686 | } | 2686 | } |
2687 | if ( ! fullDateRange ) { | 2687 | if ( ! fullDateRange ) { |
2688 | if ( addresseeLSync.revision() != addresseeRSync.revision() ) { | 2688 | if ( addresseeLSync.revision() != addresseeRSync.revision() ) { |
2689 | 2689 | ||
2690 | // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() ); | 2690 | // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() ); |
2691 | //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec()); | 2691 | //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec()); |
2692 | fullDateRange = true; | 2692 | fullDateRange = true; |
2693 | //qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() ); | 2693 | //qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() ); |
2694 | } | 2694 | } |
2695 | } | 2695 | } |
2696 | // fullDateRange = true; // debug only! | 2696 | // fullDateRange = true; // debug only! |
2697 | if ( fullDateRange ) | 2697 | if ( fullDateRange ) |
2698 | mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365); | 2698 | mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365); |
2699 | else | 2699 | else |
2700 | mLastAddressbookSync = addresseeLSync.revision(); | 2700 | mLastAddressbookSync = addresseeLSync.revision(); |
2701 | // for resyncing if own file has changed | 2701 | // for resyncing if own file has changed |
2702 | // PENDING fixme later when implemented | 2702 | // PENDING fixme later when implemented |
2703 | #if 0 | 2703 | #if 0 |
2704 | if ( mCurrentSyncDevice == "deleteaftersync" ) { | 2704 | if ( mCurrentSyncDevice == "deleteaftersync" ) { |
2705 | mLastAddressbookSync = loadedFileVersion; | 2705 | mLastAddressbookSync = loadedFileVersion; |
2706 | qDebug("setting mLastAddressbookSync "); | 2706 | qDebug("setting mLastAddressbookSync "); |
2707 | } | 2707 | } |
2708 | #endif | 2708 | #endif |
2709 | 2709 | ||
2710 | //qDebug("*************************** "); | 2710 | //qDebug("*************************** "); |
2711 | // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() ); | 2711 | // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() ); |
2712 | QStringList er = remote->uidList(); | 2712 | QStringList er = remote->uidList(); |
2713 | Addressee inR ;//= er.first(); | 2713 | Addressee inR ;//= er.first(); |
2714 | Addressee inL; | 2714 | Addressee inL; |
2715 | 2715 | ||
2716 | syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count()); | 2716 | syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count()); |
2717 | 2717 | ||
2718 | int modulo = (er.count()/10)+1; | 2718 | int modulo = (er.count()/10)+1; |
2719 | int incCounter = 0; | 2719 | int incCounter = 0; |
2720 | while ( incCounter < er.count()) { | 2720 | while ( incCounter < er.count()) { |
2721 | if (syncManager->isProgressBarCanceled()) | 2721 | if (syncManager->isProgressBarCanceled()) |
2722 | return false; | 2722 | return false; |
2723 | if ( incCounter % modulo == 0 ) | 2723 | if ( incCounter % modulo == 0 ) |
2724 | syncManager->showProgressBar(incCounter); | 2724 | syncManager->showProgressBar(incCounter); |
2725 | 2725 | ||
2726 | uid = er[ incCounter ]; | 2726 | uid = er[ incCounter ]; |
2727 | bool skipIncidence = false; | 2727 | bool skipIncidence = false; |
2728 | if ( uid.left(19) == QString("last-syncAddressee-") ) | 2728 | if ( uid.left(19) == QString("last-syncAddressee-") ) |
2729 | skipIncidence = true; | 2729 | skipIncidence = true; |
2730 | QString idS,OidS; | 2730 | QString idS,OidS; |
2731 | qApp->processEvents(); | 2731 | qApp->processEvents(); |
2732 | if ( !skipIncidence ) { | 2732 | if ( !skipIncidence ) { |
2733 | inL = local->findByUid( uid ); | 2733 | inL = local->findByUid( uid ); |
2734 | inR = remote->findByUid( uid ); | 2734 | inR = remote->findByUid( uid ); |
2735 | //inL.setResource( 0 ); | 2735 | //inL.setResource( 0 ); |
2736 | //inR.setResource( 0 ); | 2736 | //inR.setResource( 0 ); |
2737 | if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars | 2737 | if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars |
2738 | if ( !inL.resource() || inL.resource()->includeInSync() ) { | 2738 | if ( !inL.resource() || inL.resource()->includeInSync() ) { |
2739 | if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) { | 2739 | if ( take = takeAddressee( &inL, &inR, mode, fullDateRange ) ) { |
2740 | //qDebug("take %d %s ", take, inL.summary().latin1()); | 2740 | //qDebug("take %d %s ", take, inL.summary().latin1()); |
2741 | if ( take == 3 ) | 2741 | if ( take == 3 ) |
2742 | return false; | 2742 | return false; |
2743 | if ( take == 1 ) {// take local ********************** | 2743 | if ( take == 1 ) {// take local ********************** |
2744 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2744 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2745 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | 2745 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); |
2746 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | 2746 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); |
2747 | local->insertAddressee( inL, false ); | 2747 | local->insertAddressee( inL, false ); |
2748 | idS = inR.externalUID(); | 2748 | idS = inR.externalUID(); |
2749 | OidS = inR.originalExternalUID(); | 2749 | OidS = inR.originalExternalUID(); |
2750 | } | 2750 | } |
2751 | else | 2751 | else |
2752 | idS = inR.IDStr(); | 2752 | idS = inR.IDStr(); |
2753 | remote->removeAddressee( inR ); | 2753 | remote->removeAddressee( inR ); |
2754 | inR = inL; | 2754 | inR = inL; |
2755 | inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 2755 | inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
2756 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2756 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2757 | inR.setOriginalExternalUID( OidS ); | 2757 | inR.setOriginalExternalUID( OidS ); |
2758 | inR.setExternalUID( idS ); | 2758 | inR.setExternalUID( idS ); |
2759 | if ( syncManager->syncWithDesktop() ) { | 2759 | if ( syncManager->syncWithDesktop() ) { |
2760 | inR.setIDStr("changed" ); | 2760 | inR.setIDStr("changed" ); |
2761 | } | 2761 | } |
2762 | //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); | 2762 | //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); |
2763 | } else { | 2763 | } else { |
2764 | inR.setIDStr( idS ); | 2764 | inR.setIDStr( idS ); |
2765 | } | 2765 | } |
2766 | inR.setResource( 0 ); | 2766 | inR.setResource( 0 ); |
2767 | remote->insertAddressee( inR , false); | 2767 | remote->insertAddressee( inR , false); |
2768 | ++changedRemote; | 2768 | ++changedRemote; |
2769 | } else { // take == 2 take remote ********************** | 2769 | } else { // take == 2 take remote ********************** |
2770 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2770 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2771 | if ( inR.revision().date().year() < 2004 ) | 2771 | if ( inR.revision().date().year() < 2004 ) |
2772 | inR.setRevision( modifiedCalendar ); | 2772 | inR.setRevision( modifiedCalendar ); |
2773 | } | 2773 | } |
2774 | idS = inL.IDStr(); | 2774 | idS = inL.IDStr(); |
2775 | local->removeAddressee( inL ); | 2775 | local->removeAddressee( inL ); |
2776 | inL = inR; | 2776 | inL = inR; |
2777 | inL.setIDStr( idS ); | 2777 | inL.setIDStr( idS ); |
2778 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2778 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2779 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | 2779 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); |
2780 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | 2780 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); |
2781 | } | 2781 | } |
2782 | inL.setResource( 0 ); | 2782 | inL.setResource( 0 ); |
2783 | local->insertAddressee( inL , false ); | 2783 | local->insertAddressee( inL , false ); |
2784 | ++changedLocal; | 2784 | ++changedLocal; |
2785 | } | 2785 | } |
2786 | } | 2786 | } |
2787 | } | 2787 | } |
2788 | } else { // no conflict ********** add or delete remote | 2788 | } else { // no conflict ********** add or delete remote |
2789 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2789 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2790 | QString des = addresseeLSync.note(); | 2790 | QString des = addresseeLSync.note(); |
2791 | if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it | 2791 | if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it |
2792 | inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); | 2792 | inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); |
2793 | remote->insertAddressee( inR, false ); | 2793 | remote->insertAddressee( inR, false ); |
2794 | ++deletedAddresseeR; | 2794 | ++deletedAddresseeR; |
2795 | } else { | 2795 | } else { |
2796 | inR.setRevision( modifiedCalendar ); | 2796 | inR.setRevision( modifiedCalendar ); |
2797 | remote->insertAddressee( inR, false ); | 2797 | remote->insertAddressee( inR, false ); |
2798 | inL = inR; | 2798 | inL = inR; |
2799 | inL.setIDStr( ":" ); | 2799 | inL.setIDStr( ":" ); |
2800 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); | 2800 | inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); |
2801 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); | 2801 | inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); |
2802 | inL.setResource( 0 ); | 2802 | inL.setResource( 0 ); |
2803 | local->insertAddressee( inL , false); | 2803 | local->insertAddressee( inL , false); |
2804 | ++addedAddressee; | 2804 | ++addedAddressee; |
2805 | } | 2805 | } |
2806 | } else { | 2806 | } else { |
2807 | if ( inR.revision() > mLastAddressbookSync || mode == 5 ) { | 2807 | if ( inR.revision() > mLastAddressbookSync || mode == 5 ) { |
2808 | inR.setRevision( modifiedCalendar ); | 2808 | inR.setRevision( modifiedCalendar ); |
2809 | remote->insertAddressee( inR, false ); | 2809 | remote->insertAddressee( inR, false ); |
2810 | inR.setResource( 0 ); | 2810 | inR.setResource( 0 ); |
2811 | local->insertAddressee( inR, false ); | 2811 | local->insertAddressee( inR, false ); |
2812 | ++addedAddressee; | 2812 | ++addedAddressee; |
2813 | } else { | 2813 | } else { |
2814 | // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); | 2814 | // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); |
2815 | remote->removeAddressee( inR ); | 2815 | remote->removeAddressee( inR ); |
2816 | ++deletedAddresseeR; | 2816 | ++deletedAddresseeR; |
2817 | } | 2817 | } |
2818 | } | 2818 | } |
2819 | } | 2819 | } |
2820 | } | 2820 | } |
2821 | ++incCounter; | 2821 | ++incCounter; |
2822 | } | 2822 | } |
2823 | er.clear(); | 2823 | er.clear(); |
2824 | QStringList el = local->uidList(); | 2824 | QStringList el = local->uidList(); |
2825 | modulo = (el.count()/10)+1; | 2825 | modulo = (el.count()/10)+1; |
2826 | 2826 | ||
2827 | syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); | 2827 | syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); |
2828 | incCounter = 0; | 2828 | incCounter = 0; |
2829 | while ( incCounter < el.count()) { | 2829 | while ( incCounter < el.count()) { |
2830 | qApp->processEvents(); | 2830 | qApp->processEvents(); |
2831 | if (syncManager->isProgressBarCanceled()) | 2831 | if (syncManager->isProgressBarCanceled()) |
2832 | return false; | 2832 | return false; |
2833 | if ( incCounter % modulo == 0 ) | 2833 | if ( incCounter % modulo == 0 ) |
2834 | syncManager->showProgressBar(incCounter); | 2834 | syncManager->showProgressBar(incCounter); |
2835 | uid = el[ incCounter ]; | 2835 | uid = el[ incCounter ]; |
2836 | bool skipIncidence = false; | 2836 | bool skipIncidence = false; |
2837 | if ( uid.left(19) == QString("last-syncAddressee-") ) | 2837 | if ( uid.left(19) == QString("last-syncAddressee-") ) |
2838 | skipIncidence = true; | 2838 | skipIncidence = true; |
2839 | if ( !skipIncidence ) { | 2839 | if ( !skipIncidence ) { |
2840 | inL = local->findByUid( uid ); | 2840 | inL = local->findByUid( uid ); |
2841 | if ( !inL.resource() || inL.resource()->includeInSync() ) { | 2841 | if ( !inL.resource() || inL.resource()->includeInSync() ) { |
2842 | inR = remote->findByUid( uid ); | 2842 | inR = remote->findByUid( uid ); |
2843 | if ( inR.isEmpty() ) { // no conflict ********** add or delete local | 2843 | if ( inR.isEmpty() ) { // no conflict ********** add or delete local |
2844 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2844 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2845 | if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 2845 | if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
2846 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); | 2846 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); |
2847 | local->removeAddressee( inL ); | 2847 | local->removeAddressee( inL ); |
2848 | ++deletedAddresseeL; | 2848 | ++deletedAddresseeL; |
2849 | } else { | 2849 | } else { |
2850 | if ( ! syncManager->mWriteBackExistingOnly ) { | 2850 | if ( ! syncManager->mWriteBackExistingOnly ) { |
2851 | inL.removeID(mCurrentSyncDevice ); | 2851 | inL.removeID(mCurrentSyncDevice ); |
2852 | ++addedAddresseeR; | 2852 | ++addedAddresseeR; |
2853 | inL.setRevision( modifiedCalendar ); | 2853 | inL.setRevision( modifiedCalendar ); |
2854 | local->insertAddressee( inL, false ); | 2854 | local->insertAddressee( inL, false ); |
2855 | inR = inL; | 2855 | inR = inL; |
2856 | inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); | 2856 | inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); |
2857 | inR.setResource( 0 ); | 2857 | inR.setResource( 0 ); |
2858 | remote->insertAddressee( inR, false ); | 2858 | remote->insertAddressee( inR, false ); |
2859 | } | 2859 | } |
2860 | } | 2860 | } |
2861 | } else { | 2861 | } else { |
2862 | if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { | 2862 | if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { |
2863 | //qDebug("data %s ", inL.revision().toString().latin1()); | 2863 | //qDebug("data %s ", inL.revision().toString().latin1()); |
2864 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); | 2864 | // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); |
2865 | local->removeAddressee( inL ); | 2865 | local->removeAddressee( inL ); |
2866 | ++deletedAddresseeL; | 2866 | ++deletedAddresseeL; |
2867 | } else { | 2867 | } else { |
2868 | if ( ! syncManager->mWriteBackExistingOnly ) { | 2868 | if ( ! syncManager->mWriteBackExistingOnly ) { |
2869 | ++addedAddresseeR; | 2869 | ++addedAddresseeR; |
2870 | inL.setRevision( modifiedCalendar ); | 2870 | inL.setRevision( modifiedCalendar ); |
2871 | local->insertAddressee( inL, false ); | 2871 | local->insertAddressee( inL, false ); |
2872 | inR = inL; | 2872 | inR = inL; |
2873 | inR.setIDStr( ":" ); | 2873 | inR.setIDStr( ":" ); |
2874 | inR.setResource( 0 ); | 2874 | inR.setResource( 0 ); |
2875 | remote->insertAddressee( inR, false ); | 2875 | remote->insertAddressee( inR, false ); |
2876 | } | 2876 | } |
2877 | } | 2877 | } |
2878 | } | 2878 | } |
2879 | } | 2879 | } |
2880 | } | 2880 | } |
2881 | } | 2881 | } |
2882 | ++incCounter; | 2882 | ++incCounter; |
2883 | } | 2883 | } |
2884 | el.clear(); | 2884 | el.clear(); |
2885 | syncManager->hideProgressBar(); | 2885 | syncManager->hideProgressBar(); |
2886 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); | 2886 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); |
2887 | // get rid of micro seconds | 2887 | // get rid of micro seconds |
2888 | QTime t = mLastAddressbookSync.time(); | 2888 | QTime t = mLastAddressbookSync.time(); |
2889 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); | 2889 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); |
2890 | addresseeLSync.setRevision( mLastAddressbookSync ); | 2890 | addresseeLSync.setRevision( mLastAddressbookSync ); |
2891 | addresseeRSync.setRevision( mLastAddressbookSync ); | 2891 | addresseeRSync.setRevision( mLastAddressbookSync ); |
2892 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; | 2892 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; |
2893 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); | 2893 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); |
2894 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; | 2894 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; |
2895 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); | 2895 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); |
2896 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; | 2896 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; |
2897 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); | 2897 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); |
2898 | addresseeRSync.setNote( "" ) ; | 2898 | addresseeRSync.setNote( "" ) ; |
2899 | addresseeLSync.setNote( "" ); | 2899 | addresseeLSync.setNote( "" ); |
2900 | 2900 | ||
2901 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) | 2901 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) |
2902 | remote->insertAddressee( addresseeRSync, false ); | 2902 | remote->insertAddressee( addresseeRSync, false ); |
2903 | local->insertAddressee( addresseeLSync, false ); | 2903 | local->insertAddressee( addresseeLSync, false ); |
2904 | QString mes; | 2904 | QString mes; |
2905 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); | 2905 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); |
2906 | qDebug( mes ); | 2906 | qDebug( mes ); |
2907 | mes = i18n("Local addressbook changed!\n") +mes; | 2907 | mes = i18n("Local addressbook changed!\n") +mes; |
2908 | if ( syncManager->mShowSyncSummary ) { | 2908 | if ( syncManager->mShowSyncSummary ) { |
2909 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, | 2909 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, |
2910 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { | 2910 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { |
2911 | qDebug("cancelled "); | 2911 | qDebug("cancelled "); |
2912 | return false; | 2912 | return false; |
2913 | } | 2913 | } |
2914 | } | 2914 | } |
2915 | return syncOK; | 2915 | return syncOK; |
2916 | } | 2916 | } |
2917 | 2917 | ||
2918 | 2918 | ||
2919 | //this is a overwritten callbackmethods from the syncinterface | 2919 | //this is a overwritten callbackmethods from the syncinterface |
2920 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | 2920 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) |
2921 | { | 2921 | { |
2922 | 2922 | ||
2923 | //pending prepare addresseeview for output | 2923 | //pending prepare addresseeview for output |
2924 | //pending detect, if remote file has REV field. if not switch to external sync | 2924 | //pending detect, if remote file has REV field. if not switch to external sync |
2925 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 2925 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
2926 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 2926 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
2927 | 2927 | ||
2928 | AddressBook abLocal(filename,"syncContact"); | 2928 | AddressBook abLocal(filename,"syncContact"); |
2929 | bool syncOK = false; | 2929 | bool syncOK = false; |
2930 | if ( abLocal.load() ) { | 2930 | if ( abLocal.load() ) { |
2931 | qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); | 2931 | qDebug("AB loaded %s,sync mode %d",filename.latin1(), mode ); |
2932 | bool external = false; | 2932 | bool external = false; |
2933 | bool isXML = false; | 2933 | bool isXML = false; |
2934 | if ( filename.right(4) == ".xml") { | 2934 | if ( filename.right(4) == ".xml") { |
2935 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2935 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2936 | isXML = true; | 2936 | isXML = true; |
2937 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 2937 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
2938 | } else { | 2938 | } else { |
2939 | external = !manager->mIsKapiFile; | 2939 | external = !manager->mIsKapiFile; |
2940 | if ( external ) { | 2940 | if ( external ) { |
2941 | qDebug("Setting vcf mode to external "); | 2941 | qDebug("Setting vcf mode to external "); |
2942 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2942 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2943 | AddressBook::Iterator it; | 2943 | AddressBook::Iterator it; |
2944 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 2944 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
2945 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); | 2945 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); |
2946 | (*it).computeCsum( mCurrentSyncDevice ); | 2946 | (*it).computeCsum( mCurrentSyncDevice ); |
2947 | } | 2947 | } |
2948 | } | 2948 | } |
2949 | } | 2949 | } |
2950 | //AddressBook::Iterator it; | 2950 | //AddressBook::Iterator it; |
2951 | //QStringList vcards; | 2951 | //QStringList vcards; |
2952 | //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 2952 | //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
2953 | // qDebug("Name %s ", (*it).familyName().latin1()); | 2953 | // qDebug("Name %s ", (*it).familyName().latin1()); |
2954 | //} | 2954 | //} |
2955 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); | 2955 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); |
2956 | if ( syncOK ) { | 2956 | if ( syncOK ) { |
2957 | if ( syncManager->mWriteBackFile ) | 2957 | if ( syncManager->mWriteBackFile ) |
2958 | { | 2958 | { |
2959 | if ( external ) | 2959 | if ( external ) |
2960 | abLocal.removeSyncAddressees( !isXML); | 2960 | abLocal.removeSyncAddressees( !isXML); |
2961 | qDebug("Saving remote AB "); | 2961 | qDebug("Saving remote AB "); |
2962 | if ( ! abLocal.saveAB()) | 2962 | if ( ! abLocal.saveAB()) |
2963 | qDebug("Error writing back AB to file "); | 2963 | qDebug("Error writing back AB to file "); |
2964 | if ( external ) { | 2964 | if ( external ) { |
2965 | // afterwrite processing | 2965 | // afterwrite processing |
2966 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); | 2966 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); |
2967 | } | 2967 | } |
2968 | } | 2968 | } |
2969 | } | 2969 | } |
2970 | setModified(); | 2970 | setModified(); |
2971 | 2971 | ||
2972 | } | 2972 | } |
2973 | abLocal.removeResources(); | 2973 | abLocal.removeResources(); |
2974 | if ( syncOK ) | 2974 | if ( syncOK ) |
2975 | mViewManager->refreshView(); | 2975 | mViewManager->refreshView(); |
2976 | return syncOK; | 2976 | return syncOK; |
2977 | 2977 | ||
2978 | } | 2978 | } |
2979 | void KABCore::removeSyncInfo( QString syncProfile) | 2979 | void KABCore::removeSyncInfo( QString syncProfile) |
2980 | { | 2980 | { |
2981 | qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1()); | 2981 | qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1()); |
2982 | mAddressBook->removeSyncInfo( syncProfile ); | 2982 | mAddressBook->removeSyncInfo( syncProfile ); |
2983 | setModified(); | 2983 | setModified(); |
2984 | } | 2984 | } |
2985 | 2985 | ||
2986 | 2986 | ||
2987 | //this is a overwritten callbackmethods from the syncinterface | 2987 | //this is a overwritten callbackmethods from the syncinterface |
2988 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) | 2988 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) |
2989 | { | 2989 | { |
2990 | if ( resource == "phone" ) | 2990 | if ( resource == "phone" ) |
2991 | return syncPhone(); | 2991 | return syncPhone(); |
2992 | disableBR( true ); | 2992 | disableBR( true ); |
2993 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 2993 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
2994 | 2994 | ||
2995 | AddressBook abLocal( resource,"syncContact"); | 2995 | AddressBook abLocal( resource,"syncContact"); |
2996 | bool syncOK = false; | 2996 | bool syncOK = false; |
2997 | if ( abLocal.load() ) { | 2997 | if ( abLocal.load() ) { |
2998 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2998 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2999 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2999 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3000 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); | 3000 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); |
3001 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 3001 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
3002 | if ( syncOK ) { | 3002 | if ( syncOK ) { |
3003 | if ( syncManager->mWriteBackFile ) { | 3003 | if ( syncManager->mWriteBackFile ) { |
3004 | abLocal.removeSyncAddressees( false ); | 3004 | abLocal.removeSyncAddressees( false ); |
3005 | abLocal.saveAB(); | 3005 | abLocal.saveAB(); |
3006 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); | 3006 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
3007 | } | 3007 | } |
3008 | } else | 3008 | } else |
3009 | message( i18n("Sync cancelled or failed.") ); | 3009 | message( i18n("Sync cancelled or failed.") ); |
3010 | setModified(); | 3010 | setModified(); |
3011 | } | 3011 | } |
3012 | abLocal.removeResources(); | 3012 | abLocal.removeResources(); |
3013 | if ( syncOK ) | 3013 | if ( syncOK ) |
3014 | mViewManager->refreshView(); | 3014 | mViewManager->refreshView(); |
3015 | disableBR( false ); | 3015 | disableBR( false ); |
3016 | return syncOK; | 3016 | return syncOK; |
3017 | 3017 | ||
3018 | } | 3018 | } |
3019 | void KABCore::message( QString m ) | 3019 | void KABCore::message( QString m ) |
3020 | { | 3020 | { |
3021 | topLevelWidget()->setCaption( m ); | 3021 | topLevelWidget()->setCaption( m ); |
3022 | mMessageTimer->start( 15000, true ); | 3022 | mMessageTimer->start( 15000, true ); |
3023 | } | 3023 | } |
3024 | bool KABCore::syncPhone() | 3024 | bool KABCore::syncPhone() |
3025 | { | 3025 | { |
3026 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 3026 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
3027 | QString fileName = getPhoneFile(); | 3027 | QString fileName = getPhoneFile(); |
3028 | if ( !PhoneAccess::readFromPhone( fileName) ) { | 3028 | if ( !PhoneAccess::readFromPhone( fileName) ) { |
3029 | message(i18n("Phone access failed!")); | 3029 | message(i18n("Phone access failed!")); |
3030 | return false; | 3030 | return false; |
3031 | } | 3031 | } |
3032 | AddressBook abLocal( fileName,"syncContact"); | 3032 | AddressBook abLocal( fileName,"syncContact"); |
3033 | bool syncOK = false; | 3033 | bool syncOK = false; |
3034 | { | 3034 | { |
3035 | abLocal.importFromFile( fileName ); | 3035 | abLocal.importFromFile( fileName ); |
3036 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 3036 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
3037 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3037 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3038 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); | 3038 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); |
3039 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 3039 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
3040 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 3040 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
3041 | if ( syncOK ) { | 3041 | if ( syncOK ) { |
3042 | if ( syncManager->mWriteBackFile ) { | 3042 | if ( syncManager->mWriteBackFile ) { |
3043 | abLocal.removeSyncAddressees( true ); | 3043 | abLocal.removeSyncAddressees( true ); |
3044 | abLocal.saveABphone( fileName ); | 3044 | abLocal.saveABphone( fileName ); |
3045 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); | 3045 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); |
3046 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); | 3046 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); |
3047 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); | 3047 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
3048 | } | 3048 | } |
3049 | } | 3049 | } |
3050 | setModified(); | 3050 | setModified(); |
3051 | } | 3051 | } |
3052 | abLocal.removeResources(); | 3052 | abLocal.removeResources(); |
3053 | if ( syncOK ) | 3053 | if ( syncOK ) |
3054 | mViewManager->refreshView(); | 3054 | mViewManager->refreshView(); |
3055 | return syncOK; | 3055 | return syncOK; |
3056 | } | 3056 | } |
3057 | void KABCore::getFile( bool success ) | 3057 | void KABCore::getFile( bool success ) |
3058 | { | 3058 | { |
3059 | if ( ! success ) { | 3059 | if ( ! success ) { |
3060 | message( i18n("Error receiving file. Nothing changed!") ); | 3060 | message( i18n("Error receiving file. Nothing changed!") ); |
3061 | return; | 3061 | return; |
3062 | } | 3062 | } |
3063 | int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); | 3063 | int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); |
3064 | if ( count ) | 3064 | if ( count ) |
3065 | setModified( true ); | 3065 | setModified( true ); |
3066 | message( i18n("Pi-Sync successful!") ); | 3066 | message( i18n("Pi-Sync successful!") ); |
3067 | mViewManager->refreshView(); | 3067 | mViewManager->refreshView(); |
3068 | } | 3068 | } |
3069 | void KABCore::syncFileRequest() | 3069 | void KABCore::syncFileRequest() |
3070 | { | 3070 | { |
3071 | if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { | 3071 | if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { |
3072 | syncManager->slotSyncMenu( 999 ); | 3072 | syncManager->slotSyncMenu( 999 ); |
3073 | } | 3073 | } |
3074 | mAddressBook->export2File( sentSyncFile() ); | 3074 | mAddressBook->export2File( sentSyncFile() ); |
3075 | } | 3075 | } |
3076 | QString KABCore::sentSyncFile() | 3076 | QString KABCore::sentSyncFile() |
3077 | { | 3077 | { |
3078 | #ifdef DESKTOP_VERSION | 3078 | #ifdef DESKTOP_VERSION |
3079 | return locateLocal( "tmp", "copysyncab.vcf" ); | 3079 | return locateLocal( "tmp", "copysyncab.vcf" ); |
3080 | #else | 3080 | #else |
3081 | return QString( "/tmp/copysyncab.vcf" ); | 3081 | return QString( "/tmp/copysyncab.vcf" ); |
3082 | #endif | 3082 | #endif |
3083 | } | 3083 | } |
3084 | 3084 | ||
3085 | void KABCore::setCaptionBack() | 3085 | void KABCore::setCaptionBack() |
3086 | { | 3086 | { |
3087 | mMessageTimer->stop(); | 3087 | mMessageTimer->stop(); |
3088 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); | 3088 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); |
3089 | } | 3089 | } |