summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-29 18:35:10 (UTC)
committer zautrix <zautrix>2005-03-29 18:35:10 (UTC)
commitb70d9695bb6a2d567b75965c0530792ad90c84a3 (patch) (unidiff)
treebc27647d044cf4a8d9c75acd19d9a2d078fe00b2
parenta7c827aa0e555206b60dec3bc07f7afab4352883 (diff)
downloadkdepimpi-b70d9695bb6a2d567b75965c0530792ad90c84a3.zip
kdepimpi-b70d9695bb6a2d567b75965c0530792ad90c84a3.tar.gz
kdepimpi-b70d9695bb6a2d567b75965c0530792ad90c84a3.tar.bz2
icons
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/kaddressbook/germantranslation.txt4
-rw-r--r--bin/kdepim/kaddressbook/icons16/ic_family.pngbin0 -> 7865 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons16/ic_female.pngbin0 -> 5745 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons16/ic_kids.pngbin0 -> 9039 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons16/ic_male.pngbin0 -> 6440 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons16/ic_penguin.pngbin0 -> 5343 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons16/package_toys.pngbin16139 -> 0 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons22/ic_family.pngbin0 -> 7865 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons22/ic_female.pngbin0 -> 5745 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons22/ic_kids.pngbin0 -> 9039 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons22/ic_male.pngbin0 -> 6440 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons22/ic_penguin.pngbin0 -> 5343 bytes
-rw-r--r--bin/kdepim/kaddressbook/icons22/package_toys.pngbin16139 -> 0 bytes
-rw-r--r--kabc/addresseeview.cpp10
-rw-r--r--kaddressbook/addresseeeditordialog.cpp2
-rw-r--r--kaddressbook/kabcore.cpp1
-rw-r--r--korganizer/koviewmanager.cpp2
17 files changed, 13 insertions, 6 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt
index 6721d5f..30b4168 100644
--- a/bin/kdepim/kaddressbook/germantranslation.txt
+++ b/bin/kdepim/kaddressbook/germantranslation.txt
@@ -1,758 +1,758 @@
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 for Contacts...","Setze Kategorien für Kontakte..." }, 145{ "Set Categories for Contacts...","Setze Kategorien für Kontakte..." },
146{ "Edit Category List...","Editiere Kategorieliste..." }, 146{ "Edit Category List...","Editiere Kategorieliste..." },
147{ "Remove "voice"...","Entferne "voice"..." }, 147{ "Remove "voice"...","Entferne "voice"..." },
148{ "Import from Outlook...","Importiere aus Outlook..." }, 148{ "Import from Outlook...","Importiere aus Outlook..." },
149{ "Licence","Lizenz" }, 149{ "Licence","Lizenz" },
150{ "Faq","Fragen + Antworten" }, 150{ "Faq","Fragen + Antworten" },
151{ "What's New?","Was ist neu?" }, 151{ "What's New?","Was ist neu?" },
152{ "Sync HowTo","Sync Anleitung" }, 152{ "Sync HowTo","Sync Anleitung" },
153{ "&About KAddressBook","Über KAdressBuch" }, 153{ "&About KAddressBook","Über KAdressBuch" },
154{ "Select Incremental Search Field","Selektiere Such Feld" }, 154{ "Select Incremental Search Field","Selektiere Such Feld" },
155{ "Synchronize","Synchronisieren" }, 155{ "Synchronize","Synchronisieren" },
156{ "Configure...","Konfigurieren..." }, 156{ "Configure...","Konfigurieren..." },
157{ "Enable Pi-Sync","Aktiviere Pi-Sync" }, 157{ "Enable Pi-Sync","Aktiviere Pi-Sync" },
158{ "Multiple sync","Multi Sync" }, 158{ "Multiple sync","Multi Sync" },
159{ "Import CSV List...","Importiere CSV-Datei..." }, 159{ "Import CSV List...","Importiere CSV-Datei..." },
160{ "Export CSV List...","Exportiere CSV-Datei..." }, 160{ "Export CSV List...","Exportiere CSV-Datei..." },
161{ "Import KDE 2 Addressbook...","Importiere KDE 2 Adressbuch..." }, 161{ "Import KDE 2 Addressbook...","Importiere KDE 2 Adressbuch..." },
162{ "Import vCard...","Importiere vCard..." }, 162{ "Import vCard...","Importiere vCard..." },
163{ "Export vCard 3.0...","Exportiere vCard 3.0..." }, 163{ "Export vCard 3.0...","Exportiere vCard 3.0..." },
164{ "Import Qtopia...","Importiere Qtopia..." }, 164{ "Import Qtopia...","Importiere Qtopia..." },
165{ "Export Qtopia...","Exportiere Qtopia..." }, 165{ "Export Qtopia...","Exportiere Qtopia..." },
166{ "Edit Contact","Bearbeite Kontakt" }, 166{ "Edit Contact","Bearbeite Kontakt" },
167{ "Ok","Ok" }, 167{ "Ok","Ok" },
168{ "Apply","Anwenden" }, 168{ "Apply","Anwenden" },
169{ "Cancel","Abbrechen" }, 169{ "Cancel","Abbrechen" },
170{ "KAddressbook/Pi","KAdressbuch/Pi" }, 170{ "KAddressbook/Pi","KAdressbuch/Pi" },
171{ "No Filter","Kein Filter" }, 171{ "No Filter","Kein Filter" },
172{ "Given Name","Vorname" }, 172{ "Given Name","Vorname" },
173{ "Family Name","Nachname" }, 173{ "Family Name","Nachname" },
174{ "Email Address","E-Mail Adresse" }, 174{ "Email Address","E-Mail Adresse" },
175{ "All Fields","Alle Felder" }, 175{ "All Fields","Alle Felder" },
176{ "Question","Frage" }, 176{ "Question","Frage" },
177{ "After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?","After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?" }, 177{ "After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?","After importing, phone numbers\nmay have two or more types.\n(E.g. work+voice)\nThese numbers are shown as "other".\nClick Yes to remove the voice type\nfrom numbers with more than one type.\n\nRemove voice type?" },
178{ "No","Nein" }, 178{ "No","Nein" },
179{ "Yes","Ja" }, 179{ "Yes","Ja" },
180{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile" }, 180{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile" },
181{ "Local device name:","Name dieses Gerätes:" }, 181{ "Local device name:","Name dieses Gerätes:" },
182{ "New profile","Neues Profil" }, 182{ "New profile","Neues Profil" },
183{ "Clone profile","Klone Profil" }, 183{ "Clone profile","Klone Profil" },
184{ "Delete profile","Lösche Profil" }, 184{ "Delete profile","Lösche Profil" },
185{ "Profile:","Profil:" }, 185{ "Profile:","Profil:" },
186{ "Ask for every entry on conflict","Frage bei Konflikten nach"}, 186{ "Ask for every entry on conflict","Frage bei Konflikten nach"},
187{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, 187{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" },
188{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, 188{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" },
189{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" } 189{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" }
190{ "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, 190{ "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" },
191{ "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, 191{ "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" },
192{ "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, 192{ "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" },
193{ "Write back file","Schreibe Datei zurück" }, 193{ "Write back file","Schreibe Datei zurück" },
194{ "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, 194{ "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" },
195{ "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, 195{ "Pre sync (download) command:","Bevor Sync (download) Kommando:" },
196{ "Local device name:","Name dieses Gerätes:" }, 196{ "Local device name:","Name dieses Gerätes:" },
197{ "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, 197{ "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" },
198{ "Sync preferences","Synchronisations Einstellungen" }, 198{ "Sync preferences","Synchronisations Einstellungen" },
199{ "Profile kind","Profil Art" }, 199{ "Profile kind","Profil Art" },
200{ "Local file","Lokale Datei" }, 200{ "Local file","Lokale Datei" },
201{ "Local file:","Lokale Datei:" }, 201{ "Local file:","Lokale Datei:" },
202{ "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, 202{ "Post sync (upload) command:","Nach Sync (upload) Kommando:" },
203{ "Fill in default values for:","Setze Beispiel Werte ein für:" }, 203{ "Fill in default values for:","Setze Beispiel Werte ein für:" },
204{ "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, 204{ "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" },
205{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, 205{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile"},
206{ "Device","Gerät:" }, 206{ "Device","Gerät:" },
207{ "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, 207{ "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" },
208{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" }, 208{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" },
209{ "Synchronization successful","Synchronisation erfolgreich" }, 209{ "Synchronization successful","Synchronisation erfolgreich" },
210{ "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, 210{ "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." },
211{ "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, 211{ "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" },
212{ "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, 212{ "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" },
213{ "Enter password","Passwort eingeben" }, 213{ "Enter password","Passwort eingeben" },
214{ "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, 214{ "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" },
215{ "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, 215{ "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." },
216{ "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" }, 216{ "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" },
217{ "Writing back file result: ","Resultat des Dateizurückschreibens: " }, 217{ "Writing back file result: ","Resultat des Dateizurückschreibens: " },
218{ "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, 218{ "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" },
219{ "Used %1 Client","Benutzter %1 Client" }, 219{ "Used %1 Client","Benutzter %1 Client" },
220{ "No email client installed","Kein Email Klient installiert" }, 220{ "No email client installed","Kein Email Klient installiert" },
221{ "Userdefined email client","Benutzerdef. Email Klient" }, 221{ "Userdefined email client","Benutzerdef. Email Klient" },
222{ "OM/Pi email client","OM/Pi Email Klient" }, 222{ "OM/Pi email client","OM/Pi Email Klient" },
223{ "Include in multiple ","Beziehe in mehrfach " }, 223{ "Include in multiple ","Beziehe in mehrfach " },
224{ "calendar ","Kalender " }, 224{ "calendar ","Kalender " },
225{ "addressbook ","Adressbuch " }, 225{ "addressbook ","Adressbuch " },
226{ "pwmanager","PWmanager" }, 226{ "pwmanager","PWmanager" },
227{ " sync"," Sync ein" }, 227{ " sync"," Sync ein" },
228{ "Write back synced data","Schreibe gesyncte Daten zurück" }, 228{ "Write back synced data","Schreibe gesyncte Daten zurück" },
229{ "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, 229{ "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" },
230{ "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, 230{ "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" },
231{ "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, 231{ "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " },
232{ "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, 232{ "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" },
233{ "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, 233{ "Mobile device (cell phone)","Mobiles Gerät (Handy)" },
234{ "Help...","Hilfe..." }, 234{ "Help...","Hilfe..." },
235{ "Local file Cal:","Lokale Datei Kal:" }, 235{ "Local file Cal:","Lokale Datei Kal:" },
236{ "Local file ABook:","Lokale Datei ABuch:" }, 236{ "Local file ABook:","Lokale Datei ABuch:" },
237{ "Local file PWMgr:","Lokale Datei PWMgr:" }, 237{ "Local file PWMgr:","Lokale Datei PWMgr:" },
238{ "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, 238{ "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" },
239{ "Calendar:","Kalender:" }, 239{ "Calendar:","Kalender:" },
240{ "AddressBook:","AdressBuch:" }, 240{ "AddressBook:","AdressBuch:" },
241{ "PWManager:","PWManager:" }, 241{ "PWManager:","PWManager:" },
242{ "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, 242{ "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" },
243{ "ssh/scp","ssh/scp" }, 243{ "ssh/scp","ssh/scp" },
244{ "ftp","ftp" }, 244{ "ftp","ftp" },
245{ "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, 245{ "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" },
246{ "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, 246{ "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" },
247{ "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, 247{ "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" },
248{ "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, 248{ "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" },
249{ "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, 249{ "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" },
250{ "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, 250{ "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" },
251{ "KDE-Pim sync config","KDE-Pim sync Konfig" }, 251{ "KDE-Pim sync config","KDE-Pim sync Konfig" },
252{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, 252{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" },
253{ "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, 253{ "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" },
254{ "Port number (Default: %1)","Port Nummer (Default: %1)" }, 254{ "Port number (Default: %1)","Port Nummer (Default: %1)" },
255{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, 255{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" },
256{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, 256{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" },
257{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, 257{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" },
258{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, 258{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" },
259{ "Disable Pi-Sync","Schalte Pi-Sync aus" }, 259{ "Disable Pi-Sync","Schalte Pi-Sync aus" },
260{ "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen \"Multi-Syncen\"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, 260{ "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen \"Multi-Syncen\"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" },
261{ "KDE-Pim Sync","KDE-Pim Sync" }, 261{ "KDE-Pim Sync","KDE-Pim Sync" },
262{ "Multiple profiles","Multi-Sync Profile" }, 262{ "Multiple profiles","Multi-Sync Profile" },
263{ "Device: ","Gerät: " }, 263{ "Device: ","Gerät: " },
264{ "Multiple sync started.","Multi-Sync gestartet." }, 264{ "Multiple sync started.","Multi-Sync gestartet." },
265{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, 265{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" },
266{ "KDE-Pim sync config","KDE-Pim Sync Konfig" }, 266{ "KDE-Pim sync config","KDE-Pim Sync Konfig" },
267{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein, z.B.:\n" }, 267{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein, z.B.:\n" },
268{ "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Modell\nautomatisch\erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, 268{ "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Modell\nautomatisch\erkannt\nwerden kann)\nOder füge Model Name ein:\n" },
269{ "KO/Pi config error","KO/Pi Konfig. Fehler" }, 269{ "KO/Pi config error","KO/Pi Konfig. Fehler" },
270{ "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, 270{ "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" },
271{ "Edit Address Book Filters","Editiere Addressbuch Filter" }, 271{ "Edit Address Book Filters","Editiere Addressbuch Filter" },
272{ "&Add...","Hinzufügen..." }, 272{ "&Add...","Hinzufügen..." },
273{ "&Edit...","B&earbeiten..." }, 273{ "&Edit...","B&earbeiten..." },
274{ "&Remove","Entfe&rne" }, 274{ "&Remove","Entfe&rne" },
275{ "Modify View: ","Ansicht ändern: " }, 275{ "Modify View: ","Ansicht ändern: " },
276{ "Fields","Felder" }, 276{ "Fields","Felder" },
277{ "Select Fields to Display","Wähle anzuzeigende Felder" }, 277{ "Select Fields to Display","Wähle anzuzeigende Felder" },
278{ "All","Alles" }, 278{ "All","Alles" },
279{ "Frequent","Frequent" }, 279{ "Frequent","Frequent" },
280{ "Address","Adresse" }, 280{ "Address","Adresse" },
281{ "Email","E-Mail" }, 281{ "Email","E-Mail" },
282{ "Personal","Persönl." }, 282{ "Personal","Persönl." },
283{ "Organization","Organisation" }, 283{ "Organization","Organisation" },
284{ "Custom","Benutzerdefiniert" }, 284{ "Custom","Benutzerdefiniert" },
285{ "&Selected\nfields:","&Selektierte\nFelder:" }, 285{ "&Selected\nfields:","&Selektierte\nFelder:" },
286{ "Formatted Name","Format. Name" }, 286{ "Formatted Name","Format. Name" },
287{ "Additional Names","Mittelname" }, 287{ "Additional Names","Mittelname" },
288{ "Honorific Prefixes","Namen Prefix" }, 288{ "Honorific Prefixes","Namen Prefix" },
289{ "Honorific Suffixes","Namen Suffix" }, 289{ "Honorific Suffixes","Namen Suffix" },
290{ "Nick Name","Sptitzname" }, 290{ "Nick Name","Sptitzname" },
291{ "Birthday","Geburtstag" }, 291{ "Birthday","Geburtstag" },
292{ "Home Address Street","Privat Adresse Strasse" }, 292{ "Home Address Street","Privat Adresse Strasse" },
293{ "Home Address Locality","Privat Adresse Stadt" }, 293{ "Home Address Locality","Privat Adresse Stadt" },
294{ "Home Address Region","Privat Adresse Bundesland" }, 294{ "Home Address Region","Privat Adresse Bundesland" },
295{ "Home Address Postal Code","Privat Adresse PLZ" }, 295{ "Home Address Postal Code","Privat Adresse PLZ" },
296{ "Home Address Country","Privat Adresse Land" }, 296{ "Home Address Country","Privat Adresse Land" },
297{ "Home Address Label","Privat Adresse Label" }, 297{ "Home Address Label","Privat Adresse Label" },
298{ "Business Address Street","Büro Adresse Strasse" }, 298{ "Business Address Street","Büro Adresse Strasse" },
299{ "Business Address Locality","Büro Adresse Stadt" }, 299{ "Business Address Locality","Büro Adresse Stadt" },
300{ "Business Address Region","Büro Adresse Bundesland" }, 300{ "Business Address Region","Büro Adresse Bundesland" },
301{ "Business Address Postal Code","Büro Adresse PLZ" }, 301{ "Business Address Postal Code","Büro Adresse PLZ" },
302{ "Business Address Country","Büro Adresse Land" }, 302{ "Business Address Country","Büro Adresse Land" },
303{ "Business Address Label","Büro Adresse Label" }, 303{ "Business Address Label","Büro Adresse Label" },
304{ "Home Phone","Privat Telefon" }, 304{ "Home Phone","Privat Telefon" },
305{ "Business Phone","Büro Telefon" }, 305{ "Business Phone","Büro Telefon" },
306{ "Mobile Phone","Handy" }, 306{ "Mobile Phone","Handy" },
307{ "Home Fax","Privat Fax" }, 307{ "Home Fax","Privat Fax" },
308{ "Business Fax","Büro Fax" }, 308{ "Business Fax","Büro Fax" },
309{ "Car Phone","Autotelefon" }, 309{ "Car Phone","Autotelefon" },
310{ "ISDN","ISDN" }, 310{ "ISDN","ISDN" },
311{ "Pager","Pager" }, 311{ "Pager","Pager" },
312{ "Mail Client","Mail Client" }, 312{ "Mail Client","Mail Client" },
313{ "Title","Titel" }, 313{ "Title","Titel" },
314{ "Role","Rolle" }, 314{ "Role","Rolle" },
315{ "Note","Notiz" }, 315{ "Note","Notiz" },
316{ "URL","URL" }, 316{ "URL","URL" },
317{ "Resource","Resource" }, 317{ "Resource","Resource" },
318{ "SIP","SIP" }, 318{ "SIP","SIP" },
319{ "Default Filter","Default Filter" }, 319{ "Default Filter","Default Filter" },
320{ "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." }, 320{ "The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime.","#The default filter will be activated whenever this view is displayed. This feature allows you to configure views that only interact with certain types of information based on the filter. Once the view is activated, the filter can be changed at anytime." },
321{ "No default filter","Kein default Filter" }, 321{ "No default filter","Kein default Filter" },
322{ "Use last active filter","Nutze letzen aktiven Filter" }, 322{ "Use last active filter","Nutze letzen aktiven Filter" },
323{ "Use filter:","Nutze Filter:" }, 323{ "Use filter:","Nutze Filter:" },
324{ "Look & Feel","Look & Feel" }, 324{ "Look & Feel","Look & Feel" },
325{ "Row Separator","Reihen Separator" }, 325{ "Row Separator","Reihen Separator" },
326{ "Alternating backgrounds","Abwechselnder Hintergrund" }, 326{ "Alternating backgrounds","Abwechselnder Hintergrund" },
327{ "Single line","Einzelne Zeile" }, 327{ "Single line","Einzelne Zeile" },
328{ "Enable background image:","Hintergrundbild:" }, 328{ "Enable background image:","Hintergrundbild:" },
329{ "Enable contact tooltips","Contact Tooltips" }, 329{ "Enable contact tooltips","Contact Tooltips" },
330{ "&Enable custom Colors","Benutzerdef. Farben" }, 330{ "&Enable custom Colors","Benutzerdef. Farben" },
331{ "&Colors","Farben" }, 331{ "&Colors","Farben" },
332{ "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." }, 332{ "If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used.","#If custom colors are enabled, you may choose the colors for the view below. Otherwise colors from your current KDE color scheme are used." },
333{ "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." }, 333{ "Double click or press RETURN on a item to select a color for the related strings in the view.","#Double click or press RETURN on a item to select a color for the related strings in the view." },
334{ "&Enable custom fonts","B&enutzerdefinierte Schriften" }, 334{ "&Enable custom fonts","B&enutzerdefinierte Schriften" },
335{ "&Text font:","Textschriftart:" }, 335{ "&Text font:","Textschriftart:" },
336{ "&Header font:","Titelschriftart:" }, 336{ "&Header font:","Titelschriftart:" },
337{ "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." }, 337{ "If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data.","#If custom fonts are enabled, you may choose which fonts to use for this view below. Otherwise the default KDE font will be used, in bold style for the header and normal style for the data." },
338{ "&Fonts","Schri&ften" }, 338{ "&Fonts","Schri&ften" },
339{ "Background Color","Hintergrundfarbe" }, 339{ "Background Color","Hintergrundfarbe" },
340{ "Text Color","Textfarbe" }, 340{ "Text Color","Textfarbe" },
341{ "Header Background Color","Titel Hintergrundfarbe" }, 341{ "Header Background Color","Titel Hintergrundfarbe" },
342{ "Header Text Color","Titel Farbe" }, 342{ "Header Text Color","Titel Farbe" },
343{ "Highlight Color","Auswahlfarbe" }, 343{ "Highlight Color","Auswahlfarbe" },
344{ "Highlighted Text Color","Auswahltextfarbe" }, 344{ "Highlighted Text Color","Auswahltextfarbe" },
345{ "Alternating Background Color","Abwechselnder Hintergrundfarbe" }, 345{ "Alternating Background Color","Abwechselnder Hintergrundfarbe" },
346{ "Postal","Post" }, 346{ "Postal","Post" },
347{ "Dr.","Dr." }, 347{ "Dr.","Dr." },
348{ "Miss","Frl." }, 348{ "Miss","Frl." },
349{ "Mr.","Herr" }, 349{ "Mr.","Herr" },
350{ "Mrs.","Frau" }, 350{ "Mrs.","Frau" },
351{ "Ms.","Fr." }, 351{ "Ms.","Fr." },
352{ "Prof.","Prof." }, 352{ "Prof.","Prof." },
353{ "I","I" }, 353{ "I","I" },
354{ "II","II" }, 354{ "II","II" },
355{ "III","III" }, 355{ "III","III" },
356{ "Jr.","Jr." }, 356{ "Jr.","Jr." },
357{ "Sr.","Sr." }, 357{ "Sr.","Sr." },
358{ "Name:","Name:" }, 358{ "Name:","Name:" },
359{ "Documents","Dokumente" }, 359{ "Documents","Dokumente" },
360{ "Files","Dateien" }, 360{ "Files","Dateien" },
361{ "All Files","Alle Dateien" }, 361{ "All Files","Alle Dateien" },
362{ "Name","Name" }, 362{ "Name","Name" },
363{ "Size","Größe" }, 363{ "Size","Größe" },
364{ "Date","Datum" }, 364{ "Date","Datum" },
365{ "Mime Type","Mime Typ" }, 365{ "Mime Type","Mime Typ" },
366{ "Geo Data Input","Geo Dateneingabe" }, 366{ "Geo Data Input","Geo Dateneingabe" },
367{ "Sexagesimal","Sexagesimal" }, 367{ "Sexagesimal","Sexagesimal" },
368{ "North","Nord" }, 368{ "North","Nord" },
369{ "South","Süd" }, 369{ "South","Süd" },
370{ "East","Ost" }, 370{ "East","Ost" },
371{ "West","West" }, 371{ "West","West" },
372{ "Undefined","Unbestimmt" }, 372{ "Undefined","Unbestimmt" },
373{ "Edit Address","Bearbeite Adresse" }, 373{ "Edit Address","Bearbeite Adresse" },
374{ "Street:","Strasse:" }, 374{ "Street:","Strasse:" },
375{ "Post office box:","Postfach:" }, 375{ "Post office box:","Postfach:" },
376{ "Locality:","Stadt:" }, 376{ "Locality:","Stadt:" },
377{ "Region:","Region:" }, 377{ "Region:","Region:" },
378{ "Postal code:","PLZ:" }, 378{ "Postal code:","PLZ:" },
379{ "Country:","Staat:" }, 379{ "Country:","Staat:" },
380{ "This is the preferred address","Dies ist die bevorzugte Adresse" }, 380{ "This is the preferred address","Dies ist die bevorzugte Adresse" },
381{ "New...","Neu..." }, 381{ "New...","Neu..." },
382{ "Change Type","Ändere Art" }, 382{ "Change Type","Ändere Art" },
383{ "Edit Address Type","Ändere Address Art" }, 383{ "Edit Address Type","Ändere Address Art" },
384{ "Address Types","Address Art" }, 384{ "Address Types","Address Art" },
385{ "Domestic","Inland" }, 385{ "Domestic","Inland" },
386{ "International","International" }, 386{ "International","International" },
387{ "Parcel","Paket" }, 387{ "Parcel","Paket" },
388{ "Edit Contact Name","Ändere Kontakt Name" }, 388{ "Edit Contact Name","Ändere Kontakt Name" },
389{ "Honorific prefixes:","Namensprefixes:" }, 389{ "Honorific prefixes:","Namensprefixes:" },
390{ "Given name:","Vorname:" }, 390{ "Given name:","Vorname:" },
391{ "Additional names:","Mittelnamen:" }, 391{ "Additional names:","Mittelnamen:" },
392{ "Family names:","Nachname:" }, 392{ "Family names:","Nachname:" },
393{ "Honorific suffixes:","Namenssuffixe:" }, 393{ "Honorific suffixes:","Namenssuffixe:" },
394{ "Parse name automatically","Setze Namen automatisch" }, 394{ "Parse name automatically","Setze Namen automatisch" },
395{ "Edit Phone Numbers","Bearbeite Telefonnummern" }, 395{ "Edit Phone Numbers","Bearbeite Telefonnummern" },
396{ "Number","Nummer" }, 396{ "Number","Nummer" },
397{ "Type","Typ" }, 397{ "Type","Typ" },
398{ "Edit Phone Number","Bearbeite Telefonnummer" }, 398{ "Edit Phone Number","Bearbeite Telefonnummer" },
399{ "Number:","Nummer:" }, 399{ "Number:","Nummer:" },
400{ "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" }, 400{ "This is the preferred phone number","Dies ist die bevorzugte Telefonnummer" },
401{ "Types","Typen" }, 401{ "Types","Typen" },
402{ "Messenger","Messenger" }, 402{ "Messenger","Messenger" },
403{ "Other","Anderes" }, 403{ "Other","Anderes" },
404{ "Video","Video" }, 404{ "Video","Video" },
405{ "Mailbox","Mailbox" }, 405{ "Mailbox","Mailbox" },
406{ "Modem","Modem" }, 406{ "Modem","Modem" },
407{ "Car","Auto" }, 407{ "Car","Auto" },
408{ "PCS","PCS" }, 408{ "PCS","PCS" },
409{ "Category","Kategorie" }, 409{ "Category","Kategorie" },
410{ "Select Categories","Wähle Kategorien" }, 410{ "Select Categories","Wähle Kategorien" },
411{ " &Deselect All "," &Deselektiere alle " }, 411{ " &Deselect All "," &Deselektiere alle " },
412{ " &Edit Categories "," B&earbeite Kategorien " }, 412{ " &Edit Categories "," B&earbeite Kategorien " },
413{ "&OK","&OK" }, 413{ "&OK","&OK" },
414{ "&Cancel","Abbre&chen" }, 414{ "&Cancel","Abbre&chen" },
415{ "Configure","Konfiguriere" }, 415{ "Configure","Konfiguriere" },
416{ "Default","Voreinstellungen" }, 416{ "Default","Voreinstellungen" },
417{ "Addressbook","Adressbuch" }, 417{ "Addressbook","Adressbuch" },
418{ "Details view font","Schriftart Detailansicht" }, 418{ "Details view font","Schriftart Detailansicht" },
419{ "phone:123","phone:123" }, 419{ "phone:123","phone:123" },
420{ "Search only after <return> key pressed","Suche nur nach <return> Taste" }, 420{ "Search only after <return> key pressed","Suche nur nach <return> Taste" },
421{ "Honor KDE single click","Benutze KDE Einzelklick" }, 421{ "Honor KDE single click","Benutze KDE Einzelklick" },
422{ "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" }, 422{ "Automatic name parsing for new addressees","Automa. Name Parsen für neue Einträge" },
423{ "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" }, 423{ "Display List and Details at once (restart)","Zeige Liste und Details zusammen(neustart)" },
424{ "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" }, 424{ "Ask for quit when closing Ka/Pi","Vor Beenden von Ka/Pi nachfragen" },
425{ "General","Allgemein" }, 425{ "General","Allgemein" },
426{ "Extensions (restart)","Extensions (restart)" }, 426{ "Extensions (restart)","Extensions (restart)" },
427{ "Description","Beschreibungen" }, 427{ "Description","Beschreibungen" },
428{ "Extensions","Extensions" }, 428{ "Extensions","Extensions" },
429{ "Prefixes","Prefixe" }, 429{ "Prefixes","Prefixe" },
430{ "Inclusions","Inclusions" }, 430{ "Inclusions","Inclusions" },
431{ "Suffixes","Suffixe" }, 431{ "Suffixes","Suffixe" },
432{ "Default formatted name:","Default format. Name:" }, 432{ "Default formatted name:","Default format. Name:" },
433{ "Empty","Leer" }, 433{ "Empty","Leer" },
434{ "Simple Name","Einfacher Name" }, 434{ "Simple Name","Einfacher Name" },
435{ "Full Name","Voller Name" }, 435{ "Full Name","Voller Name" },
436{ "Reverse Name","Namen umdrehen" }, 436{ "Reverse Name","Namen umdrehen" },
437{ "Contact","Kontakt" }, 437{ "Contact","Kontakt" },
438{ "Global","Allgemein" }, 438{ "Global","Allgemein" },
439{ "Phone","Telefon" }, 439{ "Phone","Telefon" },
440{ "SMS","SMS" }, 440{ "SMS","SMS" },
441{ "Language:(needs restart)","Sprache:(Neustart)" }, 441{ "Language:(needs restart)","Sprache:(Neustart)" },
442{ "English","English" }, 442{ "English","English" },
443{ "German","Deutsch" }, 443{ "German","Deutsch" },
444{ "French","Französisch" }, 444{ "French","Französisch" },
445{ "Italian","Italienisch" }, 445{ "Italian","Italienisch" },
446{ "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" }, 446{ "User defined (usertranslation.txt)","Benutzerdef. (usertranslation.txt)" },
447{ "Time Format(nr):","Zeit Format(nr):" }, 447{ "Time Format(nr):","Zeit Format(nr):" },
448{ "24:00","24:00" }, 448{ "24:00","24:00" },
449{ "12:00am","12:00am" }, 449{ "12:00am","12:00am" },
450{ "Week starts on Sunday","Woche beginnt Sonntags" }, 450{ "Week starts on Sunday","Woche beginnt Sonntags" },
451{ "Locale","Locale" }, 451{ "Locale","Locale" },
452{ "Date Format:","Datums Format:" }, 452{ "Date Format:","Datums Format:" },
453{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, 453{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" },
454{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, 454{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" },
455{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, 455{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" },
456{ "User defined","Benutzerdefiniert" }, 456{ "User defined","Benutzerdefiniert" },
457{ "User long date:","Format langes Datum:" }, 457{ "User long date:","Format langes Datum:" },
458{ "User short date:","Format kurzes Datum:" }, 458{ "User short date:","Format kurzes Datum:" },
459{ "Daylight start:","Sommerzeit Beginn:" }, 459{ "Daylight start:","Sommerzeit Beginn:" },
460{ "Daylight end:","Sommerzeit Ende:" }, 460{ "Daylight end:","Sommerzeit Ende:" },
461{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, 461{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" },
462{ "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" }, 462{ "Monday 19 April 2004: %A %d %B %Y","Monday 19 April 2004: %A %d %B %Y" },
463{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, 463{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" },
464{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, 464{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" },
465{ "Date Format","Datums Format" }, 465{ "Date Format","Datums Format" },
466{ "Timezone:","Zeitzone:" }, 466{ "Timezone:","Zeitzone:" },
467{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, 467{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." },
468{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, 468{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" },
469{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, 469{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" },
470{ "Used Mail Client","Benutzter Mail Client" }, 470{ "Used Mail Client","Benutzter Mail Client" },
471{ "Channel:","Channel:" }, 471{ "Channel:","Channel:" },
472{ "Message:","Message:" }, 472{ "Message:","Message:" },
473{ "Parameters:","Parameter:" }, 473{ "Parameters:","Parameter:" },
474{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, 474{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" },
475{ "extra Message:","extra Message:" }, 475{ "extra Message:","extra Message:" },
476{ "extra Parameters:","extra Parameter:" }, 476{ "extra Parameters:","extra Parameter:" },
477{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, 477{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" },
478{ "External Apps.","Externe Appl." }, 478{ "External Apps.","Externe Appl." },
479{ "Used %1 Client","Benutzer %1 Client" }, 479{ "Used %1 Client","Benutzer %1 Client" },
480{ "No email client installed","Keine Email Client installiert" }, 480{ "No email client installed","Keine Email Client installiert" },
481{ "Userdefined email client","Benutzerdef. Email Client" }, 481{ "Userdefined email client","Benutzerdef. Email Client" },
482{ "OM/Pi email client","OM/Pi Email Client" }, 482{ "OM/Pi email client","OM/Pi Email Client" },
483{ "Close KA/Pi?","Schließe KA/Pi?" }, 483{ "Close KA/Pi?","Schließe KA/Pi?" },
484{ "\nChanges will be saved!","\nÄnderungen werden gespeichert!" }, 484{ "\nChanges will be saved!","\nÄnderungen werden gespeichert!" },
485{ "Yes!","Ja!" }, 485{ "Yes!","Ja!" },
486{ "There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. ","#There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. " }, 486{ "There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. ","#There was an error while attempting to save\n the address book. Please check that some \nother application is not using it. " },
487{ "Saving addressbook ... ","Speichere Adressbuch ... " }, 487{ "Saving addressbook ... ","Speichere Adressbuch ... " },
488{ "Addressbook saved!","Adressbuch gespeichert!" }, 488{ "Addressbook saved!","Adressbuch gespeichert!" },
489{ "Default Table View","Default Tabellenansicht" }, 489{ "Default Table View","Default Tabellenansicht" },
490{ "Merge and Remove","Zusammenfügen/entfernen" }, 490{ "Merge and Remove","Zusammenfügen/entfernen" },
491{ "Merge","Zusammenfügen" }, 491{ "Merge","Zusammenfügen" },
492{ "Merge Contacts Editor","Contact-Zusammenfüge-Editor" }, 492{ "Merge Contacts Editor","Contact-Zusammenfüge-Editor" },
493{ "New List...","Neue Liste..." }, 493{ "New List...","Neue Liste..." },
494{ "Rename List...","Ändere Namen..." }, 494{ "Rename List...","Ändere Namen..." },
495{ "Remove List","Lösche Liste" }, 495{ "Remove List","Lösche Liste" },
496{ "Add Contact","Kontakt hinzu" }, 496{ "Add Contact","Kontakt hinzu" },
497{ "Change Email...","Ändere Email..." }, 497{ "Change Email...","Ändere Email..." },
498{ "Remove Contact","Entferne Kontakt" }, 498{ "Remove Contact","Entferne Kontakt" },
499{ "Use Preferred","Nutze Preferred" }, 499{ "Use Preferred","Nutze Preferred" },
500{ "Distribution List Editor","Distribution List Editor" }, 500{ "Distribution List Editor","Distribution List Editor" },
501{ "Choose which contacts to export","Wähle Kontakte zum Exportieren" }, 501{ "Choose which contacts to export","Wähle Kontakte zum Exportieren" },
502{ "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" }, 502{ "Which contacts do you want to export?","Welche Kontakte sollen exportiert werden?" },
503{ "Contact Selection","Kontaktauswahl" }, 503{ "Contact Selection","Kontaktauswahl" },
504{ "&All","&Alle" }, 504{ "&All","&Alle" },
505{ "Export the entire address book","Exportiere das komplette Addressbuch" }, 505{ "Export the entire address book","Exportiere das komplette Addressbuch" },
506{ "&Selected","Au&sgewählte" }, 506{ "&Selected","Au&sgewählte" },
507{ "Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","###Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected." }, 507{ "Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","###Only export contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected." },
508{ "By matching &filter","Zutreffender &Filter" }, 508{ "By matching &filter","Zutreffender &Filter" },
509{ "Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","###Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters" }, 509{ "Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","###Only export contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters" },
510{ "By Cate&gories","Kategorien" }, 510{ "By Cate&gories","Kategorien" },
511{ "Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","###Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories." }, 511{ "Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","###Only export contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories." },
512{ "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." }, 512{ "Select a filter to decide which contacts to export.","Wähle Filter zum Export aus." },
513{ "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." }, 513{ "Check the categories whose members you want to export.","Wähle die Kategorien zum Export aus." },
514{ "Sorting","Sortieren" }, 514{ "Sorting","Sortieren" },
515{ "Criterion:","Merkmal:" }, 515{ "Criterion:","Merkmal:" },
516{ "Order:","Reihenfolge:" }, 516{ "Order:","Reihenfolge:" },
517{ "Ascending","Aufsteigend" }, 517{ "Ascending","Aufsteigend" },
518{ "Descending","Absteigend" }, 518{ "Descending","Absteigend" },
519{ "Save file","Datei speichern" }, 519{ "Save file","Datei speichern" },
520{ "Error","Fehler" }, 520{ "Error","Fehler" },
521{ "Unable to export contacts.","Exportieren der Kontakte geht nicht." }, 521{ "Unable to export contacts.","Exportieren der Kontakte geht nicht." },
522{ "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" }, 522{ "\nNo unsaved changes detected!\nNothing will be saved!","\nKeine ungespeicherten\nÄnderungen erkannt!\nNichts wird gespeichert!" },
523{ "Manage new categories...","Verwalte neue Kategorien..." }, 523{ "Manage new categories...","Verwalte neue Kategorien..." },
524{ "&File","Datei" }, 524{ "&File","Datei" },
525{ "&Edit","Bearbeite" }, 525{ "&Edit","Bearbeite" },
526{ "&View","Ansichten" }, 526{ "&View","Ansichten" },
527{ "&Settings","Konfiguration" }, 527{ "&Settings","Konfiguration" },
528{ "&Change selected","Ändere Selekt." }, 528{ "&Change selected","Ändere Selekt." },
529{ "&Help","Hilfe" }, 529{ "&Help","Hilfe" },
530{ "Remove sync info","Entferne Sync Info" }, 530{ "Remove sync info","Entferne Sync Info" },
531{ "For all profiles","Für alle Profile" }, 531{ "For all profiles","Für alle Profile" },
532{ "&Change","Ändere" }, 532{ "&Change","Ändere" },
533{ "Import xml (Qtopia)...","Importiere xml (Qtopia)..." }, 533{ "Import xml (Qtopia)...","Importiere xml (Qtopia)..." },
534{ "Export xml (Qtopia)...","Exportiere xml (Qtopia)..." }, 534{ "Export xml (Qtopia)...","Exportiere xml (Qtopia)..." },
535{ "Export to phone","Exportiere aufs Handy..." }, 535{ "Export to phone","Exportiere aufs Handy..." },
536{ "Which contacts do you want to select?","Welche Kontakte möchten Sie wählen?" }, 536{ "Which contacts do you want to select?","Welche Kontakte möchten Sie wählen?" },
537{ "&Modify","Ändere" }, 537{ "&Modify","Ändere" },
538{ "Choose which contacts to select","Bitte Kontakte auswählen!" }, 538{ "Choose which contacts to select","Bitte Kontakte auswählen!" },
539{ "After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nKontakten geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, 539{ "After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nKontakten geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " },
540{ "Manage new Categories","Verwalte neue Kategorien" }, 540{ "Manage new Categories","Verwalte neue Kategorien" },
541{ "Add to category list","Füge zur Kategorieliste hinzu" }, 541{ "Add to category list","Füge zur Kategorieliste hinzu" },
542{ "Remove from addressees","Entferne von den Kontakten" }, 542{ "Remove from addressees","Entferne von den Kontakten" },
543{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, 543{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" },
544{ "A&dd","Hinzufügen" }, 544{ "A&dd","Hinzufügen" },
545{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, 545{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." },
546{ "NOTE: This will remove all old\ncontact data on phone!","ACHTUNG: Das löscht alle alten\nKontakt Daten auf dem Handy!" }, 546{ "NOTE: This will remove all old\ncontact data on phone!","ACHTUNG: Das löscht alle alten\nKontakt Daten auf dem Handy!" },
547{ "Export to mobile phone!","Exportiere auf das Handy!" }, 547{ "Export to mobile phone!","Exportiere auf das Handy!" },
548{ "Export to phone options","Export ans Handy Optionen" }, 548{ "Export to phone options","Export ans Handy Optionen" },
549{ "Writing to phone...","Sende Daten ans Handy..." }, 549{ "Writing to phone...","Sende Daten ans Handy..." },
550{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, 550{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" },
551{ "Retry","Nochmal versuchen" }, 551{ "Retry","Nochmal versuchen" },
552{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, 552{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" },
553{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, 553{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" },
554{ "Error exporting to phone!","Fehler beim Export auf das Handy!" }, 554{ "Error exporting to phone!","Fehler beim Export auf das Handy!" },
555{ "&Print View","Drucke Ansicht" }, 555{ "&Print View","Drucke Ansicht" },
556{ "&Print Details","Drucke Details" }, 556{ "&Print Details","Drucke Details" },
557{ "Beam v&Card(s)...","Beame v&Card(s)..." }, 557{ "Beam v&Card(s)...","Beame v&Card(s)..." },
558{ "Set formatted name...","Setze formatierten Namen..." }, 558{ "Set formatted name...","Setze formatierten Namen..." },
559{ "Kde Sync HowTo","Kde Sync HowTo" }, 559{ "Kde Sync HowTo","Kde Sync HowTo" },
560{ "Multi Sync HowTo","Multi Sync HowTo" }, 560{ "Multi Sync HowTo","Multi Sync HowTo" },
561{ "&Beam","&Beame" }, 561{ "&Beam","&Beame" },
562{ "Edit Email Addresses","Editiere Email Adressen" }, 562{ "Edit Email Addresses","Editiere Email Adressen" },
563{ "Email address:","Email Adresse:" }, 563{ "Email address:","Email Adresse:" },
564{ "Change","Ändere" }, 564{ "Change","Ändere" },
565{ "Set Standard","Setze Standard" }, 565{ "Set Standard","Setze Standard" },
566{ "New Contact","Neuer Contact" }, 566{ "New Contact","Neuer Contact" },
567{ "Undo %1","Rückgängig %1" }, 567{ "Undo %1","Rückgängig %1" },
568{ "Redo","Wiederholen" }, 568{ "Redo","Wiederholen" },
569{ "Saving ... please wait! ","Am Speichern ... bitte warten! " }, 569{ "Saving ... please wait! ","Am Speichern ... bitte warten! " },
570{ "CSV Import Dialog","CSV Import Dialog" }, 570{ "CSV Import Dialog","CSV Import Dialog" },
571{ "File to import:","Datei zum Import:" }, 571{ "File to import:","Datei zum Import:" },
572{ "Delimiter","Trennzeichen" }, 572{ "Delimiter","Trennzeichen" },
573{ "Comma","Komma" }, 573{ "Comma","Komma" },
574{ "Semicolon","Semikolon" }, 574{ "Semicolon","Semikolon" },
575{ "Tabulator","Tabulator" }, 575{ "Tabulator","Tabulator" },
576{ "Space","Leerzeichen" }, 576{ "Space","Leerzeichen" },
577{ "1","1" }, 577{ "1","1" },
578{ """,""" }, 578{ """,""" },
579{ "'","'" }, 579{ "'","'" },
580{ "Start at line:","Beginne mit Zeile:" }, 580{ "Start at line:","Beginne mit Zeile:" },
581{ "Textquote:","Textquote:" }, 581{ "Textquote:","Textquote:" },
582{ "Ignore duplicate delimiters","Ignoriere doppelte Trennzeichen" }, 582{ "Ignore duplicate delimiters","Ignoriere doppelte Trennzeichen" },
583{ "Import KDE 2 Addressbook","Importiere KDE 2 Addressbook" }, 583{ "Import KDE 2 Addressbook","Importiere KDE 2 Addressbook" },
584{ "Override previously imported entries?","Überschreibe bereits importierte Einträge?" }, 584{ "Override previously imported entries?","Überschreibe bereits importierte Einträge?" },
585{ "Select vCard to Import","Selektiere zu importierende vCard" }, 585{ "Select vCard to Import","Selektiere zu importierende vCard" },
586{ "Information","Information" }, 586{ "Information","Information" },
587{ "contacts successfully imported.","Kontakte erfolgreich importiert." }, 587{ "contacts successfully imported.","Kontakte erfolgreich importiert." },
588{ "Import xml file","Importiere xml Datei" }, 588{ "Import xml file","Importiere xml Datei" },
589{ "Choose contact selection","Wähle Kontakt Auswahl" }, 589{ "Choose contact selection","Wähle Kontakt Auswahl" },
590{ "Select the entire address book","Wähle das ganze Adressbuch" }, 590{ "Select the entire address book","Wähle das ganze Adressbuch" },
591{ "Only contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","Nur in KA/Pi selektierte Kontate.\nDiese Option ist nicht verfügbar\nwhen keine Kontakte selektiert sind." }, 591{ "Only contacts selected in KAddressBook.\nThis option is disabled if no contacts are selected.","Nur in KA/Pi selektierte Kontate.\nDiese Option ist nicht verfügbar\nwhen keine Kontakte selektiert sind." },
592{ "Only contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","Nur Kontakte die auf den Filter zutreffen.\nDiese Option ist nicht verfügbar, wenn keine Filter definiert sind." }, 592{ "Only contacts matching the selected filter.\nThis option is disabled if you haven't defined any filters","Nur Kontakte die auf den Filter zutreffen.\nDiese Option ist nicht verfügbar, wenn keine Filter definiert sind." },
593{ "Only contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","Nur Kontakte die Mitglieder der Kategirien sind,\die links selektiert sind.\nDiese Option ist nicht verfügbar, wenn es keine Kategirien gibt." }, 593{ "Only contacts who are members of a category that is checked on the list to the left.\nThis option is disabled if you have no categories.","Nur Kontakte die Mitglieder der Kategirien sind,\die links selektiert sind.\nDiese Option ist nicht verfügbar, wenn es keine Kategirien gibt." },
594{ "Select a filter to decide which contacts to select.","Selektiere einen Filter um festzulegen welche Kontakte ausgewählt werden sollen." }, 594{ "Select a filter to decide which contacts to select.","Selektiere einen Filter um festzulegen welche Kontakte ausgewählt werden sollen." },
595{ "Check the categories whose members you want to select.","Setzte die Kategorien, dessen Mitglieder Sie auswählen möchten." }, 595{ "Check the categories whose members you want to select.","Setzte die Kategorien, dessen Mitglieder Sie auswählen möchten." },
596{ "I/O device: ","I/O device: " }, 596{ "I/O device: ","I/O device: " },
597{ "Connection: ","Connection: " }, 597{ "Connection: ","Connection: " },
598{ "Model(opt.): ","Model(opt.): " }, 598{ "Model(opt.): ","Model(opt.): " },
599{ "Exporting to phone...","Exportiere aufs Handy..." }, 599{ "Exporting to phone...","Exportiere aufs Handy..." },
600{ "Error exporting to phone","Fehler beim Export aufs Handy" }, 600{ "Error exporting to phone","Fehler beim Export aufs Handy" },
601{ "contacts successfully exported.","Kontakte erfolgreich exportiert." }, 601{ "contacts successfully exported.","Kontakte erfolgreich exportiert." },
602{ "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" }, 602{ "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" },
603{ "Set formatted name","Setze formatierten Namen" }, 603{ "Set formatted name","Setze formatierten Namen" },
604{ "You can set the formatted name\nfor a list of contacts in one go.","Sie können den formatierten Namen für\nein Liste von Kontakten auf einmal setzen." }, 604{ "You can set the formatted name\nfor a list of contacts in one go.","Sie können den formatierten Namen für\nein Liste von Kontakten auf einmal setzen." },
605{ "Set formatted name to:","Setze formatierten Name auf:" }, 605{ "Set formatted name to:","Setze formatierten Name auf:" },
606{ "Simple: James Bond","Einfach: James Bond" }, 606{ "Simple: James Bond","Einfach: James Bond" },
607{ "Full: Mr. James 007 Bond I","Voll: Mr. James 007 Bond I" }, 607{ "Full: Mr. James 007 Bond I","Voll: Mr. James 007 Bond I" },
608{ "Reverse: Bond, James","Umgekehrt: Bond, James" }, 608{ "Reverse: Bond, James","Umgekehrt: Bond, James" },
609{ "Organization: MI6","Organisation: MI6" }, 609{ "Organization: MI6","Organisation: MI6" },
610{ "Set formatted name to\norganization, if name empty","Setze formatierten Namen auf\nOrganisation, wenn Name leer ist." }, 610{ "Set formatted name to\norganization, if name empty","Setze formatierten Namen auf\nOrganisation, wenn Name leer ist." },
611{ "Select contact list","Selektiere Kontakt Liste" }, 611{ "Select contact list","Selektiere Kontakt Liste" },
612{ "Changing contact #%1","Ändere Kontakt #%1" }, 612{ "Changing contact #%1","Ändere Kontakt #%1" },
613{ "Refreshing view...","Lade Ansicht neu..." }, 613{ "Refreshing view...","Lade Ansicht neu..." },
614{ "Setting formatted name completed!","Setzen vom formatierten Namen beendet!" }, 614{ "Setting formatted name completed!","Setzen vom formatierten Namen beendet!" },
615{ "Removing voice...","Entferne voice..." }, 615{ "Removing voice...","Entferne voice..." },
616{ "Remove voice completed!","Entferne voice beendet!" }, 616{ "Remove voice completed!","Entferne voice beendet!" },
617{ "Merge with existing categories?","Zu bestehenden\nKategorien hinzufügen?" }, 617{ "Merge with existing categories?","Zu bestehenden\nKategorien hinzufügen?" },
618{ "Setting categories ... please wait!","Setze Kategorien ... bitte warten!" }, 618{ "Setting categories ... please wait!","Setze Kategorien ... bitte warten!" },
619{ "Setting categories completed!","Setzen der Kategorien beendet!" }, 619{ "Setting categories completed!","Setzen der Kategorien beendet!" },
620{ "OK","OK" }, 620{ "OK","OK" },
621{ "Please wait, processing categories...","Bitte warten, bearbeite Kategorien..." }, 621{ "Please wait, processing categories...","Bitte warten, bearbeite Kategorien..." },
622{ "Processing contact #%1","Bearbeite Kontakt #%1" }, 622{ "Processing contact #%1","Bearbeite Kontakt #%1" },
623{ " categories added to list! "," Kategorien zur Liste hinzugefügt! " }, 623{ " categories added to list! "," Kategorien zur Liste hinzugefügt! " },
624{ "%1: %2","%1: %2" }, 624{ "%1: %2","%1: %2" },
625{ "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n","Ihr persönlicher Kontakt ist\nnicht gesetzt! Bitte selektieren Sie\nihn und setzen ihn mit Menu:\nKonfiguration - Setze wer bin ich\n" }, 625{ "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n","Ihr persönlicher Kontakt ist\nnicht gesetzt! Bitte selektieren Sie\nihn und setzen ihn mit Menu:\nKonfiguration - Setze wer bin ich\n" },
626{ "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>","<qt>Wollen Sie wirklich<br><b>%1</b><br>als persönlichen Kontakt setzent?</qt>" }, 626{ "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>","<qt>Wollen Sie wirklich<br><b>%1</b><br>als persönlichen Kontakt setzent?</qt>" },
627{ "Cut","Ausschneiden" }, 627{ "Cut","Ausschneiden" },
628{ "Paste","Einfügen" }, 628{ "Paste","Einfügen" },
629{ "Delete","Löschen" }, 629{ "Delete","Löschen" },
630{ "Choose...","Wähle..." }, 630{ "Choose...","Wähle..." },
631{ "Add View","Ansicht hinzufügen" }, 631{ "Add View","Ansicht hinzufügen" },
632{ "View name:","Ansicht Name:" }, 632{ "View name:","Ansicht Name:" },
633{ "View Type","Ainsicht Typ" }, 633{ "View Type","Ainsicht Typ" },
634{ "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." }, 634{ "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." },
635{ "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." }, 635{ "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." },
636{ "Rolodex style cards represent contacts.","Rolodex Stil Karten repräsentieren Kontakte." }, 636{ "Rolodex style cards represent contacts.","Rolodex Stil Karten repräsentieren Kontakte." },
637{ "Draw &separators","Zeichne &Trennlinie" }, 637{ "Draw &separators","Zeichne &Trennlinie" },
638{ "Separator &width:","Trennlinien &Breite:" }, 638{ "Separator &width:","Trennlinien &Breite:" },
639{ "&Padding:","Füllung:" }, 639{ "&Padding:","Füllung:" },
640{ "Cards","Karten" }, 640{ "Cards","Karten" },
641{ "&Margin:","&Rand:" }, 641{ "&Margin:","&Rand:" },
642{ "Draw &borders","Zeichne Ränder" }, 642{ "Draw &borders","Zeichne Ränder" },
643{ "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data.","The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data." }, 643{ "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data.","The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data." },
644{ "The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators.","The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators." }, 644{ "The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators.","The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators." },
645{ "Sets the width of column separators","Sets the width of column separators" }, 645{ "Sets the width of column separators","Sets the width of column separators" },
646{ "&Layout","&Layout" }, 646{ "&Layout","&Layout" },
647{ "Show &empty fields","Zeige leere Felder" }, 647{ "Show &empty fields","Zeige leere Felder" },
648{ "Show field &labels","Zeige Feld Label" }, 648{ "Show field &labels","Zeige Feld Label" },
649{ "Be&havior","Ver&halten" }, 649{ "Be&havior","Ver&halten" },
650{ "Header, Border and Separator Color","Kopf, Rand und Trennlinien Farbe" }, 650{ "Header, Border and Separator Color","Kopf, Rand und Trennlinien Farbe" },
651{ "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>","<qt>Sind Sie sicher, dass Sie die Ansicht <b>%1</b> löschen möchten?</qt>" }, 651{ "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>","<qt>Sind Sie sicher, dass Sie die Ansicht <b>%1</b> löschen möchten?</qt>" },
652{ "Confirm Delete","Bestätige Löschen" }, 652{ "Confirm Delete","Bestätige Löschen" },
653{ "Edit Address Book Filter","Editiere Adressbuch Filter" }, 653{ "Edit Address Book Filter","Editiere Adressbuch Filter" },
654{ "Category rule","Kategorie Regel" }, 654{ "Category rule","Kategorie Regel" },
655{ "Include categories","Inklusive" }, 655{ "Include categories","Inklusive" },
656{ "Exclude categories","Exclusive" }, 656{ "Exclude categories","Exclusive" },
657{ "Include contacts, that are:","Schließe folgende Kontakte ein:" }, 657{ "Include contacts, that are:","Schließe folgende Kontakte ein:" },
658{ "public","Öffentlich" }, 658{ "public","Öffentlich" },
659{ "private","Privat" }, 659{ "private","Privat" },
660{ "confidential","Vertraulich" }, 660{ "confidential","Vertraulich" },
661{ "Configure Resources","Konfiguriere Resourcen" }, 661{ "Configure Resources","Konfiguriere Resourcen" },
662{ "Resource Configuration","Resource Konfiguration" }, 662{ "Resource Configuration","Resource Konfiguration" },
663{ "Resources","Resourcen" }, 663{ "Resources","Resourcen" },
664{ "Standard","Standard" }, 664{ "Standard","Standard" },
665{ "&Use as Standard","Setze als Standard" }, 665{ "&Use as Standard","Setze als Standard" },
666{ "Select type of the new resource:","Selektiere Typ der neuen Resource:" }, 666{ "Select type of the new resource:","Selektiere Typ der neuen Resource:" },
667{ "General Settings","Allgemeine Einstellungen" }, 667{ "General Settings","Allgemeine Einstellungen" },
668{ "Read-only","Nur-Lesen" }, 668{ "Read-only","Nur-Lesen" },
669{ "Include in sync","Schließe in Sync mit ein" }, 669{ "Include in sync","Schließe in Sync mit ein" },
670{ "%1 Resource Settings","%1 Resource Einstellungen" }, 670{ "%1 Resource Settings","%1 Resource Einstellungen" },
671{ "Format:","Format:" }, 671{ "Format:","Format:" },
672{ "Location:","Ort:" }, 672{ "Location:","Ort:" },
673{ "Full Menu bar (restart)","Volle Menu Leiste (Neustart!)" }, 673{ "Full Menu bar (restart)","Volle Menu Leiste (Neustart!)" },
674{ "Language","Sprache" }, 674{ "Language","Sprache" },
675{ "Time Format","Zeit Format" }, 675{ "Time Format","Zeit Format" },
676{ "Time Zone","Zeit Zone" }, 676{ "Time Zone","Zeit Zone" },
677{ "Data storage path","Daten Speicherpfad" }, 677{ "Data storage path","Daten Speicherpfad" },
678{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, 678{ "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" },
679{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, 679{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" },
680{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, 680{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" },
681{ "Save settings","Speichere Einstellungen" }, 681{ "Save settings","Speichere Einstellungen" },
682{ "Save standard","Speichere Standard" }, 682{ "Save standard","Speichere Standard" },
683{ "Save","Speichern" }, 683{ "Save","Speichern" },
684{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, 684{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
685{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, 685{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
686{ "Multiple Sync options","Multi Sync Optionen" }, 686{ "Multiple Sync options","Multi Sync Optionen" },
687{ "Sync algo options","Sync Ablauf Optionen" }, 687{ "Sync algo options","Sync Ablauf Optionen" },
688{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, 688{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" },
689{ "Incoming calendar filter:","Eingehender Kalender Filter:" }, 689{ "Incoming calendar filter:","Eingehender Kalender Filter:" },
690{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, 690{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" },
691{ "Write back options","Optionen zum Zurückschreiben" }, 691{ "Write back options","Optionen zum Zurückschreiben" },
692{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, 692{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" },
693{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, 693{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" },
694{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, 694{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" },
695{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, 695{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" },
696{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, 696{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" },
697{ "Time period","Zeitspanne" }, 697{ "Time period","Zeitspanne" },
698{ "From ","Von " }, 698{ "From ","Von " },
699{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, 699{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " },
700{ " weeks in the future "," Wochen in der Zukunft " }, 700{ " weeks in the future "," Wochen in der Zukunft " },
701{ "Profile kind specific settings","Profil Art abhängige Einstellungen" }, 701{ "Profile kind specific settings","Profil Art abhängige Einstellungen" },
702{ "Local temp file:","Lokale temp Datei:" }, 702{ "Local temp file:","Lokale temp Datei:" },
703{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, 703{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" },
704{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, 704{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" },
705{ "You cannot remove your standard resource!\n Please select a new standard resource first.","Standard Resource kann\nnicht entfernt werden!\nBitte eine andere Resource\nals Standard setzen." }, 705{ "You cannot remove your standard resource!\n Please select a new standard resource first.","Standard Resource kann\nnicht entfernt werden!\nBitte eine andere Resource\nals Standard setzen." },
706{ "Sorry","Tut mir leid" }, 706{ "Sorry","Tut mir leid" },
707{ "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" }, 707{ "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" },
708{ "Please restart to get the \nchanged resources (re)loaded!\n","Bitte starten Sie jetzt\ndas Programm neu, um die geänderten\nResourcen neu zu laden!\n" }, 708{ "Please restart to get the \nchanged resources (re)loaded!\n","Bitte starten Sie jetzt\ndas Programm neu, um die geänderten\nResourcen neu zu laden!\n" },
709{ "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n","Die gewählte Datei enthält\nkeine gültige vCard.\nBitte prüfen Sie die Datei\nund versuchen es erneut.\n" }, 709{ "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n","Die gewählte Datei enthält\nkeine gültige vCard.\nBitte prüfen Sie die Datei\nund versuchen es erneut.\n" },
710{ "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" }, 710{ "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" },
711{ "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" }, 711{ "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" },
712{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, 712{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
713{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, 713{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
714{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, 714{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
715{ "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, 715{ "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" },
716{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, 716{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
717{ "Error","Fehler" }, 717{ "Error","Fehler" },
718{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, 718{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
719{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 719{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
720{ "Warning","Warnung" }, 720{ "Warning","Warnung" },
721{ "Select week number","Wähle Wochen Nummer" }, 721{ "Select week number","Wähle Wochen Nummer" },
722{ "Februar","Februar" }, 722{ "Februar","Februar" },
723{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 723{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
724{ "Password for remote access:","Passwort für fernen Zugriff:" }, 724{ "Password for remote access:","Passwort für fernen Zugriff:" },
725{ "Remote IP address:","Ferne IP Adresse:" }, 725{ "Remote IP address:","Ferne IP Adresse:" },
726{ "Remote port number:","Ferne Port Nummer:" }, 726{ "Remote port number:","Ferne Port Nummer:" },
727{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 727{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
728{ "Remote from: ","Fern von: " }, 728{ "Remote from: ","Fern von: " },
729{ "Local from: ","Lokal von: " }, 729{ "Local from: ","Lokal von: " },
730{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, 730{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" },
731{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 731{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
732{ "Write back","Schreibe zurück" }, 732{ "Write back","Schreibe zurück" },
733{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 733{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
734{ "Received sync request","Sync Anfrage erhalten" }, 734{ "Received sync request","Sync Anfrage erhalten" },
735{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, 735{ "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." },
736{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 736{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
737{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 737{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
738{ "Sending file...","Sende Datei..." }, 738{ "Sending file...","Sende Datei..." },
739{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 739{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
740{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 740{ "Receiving synced file...","Gesyncte Daten erhalten..." },
741{ "Received %1 bytes","%1 Bytes erhalten" }, 741{ "Received %1 bytes","%1 Bytes erhalten" },
742{ "Writing file to disk...","Speichere Datei..." }, 742{ "Writing file to disk...","Speichere Datei..." },
743{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 743{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
744{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 744{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
745{ "Synchronize!","Synchronisiere!" }, 745{ "Synchronize!","Synchronisiere!" },
746{ "High clock skew!","Großer Uhrzeitunterschied!" }, 746{ "High clock skew!","Großer Uhrzeitunterschied!" },
747{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 747{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
748{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, 748{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
749{ "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, 749{ "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" },
750{ "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" }, 750{ "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" },
751{ "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" }, 751{ "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" },
752{ "","" }, 752{ "Edit new contact","Bearbeite neuen Kontakt" },
753{ "","" }, 753{ "Edit ","Bearbeite " },
754{ "","" }, 754{ "","" },
755{ "","" }, 755{ "","" },
756{ "","" }, 756{ "","" },
757{ "","" }, 757{ "","" },
758{ "","" }, \ No newline at end of file 758{ "","" }, \ No newline at end of file
diff --git a/bin/kdepim/kaddressbook/icons16/ic_family.png b/bin/kdepim/kaddressbook/icons16/ic_family.png
new file mode 100644
index 0000000..6b0dec6
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons16/ic_family.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons16/ic_female.png b/bin/kdepim/kaddressbook/icons16/ic_female.png
new file mode 100644
index 0000000..c427605
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons16/ic_female.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons16/ic_kids.png b/bin/kdepim/kaddressbook/icons16/ic_kids.png
new file mode 100644
index 0000000..fdbdabc
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons16/ic_kids.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons16/ic_male.png b/bin/kdepim/kaddressbook/icons16/ic_male.png
new file mode 100644
index 0000000..f22eaab
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons16/ic_male.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons16/ic_penguin.png b/bin/kdepim/kaddressbook/icons16/ic_penguin.png
new file mode 100644
index 0000000..a78da37
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons16/ic_penguin.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons16/package_toys.png b/bin/kdepim/kaddressbook/icons16/package_toys.png
deleted file mode 100644
index eea4fc7..0000000
--- a/bin/kdepim/kaddressbook/icons16/package_toys.png
+++ b/dev/null
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons22/ic_family.png b/bin/kdepim/kaddressbook/icons22/ic_family.png
new file mode 100644
index 0000000..6b0dec6
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons22/ic_family.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons22/ic_female.png b/bin/kdepim/kaddressbook/icons22/ic_female.png
new file mode 100644
index 0000000..c427605
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons22/ic_female.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons22/ic_kids.png b/bin/kdepim/kaddressbook/icons22/ic_kids.png
new file mode 100644
index 0000000..fdbdabc
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons22/ic_kids.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons22/ic_male.png b/bin/kdepim/kaddressbook/icons22/ic_male.png
new file mode 100644
index 0000000..f22eaab
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons22/ic_male.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons22/ic_penguin.png b/bin/kdepim/kaddressbook/icons22/ic_penguin.png
new file mode 100644
index 0000000..a78da37
--- a/dev/null
+++ b/bin/kdepim/kaddressbook/icons22/ic_penguin.png
Binary files differ
diff --git a/bin/kdepim/kaddressbook/icons22/package_toys.png b/bin/kdepim/kaddressbook/icons22/package_toys.png
deleted file mode 100644
index eea4fc7..0000000
--- a/bin/kdepim/kaddressbook/icons22/package_toys.png
+++ b/dev/null
Binary files differ
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index e85991e..8f104e0 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -1,497 +1,503 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 3
4 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 4 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22#include <kabc/address.h> 22#include <kabc/address.h>
23#include <kabc/addressee.h> 23#include <kabc/addressee.h>
24#include <kabc/phonenumber.h> 24#include <kabc/phonenumber.h>
25#include <kglobal.h> 25#include <kglobal.h>
26//US#include <kglobalsettings.h> 26//US#include <kglobalsettings.h>
27#include <kiconloader.h> 27#include <kiconloader.h>
28#include <klocale.h> 28#include <klocale.h>
29//US #include <kstringhandler.h> 29//US #include <kstringhandler.h>
30#include <qscrollview.h> 30#include <qscrollview.h>
31#include <qregexp.h> 31#include <qregexp.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qvbox.h> 33#include <qvbox.h>
34#include <qlabel.h> 34#include <qlabel.h>
35#include <qwidget.h> 35#include <qwidget.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qapplication.h> 37#include <qapplication.h>
38#include <qpushbutton.h> 38#include <qpushbutton.h>
39#ifdef DESKTOP_VERSION 39#ifdef DESKTOP_VERSION
40#include <qpaintdevicemetrics.h> 40#include <qpaintdevicemetrics.h>
41#include <qprinter.h> 41#include <qprinter.h>
42#include <qpainter.h> 42#include <qpainter.h>
43#endif 43#endif
44 44
45 45
46#include "externalapphandler.h" 46#include "externalapphandler.h"
47#include <kabc/addresseeview.h> 47#include <kabc/addresseeview.h>
48 48
49 49
50//US #ifndef DESKTOP_VERSION 50//US #ifndef DESKTOP_VERSION
51//US #include <qtopia/qcopenvelope_qws.h> 51//US #include <qtopia/qcopenvelope_qws.h>
52//US #include <qpe/qpeapplication.h> 52//US #include <qpe/qpeapplication.h>
53//US #endif 53//US #endif
54 54
55//US static int kphoneInstalled = 0; 55//US static int kphoneInstalled = 0;
56 56
57using namespace KABC; 57using namespace KABC;
58 58
59AddresseeView::AddresseeView( QWidget *parent, const char *name ) 59AddresseeView::AddresseeView( QWidget *parent, const char *name )
60 : QTextBrowser( parent, name ) 60 : QTextBrowser( parent, name )
61 61
62 62
63{ 63{
64//US setWrapPolicy( QTextEdit::AtWordBoundary ); 64//US setWrapPolicy( QTextEdit::AtWordBoundary );
65 setLinkUnderline( false ); 65 setLinkUnderline( false );
66 // setVScrollBarMode( QScrollView::AlwaysOff ); 66 // setVScrollBarMode( QScrollView::AlwaysOff );
67 //setHScrollBarMode( QScrollView::AlwaysOff ); 67 //setHScrollBarMode( QScrollView::AlwaysOff );
68 68
69//US QStyleSheet *sheet = styleSheet(); 69//US QStyleSheet *sheet = styleSheet();
70//US QStyleSheetItem *link = sheet->item( "a" ); 70//US QStyleSheetItem *link = sheet->item( "a" );
71//US link->setColor( KGlobalSettings::linkColor() ); 71//US link->setColor( KGlobalSettings::linkColor() );
72 72
73} 73}
74void AddresseeView::printMe() 74void AddresseeView::printMe()
75{ 75{
76#ifdef DESKTOP_VERSION 76#ifdef DESKTOP_VERSION
77 QPrinter printer; 77 QPrinter printer;
78 if (!printer.setup() ) 78 if (!printer.setup() )
79 return; 79 return;
80 QPainter p; 80 QPainter p;
81 p.begin ( &printer ); 81 p.begin ( &printer );
82 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); 82 QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer );
83 float dx, dy; 83 float dx, dy;
84 int wid = (m.width() * 9)/10; 84 int wid = (m.width() * 9)/10;
85 dx = (float) wid/(float)contentsWidth (); 85 dx = (float) wid/(float)contentsWidth ();
86 dy = (float)(m.height()) / (float)contentsHeight (); 86 dy = (float)(m.height()) / (float)contentsHeight ();
87 float scale; 87 float scale;
88 // scale to fit the width or height of the paper 88 // scale to fit the width or height of the paper
89 if ( dx < dy ) 89 if ( dx < dy )
90 scale = dx; 90 scale = dx;
91 else 91 else
92 scale = dy; 92 scale = dy;
93 p.translate( m.width()/10,0 ); 93 p.translate( m.width()/10,0 );
94 p.scale( scale, scale ); 94 p.scale( scale, scale );
95 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); 95 drawContents ( &p, 0,0, contentsWidth (), contentsHeight () );
96 p.end(); 96 p.end();
97#endif 97#endif
98} 98}
99void AddresseeView::setSource(const QString& n) 99void AddresseeView::setSource(const QString& n)
100{ 100{
101 //qDebug("********AddresseeView::setSource %s", n.latin1()); 101 //qDebug("********AddresseeView::setSource %s", n.latin1());
102 102
103 if ( n.left( 6 ) == "mailto" ) 103 if ( n.left( 6 ) == "mailto" )
104 ExternalAppHandler::instance()->mailToOneContact( n.mid(7) ); 104 ExternalAppHandler::instance()->mailToOneContact( n.mid(7) );
105 else if ( n.left( 7 ) == "phoneto" ) 105 else if ( n.left( 7 ) == "phoneto" )
106 ExternalAppHandler::instance()->callByPhone( n.mid(8) ); 106 ExternalAppHandler::instance()->callByPhone( n.mid(8) );
107 else if ( n.left( 5 ) == "faxto" ) 107 else if ( n.left( 5 ) == "faxto" )
108 ExternalAppHandler::instance()->callByFax( n.mid(6) ); 108 ExternalAppHandler::instance()->callByFax( n.mid(6) );
109 else if ( n.left( 5 ) == "smsto" ) 109 else if ( n.left( 5 ) == "smsto" )
110 ExternalAppHandler::instance()->callBySMS( n.mid(6) ); 110 ExternalAppHandler::instance()->callBySMS( n.mid(6) );
111 else if ( n.left( 7 ) == "pagerto" ) 111 else if ( n.left( 7 ) == "pagerto" )
112 ExternalAppHandler::instance()->callByPager( n.mid(8) ); 112 ExternalAppHandler::instance()->callByPager( n.mid(8) );
113 else if ( n.left( 5 ) == "sipto" ) 113 else if ( n.left( 5 ) == "sipto" )
114 ExternalAppHandler::instance()->callBySIP( n.mid(6) ); 114 ExternalAppHandler::instance()->callBySIP( n.mid(6) );
115 115
116} 116}
117void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) 117void AddresseeView::setAddressee( const KABC::Addressee& mAddressee )
118{ 118{
119 bool kemailAvail = ExternalAppHandler::instance()->isEmailAppAvailable(); 119 bool kemailAvail = ExternalAppHandler::instance()->isEmailAppAvailable();
120 // mAddressee = addr; 120 // mAddressee = addr;
121 // clear view 121 // clear view
122 //setText( QString::null ); 122 //setText( QString::null );
123 123
124 if ( mAddressee.isEmpty() ) { 124 if ( mAddressee.isEmpty() ) {
125 setText( QString::null); 125 setText( QString::null);
126 return; 126 return;
127 } 127 }
128 QString name = ( mAddressee.assembledName().isEmpty() ? 128 QString name = ( mAddressee.assembledName().isEmpty() ?
129 mAddressee.formattedName() : mAddressee.assembledName() ); 129 mAddressee.formattedName() : mAddressee.assembledName() );
130 130
131 QString dynamicPart; 131 QString dynamicPart;
132 132
133 dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(),true ); 133 dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(),true );
134 QStringList emails = mAddressee.emails(); 134 QStringList emails = mAddressee.emails();
135 QStringList::ConstIterator emailIt; 135 QStringList::ConstIterator emailIt;
136 QString type = i18n( "Email" ); 136 QString type = i18n( "Email" );
137 emailIt = emails.begin(); 137 emailIt = emails.begin();
138 if ( emailIt != emails.end() ) { 138 if ( emailIt != emails.end() ) {
139 if ( kemailAvail ) { 139 if ( kemailAvail ) {
140 dynamicPart += QString( 140 dynamicPart += QString(
141 "<tr><td align=\"right\"><b>%1</b></td>" 141 "<tr><td align=\"right\"><b>%1</b></td>"
142 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) 142 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" )
143 .arg( type ) 143 .arg( type )
144 .arg( name ) 144 .arg( name )
145 .arg( *emailIt ) 145 .arg( *emailIt )
146 .arg( *emailIt ); 146 .arg( *emailIt );
147 ++emailIt; 147 ++emailIt;
148 } else { 148 } else {
149 dynamicPart += QString( 149 dynamicPart += QString(
150 "<tr><td align=\"right\"><b>%1</b></td>" 150 "<tr><td align=\"right\"><b>%1</b></td>"
151 "<td align=\"left\">%2</td></tr>" ) 151 "<td align=\"left\">%2</td></tr>" )
152 .arg( type ) 152 .arg( type )
153 .arg( *emailIt ); 153 .arg( *emailIt );
154 ++emailIt; 154 ++emailIt;
155 } 155 }
156 } 156 }
157 if ( mAddressee.birthday().date().isValid() ) { 157 if ( mAddressee.birthday().date().isValid() ) {
158 dynamicPart += QString( 158 dynamicPart += QString(
159 "<tr><td align=\"right\"><b>%1</b></td>" 159 "<tr><td align=\"right\"><b>%1</b></td>"
160 "<td align=\"left\">%2</td></tr>" ) 160 "<td align=\"left\">%2</td></tr>" )
161 .arg( i18n ("Birthday") ) 161 .arg( i18n ("Birthday") )
162 .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) ); 162 .arg( KGlobal::locale()->formatDate( mAddressee.birthday().date() ,true) );
163 } 163 }
164 dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(), false ); 164 dynamicPart += getPhoneNumbers( mAddressee.phoneNumbers(), false );
165 165
166 for ( ; emailIt != emails.end(); ++emailIt ) { 166 for ( ; emailIt != emails.end(); ++emailIt ) {
167 if ( kemailAvail ) { 167 if ( kemailAvail ) {
168 dynamicPart += QString( 168 dynamicPart += QString(
169 "<tr><td align=\"right\"><b>%1</b></td>" 169 "<tr><td align=\"right\"><b>%1</b></td>"
170 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) 170 "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" )
171 .arg( type ) 171 .arg( type )
172 .arg( name ) 172 .arg( name )
173 .arg( *emailIt ) 173 .arg( *emailIt )
174 .arg( *emailIt ); 174 .arg( *emailIt );
175 } else { 175 } else {
176 dynamicPart += QString( 176 dynamicPart += QString(
177 "<tr><td align=\"right\"><b>%1</b></td>" 177 "<tr><td align=\"right\"><b>%1</b></td>"
178 "<td align=\"left\">%2</td></tr>" ) 178 "<td align=\"left\">%2</td></tr>" )
179 .arg( type ) 179 .arg( type )
180 .arg( *emailIt ); 180 .arg( *emailIt );
181 } 181 }
182 } 182 }
183 183
184 if ( !mAddressee.url().url().isEmpty() ) { 184 if ( !mAddressee.url().url().isEmpty() ) {
185 dynamicPart += QString( 185 dynamicPart += QString(
186 "<tr><td align=\"right\"><b>%1</b></td>" 186 "<tr><td align=\"right\"><b>%1</b></td>"
187 "<td align=\"left\">%2</td></tr>" ) 187 "<td align=\"left\">%2</td></tr>" )
188 .arg( i18n( "Homepage" ) ) 188 .arg( i18n( "Homepage" ) )
189//US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) ); 189//US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) );
190 .arg( mAddressee.url().url() ); 190 .arg( mAddressee.url().url() );
191 //qDebug("AddresseeView::setAddressee has to be verified."); 191 //qDebug("AddresseeView::setAddressee has to be verified.");
192 } 192 }
193 193
194 KABC::Address::List addresses = mAddressee.addresses(); 194 KABC::Address::List addresses = mAddressee.addresses();
195 KABC::Address::List::ConstIterator addrIt; 195 KABC::Address::List::ConstIterator addrIt;
196 for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) { 196 for ( addrIt = addresses.begin(); addrIt != addresses.end(); ++addrIt ) {
197 if ( true /*(*addrIt).label().isEmpty()*/ ) { 197 if ( true /*(*addrIt).label().isEmpty()*/ ) {
198 QString formattedAddress = (*addrIt).formattedAddress().stripWhiteSpace(); 198 QString formattedAddress = (*addrIt).formattedAddress().stripWhiteSpace();
199//US formattedAddress = formattedAddress.replace( '\n', "<br>" ); 199//US formattedAddress = formattedAddress.replace( '\n', "<br>" );
200 //qDebug("adresss %s ",formattedAddress.latin1() ); 200 //qDebug("adresss %s ",formattedAddress.latin1() );
201 formattedAddress = formattedAddress.replace( QRegExp("\n"), "<br>" ); 201 formattedAddress = formattedAddress.replace( QRegExp("\n"), "<br>" );
202 //qDebug("AddresseeView::setAddressee has to be verified."); 202 //qDebug("AddresseeView::setAddressee has to be verified.");
203 203
204 dynamicPart += QString( 204 dynamicPart += QString(
205 "<tr><td align=\"right\"><b>%1</b></td>" 205 "<tr><td align=\"right\"><b>%1</b></td>"
206 "<td align=\"left\">%2</td></tr>" ) 206 "<td align=\"left\">%2</td></tr>" )
207 .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) 207 .arg( KABC::Address::typeLabel( (*addrIt).type() ) )
208 .arg( formattedAddress ); 208 .arg( formattedAddress );
209 } else { 209 } else {
210 210
211 dynamicPart += QString( 211 dynamicPart += QString(
212 "<tr><td align=\"right\"><b>%1</b></td>" 212 "<tr><td align=\"right\"><b>%1</b></td>"
213 "<td align=\"left\">%2</td></tr>" ) 213 "<td align=\"left\">%2</td></tr>" )
214 .arg( KABC::Address::typeLabel( (*addrIt).type() ) ) 214 .arg( KABC::Address::typeLabel( (*addrIt).type() ) )
215//US .arg( (*addrIt).label().replace( '\n', "<br>" ) ); 215//US .arg( (*addrIt).label().replace( '\n', "<br>" ) );
216 .arg( (*addrIt).label() /*replace( QRegExp("\n"), "<br>" )*/ ); 216 .arg( (*addrIt).label() /*replace( QRegExp("\n"), "<br>" )*/ );
217 217
218 } 218 }
219 } 219 }
220 220
221 QString notes; 221 QString notes;
222 if ( !mAddressee.note().isEmpty() ) { 222 if ( !mAddressee.note().isEmpty() ) {
223 notes = QString( 223 notes = QString(
224 "<tr>" 224 "<tr>"
225 "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label 225 "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label
226 "<td align=\"left\">%2</td>" // note 226 "<td align=\"left\">%2</td>" // note
227 "</tr>" ).arg( i18n( "Notes" ) ) 227 "</tr>" ).arg( i18n( "Notes" ) )
228//US .arg( mAddressee.note().replace( '\n', "<br>" ) ); 228//US .arg( mAddressee.note().replace( '\n', "<br>" ) );
229 .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) ); 229 .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) );
230 //qDebug("AddresseeView::setAddressee has to be verified."); 230 //qDebug("AddresseeView::setAddressee has to be verified.");
231 } 231 }
232 232
233 QString aRole = ""; 233 QString aRole = "";
234 QString aOrga = ""; 234 QString aOrga = "";
235 if ( true /*!mAddressee.role().isEmpty()*/ ) { 235 if ( true /*!mAddressee.role().isEmpty()*/ ) {
236 aRole = "<tr>" 236 aRole = "<tr>"
237 "<td align=\"left\">" + mAddressee.role() + "</td>" 237 "<td align=\"left\">" + mAddressee.role() + "</td>"
238 "</tr>"; 238 "</tr>";
239 } 239 }
240 if ( true /*!mAddressee.organization().isEmpty()*/ ) { 240 if ( true /*!mAddressee.organization().isEmpty()*/ ) {
241 aOrga = "<tr>" 241 aOrga = "<tr>"
242 "<td align=\"left\">" + mAddressee.organization() + "</td>" 242 "<td align=\"left\">" + mAddressee.organization() + "</td>"
243 "</tr>"; 243 "</tr>";
244 } 244 }
245 mText = ""; 245 mText = "";
246 QString picString = ""; 246 QString picString = "";
247 KABC::Picture picture = mAddressee.photo(); 247 KABC::Picture picture = mAddressee.photo();
248 bool picAvailintern = false; 248 bool picAvailintern = false;
249 bool picAvailUrl = false; 249 bool picAvailUrl = false;
250 if (! picture.undefined() ) { 250 if (! picture.undefined() ) {
251 picAvailintern = (picture.isIntern() && !picture.data().isNull()); 251 picAvailintern = (picture.isIntern() && !picture.data().isNull());
252 picAvailUrl = !picture.isIntern() && QFile::exists(picture.url() ); 252 picAvailUrl = !picture.isIntern() && QFile::exists(picture.url() );
253 } 253 }
254 if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) { 254 if ( picAvailUrl || picAvailintern || QApplication::desktop()->width() > 320 ) {
255 picString = "<img src=\"myimage\" width=\"50\" height=\"70\">";
255 if ( picAvailintern ) { 256 if ( picAvailintern ) {
256 QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() ); 257 QMimeSourceFactory::defaultFactory()->setImage( "myimage", picture.data() );
257 } else { 258 } else {
258 if ( picAvailUrl ) { 259 if ( picAvailUrl ) {
259 QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", QPixmap( picture.url() )); 260 QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", QPixmap( picture.url() ));
260 } else { 261 } else {
261 QMimeSourceFactory::defaultFactory()->setPixmap( "myimage", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) ); 262 static bool setDefaultImage = false;
263 if ( !setDefaultImage ) {
264 qDebug("Setting default pixmap ");
265 QMimeSourceFactory::defaultFactory()->setPixmap( "defaultPenguin", KGlobal::iconLoader()->loadIcon( "package_toys", KIcon::Desktop, 128 ) );
266 setDefaultImage = true;
267 }
268 picString = "<img src=\"defaultPenguin\" width=\"64\" height=\"64\">";
262 } 269 }
263 } 270 }
264 picString = "<img src=\"myimage\" width=\"50\" height=\"70\">";
265 mText = QString::fromLatin1( 271 mText = QString::fromLatin1(
266 "<html>" 272 "<html>"
267 "<body text=\"%1\" bgcolor=\"%2\">" // text and background color 273 "<body text=\"%1\" bgcolor=\"%2\">" // text and background color
268 "<table>" 274 "<table>"
269 "<tr>" 275 "<tr>"
270 "<td rowspan=\"3\" align=\"right\" valign=\"top\">" 276 "<td rowspan=\"3\" align=\"right\" valign=\"top\">"
271 "%3" 277 "%3"
272 "</td>" 278 "</td>"
273 "<td align=\"left\"><font size=\"+2\"><b>%4</b></font></td>" // name 279 "<td align=\"left\"><font size=\"+2\"><b>%4</b></font></td>" // name
274 "</tr>" 280 "</tr>"
275 "%5" // role 281 "%5" // role
276 "%6" // organization 282 "%6" // organization
277 "<td colspan=\"2\">&nbsp;</td>" 283 "<td colspan=\"2\">&nbsp;</td>"
278 "%7" // dynamic part 284 "%7" // dynamic part
279 "%8" // notes 285 "%8" // notes
280 "</table>" 286 "</table>"
281 "</body>" 287 "</body>"
282 "</html>") 288 "</html>")
283//US 289//US
284 .arg( /*KGlobalSettings::textColor().name()*/ "black" ) 290 .arg( /*KGlobalSettings::textColor().name()*/ "black" )
285//US 291//US
286 .arg( /*KGlobalSettings::baseColor().name()*/ "white" ) 292 .arg( /*KGlobalSettings::baseColor().name()*/ "white" )
287 .arg( picString ) 293 .arg( picString )
288 .arg( name ) 294 .arg( name )
289 .arg( aRole ) 295 .arg( aRole )
290 .arg( aOrga ) 296 .arg( aOrga )
291 .arg( dynamicPart ) 297 .arg( dynamicPart )
292 .arg( notes ); 298 .arg( notes );
293 299
294 } else { // no picture! 300 } else { // no picture!
295 301
296mText = "<table width=\"100%\">\n"; 302mText = "<table width=\"100%\">\n";
297 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 303 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
298#ifdef DESKTOP_VERSION 304#ifdef DESKTOP_VERSION
299 mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h1>"; 305 mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h1>";
300 mText += "<font color=\"#FFFFFF\">" + name +"</font></h1>"; 306 mText += "<font color=\"#FFFFFF\">" + name +"</font></h1>";
301#else 307#else
302 mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h3>"; 308 mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h3>";
303 mText += "<font color=\"#FFFFFF\"> " + name +"</font></h3>"; 309 mText += "<font color=\"#FFFFFF\"> " + name +"</font></h3>";
304#endif 310#endif
305 311
306 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; 312 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>";
307 313
308 mText += "<table><td colspan=\"2\">&nbsp;</td>"; 314 mText += "<table><td colspan=\"2\">&nbsp;</td>";
309 /* 315 /*
310 mText += QString("<tr><td align=\"right\"><b2>%1</b2></td>" 316 mText += QString("<tr><td align=\"right\"><b2>%1</b2></td>"
311 "<td align=\"left\"><b>%2</b></td></tr>" ) 317 "<td align=\"left\"><b>%2</b></td></tr>" )
312 .arg( i18n(" ") ) 318 .arg( i18n(" ") )
313 .arg( name ); 319 .arg( name );
314 */ 320 */
315 if ( ! mAddressee.role().isEmpty() ) 321 if ( ! mAddressee.role().isEmpty() )
316 mText += QString("<tr><td align=\"right\"><b>%1</b></td>" 322 mText += QString("<tr><td align=\"right\"><b>%1</b></td>"
317 "<td align=\"left\">%2</td></tr>" ) 323 "<td align=\"left\">%2</td></tr>" )
318 .arg( i18n(" ") ) 324 .arg( i18n(" ") )
319 .arg( mAddressee.role()); 325 .arg( mAddressee.role());
320 if ( ! mAddressee.organization().isEmpty() ) 326 if ( ! mAddressee.organization().isEmpty() )
321 mText += QString("<tr><td align=\"right\"><b>%1</b></td>" 327 mText += QString("<tr><td align=\"right\"><b>%1</b></td>"
322 "<td align=\"left\">%2</td></tr>" ) 328 "<td align=\"left\">%2</td></tr>" )
323 .arg( i18n(" ") ) 329 .arg( i18n(" ") )
324 .arg( mAddressee.organization()); 330 .arg( mAddressee.organization());
325 mText += dynamicPart; 331 mText += dynamicPart;
326 mText += notes; 332 mText += notes;
327 mText += "</table>"; 333 mText += "</table>";
328 334
329 } 335 }
330 336
331 // at last display it... 337 // at last display it...
332 setText( mText ); 338 setText( mText );
333 339
334} 340}
335 341
336QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool preferred ) 342QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool preferred )
337{ 343{
338 ExternalAppHandler* eah = ExternalAppHandler::instance(); 344 ExternalAppHandler* eah = ExternalAppHandler::instance();
339 bool kphoneAvail = eah->isPhoneAppAvailable(); 345 bool kphoneAvail = eah->isPhoneAppAvailable();
340 bool kfaxAvail = eah->isFaxAppAvailable(); 346 bool kfaxAvail = eah->isFaxAppAvailable();
341 bool ksmsAvail = eah->isSMSAppAvailable(); 347 bool ksmsAvail = eah->isSMSAppAvailable();
342 bool kpagerAvail = eah->isPagerAppAvailable(); 348 bool kpagerAvail = eah->isPagerAppAvailable();
343 bool ksipAvail = eah->isSIPAppAvailable(); 349 bool ksipAvail = eah->isSIPAppAvailable();
344 QString dynamicPart; 350 QString dynamicPart;
345 KABC::PhoneNumber::List::ConstIterator phoneIt; 351 KABC::PhoneNumber::List::ConstIterator phoneIt;
346 QString extension; 352 QString extension;
347 int phonetype; 353 int phonetype;
348 QString sms; 354 QString sms;
349 for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { 355 for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) {
350 phonetype = (*phoneIt).type(); 356 phonetype = (*phoneIt).type();
351 if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) 357 if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred )
352 continue; 358 continue;
353 if (ksmsAvail && 359 if (ksmsAvail &&
354 ( 360 (
355 ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || 361 ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) ||
356 ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell) 362 ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell)
357 ) 363 )
358 ) 364 )
359 { 365 {
360 sms = QString("<a href=\"smsto:%1 \">(sms)</a>" ) 366 sms = QString("<a href=\"smsto:%1 \">(sms)</a>" )
361 .arg( (*phoneIt).number() ); 367 .arg( (*phoneIt).number() );
362 368
363 } 369 }
364 else 370 else
365 sms = ""; 371 sms = "";
366 372
367 extension = QString::null; 373 extension = QString::null;
368 if ((phonetype & KABC::PhoneNumber::Fax) == KABC::PhoneNumber::Fax) { 374 if ((phonetype & KABC::PhoneNumber::Fax) == KABC::PhoneNumber::Fax) {
369 if (kfaxAvail) extension = "faxto:"; 375 if (kfaxAvail) extension = "faxto:";
370 } 376 }
371 else if ((phonetype & KABC::PhoneNumber::Pager) == KABC::PhoneNumber::Pager) { 377 else if ((phonetype & KABC::PhoneNumber::Pager) == KABC::PhoneNumber::Pager) {
372 if (kpagerAvail) extension = "pagerto:"; 378 if (kpagerAvail) extension = "pagerto:";
373 } 379 }
374 else if ((phonetype & KABC::PhoneNumber::Sip) == KABC::PhoneNumber::Sip) { 380 else if ((phonetype & KABC::PhoneNumber::Sip) == KABC::PhoneNumber::Sip) {
375 if (ksipAvail) extension = "sipto:"; 381 if (ksipAvail) extension = "sipto:";
376 } 382 }
377 else if (kphoneAvail) { 383 else if (kphoneAvail) {
378 extension = "phoneto:"; 384 extension = "phoneto:";
379 } 385 }
380 else 386 else
381 extension = QString::null; 387 extension = QString::null;
382 388
383 if ( !extension.isEmpty() ) { 389 if ( !extension.isEmpty() ) {
384 dynamicPart += QString( 390 dynamicPart += QString(
385 "<tr><td align=\"right\"><b>%1</b></td>" 391 "<tr><td align=\"right\"><b>%1</b></td>"
386 "<td align=\"left\"><a href=\"%2%3 \">%4</a> %5</td></tr>" ) 392 "<td align=\"left\"><a href=\"%2%3 \">%4</a> %5</td></tr>" )
387 .arg( KABC::PhoneNumber::typeLabel( phonetype ) ) 393 .arg( KABC::PhoneNumber::typeLabel( phonetype ) )
388 .arg( extension ) 394 .arg( extension )
389 .arg( (*phoneIt).number() ) 395 .arg( (*phoneIt).number() )
390 .arg( (*phoneIt).number() ) 396 .arg( (*phoneIt).number() )
391 .arg( sms ); 397 .arg( sms );
392 398
393 } else { 399 } else {
394 dynamicPart += QString( 400 dynamicPart += QString(
395 "<tr><td align=\"right\"><b>%1</b></td>" 401 "<tr><td align=\"right\"><b>%1</b></td>"
396 "<td align=\"left\">%2 %3</td></tr>" ) 402 "<td align=\"left\">%2 %3</td></tr>" )
397 .arg( KABC::PhoneNumber::typeLabel( phonetype ) ) 403 .arg( KABC::PhoneNumber::typeLabel( phonetype ) )
398 .arg( (*phoneIt).number() ) 404 .arg( (*phoneIt).number() )
399 .arg( sms ); 405 .arg( sms );
400 } 406 }
401 } 407 }
402 return dynamicPart; 408 return dynamicPart;
403} 409}
404/* 410/*
405KABC::Addressee AddresseeView::addressee() const 411KABC::Addressee AddresseeView::addressee() const
406{ 412{
407 return mAddressee; 413 return mAddressee;
408} 414}
409*/ 415*/
410void AddresseeView::addTag(const QString & tag,const QString & text) 416void AddresseeView::addTag(const QString & tag,const QString & text)
411{ 417{
412 if ( text.isEmpty() ) 418 if ( text.isEmpty() )
413 return; 419 return;
414 int number=text.contains("\n"); 420 int number=text.contains("\n");
415 QString str = "<" + tag + ">"; 421 QString str = "<" + tag + ">";
416 QString tmpText=text; 422 QString tmpText=text;
417 QString tmpStr=str; 423 QString tmpStr=str;
418 if(number !=-1) 424 if(number !=-1)
419 { 425 {
420 if (number > 0) { 426 if (number > 0) {
421 int pos=0; 427 int pos=0;
422 QString tmp; 428 QString tmp;
423 for(int i=0;i<=number;i++) { 429 for(int i=0;i<=number;i++) {
424 pos=tmpText.find("\n"); 430 pos=tmpText.find("\n");
425 tmp=tmpText.left(pos); 431 tmp=tmpText.left(pos);
426 tmpText=tmpText.right(tmpText.length()-pos-1); 432 tmpText=tmpText.right(tmpText.length()-pos-1);
427 tmpStr+=tmp+"<br>"; 433 tmpStr+=tmp+"<br>";
428 } 434 }
429 } 435 }
430 else tmpStr += tmpText; 436 else tmpStr += tmpText;
431 tmpStr+="</" + tag + ">"; 437 tmpStr+="</" + tag + ">";
432 mText.append(tmpStr); 438 mText.append(tmpStr);
433 } 439 }
434 else 440 else
435 { 441 {
436 str += text + "</" + tag + ">"; 442 str += text + "</" + tag + ">";
437 mText.append(str); 443 mText.append(str);
438 } 444 }
439} 445}
440 446
441AddresseeChooser::AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bool takeloc, QWidget *parent, const char *name ) : KDialogBase(parent,name, 447AddresseeChooser::AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bool takeloc, QWidget *parent, const char *name ) : KDialogBase(parent,name,
442 true ,i18n("Conflict! Please choose Adressee!"),Ok|User1|Close,Close, false) 448 true ,i18n("Conflict! Please choose Adressee!"),Ok|User1|Close,Close, false)
443{ 449{
444 findButton( Close )->setText( i18n("Cancel Sync")); 450 findButton( Close )->setText( i18n("Cancel Sync"));
445 findButton( Ok )->setText( i18n("Remote")); 451 findButton( Ok )->setText( i18n("Remote"));
446 findButton( User1 )->setText( i18n("Local")); 452 findButton( User1 )->setText( i18n("Local"));
447 QWidget* topframe = new QWidget( this ); 453 QWidget* topframe = new QWidget( this );
448 setMainWidget( topframe ); 454 setMainWidget( topframe );
449 QBoxLayout* bl; 455 QBoxLayout* bl;
450 if ( QApplication::desktop()->width() < 640 ) { 456 if ( QApplication::desktop()->width() < 640 ) {
451 bl = new QVBoxLayout( topframe ); 457 bl = new QVBoxLayout( topframe );
452 } else { 458 } else {
453 bl = new QHBoxLayout( topframe ); 459 bl = new QHBoxLayout( topframe );
454 } 460 }
455 QVBox* subframe = new QVBox( topframe ); 461 QVBox* subframe = new QVBox( topframe );
456 bl->addWidget(subframe ); 462 bl->addWidget(subframe );
457 QLabel* lab = new QLabel( i18n("Local Addressee"), subframe ); 463 QLabel* lab = new QLabel( i18n("Local Addressee"), subframe );
458 if ( takeloc ) 464 if ( takeloc )
459 lab->setBackgroundColor(Qt::green.light() ); 465 lab->setBackgroundColor(Qt::green.light() );
460 AddresseeView * av = new AddresseeView( subframe ); 466 AddresseeView * av = new AddresseeView( subframe );
461 av->setAddressee( loc ); 467 av->setAddressee( loc );
462 subframe = new QVBox( topframe ); 468 subframe = new QVBox( topframe );
463 bl->addWidget(subframe ); 469 bl->addWidget(subframe );
464 lab = new QLabel( i18n("Remote Addressee"), subframe ); 470 lab = new QLabel( i18n("Remote Addressee"), subframe );
465 if ( !takeloc ) 471 if ( !takeloc )
466 lab->setBackgroundColor(Qt::green.light() ); 472 lab->setBackgroundColor(Qt::green.light() );
467 av = new AddresseeView( subframe ); 473 av = new AddresseeView( subframe );
468 av->setAddressee( rem ); 474 av->setAddressee( rem );
469 QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); 475 QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote()));
470 QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local())); 476 QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local()));
471#ifndef DESKTOP_VERSION 477#ifndef DESKTOP_VERSION
472 showMaximized(); 478 showMaximized();
473#else 479#else
474 resize ( 640, 400 ); 480 resize ( 640, 400 );
475#endif 481#endif
476} 482}
477 483
478int AddresseeChooser::executeD( bool local ) 484int AddresseeChooser::executeD( bool local )
479{ 485{
480 mSyncResult = 3; 486 mSyncResult = 3;
481 if ( local ) 487 if ( local )
482 findButton( User1 )->setFocus(); 488 findButton( User1 )->setFocus();
483 else 489 else
484 findButton( Ok )->setFocus(); 490 findButton( Ok )->setFocus();
485 exec(); 491 exec();
486 return mSyncResult; 492 return mSyncResult;
487} 493}
488void AddresseeChooser::slot_remote() 494void AddresseeChooser::slot_remote()
489{ 495{
490 mSyncResult = 2; 496 mSyncResult = 2;
491 accept(); 497 accept();
492} 498}
493void AddresseeChooser::slot_local() 499void AddresseeChooser::slot_local()
494{ 500{
495 mSyncResult = 1; 501 mSyncResult = 1;
496 accept(); 502 accept();
497} 503}
diff --git a/kaddressbook/addresseeeditordialog.cpp b/kaddressbook/addresseeeditordialog.cpp
index a84fc61..b5a60f2 100644
--- a/kaddressbook/addresseeeditordialog.cpp
+++ b/kaddressbook/addresseeeditordialog.cpp
@@ -1,123 +1,123 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qapplication.h> 25#include <qapplication.h>
26 26
27#include <kdebug.h> 27#include <kdebug.h>
28#include <klocale.h> 28#include <klocale.h>
29#include <kglobal.h> 29#include <kglobal.h>
30 30
31#include "addresseeeditorwidget.h" 31#include "addresseeeditorwidget.h"
32#include "kabcore.h" 32#include "kabcore.h"
33 33
34#include "addresseeeditordialog.h" 34#include "addresseeeditordialog.h"
35 35
36AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent, 36AddresseeEditorDialog::AddresseeEditorDialog( KABCore *core, QWidget *parent,
37 const char *name ) 37 const char *name )
38 : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ), 38 : KDialogBase( KDialogBase::Plain, i18n( "Edit Contact" ),
39 KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply, 39 KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Apply,
40 KDialogBase::Ok, parent, name, true ) 40 KDialogBase::Ok, parent, name, true )
41{ 41{
42 42
43 43
44 QWidget *page = plainPage(); 44 QWidget *page = plainPage();
45 45
46 QVBoxLayout *layout = new QVBoxLayout( page ); 46 QVBoxLayout *layout = new QVBoxLayout( page );
47 47
48 mEditorWidget = new AddresseeEditorWidget( core, false, page ); 48 mEditorWidget = new AddresseeEditorWidget( core, false, page );
49 connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ), 49 connect( mEditorWidget, SIGNAL( modified( const KABC::Addressee::List& ) ),
50 SLOT( widgetModified() ) ); 50 SLOT( widgetModified() ) );
51 layout->addWidget( mEditorWidget ); 51 layout->addWidget( mEditorWidget );
52 52
53 enableButton( KDialogBase::Apply, false ); 53 enableButton( KDialogBase::Apply, false );
54 if ( QApplication::desktop()->width() < 480 ) { 54 if ( QApplication::desktop()->width() < 480 ) {
55 hideButtons(); 55 hideButtons();
56 } 56 }
57} 57}
58 58
59AddresseeEditorDialog::~AddresseeEditorDialog() 59AddresseeEditorDialog::~AddresseeEditorDialog()
60{ 60{
61 //emit editorDestroyed( mEditorWidget->addressee().uid() ); 61 //emit editorDestroyed( mEditorWidget->addressee().uid() );
62} 62}
63 63
64void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr ) 64void AddresseeEditorDialog::setAddressee( const KABC::Addressee &addr )
65{ 65{
66 enableButton( KDialogBase::Apply, false ); 66 enableButton( KDialogBase::Apply, false );
67 67
68 mEditorWidget->setAddressee( addr ); 68 mEditorWidget->setAddressee( addr );
69 69
70 this->setCaption("Edit " + addr.formattedName()); 70 this->setCaption(i18n ("Edit ") + addr.formattedName());
71} 71}
72 72
73KABC::Addressee AddresseeEditorDialog::addressee() 73KABC::Addressee AddresseeEditorDialog::addressee()
74{ 74{
75 return mEditorWidget->addressee(); 75 return mEditorWidget->addressee();
76} 76}
77 77
78bool AddresseeEditorDialog::dirty() 78bool AddresseeEditorDialog::dirty()
79{ 79{
80 return mEditorWidget->dirty(); 80 return mEditorWidget->dirty();
81} 81}
82 82
83void AddresseeEditorDialog::slotApply() 83void AddresseeEditorDialog::slotApply()
84{ 84{
85 if ( mEditorWidget->dirty() ) { 85 if ( mEditorWidget->dirty() ) {
86 mEditorWidget->save(); 86 mEditorWidget->save();
87 emit contactModified( mEditorWidget->addressee() ); 87 emit contactModified( mEditorWidget->addressee() );
88 } 88 }
89 89
90 enableButton( KDialogBase::Apply, false ); 90 enableButton( KDialogBase::Apply, false );
91 91
92 KDialogBase::slotApply(); 92 KDialogBase::slotApply();
93} 93}
94 94
95void AddresseeEditorDialog:: accept () 95void AddresseeEditorDialog:: accept ()
96{ 96{
97 slotOk(); 97 slotOk();
98 98
99} 99}
100void AddresseeEditorDialog::slotOk() 100void AddresseeEditorDialog::slotOk()
101{ 101{
102 slotApply(); 102 slotApply();
103 103
104 //KDialogBase::slotOk(); 104 //KDialogBase::slotOk();
105 emit okClicked(); 105 emit okClicked();
106 QDialog::accept(); 106 QDialog::accept();
107} 107}
108 108
109void AddresseeEditorDialog::widgetModified() 109void AddresseeEditorDialog::widgetModified()
110{ 110{
111 enableButton( KDialogBase::Apply, true ); 111 enableButton( KDialogBase::Apply, true );
112} 112}
113 113
114void AddresseeEditorDialog::slotCancel() 114void AddresseeEditorDialog::slotCancel()
115{ 115{
116 KDialogBase::slotCancel(); 116 KDialogBase::slotCancel();
117 117
118 118
119} 119}
120 120
121#ifndef KAB_EMBEDDED 121#ifndef KAB_EMBEDDED
122#include "addresseeeditordialog.moc" 122#include "addresseeeditordialog.moc"
123#endif //KAB_EMBEDDED 123#endif //KAB_EMBEDDED
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 3f9b546..e1a490d 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1,3390 +1,3391 @@
1/* 1/*
2 This file is part of KAddressbook. 2 This file is part of KAddressbook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 Async a special exception, permission is given to link this program 19 Async a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/*s 24/*s
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include "kabcore.h" 31#include "kabcore.h"
32 32
33#include <stdaddressbook.h> 33#include <stdaddressbook.h>
34#include <klocale.h> 34#include <klocale.h>
35#include <kfiledialog.h> 35#include <kfiledialog.h>
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qregexp.h> 38#include <qregexp.h>
39#include <qlineedit.h> 39#include <qlineedit.h>
40#include <qcheckbox.h> 40#include <qcheckbox.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qprogressbar.h> 42#include <qprogressbar.h>
43#include <libkdepim/phoneaccess.h> 43#include <libkdepim/phoneaccess.h>
44 44
45#ifndef KAB_EMBEDDED 45#ifndef KAB_EMBEDDED
46#include <qclipboard.h> 46#include <qclipboard.h>
47#include <qdir.h> 47#include <qdir.h>
48#include <qfile.h> 48#include <qfile.h>
49#include <qapplicaton.h> 49#include <qapplicaton.h>
50#include <qprogressbar.h> 50#include <qprogressbar.h>
51#include <qlayout.h> 51#include <qlayout.h>
52#include <qregexp.h> 52#include <qregexp.h>
53#include <qvbox.h> 53#include <qvbox.h>
54#include <kabc/addresseelist.h> 54#include <kabc/addresseelist.h>
55#include <kabc/errorhandler.h> 55#include <kabc/errorhandler.h>
56#include <kabc/resource.h> 56#include <kabc/resource.h>
57#include <kabc/vcardconverter.h> 57#include <kabc/vcardconverter.h>
58#include <kapplication.h> 58#include <kapplication.h>
59#include <kactionclasses.h> 59#include <kactionclasses.h>
60#include <kcmultidialog.h> 60#include <kcmultidialog.h>
61#include <kdebug.h> 61#include <kdebug.h>
62#include <kdeversion.h> 62#include <kdeversion.h>
63#include <kkeydialog.h> 63#include <kkeydialog.h>
64#include <kmessagebox.h> 64#include <kmessagebox.h>
65#include <kprinter.h> 65#include <kprinter.h>
66#include <kprotocolinfo.h> 66#include <kprotocolinfo.h>
67#include <kresources/selectdialog.h> 67#include <kresources/selectdialog.h>
68#include <kstandarddirs.h> 68#include <kstandarddirs.h>
69#include <ktempfile.h> 69#include <ktempfile.h>
70#include <kxmlguiclient.h> 70#include <kxmlguiclient.h>
71#include <kaboutdata.h> 71#include <kaboutdata.h>
72#include <libkdepim/categoryselectdialog.h> 72#include <libkdepim/categoryselectdialog.h>
73 73
74#include "addresseeutil.h" 74#include "addresseeutil.h"
75#include "addresseeeditordialog.h" 75#include "addresseeeditordialog.h"
76#include "extensionmanager.h" 76#include "extensionmanager.h"
77#include "kstdaction.h" 77#include "kstdaction.h"
78#include "kaddressbookservice.h" 78#include "kaddressbookservice.h"
79#include "ldapsearchdialog.h" 79#include "ldapsearchdialog.h"
80#include "printing/printingwizard.h" 80#include "printing/printingwizard.h"
81#else // KAB_EMBEDDED 81#else // KAB_EMBEDDED
82 82
83#include <kapplication.h> 83#include <kapplication.h>
84#include "KDGanttMinimizeSplitter.h" 84#include "KDGanttMinimizeSplitter.h"
85#include "kaddressbookmain.h" 85#include "kaddressbookmain.h"
86#include "kactioncollection.h" 86#include "kactioncollection.h"
87#include "addresseedialog.h" 87#include "addresseedialog.h"
88//US 88//US
89#include <addresseeview.h> 89#include <addresseeview.h>
90 90
91#include <qapp.h> 91#include <qapp.h>
92#include <qmenubar.h> 92#include <qmenubar.h>
93//#include <qtoolbar.h> 93//#include <qtoolbar.h>
94#include <qmessagebox.h> 94#include <qmessagebox.h>
95#include <kdebug.h> 95#include <kdebug.h>
96#include <kiconloader.h> // needed for SmallIcon 96#include <kiconloader.h> // needed for SmallIcon
97#include <kresources/kcmkresources.h> 97#include <kresources/kcmkresources.h>
98#include <ktoolbar.h> 98#include <ktoolbar.h>
99 99
100 100
101//#include <qlabel.h> 101//#include <qlabel.h>
102 102
103 103
104#ifndef DESKTOP_VERSION 104#ifndef DESKTOP_VERSION
105#include <qpe/ir.h> 105#include <qpe/ir.h>
106#include <qpe/qpemenubar.h> 106#include <qpe/qpemenubar.h>
107#include <qtopia/qcopenvelope_qws.h> 107#include <qtopia/qcopenvelope_qws.h>
108#else 108#else
109 109
110#include <qmenubar.h> 110#include <qmenubar.h>
111#endif 111#endif
112 112
113#endif // KAB_EMBEDDED 113#endif // KAB_EMBEDDED
114#include "kcmconfigs/kcmkabconfig.h" 114#include "kcmconfigs/kcmkabconfig.h"
115#include "kcmconfigs/kcmkdepimconfig.h" 115#include "kcmconfigs/kcmkdepimconfig.h"
116#include "kpimglobalprefs.h" 116#include "kpimglobalprefs.h"
117#include "externalapphandler.h" 117#include "externalapphandler.h"
118#include "xxportselectdialog.h" 118#include "xxportselectdialog.h"
119 119
120 120
121#include <kresources/selectdialog.h> 121#include <kresources/selectdialog.h>
122#include <kmessagebox.h> 122#include <kmessagebox.h>
123 123
124#include <picture.h> 124#include <picture.h>
125#include <resource.h> 125#include <resource.h>
126 126
127//US#include <qsplitter.h> 127//US#include <qsplitter.h>
128#include <qmap.h> 128#include <qmap.h>
129#include <qdir.h> 129#include <qdir.h>
130#include <qfile.h> 130#include <qfile.h>
131#include <qvbox.h> 131#include <qvbox.h>
132#include <qlayout.h> 132#include <qlayout.h>
133#include <qclipboard.h> 133#include <qclipboard.h>
134#include <qtextstream.h> 134#include <qtextstream.h>
135#include <qradiobutton.h> 135#include <qradiobutton.h>
136#include <qbuttongroup.h> 136#include <qbuttongroup.h>
137 137
138#include <libkdepim/categoryselectdialog.h> 138#include <libkdepim/categoryselectdialog.h>
139#include <libkdepim/categoryeditdialog.h> 139#include <libkdepim/categoryeditdialog.h>
140#include <kabc/vcardconverter.h> 140#include <kabc/vcardconverter.h>
141 141
142 142
143#include "addresseeutil.h" 143#include "addresseeutil.h"
144#include "undocmds.h" 144#include "undocmds.h"
145#include "addresseeeditordialog.h" 145#include "addresseeeditordialog.h"
146#include "viewmanager.h" 146#include "viewmanager.h"
147#include "details/detailsviewcontainer.h" 147#include "details/detailsviewcontainer.h"
148#include "kabprefs.h" 148#include "kabprefs.h"
149#include "xxportmanager.h" 149#include "xxportmanager.h"
150#include "incsearchwidget.h" 150#include "incsearchwidget.h"
151#include "jumpbuttonbar.h" 151#include "jumpbuttonbar.h"
152#include "extensionmanager.h" 152#include "extensionmanager.h"
153#include "addresseeconfig.h" 153#include "addresseeconfig.h"
154#include "nameeditdialog.h" 154#include "nameeditdialog.h"
155#include <kcmultidialog.h> 155#include <kcmultidialog.h>
156 156
157#ifdef _WIN32_ 157#ifdef _WIN32_
158#ifdef _OL_IMPORT_ 158#ifdef _OL_IMPORT_
159#include "kaimportoldialog.h" 159#include "kaimportoldialog.h"
160#endif 160#endif
161#else 161#else
162#include <unistd.h> 162#include <unistd.h>
163#endif 163#endif
164// sync includes 164// sync includes
165#include <libkdepim/ksyncprofile.h> 165#include <libkdepim/ksyncprofile.h>
166#include <libkdepim/ksyncprefsdialog.h> 166#include <libkdepim/ksyncprefsdialog.h>
167 167
168 168
169class KABCatPrefs : public QDialog 169class KABCatPrefs : public QDialog
170{ 170{
171 public: 171 public:
172 KABCatPrefs( QWidget *parent=0, const char *name=0 ) : 172 KABCatPrefs( QWidget *parent=0, const char *name=0 ) :
173 QDialog( parent, name, true ) 173 QDialog( parent, name, true )
174 { 174 {
175 setCaption( i18n("Manage new Categories") ); 175 setCaption( i18n("Manage new Categories") );
176 QVBoxLayout* lay = new QVBoxLayout( this ); 176 QVBoxLayout* lay = new QVBoxLayout( this );
177 lay->setSpacing( 3 ); 177 lay->setSpacing( 3 );
178 lay->setMargin( 3 ); 178 lay->setMargin( 3 );
179 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 179 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\naddressees\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
180 lay->addWidget( lab ); 180 lay->addWidget( lab );
181 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 181 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
182 lay->addWidget( format ); 182 lay->addWidget( format );
183 format->setExclusive ( true ) ; 183 format->setExclusive ( true ) ;
184 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 184 addCatBut = new QRadioButton(i18n("Add to category list"), format );
185 new QRadioButton(i18n("Remove from addressees"), format ); 185 new QRadioButton(i18n("Remove from addressees"), format );
186 addCatBut->setChecked( true ); 186 addCatBut->setChecked( true );
187 QPushButton * ok = new QPushButton( i18n("OK"), this ); 187 QPushButton * ok = new QPushButton( i18n("OK"), this );
188 lay->addWidget( ok ); 188 lay->addWidget( ok );
189 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 189 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
190 lay->addWidget( cancel ); 190 lay->addWidget( cancel );
191 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 191 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
192 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 192 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
193 resize( 200, 200 ); 193 resize( 200, 200 );
194 } 194 }
195 195
196 bool addCat() { return addCatBut->isChecked(); } 196 bool addCat() { return addCatBut->isChecked(); }
197private: 197private:
198 QRadioButton* addCatBut; 198 QRadioButton* addCatBut;
199}; 199};
200 200
201class KABFormatPrefs : public QDialog 201class KABFormatPrefs : public QDialog
202{ 202{
203 public: 203 public:
204 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) : 204 KABFormatPrefs( QWidget *parent=0, const char *name=0 ) :
205 QDialog( parent, name, true ) 205 QDialog( parent, name, true )
206 { 206 {
207 setCaption( i18n("Set formatted name") ); 207 setCaption( i18n("Set formatted name") );
208 QVBoxLayout* lay = new QVBoxLayout( this ); 208 QVBoxLayout* lay = new QVBoxLayout( this );
209 lay->setSpacing( 3 ); 209 lay->setSpacing( 3 );
210 lay->setMargin( 3 ); 210 lay->setMargin( 3 );
211 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this ); 211 QLabel * lab = new QLabel( i18n("You can set the formatted name\nfor a list of contacts in one go."), this );
212 lay->addWidget( lab ); 212 lay->addWidget( lab );
213 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this ); 213 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Set formatted name to:"), this );
214 lay->addWidget( format ); 214 lay->addWidget( format );
215 format->setExclusive ( true ) ; 215 format->setExclusive ( true ) ;
216 simple = new QRadioButton(i18n("Simple: James Bond"), format ); 216 simple = new QRadioButton(i18n("Simple: James Bond"), format );
217 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format ); 217 full = new QRadioButton(i18n("Full: Mr. James 007 Bond I"), format );
218 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); 218 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format );
219 company = new QRadioButton(i18n("Organization: MI6"), format ); 219 company = new QRadioButton(i18n("Organization: MI6"), format );
220 simple->setChecked( true ); 220 simple->setChecked( true );
221 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); 221 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this);
222 lay->addWidget( setCompany ); 222 lay->addWidget( setCompany );
223 QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); 223 QPushButton * ok = new QPushButton( i18n("Select contact list"), this );
224 lay->addWidget( ok ); 224 lay->addWidget( ok );
225 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 225 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
226 lay->addWidget( cancel ); 226 lay->addWidget( cancel );
227 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 227 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
228 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 228 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
229 //resize( 200, 200 ); 229 //resize( 200, 200 );
230 230
231 } 231 }
232public: 232public:
233 QRadioButton* simple, *full, *reverse, *company; 233 QRadioButton* simple, *full, *reverse, *company;
234 QCheckBox* setCompany; 234 QCheckBox* setCompany;
235}; 235};
236 236
237 237
238 238
239class KAex2phonePrefs : public QDialog 239class KAex2phonePrefs : public QDialog
240{ 240{
241 public: 241 public:
242 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 242 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
243 QDialog( parent, name, true ) 243 QDialog( parent, name, true )
244 { 244 {
245 setCaption( i18n("Export to phone options") ); 245 setCaption( i18n("Export to phone options") );
246 QVBoxLayout* lay = new QVBoxLayout( this ); 246 QVBoxLayout* lay = new QVBoxLayout( this );
247 lay->setSpacing( 3 ); 247 lay->setSpacing( 3 );
248 lay->setMargin( 3 ); 248 lay->setMargin( 3 );
249 QLabel *lab; 249 QLabel *lab;
250 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 250 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
251 lab->setAlignment (AlignHCenter ); 251 lab->setAlignment (AlignHCenter );
252 QHBox* temphb; 252 QHBox* temphb;
253 temphb = new QHBox( this ); 253 temphb = new QHBox( this );
254 new QLabel( i18n("I/O device: "), temphb ); 254 new QLabel( i18n("I/O device: "), temphb );
255 mPhoneDevice = new QLineEdit( temphb); 255 mPhoneDevice = new QLineEdit( temphb);
256 lay->addWidget( temphb ); 256 lay->addWidget( temphb );
257 temphb = new QHBox( this ); 257 temphb = new QHBox( this );
258 new QLabel( i18n("Connection: "), temphb ); 258 new QLabel( i18n("Connection: "), temphb );
259 mPhoneConnection = new QLineEdit( temphb); 259 mPhoneConnection = new QLineEdit( temphb);
260 lay->addWidget( temphb ); 260 lay->addWidget( temphb );
261 temphb = new QHBox( this ); 261 temphb = new QHBox( this );
262 new QLabel( i18n("Model(opt.): "), temphb ); 262 new QLabel( i18n("Model(opt.): "), temphb );
263 mPhoneModel = new QLineEdit( temphb); 263 mPhoneModel = new QLineEdit( temphb);
264 lay->addWidget( temphb ); 264 lay->addWidget( temphb );
265 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); 265 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this );
266 // lay->addWidget( mWriteToSim ); 266 // lay->addWidget( mWriteToSim );
267 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); 267 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) );
268 lab->setAlignment (AlignHCenter); 268 lab->setAlignment (AlignHCenter);
269 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 269 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
270 lay->addWidget( ok ); 270 lay->addWidget( ok );
271 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 271 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
272 lay->addWidget( cancel ); 272 lay->addWidget( cancel );
273 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 273 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
274 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 274 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
275 resize( 220, 240 ); 275 resize( 220, 240 );
276 276
277 } 277 }
278 278
279public: 279public:
280 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 280 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
281 QCheckBox* mWriteToSim; 281 QCheckBox* mWriteToSim;
282}; 282};
283 283
284 284
285bool pasteWithNewUid = true; 285bool pasteWithNewUid = true;
286 286
287#ifdef KAB_EMBEDDED 287#ifdef KAB_EMBEDDED
288KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) 288KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name )
289 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 289 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
290 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 290 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
291 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 291 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
292#else //KAB_EMBEDDED 292#else //KAB_EMBEDDED
293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
296 mReadWrite( readWrite ), mModified( false ) 296 mReadWrite( readWrite ), mModified( false )
297#endif //KAB_EMBEDDED 297#endif //KAB_EMBEDDED
298{ 298{
299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
300 // syncManager->setBlockSave(false); 300 // syncManager->setBlockSave(false);
301 mIncSearchWidget = 0; 301 mIncSearchWidget = 0;
302 mMiniSplitter = 0; 302 mMiniSplitter = 0;
303 mExtensionBarSplitter = 0; 303 mExtensionBarSplitter = 0;
304 mIsPart = !parent->inherits( "KAddressBookMain" ); 304 mIsPart = !parent->inherits( "KAddressBookMain" );
305 mAddressBook = KABC::StdAddressBook::self(); 305 mAddressBook = KABC::StdAddressBook::self();
306 KABC::StdAddressBook::setAutomaticSave( false ); 306 KABC::StdAddressBook::setAutomaticSave( false );
307 307
308#ifndef KAB_EMBEDDED 308#ifndef KAB_EMBEDDED
309 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 309 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
310#endif //KAB_EMBEDDED 310#endif //KAB_EMBEDDED
311 311
312 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 312 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
313 SLOT( addressBookChanged() ) ); 313 SLOT( addressBookChanged() ) );
314 314
315#if 0 315#if 0
316 // LP moved to addressbook init method 316 // LP moved to addressbook init method
317 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 317 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
318 "X-Department", "KADDRESSBOOK" ); 318 "X-Department", "KADDRESSBOOK" );
319 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 319 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
320 "X-Profession", "KADDRESSBOOK" ); 320 "X-Profession", "KADDRESSBOOK" );
321 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 321 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
322 "X-AssistantsName", "KADDRESSBOOK" ); 322 "X-AssistantsName", "KADDRESSBOOK" );
323 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 323 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
324 "X-ManagersName", "KADDRESSBOOK" ); 324 "X-ManagersName", "KADDRESSBOOK" );
325 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 325 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
326 "X-SpousesName", "KADDRESSBOOK" ); 326 "X-SpousesName", "KADDRESSBOOK" );
327 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 327 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
328 "X-Office", "KADDRESSBOOK" ); 328 "X-Office", "KADDRESSBOOK" );
329 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 329 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
330 "X-IMAddress", "KADDRESSBOOK" ); 330 "X-IMAddress", "KADDRESSBOOK" );
331 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 331 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
332 "X-Anniversary", "KADDRESSBOOK" ); 332 "X-Anniversary", "KADDRESSBOOK" );
333 333
334 //US added this field to become compatible with Opie/qtopia addressbook 334 //US added this field to become compatible with Opie/qtopia addressbook
335 // values can be "female" or "male" or "". An empty field represents undefined. 335 // values can be "female" or "male" or "". An empty field represents undefined.
336 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, 336 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
337 "X-Gender", "KADDRESSBOOK" ); 337 "X-Gender", "KADDRESSBOOK" );
338 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 338 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
339 "X-Children", "KADDRESSBOOK" ); 339 "X-Children", "KADDRESSBOOK" );
340 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 340 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
341 "X-FreeBusyUrl", "KADDRESSBOOK" ); 341 "X-FreeBusyUrl", "KADDRESSBOOK" );
342#endif 342#endif
343 initGUI(); 343 initGUI();
344 344
345 mIncSearchWidget->setFocus(); 345 mIncSearchWidget->setFocus();
346 346
347 347
348 connect( mViewManager, SIGNAL( selected( const QString& ) ), 348 connect( mViewManager, SIGNAL( selected( const QString& ) ),
349 SLOT( setContactSelected( const QString& ) ) ); 349 SLOT( setContactSelected( const QString& ) ) );
350 connect( mViewManager, SIGNAL( executed( const QString& ) ), 350 connect( mViewManager, SIGNAL( executed( const QString& ) ),
351 SLOT( executeContact( const QString& ) ) ); 351 SLOT( executeContact( const QString& ) ) );
352 352
353 connect( mViewManager, SIGNAL( deleteRequest( ) ), 353 connect( mViewManager, SIGNAL( deleteRequest( ) ),
354 SLOT( deleteContacts( ) ) ); 354 SLOT( deleteContacts( ) ) );
355 connect( mViewManager, SIGNAL( modified() ), 355 connect( mViewManager, SIGNAL( modified() ),
356 SLOT( setModified() ) ); 356 SLOT( setModified() ) );
357 357
358 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 358 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
359 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); 359 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
360 360
361 connect( mXXPortManager, SIGNAL( modified() ), 361 connect( mXXPortManager, SIGNAL( modified() ),
362 SLOT( setModified() ) ); 362 SLOT( setModified() ) );
363 363
364 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 364 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
365 SLOT( incrementalSearch( const QString& ) ) ); 365 SLOT( incrementalSearch( const QString& ) ) );
366 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 366 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
367 mJumpButtonBar, SLOT( recreateButtons() ) ); 367 mJumpButtonBar, SLOT( recreateButtons() ) );
368 368
369 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 369 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
370 SLOT( sendMail( const QString& ) ) ); 370 SLOT( sendMail( const QString& ) ) );
371 371
372 372
373 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); 373 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&)));
374 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 374 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
375 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); 375 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&)));
376 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); 376 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle()));
377 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); 377 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog()));
378 378
379 379
380#ifndef KAB_EMBEDDED 380#ifndef KAB_EMBEDDED
381 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 381 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
382 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 382 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
383 383
384 connect( mDetails, SIGNAL( browse( const QString& ) ), 384 connect( mDetails, SIGNAL( browse( const QString& ) ),
385 SLOT( browse( const QString& ) ) ); 385 SLOT( browse( const QString& ) ) );
386 386
387 387
388 mAddressBookService = new KAddressBookService( this ); 388 mAddressBookService = new KAddressBookService( this );
389 389
390#endif //KAB_EMBEDDED 390#endif //KAB_EMBEDDED
391 391
392 mMessageTimer = new QTimer( this ); 392 mMessageTimer = new QTimer( this );
393 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); 393 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
394 mEditorDialog = 0; 394 mEditorDialog = 0;
395 createAddresseeEditorDialog( this ); 395 createAddresseeEditorDialog( this );
396 setModified( false ); 396 setModified( false );
397 mBRdisabled = false; 397 mBRdisabled = false;
398#ifndef DESKTOP_VERSION 398#ifndef DESKTOP_VERSION
399 infrared = 0; 399 infrared = 0;
400#endif 400#endif
401 //toggleBeamReceive( ); 401 //toggleBeamReceive( );
402 //mMainWindow->toolBar()->show(); 402 //mMainWindow->toolBar()->show();
403 // we have a toolbar repainting error on the Zaurus when starting KA/Pi 403 // we have a toolbar repainting error on the Zaurus when starting KA/Pi
404 QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 404 QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
405} 405}
406 406
407void KABCore::updateToolBar() 407void KABCore::updateToolBar()
408{ 408{
409 static int iii = 0; 409 static int iii = 0;
410 ++iii; 410 ++iii;
411 mMainWindow->toolBar()->repaintMe(); 411 mMainWindow->toolBar()->repaintMe();
412 if ( iii < 4 ) 412 if ( iii < 4 )
413 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); 413 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar()));
414} 414}
415KABCore::~KABCore() 415KABCore::~KABCore()
416{ 416{
417 // save(); 417 // save();
418 //saveSettings(); 418 //saveSettings();
419 //KABPrefs::instance()->writeConfig(); 419 //KABPrefs::instance()->writeConfig();
420 delete AddresseeConfig::instance(); 420 delete AddresseeConfig::instance();
421 mAddressBook = 0; 421 mAddressBook = 0;
422 KABC::StdAddressBook::close(); 422 KABC::StdAddressBook::close();
423 423
424 delete syncManager; 424 delete syncManager;
425#ifndef DESKTOP_VERSION 425#ifndef DESKTOP_VERSION
426 if ( infrared ) 426 if ( infrared )
427 delete infrared; 427 delete infrared;
428#endif 428#endif
429} 429}
430void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 430void KABCore::receive( const QCString& cmsg, const QByteArray& data )
431{ 431{
432 //qDebug("KA: QCOP message received: %s ", cmsg.data() ); 432 //qDebug("KA: QCOP message received: %s ", cmsg.data() );
433 if ( cmsg == "setDocument(QString)" ) { 433 if ( cmsg == "setDocument(QString)" ) {
434 QDataStream stream( data, IO_ReadOnly ); 434 QDataStream stream( data, IO_ReadOnly );
435 QString fileName; 435 QString fileName;
436 stream >> fileName; 436 stream >> fileName;
437 recieve( fileName ); 437 recieve( fileName );
438 return; 438 return;
439 } 439 }
440} 440}
441void KABCore::toggleBeamReceive( ) 441void KABCore::toggleBeamReceive( )
442{ 442{
443 if ( mBRdisabled ) 443 if ( mBRdisabled )
444 return; 444 return;
445#ifndef DESKTOP_VERSION 445#ifndef DESKTOP_VERSION
446 if ( infrared ) { 446 if ( infrared ) {
447 qDebug("KA: AB disable BeamReceive "); 447 qDebug("KA: AB disable BeamReceive ");
448 delete infrared; 448 delete infrared;
449 infrared = 0; 449 infrared = 0;
450 mActionBR->setChecked(false); 450 mActionBR->setChecked(false);
451 return; 451 return;
452 } 452 }
453 qDebug("KA: AB enable BeamReceive "); 453 qDebug("KA: AB enable BeamReceive ");
454 mActionBR->setChecked(true); 454 mActionBR->setChecked(true);
455 455
456 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 456 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
457 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 457 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& )));
458#endif 458#endif
459} 459}
460 460
461 461
462void KABCore::disableBR(bool b) 462void KABCore::disableBR(bool b)
463{ 463{
464#ifndef DESKTOP_VERSION 464#ifndef DESKTOP_VERSION
465 if ( b ) { 465 if ( b ) {
466 if ( infrared ) { 466 if ( infrared ) {
467 toggleBeamReceive( ); 467 toggleBeamReceive( );
468 } 468 }
469 mBRdisabled = true; 469 mBRdisabled = true;
470 } else { 470 } else {
471 if ( mBRdisabled ) { 471 if ( mBRdisabled ) {
472 mBRdisabled = false; 472 mBRdisabled = false;
473 //toggleBeamReceive( ); 473 //toggleBeamReceive( );
474 } 474 }
475 } 475 }
476#endif 476#endif
477 477
478} 478}
479void KABCore::recieve( QString fn ) 479void KABCore::recieve( QString fn )
480{ 480{
481 //qDebug("KABCore::recieve "); 481 //qDebug("KABCore::recieve ");
482 int count = mAddressBook->importFromFile( fn, true ); 482 int count = mAddressBook->importFromFile( fn, true );
483 if ( count ) 483 if ( count )
484 setModified( true ); 484 setModified( true );
485 mViewManager->refreshView(); 485 mViewManager->refreshView();
486 message(i18n("%1 contact(s) received!").arg( count )); 486 message(i18n("%1 contact(s) received!").arg( count ));
487 topLevelWidget()->showMaximized(); 487 topLevelWidget()->showMaximized();
488 topLevelWidget()->raise(); 488 topLevelWidget()->raise();
489} 489}
490void KABCore::restoreSettings() 490void KABCore::restoreSettings()
491{ 491{
492 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; 492 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
493 493
494 bool state; 494 bool state;
495 495
496 if (mMultipleViewsAtOnce) 496 if (mMultipleViewsAtOnce)
497 state = KABPrefs::instance()->mDetailsPageVisible; 497 state = KABPrefs::instance()->mDetailsPageVisible;
498 else 498 else
499 state = false; 499 state = false;
500 500
501 mActionDetails->setChecked( state ); 501 mActionDetails->setChecked( state );
502 setDetailsVisible( state ); 502 setDetailsVisible( state );
503 503
504 state = KABPrefs::instance()->mJumpButtonBarVisible; 504 state = KABPrefs::instance()->mJumpButtonBarVisible;
505 505
506 mActionJumpBar->setChecked( state ); 506 mActionJumpBar->setChecked( state );
507 setJumpButtonBarVisible( state ); 507 setJumpButtonBarVisible( state );
508/*US 508/*US
509 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; 509 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
510 if ( splitterSize.count() == 0 ) { 510 if ( splitterSize.count() == 0 ) {
511 splitterSize.append( width() / 2 ); 511 splitterSize.append( width() / 2 );
512 splitterSize.append( width() / 2 ); 512 splitterSize.append( width() / 2 );
513 } 513 }
514 mMiniSplitter->setSizes( splitterSize ); 514 mMiniSplitter->setSizes( splitterSize );
515 if ( mExtensionBarSplitter ) { 515 if ( mExtensionBarSplitter ) {
516 splitterSize = KABPrefs::instance()->mExtensionsSplitter; 516 splitterSize = KABPrefs::instance()->mExtensionsSplitter;
517 if ( splitterSize.count() == 0 ) { 517 if ( splitterSize.count() == 0 ) {
518 splitterSize.append( width() / 2 ); 518 splitterSize.append( width() / 2 );
519 splitterSize.append( width() / 2 ); 519 splitterSize.append( width() / 2 );
520 } 520 }
521 mExtensionBarSplitter->setSizes( splitterSize ); 521 mExtensionBarSplitter->setSizes( splitterSize );
522 522
523 } 523 }
524*/ 524*/
525 mViewManager->restoreSettings(); 525 mViewManager->restoreSettings();
526 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); 526 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
527 mExtensionManager->restoreSettings(); 527 mExtensionManager->restoreSettings();
528#ifdef DESKTOP_VERSION 528#ifdef DESKTOP_VERSION
529 int wid = width(); 529 int wid = width();
530 if ( wid < 10 ) 530 if ( wid < 10 )
531 wid = 400; 531 wid = 400;
532#else 532#else
533 int wid = QApplication::desktop()->width(); 533 int wid = QApplication::desktop()->width();
534 if ( wid < 640 ) 534 if ( wid < 640 )
535 wid = QApplication::desktop()->height(); 535 wid = QApplication::desktop()->height();
536#endif 536#endif
537 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; 537 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter;
538 if ( true /*splitterSize.count() == 0*/ ) { 538 if ( true /*splitterSize.count() == 0*/ ) {
539 splitterSize.append( wid / 2 ); 539 splitterSize.append( wid / 2 );
540 splitterSize.append( wid / 2 ); 540 splitterSize.append( wid / 2 );
541 } 541 }
542 mMiniSplitter->setSizes( splitterSize ); 542 mMiniSplitter->setSizes( splitterSize );
543 if ( mExtensionBarSplitter ) { 543 if ( mExtensionBarSplitter ) {
544 //splitterSize = KABPrefs::instance()->mExtensionsSplitter; 544 //splitterSize = KABPrefs::instance()->mExtensionsSplitter;
545 if ( true /*splitterSize.count() == 0*/ ) { 545 if ( true /*splitterSize.count() == 0*/ ) {
546 splitterSize.append( wid / 2 ); 546 splitterSize.append( wid / 2 );
547 splitterSize.append( wid / 2 ); 547 splitterSize.append( wid / 2 );
548 } 548 }
549 mExtensionBarSplitter->setSizes( splitterSize ); 549 mExtensionBarSplitter->setSizes( splitterSize );
550 550
551 } 551 }
552 552
553 553
554} 554}
555 555
556void KABCore::saveSettings() 556void KABCore::saveSettings()
557{ 557{
558 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); 558 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked();
559 if ( mExtensionBarSplitter ) 559 if ( mExtensionBarSplitter )
560 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 560 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
561 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); 561 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked();
562 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); 562 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes();
563#ifndef KAB_EMBEDDED 563#ifndef KAB_EMBEDDED
564 564
565 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 565 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
566 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); 566 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
567#endif //KAB_EMBEDDED 567#endif //KAB_EMBEDDED
568 mExtensionManager->saveSettings(); 568 mExtensionManager->saveSettings();
569 mViewManager->saveSettings(); 569 mViewManager->saveSettings();
570 570
571 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); 571 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
572 KABPrefs::instance()->writeConfig(); 572 KABPrefs::instance()->writeConfig();
573 qDebug("KA: KABCore::saveSettings() "); 573 qDebug("KA: KABCore::saveSettings() ");
574} 574}
575 575
576KABC::AddressBook *KABCore::addressBook() const 576KABC::AddressBook *KABCore::addressBook() const
577{ 577{
578 return mAddressBook; 578 return mAddressBook;
579} 579}
580 580
581KConfig *KABCore::config() 581KConfig *KABCore::config()
582{ 582{
583#ifndef KAB_EMBEDDED 583#ifndef KAB_EMBEDDED
584 return KABPrefs::instance()->config(); 584 return KABPrefs::instance()->config();
585#else //KAB_EMBEDDED 585#else //KAB_EMBEDDED
586 return KABPrefs::instance()->getConfig(); 586 return KABPrefs::instance()->getConfig();
587#endif //KAB_EMBEDDED 587#endif //KAB_EMBEDDED
588} 588}
589 589
590KActionCollection *KABCore::actionCollection() const 590KActionCollection *KABCore::actionCollection() const
591{ 591{
592 return mGUIClient->actionCollection(); 592 return mGUIClient->actionCollection();
593} 593}
594 594
595KABC::Field *KABCore::currentSearchField() const 595KABC::Field *KABCore::currentSearchField() const
596{ 596{
597 if (mIncSearchWidget) 597 if (mIncSearchWidget)
598 return mIncSearchWidget->currentField(); 598 return mIncSearchWidget->currentField();
599 else 599 else
600 return 0; 600 return 0;
601} 601}
602 602
603QStringList KABCore::selectedUIDs() const 603QStringList KABCore::selectedUIDs() const
604{ 604{
605 return mViewManager->selectedUids(); 605 return mViewManager->selectedUids();
606} 606}
607 607
608KABC::Resource *KABCore::requestResource( QWidget *parent ) 608KABC::Resource *KABCore::requestResource( QWidget *parent )
609{ 609{
610 QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); 610 QPtrList<KABC::Resource> kabcResources = addressBook()->resources();
611 611
612 QPtrList<KRES::Resource> kresResources; 612 QPtrList<KRES::Resource> kresResources;
613 QPtrListIterator<KABC::Resource> resIt( kabcResources ); 613 QPtrListIterator<KABC::Resource> resIt( kabcResources );
614 KABC::Resource *resource; 614 KABC::Resource *resource;
615 while ( ( resource = resIt.current() ) != 0 ) { 615 while ( ( resource = resIt.current() ) != 0 ) {
616 ++resIt; 616 ++resIt;
617 if ( !resource->readOnly() ) { 617 if ( !resource->readOnly() ) {
618 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 618 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
619 if ( res ) 619 if ( res )
620 kresResources.append( res ); 620 kresResources.append( res );
621 } 621 }
622 } 622 }
623 623
624 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); 624 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent );
625 return static_cast<KABC::Resource*>( res ); 625 return static_cast<KABC::Resource*>( res );
626} 626}
627 627
628#ifndef KAB_EMBEDDED 628#ifndef KAB_EMBEDDED
629KAboutData *KABCore::createAboutData() 629KAboutData *KABCore::createAboutData()
630#else //KAB_EMBEDDED 630#else //KAB_EMBEDDED
631void KABCore::createAboutData() 631void KABCore::createAboutData()
632#endif //KAB_EMBEDDED 632#endif //KAB_EMBEDDED
633{ 633{
634#ifndef KAB_EMBEDDED 634#ifndef KAB_EMBEDDED
635 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), 635 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ),
636 "3.1", I18N_NOOP( "The KDE Address Book" ), 636 "3.1", I18N_NOOP( "The KDE Address Book" ),
637 KAboutData::License_GPL_V2, 637 KAboutData::License_GPL_V2,
638 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); 638 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) );
639 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); 639 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" );
640 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); 640 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) );
641 about->addAuthor( "Cornelius Schumacher", 641 about->addAuthor( "Cornelius Schumacher",
642 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), 642 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ),
643 "schumacher@kde.org" ); 643 "schumacher@kde.org" );
644 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), 644 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ),
645 "mpilone@slac.com" ); 645 "mpilone@slac.com" );
646 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); 646 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) );
647 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); 647 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) );
648 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), 648 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ),
649 "michel@klaralvdalens-datakonsult.se" ); 649 "michel@klaralvdalens-datakonsult.se" );
650 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), 650 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ),
651 "hansen@kde.org" ); 651 "hansen@kde.org" );
652 652
653 return about; 653 return about;
654#endif //KAB_EMBEDDED 654#endif //KAB_EMBEDDED
655 655
656 QString version; 656 QString version;
657#include <../version> 657#include <../version>
658 QMessageBox::about( this, "About KAddressbook/Pi", 658 QMessageBox::about( this, "About KAddressbook/Pi",
659 "KAddressbook/Platform-independent\n" 659 "KAddressbook/Platform-independent\n"
660 "(KA/Pi) " +version + " - " + 660 "(KA/Pi) " +version + " - " +
661#ifdef DESKTOP_VERSION 661#ifdef DESKTOP_VERSION
662 "Desktop Edition\n" 662 "Desktop Edition\n"
663#else 663#else
664 "PDA-Edition\n" 664 "PDA-Edition\n"
665 "for: Zaurus 5500 / 7x0 / 8x0\n" 665 "for: Zaurus 5500 / 7x0 / 8x0\n"
666#endif 666#endif
667 667
668 "(c) 2004 Ulf Schenk\n" 668 "(c) 2004 Ulf Schenk\n"
669 "(c) 2004 Lutz Rogowski\n" 669 "(c) 2004 Lutz Rogowski\n"
670 "(c) 1997-2003, The KDE PIM Team\n" 670 "(c) 1997-2003, The KDE PIM Team\n"
671 "Tobias Koenig Current maintainer\ntokoe@kde.org\n" 671 "Tobias Koenig Current maintainer\ntokoe@kde.org\n"
672 "Don Sanders Original author\n" 672 "Don Sanders Original author\n"
673 "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" 673 "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n"
674 "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" 674 "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n"
675 "Greg Stern DCOP interface\n" 675 "Greg Stern DCOP interface\n"
676 "Mark Westcot Contact pinning\n" 676 "Mark Westcot Contact pinning\n"
677 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" 677 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n"
678 "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" 678 "Steffen Hansen LDAP Lookup\nhansen@kde.org\n"
679#ifdef _WIN32_ 679#ifdef _WIN32_
680 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" 680 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n"
681#endif 681#endif
682 ); 682 );
683} 683}
684 684
685void KABCore::setContactSelected( const QString &uid ) 685void KABCore::setContactSelected( const QString &uid )
686{ 686{
687 KABC::Addressee addr = mAddressBook->findByUid( uid ); 687 KABC::Addressee addr = mAddressBook->findByUid( uid );
688 if ( !mDetails->isHidden() ) 688 if ( !mDetails->isHidden() )
689 mDetails->setAddressee( addr ); 689 mDetails->setAddressee( addr );
690 690
691 if ( !addr.isEmpty() ) { 691 if ( !addr.isEmpty() ) {
692 emit contactSelected( addr.formattedName() ); 692 emit contactSelected( addr.formattedName() );
693 KABC::Picture pic = addr.photo(); 693 KABC::Picture pic = addr.photo();
694 if ( pic.isIntern() ) { 694 if ( pic.isIntern() ) {
695//US emit contactSelected( pic.data() ); 695//US emit contactSelected( pic.data() );
696//US instead use: 696//US instead use:
697 QPixmap px; 697 QPixmap px;
698 if (pic.data().isNull() != true) 698 if (pic.data().isNull() != true)
699 { 699 {
700 px.convertFromImage(pic.data()); 700 px.convertFromImage(pic.data());
701 } 701 }
702 702
703 emit contactSelected( px ); 703 emit contactSelected( px );
704 } 704 }
705 } 705 }
706 706
707 707
708 mExtensionManager->setSelectionChanged(); 708 mExtensionManager->setSelectionChanged();
709 709
710 // update the actions 710 // update the actions
711 bool selected = !uid.isEmpty(); 711 bool selected = !uid.isEmpty();
712 712
713 if ( mReadWrite ) { 713 if ( mReadWrite ) {
714 mActionCut->setEnabled( selected ); 714 mActionCut->setEnabled( selected );
715 mActionPaste->setEnabled( selected ); 715 mActionPaste->setEnabled( selected );
716 } 716 }
717 717
718 mActionCopy->setEnabled( selected ); 718 mActionCopy->setEnabled( selected );
719 mActionDelete->setEnabled( selected ); 719 mActionDelete->setEnabled( selected );
720 mActionEditAddressee->setEnabled( selected ); 720 mActionEditAddressee->setEnabled( selected );
721 mActionMail->setEnabled( selected ); 721 mActionMail->setEnabled( selected );
722 mActionMailVCard->setEnabled( selected ); 722 mActionMailVCard->setEnabled( selected );
723 //if (mActionBeam) 723 //if (mActionBeam)
724 //mActionBeam->setEnabled( selected ); 724 //mActionBeam->setEnabled( selected );
725 mActionWhoAmI->setEnabled( selected ); 725 mActionWhoAmI->setEnabled( selected );
726} 726}
727 727
728void KABCore::sendMail() 728void KABCore::sendMail()
729{ 729{
730 sendMail( mViewManager->selectedEmails().join( ", " ) ); 730 sendMail( mViewManager->selectedEmails().join( ", " ) );
731} 731}
732 732
733void KABCore::sendMail( const QString& emaillist ) 733void KABCore::sendMail( const QString& emaillist )
734{ 734{
735 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " 735 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... "
736 if (emaillist.contains(",") > 0) 736 if (emaillist.contains(",") > 0)
737 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); 737 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null );
738 else 738 else
739 ExternalAppHandler::instance()->mailToOneContact( emaillist ); 739 ExternalAppHandler::instance()->mailToOneContact( emaillist );
740} 740}
741 741
742 742
743 743
744void KABCore::mailVCard() 744void KABCore::mailVCard()
745{ 745{
746 QStringList uids = mViewManager->selectedUids(); 746 QStringList uids = mViewManager->selectedUids();
747 if ( !uids.isEmpty() ) 747 if ( !uids.isEmpty() )
748 mailVCard( uids ); 748 mailVCard( uids );
749} 749}
750 750
751void KABCore::mailVCard( const QStringList& uids ) 751void KABCore::mailVCard( const QStringList& uids )
752{ 752{
753 QStringList urls; 753 QStringList urls;
754 754
755// QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); 755// QString tmpdir = locateLocal("tmp", KGlobal::getAppName());
756 756
757 QString dirName = "/tmp/" + KApplication::randomString( 8 ); 757 QString dirName = "/tmp/" + KApplication::randomString( 8 );
758 758
759 759
760 760
761 QDir().mkdir( dirName, true ); 761 QDir().mkdir( dirName, true );
762 762
763 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 763 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
764 KABC::Addressee a = mAddressBook->findByUid( *it ); 764 KABC::Addressee a = mAddressBook->findByUid( *it );
765 765
766 if ( a.isEmpty() ) 766 if ( a.isEmpty() )
767 continue; 767 continue;
768 768
769 QString name = a.givenName() + "_" + a.familyName() + ".vcf"; 769 QString name = a.givenName() + "_" + a.familyName() + ".vcf";
770 770
771 QString fileName = dirName + "/" + name; 771 QString fileName = dirName + "/" + name;
772 772
773 QFile outFile(fileName); 773 QFile outFile(fileName);
774 774
775 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully 775 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully
776 KABC::VCardConverter converter; 776 KABC::VCardConverter converter;
777 QString vcard; 777 QString vcard;
778 778
779 converter.addresseeToVCard( a, vcard ); 779 converter.addresseeToVCard( a, vcard );
780 780
781 QTextStream t( &outFile ); // use a text stream 781 QTextStream t( &outFile ); // use a text stream
782 t.setEncoding( QTextStream::UnicodeUTF8 ); 782 t.setEncoding( QTextStream::UnicodeUTF8 );
783 t << vcard; 783 t << vcard;
784 784
785 outFile.close(); 785 outFile.close();
786 786
787 urls.append( fileName ); 787 urls.append( fileName );
788 } 788 }
789 } 789 }
790 790
791 bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); 791 bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") );
792 792
793 793
794/*US 794/*US
795 kapp->invokeMailer( QString::null, QString::null, QString::null, 795 kapp->invokeMailer( QString::null, QString::null, QString::null,
796 QString::null, // subject 796 QString::null, // subject
797 QString::null, // body 797 QString::null, // body
798 QString::null, 798 QString::null,
799 urls ); // attachments 799 urls ); // attachments
800*/ 800*/
801 801
802} 802}
803 803
804/** 804/**
805 Beams the "WhoAmI contact. 805 Beams the "WhoAmI contact.
806*/ 806*/
807void KABCore::beamMySelf() 807void KABCore::beamMySelf()
808{ 808{
809 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); 809 KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI();
810 if (!a.isEmpty()) 810 if (!a.isEmpty())
811 { 811 {
812 QStringList uids; 812 QStringList uids;
813 uids << a.uid(); 813 uids << a.uid();
814 814
815 beamVCard(uids); 815 beamVCard(uids);
816 } else { 816 } else {
817 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); 817 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
818 818
819 819
820 } 820 }
821} 821}
822void KABCore::updateMainWindow() 822void KABCore::updateMainWindow()
823{ 823{
824 mMainWindow->showMaximized(); 824 mMainWindow->showMaximized();
825 mMainWindow->update(); 825 mMainWindow->update();
826} 826}
827void KABCore::resizeEvent(QResizeEvent* e ) 827void KABCore::resizeEvent(QResizeEvent* e )
828{ 828{
829 if ( !mMiniSplitter ) 829 if ( !mMiniSplitter )
830 return; 830 return;
831 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); 831 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) ");
832 if ( QApplication::desktop()->width() >= 480 ) { 832 if ( QApplication::desktop()->width() >= 480 ) {
833 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 833 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480
834 if ( mMiniSplitter->orientation() == Qt::Vertical ) { 834 if ( mMiniSplitter->orientation() == Qt::Vertical ) {
835 mMiniSplitter->setOrientation( Qt::Horizontal); 835 mMiniSplitter->setOrientation( Qt::Horizontal);
836 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 836 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
837 } 837 }
838 if ( QApplication::desktop()->width() <= 640 ) { 838 if ( QApplication::desktop()->width() <= 640 ) {
839 mMainWindow->showMinimized(); 839 mMainWindow->showMinimized();
840 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 840 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
841 mViewManager->getFilterAction()->setComboWidth( 150 ); 841 mViewManager->getFilterAction()->setComboWidth( 150 );
842 if ( mIncSearchWidget ) 842 if ( mIncSearchWidget )
843 mIncSearchWidget->setSize(); 843 mIncSearchWidget->setSize();
844 QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); 844 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
845 } 845 }
846 846
847 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 847 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640
848 if ( mMiniSplitter->orientation() == Qt::Horizontal ) { 848 if ( mMiniSplitter->orientation() == Qt::Horizontal ) {
849 mMiniSplitter->setOrientation( Qt::Vertical ); 849 mMiniSplitter->setOrientation( Qt::Vertical );
850 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 850 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
851 } 851 }
852 if ( QApplication::desktop()->width() <= 640 ) { 852 if ( QApplication::desktop()->width() <= 640 ) {
853 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 853 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
854 mMainWindow->showMinimized(); 854 mMainWindow->showMinimized();
855 if ( KABPrefs::instance()->mHideSearchOnSwitch ) { 855 if ( KABPrefs::instance()->mHideSearchOnSwitch ) {
856 if ( mIncSearchWidget ) { 856 if ( mIncSearchWidget ) {
857 mIncSearchWidget->setSize(); 857 mIncSearchWidget->setSize();
858 } 858 }
859 } else { 859 } else {
860 mViewManager->getFilterAction()->setComboWidth( 0 ); 860 mViewManager->getFilterAction()->setComboWidth( 0 );
861 } 861 }
862 QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); 862 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
863 } 863 }
864 } 864 }
865 } 865 }
866 QWidget::resizeEvent( e ); 866 QWidget::resizeEvent( e );
867 867
868} 868}
869void KABCore::export2phone() 869void KABCore::export2phone()
870{ 870{
871 871
872 QStringList uids; 872 QStringList uids;
873 XXPortSelectDialog dlg( this, false, this ); 873 XXPortSelectDialog dlg( this, false, this );
874 if ( dlg.exec() ) 874 if ( dlg.exec() )
875 uids = dlg.uids(); 875 uids = dlg.uids();
876 else 876 else
877 return; 877 return;
878 if ( uids.isEmpty() ) 878 if ( uids.isEmpty() )
879 return; 879 return;
880 // qDebug("count %d ", uids.count()); 880 // qDebug("count %d ", uids.count());
881 881
882 KAex2phonePrefs ex2phone; 882 KAex2phonePrefs ex2phone;
883 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 883 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
884 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 884 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
885 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 885 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
886 886
887 if ( !ex2phone.exec() ) { 887 if ( !ex2phone.exec() ) {
888 return; 888 return;
889 } 889 }
890 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 890 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
891 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 891 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
892 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 892 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
893 893
894 894
895 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 895 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
896 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 896 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
897 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 897 KPimGlobalPrefs::instance()->mEx2PhoneModel );
898 898
899 QString fileName = getPhoneFile(); 899 QString fileName = getPhoneFile();
900 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) 900 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) )
901 return; 901 return;
902 902
903 message(i18n("Exporting to phone...")); 903 message(i18n("Exporting to phone..."));
904 QTimer::singleShot( 1, this , SLOT ( writeToPhone())); 904 QTimer::singleShot( 1, this , SLOT ( writeToPhone()));
905 905
906} 906}
907QString KABCore::getPhoneFile() 907QString KABCore::getPhoneFile()
908{ 908{
909#ifdef DESKTOP_VERSION 909#ifdef DESKTOP_VERSION
910 return locateLocal("tmp", "phonefile.vcf"); 910 return locateLocal("tmp", "phonefile.vcf");
911#else 911#else
912 return "/tmp/phonefile.vcf"; 912 return "/tmp/phonefile.vcf";
913#endif 913#endif
914 914
915} 915}
916void KABCore::writeToPhone( ) 916void KABCore::writeToPhone( )
917{ 917{
918 if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) 918 if ( PhoneAccess::writeToPhone( getPhoneFile() ) )
919 message(i18n("Export to phone finished!")); 919 message(i18n("Export to phone finished!"));
920 else 920 else
921 qDebug(i18n("KA: Error exporting to phone")); 921 qDebug(i18n("KA: Error exporting to phone"));
922} 922}
923void KABCore::beamVCard() 923void KABCore::beamVCard()
924{ 924{
925 QStringList uids; 925 QStringList uids;
926 XXPortSelectDialog dlg( this, false, this ); 926 XXPortSelectDialog dlg( this, false, this );
927 if ( dlg.exec() ) 927 if ( dlg.exec() )
928 uids = dlg.uids(); 928 uids = dlg.uids();
929 else 929 else
930 return; 930 return;
931 if ( uids.isEmpty() ) 931 if ( uids.isEmpty() )
932 return; 932 return;
933 beamVCard( uids ); 933 beamVCard( uids );
934} 934}
935 935
936 936
937void KABCore::beamVCard(const QStringList& uids) 937void KABCore::beamVCard(const QStringList& uids)
938{ 938{
939 939
940 // LR: we should use the /tmp dir on the Zaurus, 940 // LR: we should use the /tmp dir on the Zaurus,
941 // because: /tmp = RAM, (HOME)/kdepim = flash memory 941 // because: /tmp = RAM, (HOME)/kdepim = flash memory
942 942
943#ifdef DESKTOP_VERSION 943#ifdef DESKTOP_VERSION
944 QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); 944 QString fileName = locateLocal("tmp", "kapibeamfile.vcf");
945#else 945#else
946 QString fileName = "/tmp/kapibeamfile.vcf"; 946 QString fileName = "/tmp/kapibeamfile.vcf";
947#endif 947#endif
948 948
949 KABC::VCardConverter converter; 949 KABC::VCardConverter converter;
950 QString description; 950 QString description;
951 QString datastream; 951 QString datastream;
952 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 952 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
953 KABC::Addressee a = mAddressBook->findByUid( *it ); 953 KABC::Addressee a = mAddressBook->findByUid( *it );
954 954
955 if ( a.isEmpty() ) 955 if ( a.isEmpty() )
956 continue; 956 continue;
957 957
958 if (description.isEmpty()) 958 if (description.isEmpty())
959 description = a.formattedName(); 959 description = a.formattedName();
960 960
961 QString vcard; 961 QString vcard;
962 converter.addresseeToVCard( a, vcard ); 962 converter.addresseeToVCard( a, vcard );
963 int start = 0; 963 int start = 0;
964 int next; 964 int next;
965 while ( (next = vcard.find("TYPE=", start) )>= 0 ) { 965 while ( (next = vcard.find("TYPE=", start) )>= 0 ) {
966 int semi = vcard.find(";", next); 966 int semi = vcard.find(";", next);
967 int dopp = vcard.find(":", next); 967 int dopp = vcard.find(":", next);
968 int sep; 968 int sep;
969 if ( semi < dopp && semi >= 0 ) 969 if ( semi < dopp && semi >= 0 )
970 sep = semi ; 970 sep = semi ;
971 else 971 else
972 sep = dopp; 972 sep = dopp;
973 datastream +=vcard.mid( start, next - start); 973 datastream +=vcard.mid( start, next - start);
974 datastream +=vcard.mid( next+5,sep -next -5 ).upper(); 974 datastream +=vcard.mid( next+5,sep -next -5 ).upper();
975 start = sep; 975 start = sep;
976 } 976 }
977 datastream += vcard.mid( start,vcard.length() ); 977 datastream += vcard.mid( start,vcard.length() );
978 } 978 }
979#ifndef DESKTOP_VERSION 979#ifndef DESKTOP_VERSION
980 QFile outFile(fileName); 980 QFile outFile(fileName);
981 if ( outFile.open(IO_WriteOnly) ) { 981 if ( outFile.open(IO_WriteOnly) ) {
982 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 982 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
983 QTextStream t( &outFile ); // use a text stream 983 QTextStream t( &outFile ); // use a text stream
984 //t.setEncoding( QTextStream::UnicodeUTF8 ); 984 //t.setEncoding( QTextStream::UnicodeUTF8 );
985 t.setEncoding( QTextStream::Latin1 ); 985 t.setEncoding( QTextStream::Latin1 );
986 t <<datastream.latin1(); 986 t <<datastream.latin1();
987 outFile.close(); 987 outFile.close();
988 Ir *ir = new Ir( this ); 988 Ir *ir = new Ir( this );
989 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); 989 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
990 ir->send( fileName, description, "text/x-vCard" ); 990 ir->send( fileName, description, "text/x-vCard" );
991 } else { 991 } else {
992 qDebug("KA: Error open temp beam file "); 992 qDebug("KA: Error open temp beam file ");
993 return; 993 return;
994 } 994 }
995#endif 995#endif
996 996
997} 997}
998 998
999void KABCore::beamDone( Ir *ir ) 999void KABCore::beamDone( Ir *ir )
1000{ 1000{
1001#ifndef DESKTOP_VERSION 1001#ifndef DESKTOP_VERSION
1002 delete ir; 1002 delete ir;
1003#endif 1003#endif
1004 topLevelWidget()->raise(); 1004 topLevelWidget()->raise();
1005 message( i18n("Beaming finished!") ); 1005 message( i18n("Beaming finished!") );
1006} 1006}
1007 1007
1008 1008
1009void KABCore::browse( const QString& url ) 1009void KABCore::browse( const QString& url )
1010{ 1010{
1011#ifndef KAB_EMBEDDED 1011#ifndef KAB_EMBEDDED
1012 kapp->invokeBrowser( url ); 1012 kapp->invokeBrowser( url );
1013#else //KAB_EMBEDDED 1013#else //KAB_EMBEDDED
1014 qDebug("KABCore::browse must be fixed"); 1014 qDebug("KABCore::browse must be fixed");
1015#endif //KAB_EMBEDDED 1015#endif //KAB_EMBEDDED
1016} 1016}
1017 1017
1018void KABCore::selectAllContacts() 1018void KABCore::selectAllContacts()
1019{ 1019{
1020 mViewManager->setSelected( QString::null, true ); 1020 mViewManager->setSelected( QString::null, true );
1021} 1021}
1022 1022
1023void KABCore::deleteContacts() 1023void KABCore::deleteContacts()
1024{ 1024{
1025 QStringList uidList = mViewManager->selectedUids(); 1025 QStringList uidList = mViewManager->selectedUids();
1026 deleteContacts( uidList ); 1026 deleteContacts( uidList );
1027} 1027}
1028 1028
1029void KABCore::deleteContacts( const QStringList &uids ) 1029void KABCore::deleteContacts( const QStringList &uids )
1030{ 1030{
1031 if ( uids.count() > 0 ) { 1031 if ( uids.count() > 0 ) {
1032 PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); 1032 PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids );
1033 UndoStack::instance()->push( command ); 1033 UndoStack::instance()->push( command );
1034 RedoStack::instance()->clear(); 1034 RedoStack::instance()->clear();
1035 1035
1036 // now if we deleted anything, refresh 1036 // now if we deleted anything, refresh
1037 setContactSelected( QString::null ); 1037 setContactSelected( QString::null );
1038 setModified( true ); 1038 setModified( true );
1039 } 1039 }
1040} 1040}
1041 1041
1042void KABCore::copyContacts() 1042void KABCore::copyContacts()
1043{ 1043{
1044 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 1044 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
1045 1045
1046 QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); 1046 QString clipText = AddresseeUtil::addresseesToClipboard( addrList );
1047 1047
1048 kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; 1048 kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl;
1049 1049
1050 QClipboard *cb = QApplication::clipboard(); 1050 QClipboard *cb = QApplication::clipboard();
1051 cb->setText( clipText ); 1051 cb->setText( clipText );
1052} 1052}
1053 1053
1054void KABCore::cutContacts() 1054void KABCore::cutContacts()
1055{ 1055{
1056 QStringList uidList = mViewManager->selectedUids(); 1056 QStringList uidList = mViewManager->selectedUids();
1057 1057
1058//US if ( uidList.size() > 0 ) { 1058//US if ( uidList.size() > 0 ) {
1059 if ( uidList.count() > 0 ) { 1059 if ( uidList.count() > 0 ) {
1060 PwCutCommand *command = new PwCutCommand( mAddressBook, uidList ); 1060 PwCutCommand *command = new PwCutCommand( mAddressBook, uidList );
1061 UndoStack::instance()->push( command ); 1061 UndoStack::instance()->push( command );
1062 RedoStack::instance()->clear(); 1062 RedoStack::instance()->clear();
1063 1063
1064 setModified( true ); 1064 setModified( true );
1065 } 1065 }
1066} 1066}
1067 1067
1068void KABCore::pasteContacts() 1068void KABCore::pasteContacts()
1069{ 1069{
1070 QClipboard *cb = QApplication::clipboard(); 1070 QClipboard *cb = QApplication::clipboard();
1071 1071
1072 KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); 1072 KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() );
1073 1073
1074 pasteContacts( list ); 1074 pasteContacts( list );
1075} 1075}
1076 1076
1077void KABCore::pasteContacts( KABC::Addressee::List &list ) 1077void KABCore::pasteContacts( KABC::Addressee::List &list )
1078{ 1078{
1079 KABC::Resource *resource = requestResource( this ); 1079 KABC::Resource *resource = requestResource( this );
1080 KABC::Addressee::List::Iterator it; 1080 KABC::Addressee::List::Iterator it;
1081 for ( it = list.begin(); it != list.end(); ++it ) 1081 for ( it = list.begin(); it != list.end(); ++it )
1082 (*it).setResource( resource ); 1082 (*it).setResource( resource );
1083 1083
1084 PwPasteCommand *command = new PwPasteCommand( this, list ); 1084 PwPasteCommand *command = new PwPasteCommand( this, list );
1085 UndoStack::instance()->push( command ); 1085 UndoStack::instance()->push( command );
1086 RedoStack::instance()->clear(); 1086 RedoStack::instance()->clear();
1087 1087
1088 setModified( true ); 1088 setModified( true );
1089} 1089}
1090 1090
1091void KABCore::setWhoAmI() 1091void KABCore::setWhoAmI()
1092{ 1092{
1093 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 1093 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
1094 1094
1095 if ( addrList.count() > 1 ) { 1095 if ( addrList.count() > 1 ) {
1096 KMessageBox::sorry( this, i18n( "Please select only one contact." ) ); 1096 KMessageBox::sorry( this, i18n( "Please select only one contact." ) );
1097 return; 1097 return;
1098 } 1098 }
1099 1099
1100 QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) ); 1100 QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) );
1101 if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes ) 1101 if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes )
1102 static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); 1102 static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] );
1103} 1103}
1104void KABCore::editCategories() 1104void KABCore::editCategories()
1105{ 1105{
1106 KPIM::CategoryEditDialog dlg ( KABPrefs::instance(), this, "", true ); 1106 KPIM::CategoryEditDialog dlg ( KABPrefs::instance(), this, "", true );
1107 dlg.exec(); 1107 dlg.exec();
1108} 1108}
1109void KABCore::setCategories() 1109void KABCore::setCategories()
1110{ 1110{
1111 1111
1112 QStringList uids; 1112 QStringList uids;
1113 XXPortSelectDialog dlgx( this, false, this ); 1113 XXPortSelectDialog dlgx( this, false, this );
1114 if ( dlgx.exec() ) 1114 if ( dlgx.exec() )
1115 uids = dlgx.uids(); 1115 uids = dlgx.uids();
1116 else 1116 else
1117 return; 1117 return;
1118 if ( uids.isEmpty() ) 1118 if ( uids.isEmpty() )
1119 return; 1119 return;
1120 // qDebug("count %d ", uids.count()); 1120 // qDebug("count %d ", uids.count());
1121 1121
1122 1122
1123 KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); 1123 KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true );
1124 if ( !dlg.exec() ) { 1124 if ( !dlg.exec() ) {
1125 message( i18n("Setting categories cancelled") ); 1125 message( i18n("Setting categories cancelled") );
1126 return; 1126 return;
1127 } 1127 }
1128 bool merge = false; 1128 bool merge = false;
1129 QString msg = i18n( "Merge with existing categories?" ); 1129 QString msg = i18n( "Merge with existing categories?" );
1130 if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) 1130 if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes )
1131 merge = true; 1131 merge = true;
1132 1132
1133 message( i18n("Setting categories ... please wait!") ); 1133 message( i18n("Setting categories ... please wait!") );
1134 QStringList categories = dlg.selectedCategories(); 1134 QStringList categories = dlg.selectedCategories();
1135 1135
1136 //QStringList uids = mViewManager->selectedUids(); 1136 //QStringList uids = mViewManager->selectedUids();
1137 QStringList::Iterator it; 1137 QStringList::Iterator it;
1138 for ( it = uids.begin(); it != uids.end(); ++it ) { 1138 for ( it = uids.begin(); it != uids.end(); ++it ) {
1139 KABC::Addressee addr = mAddressBook->findByUid( *it ); 1139 KABC::Addressee addr = mAddressBook->findByUid( *it );
1140 if ( !addr.isEmpty() ) { 1140 if ( !addr.isEmpty() ) {
1141 if ( !merge ) 1141 if ( !merge )
1142 addr.setCategories( categories ); 1142 addr.setCategories( categories );
1143 else { 1143 else {
1144 QStringList addrCategories = addr.categories(); 1144 QStringList addrCategories = addr.categories();
1145 QStringList::Iterator catIt; 1145 QStringList::Iterator catIt;
1146 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { 1146 for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) {
1147 if ( !addrCategories.contains( *catIt ) ) 1147 if ( !addrCategories.contains( *catIt ) )
1148 addrCategories.append( *catIt ); 1148 addrCategories.append( *catIt );
1149 } 1149 }
1150 addr.setCategories( addrCategories ); 1150 addr.setCategories( addrCategories );
1151 } 1151 }
1152 mAddressBook->insertAddressee( addr ); 1152 mAddressBook->insertAddressee( addr );
1153 } 1153 }
1154 } 1154 }
1155 1155
1156 if ( uids.count() > 0 ) 1156 if ( uids.count() > 0 )
1157 setModified( true ); 1157 setModified( true );
1158 message( i18n("Setting categories completed!") ); 1158 message( i18n("Setting categories completed!") );
1159} 1159}
1160 1160
1161void KABCore::setSearchFields( const KABC::Field::List &fields ) 1161void KABCore::setSearchFields( const KABC::Field::List &fields )
1162{ 1162{
1163 mIncSearchWidget->setFields( fields ); 1163 mIncSearchWidget->setFields( fields );
1164} 1164}
1165 1165
1166void KABCore::incrementalSearch( const QString& text ) 1166void KABCore::incrementalSearch( const QString& text )
1167{ 1167{
1168 QString stext; 1168 QString stext;
1169 if ( KABPrefs::instance()->mAutoSearchWithWildcard ) { 1169 if ( KABPrefs::instance()->mAutoSearchWithWildcard ) {
1170 stext = "*" + text; 1170 stext = "*" + text;
1171 } else { 1171 } else {
1172 stext = text; 1172 stext = text;
1173 } 1173 }
1174 mViewManager->doSearch( stext, mIncSearchWidget->currentField() ); 1174 mViewManager->doSearch( stext, mIncSearchWidget->currentField() );
1175} 1175}
1176 1176
1177void KABCore::setModified() 1177void KABCore::setModified()
1178{ 1178{
1179 setModified( true ); 1179 setModified( true );
1180} 1180}
1181 1181
1182void KABCore::setModifiedWOrefresh() 1182void KABCore::setModifiedWOrefresh()
1183{ 1183{
1184 // qDebug("KABCore::setModifiedWOrefresh() "); 1184 // qDebug("KABCore::setModifiedWOrefresh() ");
1185 mModified = true; 1185 mModified = true;
1186 mActionSave->setEnabled( mModified ); 1186 mActionSave->setEnabled( mModified );
1187 1187
1188 1188
1189} 1189}
1190void KABCore::setModified( bool modified ) 1190void KABCore::setModified( bool modified )
1191{ 1191{
1192 mModified = modified; 1192 mModified = modified;
1193 mActionSave->setEnabled( mModified ); 1193 mActionSave->setEnabled( mModified );
1194 1194
1195 if ( modified ) 1195 if ( modified )
1196 mJumpButtonBar->recreateButtons(); 1196 mJumpButtonBar->recreateButtons();
1197 1197
1198 mViewManager->refreshView(); 1198 mViewManager->refreshView();
1199 1199
1200} 1200}
1201 1201
1202bool KABCore::modified() const 1202bool KABCore::modified() const
1203{ 1203{
1204 return mModified; 1204 return mModified;
1205} 1205}
1206 1206
1207void KABCore::contactModified( const KABC::Addressee &addr ) 1207void KABCore::contactModified( const KABC::Addressee &addr )
1208{ 1208{
1209 addrModified( addr ); 1209 addrModified( addr );
1210#if 0 // debug only 1210#if 0 // debug only
1211 KABC::Addressee ad = addr; 1211 KABC::Addressee ad = addr;
1212 ad.computeCsum( "123"); 1212 ad.computeCsum( "123");
1213#endif 1213#endif
1214} 1214}
1215 1215
1216void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) 1216void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails )
1217{ 1217{
1218 1218
1219 Command *command = 0; 1219 Command *command = 0;
1220 QString uid; 1220 QString uid;
1221 1221
1222 // check if it exists already 1222 // check if it exists already
1223 KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); 1223 KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() );
1224 if ( origAddr.isEmpty() ) 1224 if ( origAddr.isEmpty() )
1225 command = new PwNewCommand( mAddressBook, addr ); 1225 command = new PwNewCommand( mAddressBook, addr );
1226 else { 1226 else {
1227 command = new PwEditCommand( mAddressBook, origAddr, addr ); 1227 command = new PwEditCommand( mAddressBook, origAddr, addr );
1228 uid = addr.uid(); 1228 uid = addr.uid();
1229 } 1229 }
1230 1230
1231 UndoStack::instance()->push( command ); 1231 UndoStack::instance()->push( command );
1232 RedoStack::instance()->clear(); 1232 RedoStack::instance()->clear();
1233 if ( updateDetails ) 1233 if ( updateDetails )
1234 mDetails->setAddressee( addr ); 1234 mDetails->setAddressee( addr );
1235 setModified( true ); 1235 setModified( true );
1236} 1236}
1237 1237
1238void KABCore::newContact() 1238void KABCore::newContact()
1239{ 1239{
1240 1240
1241 1241
1242 QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); 1242 QPtrList<KABC::Resource> kabcResources = mAddressBook->resources();
1243 1243
1244 QPtrList<KRES::Resource> kresResources; 1244 QPtrList<KRES::Resource> kresResources;
1245 QPtrListIterator<KABC::Resource> it( kabcResources ); 1245 QPtrListIterator<KABC::Resource> it( kabcResources );
1246 KABC::Resource *resource; 1246 KABC::Resource *resource;
1247 while ( ( resource = it.current() ) != 0 ) { 1247 while ( ( resource = it.current() ) != 0 ) {
1248 ++it; 1248 ++it;
1249 if ( !resource->readOnly() ) { 1249 if ( !resource->readOnly() ) {
1250 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 1250 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
1251 if ( res ) 1251 if ( res )
1252 kresResources.append( res ); 1252 kresResources.append( res );
1253 } 1253 }
1254 } 1254 }
1255 1255
1256 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); 1256 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this );
1257 resource = static_cast<KABC::Resource*>( res ); 1257 resource = static_cast<KABC::Resource*>( res );
1258 1258
1259 if ( resource ) { 1259 if ( resource ) {
1260 KABC::Addressee addr; 1260 KABC::Addressee addr;
1261 addr.setResource( resource ); 1261 addr.setResource( resource );
1262 mEditorDialog->setAddressee( addr ); 1262 mEditorDialog->setAddressee( addr );
1263 mEditorDialog->setCaption( i18n("Edit new contact"));
1263 KApplication::execDialog ( mEditorDialog ); 1264 KApplication::execDialog ( mEditorDialog );
1264 1265
1265 } else 1266 } else
1266 return; 1267 return;
1267 1268
1268 // mEditorDict.insert( dialog->addressee().uid(), dialog ); 1269 // mEditorDict.insert( dialog->addressee().uid(), dialog );
1269 1270
1270 1271
1271} 1272}
1272 1273
1273void KABCore::addEmail( QString aStr ) 1274void KABCore::addEmail( QString aStr )
1274{ 1275{
1275#ifndef KAB_EMBEDDED 1276#ifndef KAB_EMBEDDED
1276 QString fullName, email; 1277 QString fullName, email;
1277 1278
1278 KABC::Addressee::parseEmailAddress( aStr, fullName, email ); 1279 KABC::Addressee::parseEmailAddress( aStr, fullName, email );
1279 1280
1280 // Try to lookup the addressee matching the email address 1281 // Try to lookup the addressee matching the email address
1281 bool found = false; 1282 bool found = false;
1282 QStringList emailList; 1283 QStringList emailList;
1283 KABC::AddressBook::Iterator it; 1284 KABC::AddressBook::Iterator it;
1284 for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) { 1285 for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) {
1285 emailList = (*it).emails(); 1286 emailList = (*it).emails();
1286 if ( emailList.contains( email ) > 0 ) { 1287 if ( emailList.contains( email ) > 0 ) {
1287 found = true; 1288 found = true;
1288 (*it).setNameFromString( fullName ); 1289 (*it).setNameFromString( fullName );
1289 editContact( (*it).uid() ); 1290 editContact( (*it).uid() );
1290 } 1291 }
1291 } 1292 }
1292 1293
1293 if ( !found ) { 1294 if ( !found ) {
1294 KABC::Addressee addr; 1295 KABC::Addressee addr;
1295 addr.setNameFromString( fullName ); 1296 addr.setNameFromString( fullName );
1296 addr.insertEmail( email, true ); 1297 addr.insertEmail( email, true );
1297 1298
1298 mAddressBook->insertAddressee( addr ); 1299 mAddressBook->insertAddressee( addr );
1299 mViewManager->refreshView( addr.uid() ); 1300 mViewManager->refreshView( addr.uid() );
1300 editContact( addr.uid() ); 1301 editContact( addr.uid() );
1301 } 1302 }
1302#else //KAB_EMBEDDED 1303#else //KAB_EMBEDDED
1303 qDebug("KABCore::addEmail finsih method"); 1304 qDebug("KABCore::addEmail finsih method");
1304#endif //KAB_EMBEDDED 1305#endif //KAB_EMBEDDED
1305} 1306}
1306 1307
1307void KABCore::importVCard( const KURL &url, bool showPreview ) 1308void KABCore::importVCard( const KURL &url, bool showPreview )
1308{ 1309{
1309 mXXPortManager->importVCard( url, showPreview ); 1310 mXXPortManager->importVCard( url, showPreview );
1310} 1311}
1311void KABCore::importFromOL() 1312void KABCore::importFromOL()
1312{ 1313{
1313#ifdef _OL_IMPORT_ 1314#ifdef _OL_IMPORT_
1314 KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this ); 1315 KAImportOLdialog* idgl = new KAImportOLdialog( i18n("Import Contacts from OL"), mAddressBook, this );
1315 idgl->exec(); 1316 idgl->exec();
1316 KABC::Addressee::List list = idgl->getAddressList(); 1317 KABC::Addressee::List list = idgl->getAddressList();
1317 if ( list.count() > 0 ) { 1318 if ( list.count() > 0 ) {
1318 KABC::Addressee::List listNew; 1319 KABC::Addressee::List listNew;
1319 KABC::Addressee::List listExisting; 1320 KABC::Addressee::List listExisting;
1320 KABC::Addressee::List::Iterator it; 1321 KABC::Addressee::List::Iterator it;
1321 KABC::AddressBook::Iterator iter; 1322 KABC::AddressBook::Iterator iter;
1322 for ( it = list.begin(); it != list.end(); ++it ) { 1323 for ( it = list.begin(); it != list.end(); ++it ) {
1323 if ( mAddressBook->findByUid((*it).uid() ).isEmpty()) 1324 if ( mAddressBook->findByUid((*it).uid() ).isEmpty())
1324 listNew.append( (*it) ); 1325 listNew.append( (*it) );
1325 else 1326 else
1326 listExisting.append( (*it) ); 1327 listExisting.append( (*it) );
1327 } 1328 }
1328 if ( listExisting.count() > 0 ) 1329 if ( listExisting.count() > 0 )
1329 KMessageBox::information( this, i18n("%1 contacts not added to addressbook\nbecause they were already in the addressbook!").arg( listExisting.count() )); 1330 KMessageBox::information( this, i18n("%1 contacts not added to addressbook\nbecause they were already in the addressbook!").arg( listExisting.count() ));
1330 if ( listNew.count() > 0 ) { 1331 if ( listNew.count() > 0 ) {
1331 pasteWithNewUid = false; 1332 pasteWithNewUid = false;
1332 pasteContacts( listNew ); 1333 pasteContacts( listNew );
1333 pasteWithNewUid = true; 1334 pasteWithNewUid = true;
1334 } 1335 }
1335 } 1336 }
1336 delete idgl; 1337 delete idgl;
1337#endif 1338#endif
1338} 1339}
1339 1340
1340void KABCore::importVCard( const QString &vCard, bool showPreview ) 1341void KABCore::importVCard( const QString &vCard, bool showPreview )
1341{ 1342{
1342 mXXPortManager->importVCard( vCard, showPreview ); 1343 mXXPortManager->importVCard( vCard, showPreview );
1343} 1344}
1344 1345
1345//US added a second method without defaultparameter 1346//US added a second method without defaultparameter
1346void KABCore::editContact2() { 1347void KABCore::editContact2() {
1347 editContact( QString::null ); 1348 editContact( QString::null );
1348} 1349}
1349 1350
1350void KABCore::editContact( const QString &uid ) 1351void KABCore::editContact( const QString &uid )
1351{ 1352{
1352 1353
1353 if ( mExtensionManager->isQuickEditVisible() ) 1354 if ( mExtensionManager->isQuickEditVisible() )
1354 return; 1355 return;
1355 1356
1356 // First, locate the contact entry 1357 // First, locate the contact entry
1357 QString localUID = uid; 1358 QString localUID = uid;
1358 if ( localUID.isNull() ) { 1359 if ( localUID.isNull() ) {
1359 QStringList uidList = mViewManager->selectedUids(); 1360 QStringList uidList = mViewManager->selectedUids();
1360 if ( uidList.count() > 0 ) 1361 if ( uidList.count() > 0 )
1361 localUID = *( uidList.at( 0 ) ); 1362 localUID = *( uidList.at( 0 ) );
1362 } 1363 }
1363 1364
1364 KABC::Addressee addr = mAddressBook->findByUid( localUID ); 1365 KABC::Addressee addr = mAddressBook->findByUid( localUID );
1365 if ( !addr.isEmpty() ) { 1366 if ( !addr.isEmpty() ) {
1366 mEditorDialog->setAddressee( addr ); 1367 mEditorDialog->setAddressee( addr );
1367 KApplication::execDialog ( mEditorDialog ); 1368 KApplication::execDialog ( mEditorDialog );
1368 } 1369 }
1369} 1370}
1370 1371
1371/** 1372/**
1372 Shows or edits the detail view for the given uid. If the uid is QString::null, 1373 Shows or edits the detail view for the given uid. If the uid is QString::null,
1373 the method will try to find a selected addressee in the view. 1374 the method will try to find a selected addressee in the view.
1374 */ 1375 */
1375void KABCore::executeContact( const QString &uid /*US = QString::null*/ ) 1376void KABCore::executeContact( const QString &uid /*US = QString::null*/ )
1376{ 1377{
1377 if ( mMultipleViewsAtOnce ) 1378 if ( mMultipleViewsAtOnce )
1378 { 1379 {
1379 editContact( uid ); 1380 editContact( uid );
1380 } 1381 }
1381 else 1382 else
1382 { 1383 {
1383 setDetailsVisible( true ); 1384 setDetailsVisible( true );
1384 mActionDetails->setChecked(true); 1385 mActionDetails->setChecked(true);
1385 } 1386 }
1386 1387
1387} 1388}
1388 1389
1389void KABCore::save() 1390void KABCore::save()
1390{ 1391{
1391 if (syncManager->blockSave()) 1392 if (syncManager->blockSave())
1392 return; 1393 return;
1393 if ( !mModified ) 1394 if ( !mModified )
1394 return; 1395 return;
1395 1396
1396 syncManager->setBlockSave(true); 1397 syncManager->setBlockSave(true);
1397 QString text = i18n( "There was an error while attempting to save\n the " 1398 QString text = i18n( "There was an error while attempting to save\n the "
1398 "address book. Please check that some \nother application is " 1399 "address book. Please check that some \nother application is "
1399 "not using it. " ); 1400 "not using it. " );
1400 message(i18n("Saving ... please wait! "), false); 1401 message(i18n("Saving ... please wait! "), false);
1401 //qApp->processEvents(); 1402 //qApp->processEvents();
1402#ifndef KAB_EMBEDDED 1403#ifndef KAB_EMBEDDED
1403 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); 1404 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook );
1404 if ( !b || !b->save() ) { 1405 if ( !b || !b->save() ) {
1405 KMessageBox::error( this, text, i18n( "Unable to Save" ) ); 1406 KMessageBox::error( this, text, i18n( "Unable to Save" ) );
1406 } 1407 }
1407#else //KAB_EMBEDDED 1408#else //KAB_EMBEDDED
1408 KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook ); 1409 KABC::StdAddressBook *b = (KABC::StdAddressBook*)( mAddressBook );
1409 if ( !b || !b->save() ) { 1410 if ( !b || !b->save() ) {
1410 QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok")); 1411 QMessageBox::critical( this, i18n( "Unable to Save" ), text, i18n("Ok"));
1411 } 1412 }
1412#endif //KAB_EMBEDDED 1413#endif //KAB_EMBEDDED
1413 1414
1414 message(i18n("Addressbook saved!")); 1415 message(i18n("Addressbook saved!"));
1415 setModified( false ); 1416 setModified( false );
1416 syncManager->setBlockSave(false); 1417 syncManager->setBlockSave(false);
1417} 1418}
1418 1419
1419 1420
1420void KABCore::undo() 1421void KABCore::undo()
1421{ 1422{
1422 UndoStack::instance()->undo(); 1423 UndoStack::instance()->undo();
1423 1424
1424 // Refresh the view 1425 // Refresh the view
1425 mViewManager->refreshView(); 1426 mViewManager->refreshView();
1426} 1427}
1427 1428
1428void KABCore::redo() 1429void KABCore::redo()
1429{ 1430{
1430 RedoStack::instance()->redo(); 1431 RedoStack::instance()->redo();
1431 1432
1432 // Refresh the view 1433 // Refresh the view
1433 mViewManager->refreshView(); 1434 mViewManager->refreshView();
1434} 1435}
1435void KABCore::setJumpButtonBar( bool visible ) 1436void KABCore::setJumpButtonBar( bool visible )
1436{ 1437{
1437 setJumpButtonBarVisible(visible ); 1438 setJumpButtonBarVisible(visible );
1438 saveSettings(); 1439 saveSettings();
1439} 1440}
1440void KABCore::setJumpButtonBarVisible( bool visible ) 1441void KABCore::setJumpButtonBarVisible( bool visible )
1441{ 1442{
1442 if (mMultipleViewsAtOnce) 1443 if (mMultipleViewsAtOnce)
1443 { 1444 {
1444 if ( visible ) 1445 if ( visible )
1445 mJumpButtonBar->show(); 1446 mJumpButtonBar->show();
1446 else 1447 else
1447 mJumpButtonBar->hide(); 1448 mJumpButtonBar->hide();
1448 } 1449 }
1449 else 1450 else
1450 { 1451 {
1451 // show the jumpbar only if "the details are hidden" == "viewmanager are shown" 1452 // show the jumpbar only if "the details are hidden" == "viewmanager are shown"
1452 if (mViewManager->isVisible()) 1453 if (mViewManager->isVisible())
1453 { 1454 {
1454 if ( visible ) 1455 if ( visible )
1455 mJumpButtonBar->show(); 1456 mJumpButtonBar->show();
1456 else 1457 else
1457 mJumpButtonBar->hide(); 1458 mJumpButtonBar->hide();
1458 } 1459 }
1459 else 1460 else
1460 { 1461 {
1461 mJumpButtonBar->hide(); 1462 mJumpButtonBar->hide();
1462 } 1463 }
1463 } 1464 }
1464 if ( visible ) { 1465 if ( visible ) {
1465 if ( mIncSearchWidget->currentItem() == 0 ) { 1466 if ( mIncSearchWidget->currentItem() == 0 ) {
1466 message( i18n("Change search field enable jump bar") ); 1467 message( i18n("Change search field enable jump bar") );
1467 } 1468 }
1468 } 1469 }
1469} 1470}
1470 1471
1471 1472
1472void KABCore::setDetailsToState() 1473void KABCore::setDetailsToState()
1473{ 1474{
1474 setDetailsVisible( mActionDetails->isChecked() ); 1475 setDetailsVisible( mActionDetails->isChecked() );
1475} 1476}
1476void KABCore::setDetailsToggle() 1477void KABCore::setDetailsToggle()
1477{ 1478{
1478 mActionDetails->setChecked( !mActionDetails->isChecked() ); 1479 mActionDetails->setChecked( !mActionDetails->isChecked() );
1479 setDetailsToState(); 1480 setDetailsToState();
1480} 1481}
1481 1482
1482 1483
1483 1484
1484void KABCore::setDetailsVisible( bool visible ) 1485void KABCore::setDetailsVisible( bool visible )
1485{ 1486{
1486 if (visible && mDetails->isHidden()) 1487 if (visible && mDetails->isHidden())
1487 { 1488 {
1488 KABC::Addressee::List addrList = mViewManager->selectedAddressees(); 1489 KABC::Addressee::List addrList = mViewManager->selectedAddressees();
1489 if ( addrList.count() > 0 ) 1490 if ( addrList.count() > 0 )
1490 mDetails->setAddressee( addrList[ 0 ] ); 1491 mDetails->setAddressee( addrList[ 0 ] );
1491 } 1492 }
1492 1493
1493 // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between 1494 // mMultipleViewsAtOnce=false: mDetails is always visible. But we switch between
1494 // the listview and the detailview. We do that by changing the splitbar size. 1495 // the listview and the detailview. We do that by changing the splitbar size.
1495 if (mMultipleViewsAtOnce) 1496 if (mMultipleViewsAtOnce)
1496 { 1497 {
1497 if ( visible ) 1498 if ( visible )
1498 mDetails->show(); 1499 mDetails->show();
1499 else 1500 else
1500 mDetails->hide(); 1501 mDetails->hide();
1501 } 1502 }
1502 else 1503 else
1503 { 1504 {
1504 if ( visible ) { 1505 if ( visible ) {
1505 mViewManager->hide(); 1506 mViewManager->hide();
1506 mDetails->show(); 1507 mDetails->show();
1507 mIncSearchWidget->setFocus(); 1508 mIncSearchWidget->setFocus();
1508 } 1509 }
1509 else { 1510 else {
1510 mViewManager->show(); 1511 mViewManager->show();
1511 mDetails->hide(); 1512 mDetails->hide();
1512 mViewManager->setFocusAV(); 1513 mViewManager->setFocusAV();
1513 } 1514 }
1514 setJumpButtonBarVisible( !visible ); 1515 setJumpButtonBarVisible( !visible );
1515 } 1516 }
1516 1517
1517} 1518}
1518 1519
1519void KABCore::extensionChanged( int id ) 1520void KABCore::extensionChanged( int id )
1520{ 1521{
1521 //change the details view only for non desktop systems 1522 //change the details view only for non desktop systems
1522#ifndef DESKTOP_VERSION 1523#ifndef DESKTOP_VERSION
1523 1524
1524 if (id == 0) 1525 if (id == 0)
1525 { 1526 {
1526 //the user disabled the extension. 1527 //the user disabled the extension.
1527 1528
1528 if (mMultipleViewsAtOnce) 1529 if (mMultipleViewsAtOnce)
1529 { // enable detailsview again 1530 { // enable detailsview again
1530 setDetailsVisible( true ); 1531 setDetailsVisible( true );
1531 mActionDetails->setChecked( true ); 1532 mActionDetails->setChecked( true );
1532 } 1533 }
1533 else 1534 else
1534 { //go back to the listview 1535 { //go back to the listview
1535 setDetailsVisible( false ); 1536 setDetailsVisible( false );
1536 mActionDetails->setChecked( false ); 1537 mActionDetails->setChecked( false );
1537 mActionDetails->setEnabled(true); 1538 mActionDetails->setEnabled(true);
1538 } 1539 }
1539 1540
1540 } 1541 }
1541 else 1542 else
1542 { 1543 {
1543 //the user enabled the extension. 1544 //the user enabled the extension.
1544 setDetailsVisible( false ); 1545 setDetailsVisible( false );
1545 mActionDetails->setChecked( false ); 1546 mActionDetails->setChecked( false );
1546 1547
1547 if (!mMultipleViewsAtOnce) 1548 if (!mMultipleViewsAtOnce)
1548 { 1549 {
1549 mActionDetails->setEnabled(false); 1550 mActionDetails->setEnabled(false);
1550 } 1551 }
1551 1552
1552 mExtensionManager->setSelectionChanged(); 1553 mExtensionManager->setSelectionChanged();
1553 1554
1554 } 1555 }
1555 1556
1556#endif// DESKTOP_VERSION 1557#endif// DESKTOP_VERSION
1557 1558
1558} 1559}
1559 1560
1560 1561
1561void KABCore::extensionModified( const KABC::Addressee::List &list ) 1562void KABCore::extensionModified( const KABC::Addressee::List &list )
1562{ 1563{
1563 1564
1564 if ( list.count() != 0 ) { 1565 if ( list.count() != 0 ) {
1565 KABC::Addressee::List::ConstIterator it; 1566 KABC::Addressee::List::ConstIterator it;
1566 for ( it = list.begin(); it != list.end(); ++it ) 1567 for ( it = list.begin(); it != list.end(); ++it )
1567 mAddressBook->insertAddressee( *it ); 1568 mAddressBook->insertAddressee( *it );
1568 if ( list.count() > 1 ) 1569 if ( list.count() > 1 )
1569 setModified(); 1570 setModified();
1570 else 1571 else
1571 setModifiedWOrefresh(); 1572 setModifiedWOrefresh();
1572 } 1573 }
1573 if ( list.count() == 0 ) 1574 if ( list.count() == 0 )
1574 mViewManager->refreshView(); 1575 mViewManager->refreshView();
1575 else 1576 else
1576 mViewManager->refreshView( list[ 0 ].uid() ); 1577 mViewManager->refreshView( list[ 0 ].uid() );
1577 1578
1578 1579
1579 1580
1580} 1581}
1581 1582
1582QString KABCore::getNameByPhone( const QString &phone ) 1583QString KABCore::getNameByPhone( const QString &phone )
1583{ 1584{
1584#ifndef KAB_EMBEDDED 1585#ifndef KAB_EMBEDDED
1585 QRegExp r( "[/*/-/ ]" ); 1586 QRegExp r( "[/*/-/ ]" );
1586 QString localPhone( phone ); 1587 QString localPhone( phone );
1587 1588
1588 bool found = false; 1589 bool found = false;
1589 QString ownerName = ""; 1590 QString ownerName = "";
1590 KABC::AddressBook::Iterator iter; 1591 KABC::AddressBook::Iterator iter;
1591 KABC::PhoneNumber::List::Iterator phoneIter; 1592 KABC::PhoneNumber::List::Iterator phoneIter;
1592 KABC::PhoneNumber::List phoneList; 1593 KABC::PhoneNumber::List phoneList;
1593 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) { 1594 for ( iter = mAddressBook->begin(); !found && ( iter != mAddressBook->end() ); ++iter ) {
1594 phoneList = (*iter).phoneNumbers(); 1595 phoneList = (*iter).phoneNumbers();
1595 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() ); 1596 for ( phoneIter = phoneList.begin(); !found && ( phoneIter != phoneList.end() );
1596 ++phoneIter) { 1597 ++phoneIter) {
1597 // Get rid of separator chars so just the numbers are compared. 1598 // Get rid of separator chars so just the numbers are compared.
1598 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) { 1599 if ( (*phoneIter).number().replace( r, "" ) == localPhone.replace( r, "" ) ) {
1599 ownerName = (*iter).formattedName(); 1600 ownerName = (*iter).formattedName();
1600 found = true; 1601 found = true;
1601 } 1602 }
1602 } 1603 }
1603 } 1604 }
1604 1605
1605 return ownerName; 1606 return ownerName;
1606#else //KAB_EMBEDDED 1607#else //KAB_EMBEDDED
1607 qDebug("KABCore::getNameByPhone finsih method"); 1608 qDebug("KABCore::getNameByPhone finsih method");
1608 return ""; 1609 return "";
1609#endif //KAB_EMBEDDED 1610#endif //KAB_EMBEDDED
1610 1611
1611} 1612}
1612 1613
1613void KABCore::openConfigDialog() 1614void KABCore::openConfigDialog()
1614{ 1615{
1615 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); 1616 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true );
1616 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); 1617 KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" );
1617 ConfigureDialog->addModule(kabcfg ); 1618 ConfigureDialog->addModule(kabcfg );
1618 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); 1619 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" );
1619 ConfigureDialog->addModule(kdelibcfg ); 1620 ConfigureDialog->addModule(kdelibcfg );
1620 1621
1621 connect( ConfigureDialog, SIGNAL( applyClicked() ), 1622 connect( ConfigureDialog, SIGNAL( applyClicked() ),
1622 this, SLOT( configurationChanged() ) ); 1623 this, SLOT( configurationChanged() ) );
1623 connect( ConfigureDialog, SIGNAL( okClicked() ), 1624 connect( ConfigureDialog, SIGNAL( okClicked() ),
1624 this, SLOT( configurationChanged() ) ); 1625 this, SLOT( configurationChanged() ) );
1625 saveSettings(); 1626 saveSettings();
1626#ifndef DESKTOP_VERSION 1627#ifndef DESKTOP_VERSION
1627 ConfigureDialog->showMaximized(); 1628 ConfigureDialog->showMaximized();
1628#endif 1629#endif
1629 if ( ConfigureDialog->exec() ) 1630 if ( ConfigureDialog->exec() )
1630 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); 1631 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") );
1631 delete ConfigureDialog; 1632 delete ConfigureDialog;
1632} 1633}
1633 1634
1634void KABCore::openLDAPDialog() 1635void KABCore::openLDAPDialog()
1635{ 1636{
1636#ifndef KAB_EMBEDDED 1637#ifndef KAB_EMBEDDED
1637 if ( !mLdapSearchDialog ) { 1638 if ( !mLdapSearchDialog ) {
1638 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this ); 1639 mLdapSearchDialog = new LDAPSearchDialog( mAddressBook, this );
1639 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager, 1640 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), mViewManager,
1640 SLOT( refreshView() ) ); 1641 SLOT( refreshView() ) );
1641 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this, 1642 connect( mLdapSearchDialog, SIGNAL( addresseesAdded() ), this,
1642 SLOT( setModified() ) ); 1643 SLOT( setModified() ) );
1643 } else 1644 } else
1644 mLdapSearchDialog->restoreSettings(); 1645 mLdapSearchDialog->restoreSettings();
1645 1646
1646 if ( mLdapSearchDialog->isOK() ) 1647 if ( mLdapSearchDialog->isOK() )
1647 mLdapSearchDialog->exec(); 1648 mLdapSearchDialog->exec();
1648#else //KAB_EMBEDDED 1649#else //KAB_EMBEDDED
1649 qDebug("KABCore::openLDAPDialog() finsih method"); 1650 qDebug("KABCore::openLDAPDialog() finsih method");
1650#endif //KAB_EMBEDDED 1651#endif //KAB_EMBEDDED
1651} 1652}
1652 1653
1653void KABCore::print() 1654void KABCore::print()
1654{ 1655{
1655#ifndef KAB_EMBEDDED 1656#ifndef KAB_EMBEDDED
1656 KPrinter printer; 1657 KPrinter printer;
1657 if ( !printer.setup( this ) ) 1658 if ( !printer.setup( this ) )
1658 return; 1659 return;
1659 1660
1660 KABPrinting::PrintingWizard wizard( &printer, mAddressBook, 1661 KABPrinting::PrintingWizard wizard( &printer, mAddressBook,
1661 mViewManager->selectedUids(), this ); 1662 mViewManager->selectedUids(), this );
1662 1663
1663 wizard.exec(); 1664 wizard.exec();
1664#else //KAB_EMBEDDED 1665#else //KAB_EMBEDDED
1665 qDebug("KABCore::print() finsih method"); 1666 qDebug("KABCore::print() finsih method");
1666#endif //KAB_EMBEDDED 1667#endif //KAB_EMBEDDED
1667 1668
1668} 1669}
1669 1670
1670 1671
1671void KABCore::addGUIClient( KXMLGUIClient *client ) 1672void KABCore::addGUIClient( KXMLGUIClient *client )
1672{ 1673{
1673 if ( mGUIClient ) 1674 if ( mGUIClient )
1674 mGUIClient->insertChildClient( client ); 1675 mGUIClient->insertChildClient( client );
1675 else 1676 else
1676 KMessageBox::error( this, "no KXMLGUICLient"); 1677 KMessageBox::error( this, "no KXMLGUICLient");
1677} 1678}
1678 1679
1679 1680
1680void KABCore::configurationChanged() 1681void KABCore::configurationChanged()
1681{ 1682{
1682 mExtensionManager->reconfigure(); 1683 mExtensionManager->reconfigure();
1683} 1684}
1684 1685
1685void KABCore::addressBookChanged() 1686void KABCore::addressBookChanged()
1686{ 1687{
1687/*US 1688/*US
1688 QDictIterator<AddresseeEditorDialog> it( mEditorDict ); 1689 QDictIterator<AddresseeEditorDialog> it( mEditorDict );
1689 while ( it.current() ) { 1690 while ( it.current() ) {
1690 if ( it.current()->dirty() ) { 1691 if ( it.current()->dirty() ) {
1691 QString text = i18n( "Data has been changed externally. Unsaved " 1692 QString text = i18n( "Data has been changed externally. Unsaved "
1692 "changes will be lost." ); 1693 "changes will be lost." );
1693 KMessageBox::information( this, text ); 1694 KMessageBox::information( this, text );
1694 } 1695 }
1695 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); 1696 it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) );
1696 ++it; 1697 ++it;
1697 } 1698 }
1698*/ 1699*/
1699 if (mEditorDialog) 1700 if (mEditorDialog)
1700 { 1701 {
1701 if (mEditorDialog->dirty()) 1702 if (mEditorDialog->dirty())
1702 { 1703 {
1703 QString text = i18n( "Data has been changed externally. Unsaved " 1704 QString text = i18n( "Data has been changed externally. Unsaved "
1704 "changes will be lost." ); 1705 "changes will be lost." );
1705 KMessageBox::information( this, text ); 1706 KMessageBox::information( this, text );
1706 } 1707 }
1707 QString currentuid = mEditorDialog->addressee().uid(); 1708 QString currentuid = mEditorDialog->addressee().uid();
1708 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); 1709 mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) );
1709 } 1710 }
1710 mViewManager->refreshView(); 1711 mViewManager->refreshView();
1711 1712
1712 1713
1713} 1714}
1714 1715
1715AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, 1716AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1716 const char *name ) 1717 const char *name )
1717{ 1718{
1718 1719
1719 if ( mEditorDialog == 0 ) { 1720 if ( mEditorDialog == 0 ) {
1720 mEditorDialog = new AddresseeEditorDialog( this, parent, 1721 mEditorDialog = new AddresseeEditorDialog( this, parent,
1721 name ? name : "editorDialog" ); 1722 name ? name : "editorDialog" );
1722 1723
1723 1724
1724 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), 1725 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
1725 SLOT( contactModified( const KABC::Addressee& ) ) ); 1726 SLOT( contactModified( const KABC::Addressee& ) ) );
1726 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), 1727 //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ),
1727 // SLOT( slotEditorDestroyed( const QString& ) ) ; 1728 // SLOT( slotEditorDestroyed( const QString& ) ) ;
1728 } 1729 }
1729 1730
1730 return mEditorDialog; 1731 return mEditorDialog;
1731} 1732}
1732 1733
1733void KABCore::slotEditorDestroyed( const QString &uid ) 1734void KABCore::slotEditorDestroyed( const QString &uid )
1734{ 1735{
1735 //mEditorDict.remove( uid ); 1736 //mEditorDict.remove( uid );
1736} 1737}
1737 1738
1738void KABCore::initGUI() 1739void KABCore::initGUI()
1739{ 1740{
1740#ifndef KAB_EMBEDDED 1741#ifndef KAB_EMBEDDED
1741 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1742 QHBoxLayout *topLayout = new QHBoxLayout( this );
1742 topLayout->setSpacing( KDialogBase::spacingHint() ); 1743 topLayout->setSpacing( KDialogBase::spacingHint() );
1743 1744
1744 mExtensionBarSplitter = new QSplitter( this ); 1745 mExtensionBarSplitter = new QSplitter( this );
1745 mExtensionBarSplitter->setOrientation( Qt::Vertical ); 1746 mExtensionBarSplitter->setOrientation( Qt::Vertical );
1746 1747
1747 mDetailsSplitter = new QSplitter( mExtensionBarSplitter ); 1748 mDetailsSplitter = new QSplitter( mExtensionBarSplitter );
1748 1749
1749 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1750 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1750 mIncSearchWidget = new IncSearchWidget( viewSpace ); 1751 mIncSearchWidget = new IncSearchWidget( viewSpace );
1751 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1752 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1752 SLOT( incrementalSearch( const QString& ) ) ); 1753 SLOT( incrementalSearch( const QString& ) ) );
1753 1754
1754 mViewManager = new ViewManager( this, viewSpace ); 1755 mViewManager = new ViewManager( this, viewSpace );
1755 viewSpace->setStretchFactor( mViewManager, 1 ); 1756 viewSpace->setStretchFactor( mViewManager, 1 );
1756 1757
1757 mDetails = new ViewContainer( mDetailsSplitter ); 1758 mDetails = new ViewContainer( mDetailsSplitter );
1758 1759
1759 mJumpButtonBar = new JumpButtonBar( this, this ); 1760 mJumpButtonBar = new JumpButtonBar( this, this );
1760 1761
1761 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1762 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1762 1763
1763 topLayout->addWidget( mExtensionBarSplitter ); 1764 topLayout->addWidget( mExtensionBarSplitter );
1764 topLayout->setStretchFactor( mExtensionBarSplitter, 100 ); 1765 topLayout->setStretchFactor( mExtensionBarSplitter, 100 );
1765 topLayout->addWidget( mJumpButtonBar ); 1766 topLayout->addWidget( mJumpButtonBar );
1766 //topLayout->setStretchFactor( mJumpButtonBar, 1 ); 1767 //topLayout->setStretchFactor( mJumpButtonBar, 1 );
1767 1768
1768 mXXPortManager = new XXPortManager( this, this ); 1769 mXXPortManager = new XXPortManager( this, this );
1769 1770
1770#else //KAB_EMBEDDED 1771#else //KAB_EMBEDDED
1771 //US initialize viewMenu before settingup viewmanager. 1772 //US initialize viewMenu before settingup viewmanager.
1772 // Viewmanager needs this menu to plugin submenues. 1773 // Viewmanager needs this menu to plugin submenues.
1773 viewMenu = new QPopupMenu( this ); 1774 viewMenu = new QPopupMenu( this );
1774 settingsMenu = new QPopupMenu( this ); 1775 settingsMenu = new QPopupMenu( this );
1775 //filterMenu = new QPopupMenu( this ); 1776 //filterMenu = new QPopupMenu( this );
1776 ImportMenu = new QPopupMenu( this ); 1777 ImportMenu = new QPopupMenu( this );
1777 ExportMenu = new QPopupMenu( this ); 1778 ExportMenu = new QPopupMenu( this );
1778 syncMenu = new QPopupMenu( this ); 1779 syncMenu = new QPopupMenu( this );
1779 changeMenu= new QPopupMenu( this ); 1780 changeMenu= new QPopupMenu( this );
1780 beamMenu= new QPopupMenu( this ); 1781 beamMenu= new QPopupMenu( this );
1781 1782
1782//US since we have no splitter for the embedded system, setup 1783//US since we have no splitter for the embedded system, setup
1783// a layout with two frames. One left and one right. 1784// a layout with two frames. One left and one right.
1784 1785
1785 QBoxLayout *topLayout; 1786 QBoxLayout *topLayout;
1786 1787
1787 // = new QHBoxLayout( this ); 1788 // = new QHBoxLayout( this );
1788// QBoxLayout *topLayout = (QBoxLayout*)layout(); 1789// QBoxLayout *topLayout = (QBoxLayout*)layout();
1789 1790
1790// QWidget *mainBox = new QWidget( this ); 1791// QWidget *mainBox = new QWidget( this );
1791// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox); 1792// QBoxLayout * mainBoxLayout = new QHBoxLayout(mainBox);
1792 1793
1793#ifdef DESKTOP_VERSION 1794#ifdef DESKTOP_VERSION
1794 topLayout = new QHBoxLayout( this ); 1795 topLayout = new QHBoxLayout( this );
1795 1796
1796 1797
1797 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1798 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1798 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1799 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1799 1800
1800 topLayout->addWidget(mMiniSplitter ); 1801 topLayout->addWidget(mMiniSplitter );
1801 1802
1802 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter ); 1803 mExtensionBarSplitter = new KDGanttMinimizeSplitter( Qt::Vertical,mMiniSplitter );
1803 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1804 mExtensionBarSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1804 mViewManager = new ViewManager( this, mExtensionBarSplitter ); 1805 mViewManager = new ViewManager( this, mExtensionBarSplitter );
1805 mDetails = new ViewContainer( mMiniSplitter ); 1806 mDetails = new ViewContainer( mMiniSplitter );
1806 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter ); 1807 mExtensionManager = new ExtensionManager( this, mExtensionBarSplitter );
1807#else 1808#else
1808 if ( QApplication::desktop()->width() > 480 ) { 1809 if ( QApplication::desktop()->width() > 480 ) {
1809 topLayout = new QHBoxLayout( this ); 1810 topLayout = new QHBoxLayout( this );
1810 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 1811 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
1811 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 1812 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
1812 } else { 1813 } else {
1813 1814
1814 topLayout = new QHBoxLayout( this ); 1815 topLayout = new QHBoxLayout( this );
1815 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this); 1816 mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Vertical, this);
1816 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 1817 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
1817 } 1818 }
1818 1819
1819 topLayout->addWidget(mMiniSplitter ); 1820 topLayout->addWidget(mMiniSplitter );
1820 mViewManager = new ViewManager( this, mMiniSplitter ); 1821 mViewManager = new ViewManager( this, mMiniSplitter );
1821 mDetails = new ViewContainer( mMiniSplitter ); 1822 mDetails = new ViewContainer( mMiniSplitter );
1822 1823
1823 1824
1824 mExtensionManager = new ExtensionManager( this, mMiniSplitter ); 1825 mExtensionManager = new ExtensionManager( this, mMiniSplitter );
1825#endif 1826#endif
1826 //eh->hide(); 1827 //eh->hide();
1827 // topLayout->addWidget(mExtensionManager ); 1828 // topLayout->addWidget(mExtensionManager );
1828 1829
1829 1830
1830/*US 1831/*US
1831#ifndef KAB_NOSPLITTER 1832#ifndef KAB_NOSPLITTER
1832 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1833 QHBoxLayout *topLayout = new QHBoxLayout( this );
1833//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1834//US topLayout->setSpacing( KDialogBase::spacingHint() );
1834 topLayout->setSpacing( 10 ); 1835 topLayout->setSpacing( 10 );
1835 1836
1836 mDetailsSplitter = new QSplitter( this ); 1837 mDetailsSplitter = new QSplitter( this );
1837 1838
1838 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1839 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1839 1840
1840 mViewManager = new ViewManager( this, viewSpace ); 1841 mViewManager = new ViewManager( this, viewSpace );
1841 viewSpace->setStretchFactor( mViewManager, 1 ); 1842 viewSpace->setStretchFactor( mViewManager, 1 );
1842 1843
1843 mDetails = new ViewContainer( mDetailsSplitter ); 1844 mDetails = new ViewContainer( mDetailsSplitter );
1844 1845
1845 topLayout->addWidget( mDetailsSplitter ); 1846 topLayout->addWidget( mDetailsSplitter );
1846 topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1847 topLayout->setStretchFactor( mDetailsSplitter, 100 );
1847#else //KAB_NOSPLITTER 1848#else //KAB_NOSPLITTER
1848 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1849 QHBoxLayout *topLayout = new QHBoxLayout( this );
1849//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1850//US topLayout->setSpacing( KDialogBase::spacingHint() );
1850 topLayout->setSpacing( 10 ); 1851 topLayout->setSpacing( 10 );
1851 1852
1852// mDetailsSplitter = new QSplitter( this ); 1853// mDetailsSplitter = new QSplitter( this );
1853 1854
1854 QVBox *viewSpace = new QVBox( this ); 1855 QVBox *viewSpace = new QVBox( this );
1855 1856
1856 mViewManager = new ViewManager( this, viewSpace ); 1857 mViewManager = new ViewManager( this, viewSpace );
1857 viewSpace->setStretchFactor( mViewManager, 1 ); 1858 viewSpace->setStretchFactor( mViewManager, 1 );
1858 1859
1859 mDetails = new ViewContainer( this ); 1860 mDetails = new ViewContainer( this );
1860 1861
1861 topLayout->addWidget( viewSpace ); 1862 topLayout->addWidget( viewSpace );
1862// topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1863// topLayout->setStretchFactor( mDetailsSplitter, 100 );
1863 topLayout->addWidget( mDetails ); 1864 topLayout->addWidget( mDetails );
1864#endif //KAB_NOSPLITTER 1865#endif //KAB_NOSPLITTER
1865*/ 1866*/
1866 1867
1867 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 1868 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
1868 syncManager->setBlockSave(false); 1869 syncManager->setBlockSave(false);
1869 1870
1870 connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 1871 connect(syncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
1871 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 1872 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
1872 QString sync_file = sentSyncFile(); 1873 QString sync_file = sentSyncFile();
1873 //qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1()); 1874 //qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1());
1874 syncManager->setDefaultFileName( sync_file ); 1875 syncManager->setDefaultFileName( sync_file );
1875 //connect(syncManager , SIGNAL( ), this, SLOT( ) ); 1876 //connect(syncManager , SIGNAL( ), this, SLOT( ) );
1876 1877
1877#endif //KAB_EMBEDDED 1878#endif //KAB_EMBEDDED
1878 initActions(); 1879 initActions();
1879 1880
1880#ifdef KAB_EMBEDDED 1881#ifdef KAB_EMBEDDED
1881 addActionsManually(); 1882 addActionsManually();
1882 //US make sure the export and import menues are initialized before creating the xxPortManager. 1883 //US make sure the export and import menues are initialized before creating the xxPortManager.
1883 mXXPortManager = new XXPortManager( this, this ); 1884 mXXPortManager = new XXPortManager( this, this );
1884 1885
1885 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); 1886 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
1886 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); 1887 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
1887 // mActionQuit->plug ( mMainWindow->toolBar()); 1888 // mActionQuit->plug ( mMainWindow->toolBar());
1888 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); 1889 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() );
1889 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); 1890 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget);
1890 // mIncSearchWidget->hide(); 1891 // mIncSearchWidget->hide();
1891 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1892 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1892 SLOT( incrementalSearch( const QString& ) ) ); 1893 SLOT( incrementalSearch( const QString& ) ) );
1893 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); 1894 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) );
1894 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); 1895 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) );
1895 1896
1896 mJumpButtonBar = new JumpButtonBar( this, this ); 1897 mJumpButtonBar = new JumpButtonBar( this, this );
1897 1898
1898 topLayout->addWidget( mJumpButtonBar ); 1899 topLayout->addWidget( mJumpButtonBar );
1899//US topLayout->setStretchFactor( mJumpButtonBar, 10 ); 1900//US topLayout->setStretchFactor( mJumpButtonBar, 10 );
1900 1901
1901// mMainWindow->getIconToolBar()->raise(); 1902// mMainWindow->getIconToolBar()->raise();
1902 1903
1903#endif //KAB_EMBEDDED 1904#endif //KAB_EMBEDDED
1904 1905
1905} 1906}
1906void KABCore::initActions() 1907void KABCore::initActions()
1907{ 1908{
1908//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1909//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1909 1910
1910#ifndef KAB_EMBEDDED 1911#ifndef KAB_EMBEDDED
1911 connect( QApplication::clipboard(), SIGNAL( dataChanged() ), 1912 connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
1912 SLOT( clipboardDataChanged() ) ); 1913 SLOT( clipboardDataChanged() ) );
1913#endif //KAB_EMBEDDED 1914#endif //KAB_EMBEDDED
1914 1915
1915 // file menu 1916 // file menu
1916 1917
1917 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); 1918 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
1918 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 1919 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
1919 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, 1920 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager,
1920 SLOT( printView() ), actionCollection(), "kaddressbook_print" ); 1921 SLOT( printView() ), actionCollection(), "kaddressbook_print" );
1921 1922
1922 1923
1923 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails, 1924 mActionPrintDetails = new KAction( i18n( "&Print Details" ), "fileprint", 0, mDetails,
1924 SLOT( printView() ), actionCollection(), "kaddressbook_print2" ); 1925 SLOT( printView() ), actionCollection(), "kaddressbook_print2" );
1925 1926
1926 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this, 1927 mActionSave = new KAction( i18n( "&Save" ), "filesave", CTRL+Key_S, this,
1927 SLOT( save() ), actionCollection(), "file_sync" ); 1928 SLOT( save() ), actionCollection(), "file_sync" );
1928 1929
1929 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this, 1930 mActionNewContact = new KAction( i18n( "&New Contact..." ), "filenew", CTRL+Key_N, this,
1930 SLOT( newContact() ), actionCollection(), "file_new_contact" ); 1931 SLOT( newContact() ), actionCollection(), "file_new_contact" );
1931 1932
1932 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0, 1933 mActionMailVCard = new KAction(i18n("Mail &vCard..."), "mail_post_to", 0,
1933 this, SLOT( mailVCard() ), 1934 this, SLOT( mailVCard() ),
1934 actionCollection(), "file_mail_vcard"); 1935 actionCollection(), "file_mail_vcard");
1935 1936
1936 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this, 1937 mActionExport2phone = new KAction( i18n( "Export to phone" ), "ex2phone", 0, this,
1937 SLOT( export2phone() ), actionCollection(), 1938 SLOT( export2phone() ), actionCollection(),
1938 "kaddressbook_ex2phone" ); 1939 "kaddressbook_ex2phone" );
1939 1940
1940 mActionBeamVCard = 0; 1941 mActionBeamVCard = 0;
1941 mActionBeam = 0; 1942 mActionBeam = 0;
1942 1943
1943#ifndef DESKTOP_VERSION 1944#ifndef DESKTOP_VERSION
1944 if ( Ir::supported() ) { 1945 if ( Ir::supported() ) {
1945 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this, 1946 mActionBeamVCard = new KAction( i18n( "Beam v&Card(s)..." ), "beam", 0, this,
1946 SLOT( beamVCard() ), actionCollection(), 1947 SLOT( beamVCard() ), actionCollection(),
1947 "kaddressbook_beam_vcard" ); 1948 "kaddressbook_beam_vcard" );
1948 1949
1949 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, 1950 mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this,
1950 SLOT( beamMySelf() ), actionCollection(), 1951 SLOT( beamMySelf() ), actionCollection(),
1951 "kaddressbook_beam_myself" ); 1952 "kaddressbook_beam_myself" );
1952 } 1953 }
1953#endif 1954#endif
1954 1955
1955 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0, 1956 mActionEditAddressee = new KAction( i18n( "&Edit Contact..." ), "edit", 0,
1956 this, SLOT( editContact2() ), 1957 this, SLOT( editContact2() ),
1957 actionCollection(), "file_properties" ); 1958 actionCollection(), "file_properties" );
1958 1959
1959#ifdef KAB_EMBEDDED 1960#ifdef KAB_EMBEDDED
1960 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() ); 1961 // mActionQuit = KStdAction::quit( mMainWindow, SLOT( exit() ), actionCollection() );
1961 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0, 1962 mActionQuit = new KAction( i18n( "&Exit" ), "exit", 0,
1962 mMainWindow, SLOT( exit() ), 1963 mMainWindow, SLOT( exit() ),
1963 actionCollection(), "quit" ); 1964 actionCollection(), "quit" );
1964#endif //KAB_EMBEDDED 1965#endif //KAB_EMBEDDED
1965 1966
1966 // edit menu 1967 // edit menu
1967 if ( mIsPart ) { 1968 if ( mIsPart ) {
1968 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this, 1969 mActionCopy = new KAction( i18n( "&Copy" ), "editcopy", CTRL + Key_C, this,
1969 SLOT( copyContacts() ), actionCollection(), 1970 SLOT( copyContacts() ), actionCollection(),
1970 "kaddressbook_copy" ); 1971 "kaddressbook_copy" );
1971 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this, 1972 mActionCut = new KAction( i18n( "Cu&t" ), "editcut", CTRL + Key_X, this,
1972 SLOT( cutContacts() ), actionCollection(), 1973 SLOT( cutContacts() ), actionCollection(),
1973 "kaddressbook_cut" ); 1974 "kaddressbook_cut" );
1974 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this, 1975 mActionPaste = new KAction( i18n( "&Paste" ), "editpaste", CTRL + Key_V, this,
1975 SLOT( pasteContacts() ), actionCollection(), 1976 SLOT( pasteContacts() ), actionCollection(),
1976 "kaddressbook_paste" ); 1977 "kaddressbook_paste" );
1977 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this, 1978 mActionSelectAll = new KAction( i18n( "Select &All" ), CTRL + Key_A, this,
1978 SLOT( selectAllContacts() ), actionCollection(), 1979 SLOT( selectAllContacts() ), actionCollection(),
1979 "kaddressbook_select_all" ); 1980 "kaddressbook_select_all" );
1980 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this, 1981 mActionUndo = new KAction( i18n( "&Undo" ), "undo", CTRL + Key_Z, this,
1981 SLOT( undo() ), actionCollection(), 1982 SLOT( undo() ), actionCollection(),
1982 "kaddressbook_undo" ); 1983 "kaddressbook_undo" );
1983 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z, 1984 mActionRedo = new KAction( i18n( "Re&do" ), "redo", CTRL + SHIFT + Key_Z,
1984 this, SLOT( redo() ), actionCollection(), 1985 this, SLOT( redo() ), actionCollection(),
1985 "kaddressbook_redo" ); 1986 "kaddressbook_redo" );
1986 } else { 1987 } else {
1987 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() ); 1988 mActionCopy = KStdAction::copy( this, SLOT( copyContacts() ), actionCollection() );
1988 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() ); 1989 mActionCut = KStdAction::cut( this, SLOT( cutContacts() ), actionCollection() );
1989 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() ); 1990 mActionPaste = KStdAction::paste( this, SLOT( pasteContacts() ), actionCollection() );
1990 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() ); 1991 mActionSelectAll = KStdAction::selectAll( this, SLOT( selectAllContacts() ), actionCollection() );
1991 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() ); 1992 mActionUndo = KStdAction::undo( this, SLOT( undo() ), actionCollection() );
1992 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() ); 1993 mActionRedo = KStdAction::redo( this, SLOT( redo() ), actionCollection() );
1993 } 1994 }
1994 1995
1995 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete", 1996 mActionDelete = new KAction( i18n( "&Delete Contact" ), "editdelete",
1996 Key_Delete, this, SLOT( deleteContacts() ), 1997 Key_Delete, this, SLOT( deleteContacts() ),
1997 actionCollection(), "edit_delete" ); 1998 actionCollection(), "edit_delete" );
1998 1999
1999 mActionUndo->setEnabled( false ); 2000 mActionUndo->setEnabled( false );
2000 mActionRedo->setEnabled( false ); 2001 mActionRedo->setEnabled( false );
2001 2002
2002 // settings menu 2003 // settings menu
2003#ifdef KAB_EMBEDDED 2004#ifdef KAB_EMBEDDED
2004//US special menuentry to configure the addressbook resources. On KDE 2005//US special menuentry to configure the addressbook resources. On KDE
2005// you do that through the control center !!! 2006// you do that through the control center !!!
2006 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this, 2007 mActionConfigResources = new KAction( i18n( "Configure &Resources..." ), "configure_resources", 0, this,
2007 SLOT( configureResources() ), actionCollection(), 2008 SLOT( configureResources() ), actionCollection(),
2008 "kaddressbook_configure_resources" ); 2009 "kaddressbook_configure_resources" );
2009#endif //KAB_EMBEDDED 2010#endif //KAB_EMBEDDED
2010 2011
2011 if ( mIsPart ) { 2012 if ( mIsPart ) {
2012 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this, 2013 mActionConfigKAddressbook = new KAction( i18n( "&Configure KAddressBook..." ), "configure", 0, this,
2013 SLOT( openConfigDialog() ), actionCollection(), 2014 SLOT( openConfigDialog() ), actionCollection(),
2014 "kaddressbook_configure" ); 2015 "kaddressbook_configure" );
2015 2016
2016 //US not implemented yet 2017 //US not implemented yet
2017 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0, 2018 //mActionConfigShortcuts = new KAction( i18n( "Configure S&hortcuts..." ), "configure_shortcuts", 0,
2018 // this, SLOT( configureKeyBindings() ), actionCollection(), 2019 // this, SLOT( configureKeyBindings() ), actionCollection(),
2019 // "kaddressbook_configure_shortcuts" ); 2020 // "kaddressbook_configure_shortcuts" );
2020#ifdef KAB_EMBEDDED 2021#ifdef KAB_EMBEDDED
2021 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() ); 2022 mActionConfigureToolbars = KStdAction::configureToolbars( this, SLOT( mMainWindow->configureToolbars() ), actionCollection() );
2022 mActionConfigureToolbars->setEnabled( false ); 2023 mActionConfigureToolbars->setEnabled( false );
2023#endif //KAB_EMBEDDED 2024#endif //KAB_EMBEDDED
2024 2025
2025 } else { 2026 } else {
2026 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); 2027 mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() );
2027 2028
2028 //US not implemented yet 2029 //US not implemented yet
2029 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); 2030 //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() );
2030 } 2031 }
2031 2032
2032 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, 2033 mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0,
2033 actionCollection(), "options_show_jump_bar" ); 2034 actionCollection(), "options_show_jump_bar" );
2034 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) ); 2035 connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) );
2035 2036
2036 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0, 2037 mActionDetails = new KToggleAction( i18n( "Show Details" ), "listview", 0,
2037 actionCollection(), "options_show_details" ); 2038 actionCollection(), "options_show_details" );
2038 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) ); 2039 connect( mActionDetails, SIGNAL( toggled( bool ) ), SLOT( setDetailsVisible( bool ) ) );
2039 2040
2040 2041
2041 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this, 2042 mActionBR = new KToggleAction( i18n( "Beam receive enabled" ), "beam", 0, this,
2042 SLOT( toggleBeamReceive() ), actionCollection(), 2043 SLOT( toggleBeamReceive() ), actionCollection(),
2043 "kaddressbook_beam_rec" ); 2044 "kaddressbook_beam_rec" );
2044 2045
2045 2046
2046 // misc 2047 // misc
2047 // only enable LDAP lookup if we can handle the protocol 2048 // only enable LDAP lookup if we can handle the protocol
2048#ifndef KAB_EMBEDDED 2049#ifndef KAB_EMBEDDED
2049 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) { 2050 if ( KProtocolInfo::isKnownProtocol( KURL( "ldap://localhost" ) ) ) {
2050 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0, 2051 new KAction( i18n( "&Lookup Addresses in Directory" ), "find", 0,
2051 this, SLOT( openLDAPDialog() ), actionCollection(), 2052 this, SLOT( openLDAPDialog() ), actionCollection(),
2052 "ldap_lookup" ); 2053 "ldap_lookup" );
2053 } 2054 }
2054#else //KAB_EMBEDDED 2055#else //KAB_EMBEDDED
2055 //qDebug("KABCore::initActions() LDAP has to be implemented"); 2056 //qDebug("KABCore::initActions() LDAP has to be implemented");
2056#endif //KAB_EMBEDDED 2057#endif //KAB_EMBEDDED
2057 2058
2058 2059
2059 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, 2060 mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this,
2060 SLOT( setWhoAmI() ), actionCollection(), 2061 SLOT( setWhoAmI() ), actionCollection(),
2061 "set_personal" ); 2062 "set_personal" );
2062 2063
2063 2064
2064 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this, 2065 mActionCategories = new KAction( i18n( "Set Categories for Contacts..." ), 0, this,
2065 SLOT( setCategories() ), actionCollection(), 2066 SLOT( setCategories() ), actionCollection(),
2066 "edit_set_categories" ); 2067 "edit_set_categories" );
2067 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this, 2068 mActionEditCategories = new KAction( i18n( "Edit Category List..." ), 0, this,
2068 SLOT( editCategories() ), actionCollection(), 2069 SLOT( editCategories() ), actionCollection(),
2069 "edit__categories" ); 2070 "edit__categories" );
2070 2071
2071 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this, 2072 mActionRemoveVoice = new KAction( i18n( "Remove \"voice\"..." ), 0, this,
2072 SLOT( removeVoice() ), actionCollection(), 2073 SLOT( removeVoice() ), actionCollection(),
2073 "remove_voice" ); 2074 "remove_voice" );
2074 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this, 2075 mActionSetFormattedName = new KAction( i18n( "Set formatted name..." ), 0, this,
2075 SLOT( setFormattedName() ), actionCollection(), 2076 SLOT( setFormattedName() ), actionCollection(),
2076 "set_formatted" ); 2077 "set_formatted" );
2077 2078
2078 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, 2079 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this,
2079 SLOT( manageCategories() ), actionCollection(), 2080 SLOT( manageCategories() ), actionCollection(),
2080 "remove_voice" ); 2081 "remove_voice" );
2081 2082
2082 2083
2083 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, 2084 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this,
2084 SLOT( importFromOL() ), actionCollection(), 2085 SLOT( importFromOL() ), actionCollection(),
2085 "import_OL" ); 2086 "import_OL" );
2086#ifdef KAB_EMBEDDED 2087#ifdef KAB_EMBEDDED
2087 mActionLicence = new KAction( i18n( "Licence" ), 0, 2088 mActionLicence = new KAction( i18n( "Licence" ), 0,
2088 this, SLOT( showLicence() ), actionCollection(), 2089 this, SLOT( showLicence() ), actionCollection(),
2089 "licence_about_data" ); 2090 "licence_about_data" );
2090 mActionFaq = new KAction( i18n( "Faq" ), 0, 2091 mActionFaq = new KAction( i18n( "Faq" ), 0,
2091 this, SLOT( faq() ), actionCollection(), 2092 this, SLOT( faq() ), actionCollection(),
2092 "faq_about_data" ); 2093 "faq_about_data" );
2093 mActionWN = new KAction( i18n( "What's New?" ), 0, 2094 mActionWN = new KAction( i18n( "What's New?" ), 0,
2094 this, SLOT( whatsnew() ), actionCollection(), 2095 this, SLOT( whatsnew() ), actionCollection(),
2095 "wn" ); 2096 "wn" );
2096 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 2097 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
2097 this, SLOT( synchowto() ), actionCollection(), 2098 this, SLOT( synchowto() ), actionCollection(),
2098 "sync" ); 2099 "sync" );
2099 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, 2100 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0,
2100 this, SLOT( kdesynchowto() ), actionCollection(), 2101 this, SLOT( kdesynchowto() ), actionCollection(),
2101 "kdesync" ); 2102 "kdesync" );
2102 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, 2103 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0,
2103 this, SLOT( multisynchowto() ), actionCollection(), 2104 this, SLOT( multisynchowto() ), actionCollection(),
2104 "multisync" ); 2105 "multisync" );
2105 2106
2106 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 2107 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
2107 this, SLOT( createAboutData() ), actionCollection(), 2108 this, SLOT( createAboutData() ), actionCollection(),
2108 "kaddressbook_about_data" ); 2109 "kaddressbook_about_data" );
2109#endif //KAB_EMBEDDED 2110#endif //KAB_EMBEDDED
2110 2111
2111 clipboardDataChanged(); 2112 clipboardDataChanged();
2112 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2113 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2113 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2114 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2114} 2115}
2115 2116
2116//US we need this function, to plug all actions into the correct menues. 2117//US we need this function, to plug all actions into the correct menues.
2117// KDE uses a XML format to plug the actions, but we work her without this overhead. 2118// KDE uses a XML format to plug the actions, but we work her without this overhead.
2118void KABCore::addActionsManually() 2119void KABCore::addActionsManually()
2119{ 2120{
2120//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2121//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2121 2122
2122#ifdef KAB_EMBEDDED 2123#ifdef KAB_EMBEDDED
2123 QPopupMenu *fileMenu = new QPopupMenu( this ); 2124 QPopupMenu *fileMenu = new QPopupMenu( this );
2124 QPopupMenu *editMenu = new QPopupMenu( this ); 2125 QPopupMenu *editMenu = new QPopupMenu( this );
2125 QPopupMenu *helpMenu = new QPopupMenu( this ); 2126 QPopupMenu *helpMenu = new QPopupMenu( this );
2126 2127
2127 KToolBar* tb = mMainWindow->toolBar(); 2128 KToolBar* tb = mMainWindow->toolBar();
2128 2129
2129#ifndef DESKTOP_VERSION 2130#ifndef DESKTOP_VERSION
2130 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2131 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2131#endif 2132#endif
2132 QMenuBar* mb = mMainWindow->menuBar(); 2133 QMenuBar* mb = mMainWindow->menuBar();
2133 2134
2134 //US setup menubar. 2135 //US setup menubar.
2135 //Disable the following block if you do not want to have a menubar. 2136 //Disable the following block if you do not want to have a menubar.
2136 mb->insertItem( i18n("&File"), fileMenu ); 2137 mb->insertItem( i18n("&File"), fileMenu );
2137 mb->insertItem( i18n("&Edit"), editMenu ); 2138 mb->insertItem( i18n("&Edit"), editMenu );
2138 mb->insertItem( i18n("&View"), viewMenu ); 2139 mb->insertItem( i18n("&View"), viewMenu );
2139 mb->insertItem( i18n("&Settings"), settingsMenu ); 2140 mb->insertItem( i18n("&Settings"), settingsMenu );
2140#ifdef DESKTOP_VERSION 2141#ifdef DESKTOP_VERSION
2141 mb->insertItem( i18n("Synchronize"), syncMenu ); 2142 mb->insertItem( i18n("Synchronize"), syncMenu );
2142#else 2143#else
2143 mb->insertItem( i18n("Sync"), syncMenu ); 2144 mb->insertItem( i18n("Sync"), syncMenu );
2144#endif 2145#endif
2145 //mb->insertItem( i18n("&Change"), changeMenu ); 2146 //mb->insertItem( i18n("&Change"), changeMenu );
2146 mb->insertItem( i18n("&Help"), helpMenu ); 2147 mb->insertItem( i18n("&Help"), helpMenu );
2147 mIncSearchWidget = new IncSearchWidget( tb ); 2148 mIncSearchWidget = new IncSearchWidget( tb );
2148 // tb->insertWidget(-1, 0, mIncSearchWidget); 2149 // tb->insertWidget(-1, 0, mIncSearchWidget);
2149#ifndef DESKTOP_VERSION 2150#ifndef DESKTOP_VERSION
2150 } else { 2151 } else {
2151 //US setup toolbar 2152 //US setup toolbar
2152 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2153 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2153 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2154 QPopupMenu *popupBarTB = new QPopupMenu( this );
2154 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); 2155 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
2155 tb->insertWidget(-1, 0, menuBarTB); 2156 tb->insertWidget(-1, 0, menuBarTB);
2156 mIncSearchWidget = new IncSearchWidget( tb ); 2157 mIncSearchWidget = new IncSearchWidget( tb );
2157 tb->enableMoving(false); 2158 tb->enableMoving(false);
2158 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2159 popupBarTB->insertItem( i18n("&File"), fileMenu );
2159 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2160 popupBarTB->insertItem( i18n("&Edit"), editMenu );
2160 popupBarTB->insertItem( i18n("&View"), viewMenu ); 2161 popupBarTB->insertItem( i18n("&View"), viewMenu );
2161 popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); 2162 popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
2162 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 2163 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
2163 mViewManager->getFilterAction()->plug ( popupBarTB); 2164 mViewManager->getFilterAction()->plug ( popupBarTB);
2164 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); 2165 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
2165 popupBarTB->insertItem( i18n("&Help"), helpMenu ); 2166 popupBarTB->insertItem( i18n("&Help"), helpMenu );
2166 if (QApplication::desktop()->width() > 320 ) { 2167 if (QApplication::desktop()->width() > 320 ) {
2167 // mViewManager->getFilterAction()->plug ( tb); 2168 // mViewManager->getFilterAction()->plug ( tb);
2168 } 2169 }
2169 } 2170 }
2170#endif 2171#endif
2171 // mActionQuit->plug ( mMainWindow->toolBar()); 2172 // mActionQuit->plug ( mMainWindow->toolBar());
2172 2173
2173 2174
2174 2175
2175 //US Now connect the actions with the menue entries. 2176 //US Now connect the actions with the menue entries.
2176#ifdef DESKTOP_VERSION 2177#ifdef DESKTOP_VERSION
2177 mActionPrint->plug( fileMenu ); 2178 mActionPrint->plug( fileMenu );
2178 mActionPrintDetails->plug( fileMenu ); 2179 mActionPrintDetails->plug( fileMenu );
2179 fileMenu->insertSeparator(); 2180 fileMenu->insertSeparator();
2180#endif 2181#endif
2181 mActionMail->plug( fileMenu ); 2182 mActionMail->plug( fileMenu );
2182 fileMenu->insertSeparator(); 2183 fileMenu->insertSeparator();
2183 2184
2184 mActionNewContact->plug( fileMenu ); 2185 mActionNewContact->plug( fileMenu );
2185 mActionNewContact->plug( tb ); 2186 mActionNewContact->plug( tb );
2186 2187
2187 mActionEditAddressee->plug( fileMenu ); 2188 mActionEditAddressee->plug( fileMenu );
2188 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 2189 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
2189 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 2190 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
2190 mActionEditAddressee->plug( tb ); 2191 mActionEditAddressee->plug( tb );
2191 2192
2192 fileMenu->insertSeparator(); 2193 fileMenu->insertSeparator();
2193 mActionSave->plug( fileMenu ); 2194 mActionSave->plug( fileMenu );
2194 fileMenu->insertItem( "&Import", ImportMenu ); 2195 fileMenu->insertItem( "&Import", ImportMenu );
2195 fileMenu->insertItem( "&Export", ExportMenu ); 2196 fileMenu->insertItem( "&Export", ExportMenu );
2196 fileMenu->insertItem( i18n("&Change"), changeMenu ); 2197 fileMenu->insertItem( i18n("&Change"), changeMenu );
2197#ifndef DESKTOP_VERSION 2198#ifndef DESKTOP_VERSION
2198 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); 2199 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu );
2199#endif 2200#endif
2200#if 0 2201#if 0
2201 // PENDING fix MailVCard 2202 // PENDING fix MailVCard
2202 fileMenu->insertSeparator(); 2203 fileMenu->insertSeparator();
2203 mActionMailVCard->plug( fileMenu ); 2204 mActionMailVCard->plug( fileMenu );
2204#endif 2205#endif
2205#ifndef DESKTOP_VERSION 2206#ifndef DESKTOP_VERSION
2206 if ( Ir::supported() ) mActionBR->plug( beamMenu ); 2207 if ( Ir::supported() ) mActionBR->plug( beamMenu );
2207 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu ); 2208 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
2208 if ( Ir::supported() ) mActionBeam->plug( beamMenu ); 2209 if ( Ir::supported() ) mActionBeam->plug( beamMenu );
2209#endif 2210#endif
2210 fileMenu->insertSeparator(); 2211 fileMenu->insertSeparator();
2211 mActionQuit->plug( fileMenu ); 2212 mActionQuit->plug( fileMenu );
2212#ifdef _OL_IMPORT_ 2213#ifdef _OL_IMPORT_
2213 mActionImportOL->plug( ImportMenu ); 2214 mActionImportOL->plug( ImportMenu );
2214#endif 2215#endif
2215 // edit menu 2216 // edit menu
2216 mActionUndo->plug( editMenu ); 2217 mActionUndo->plug( editMenu );
2217 mActionRedo->plug( editMenu ); 2218 mActionRedo->plug( editMenu );
2218 editMenu->insertSeparator(); 2219 editMenu->insertSeparator();
2219 mActionCut->plug( editMenu ); 2220 mActionCut->plug( editMenu );
2220 mActionCopy->plug( editMenu ); 2221 mActionCopy->plug( editMenu );
2221 mActionPaste->plug( editMenu ); 2222 mActionPaste->plug( editMenu );
2222 mActionDelete->plug( editMenu ); 2223 mActionDelete->plug( editMenu );
2223 editMenu->insertSeparator(); 2224 editMenu->insertSeparator();
2224 mActionSelectAll->plug( editMenu ); 2225 mActionSelectAll->plug( editMenu );
2225 2226
2226 mActionSetFormattedName->plug( changeMenu ); 2227 mActionSetFormattedName->plug( changeMenu );
2227 mActionRemoveVoice->plug( changeMenu ); 2228 mActionRemoveVoice->plug( changeMenu );
2228 // settingsmings menu 2229 // settingsmings menu
2229//US special menuentry to configure the addressbook resources. On KDE 2230//US special menuentry to configure the addressbook resources. On KDE
2230// you do that through the control center !!! 2231// you do that through the control center !!!
2231 // settingsMenu->insertSeparator(); 2232 // settingsMenu->insertSeparator();
2232 2233
2233 mActionConfigKAddressbook->plug( settingsMenu, 0 ); 2234 mActionConfigKAddressbook->plug( settingsMenu, 0 );
2234 mActionConfigResources->plug( settingsMenu,1 ); 2235 mActionConfigResources->plug( settingsMenu,1 );
2235 settingsMenu->insertSeparator(2); 2236 settingsMenu->insertSeparator(2);
2236 2237
2237 if ( mIsPart ) { 2238 if ( mIsPart ) {
2238 //US not implemented yet 2239 //US not implemented yet
2239 //mActionConfigShortcuts->plug( settingsMenu ); 2240 //mActionConfigShortcuts->plug( settingsMenu );
2240 //mActionConfigureToolbars->plug( settingsMenu ); 2241 //mActionConfigureToolbars->plug( settingsMenu );
2241 2242
2242 } else { 2243 } else {
2243 //US not implemented yet 2244 //US not implemented yet
2244 //mActionKeyBindings->plug( settingsMenu ); 2245 //mActionKeyBindings->plug( settingsMenu );
2245 } 2246 }
2246 2247
2247 settingsMenu->insertSeparator(); 2248 settingsMenu->insertSeparator();
2248 2249
2249 mActionJumpBar->plug( settingsMenu ); 2250 mActionJumpBar->plug( settingsMenu );
2250 mActionDetails->plug( settingsMenu ); 2251 mActionDetails->plug( settingsMenu );
2251 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 2252 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
2252 mActionDetails->plug( tb ); 2253 mActionDetails->plug( tb );
2253 settingsMenu->insertSeparator(); 2254 settingsMenu->insertSeparator();
2254#ifndef DESKTOP_VERSION 2255#ifndef DESKTOP_VERSION
2255 if ( Ir::supported() ) mActionBR->plug(settingsMenu ); 2256 if ( Ir::supported() ) mActionBR->plug(settingsMenu );
2256 settingsMenu->insertSeparator(); 2257 settingsMenu->insertSeparator();
2257#endif 2258#endif
2258 2259
2259 mActionWhoAmI->plug( settingsMenu ); 2260 mActionWhoAmI->plug( settingsMenu );
2260 mActionEditCategories->plug( settingsMenu ); 2261 mActionEditCategories->plug( settingsMenu );
2261 mActionEditCategories->plug( changeMenu ); 2262 mActionEditCategories->plug( changeMenu );
2262 mActionCategories->plug( changeMenu ); 2263 mActionCategories->plug( changeMenu );
2263 mActionManageCategories->plug( changeMenu ); 2264 mActionManageCategories->plug( changeMenu );
2264 2265
2265 mActionCategories->plug( settingsMenu ); 2266 mActionCategories->plug( settingsMenu );
2266 mActionManageCategories->plug( settingsMenu ); 2267 mActionManageCategories->plug( settingsMenu );
2267 2268
2268 2269
2269 mActionWN->plug( helpMenu ); 2270 mActionWN->plug( helpMenu );
2270 mActionSyncHowto->plug( helpMenu ); 2271 mActionSyncHowto->plug( helpMenu );
2271 mActionKdeSyncHowto->plug( helpMenu ); 2272 mActionKdeSyncHowto->plug( helpMenu );
2272 mActionMultiSyncHowto->plug( helpMenu ); 2273 mActionMultiSyncHowto->plug( helpMenu );
2273 mActionFaq->plug( helpMenu ); 2274 mActionFaq->plug( helpMenu );
2274 mActionLicence->plug( helpMenu ); 2275 mActionLicence->plug( helpMenu );
2275 mActionAboutKAddressbook->plug( helpMenu ); 2276 mActionAboutKAddressbook->plug( helpMenu );
2276 2277
2277 if (KGlobal::getDesktopSize() > KGlobal::Small ) { 2278 if (KGlobal::getDesktopSize() > KGlobal::Small ) {
2278 2279
2279 mActionSave->plug( tb ); 2280 mActionSave->plug( tb );
2280 mViewManager->getFilterAction()->plug ( tb); 2281 mViewManager->getFilterAction()->plug ( tb);
2281 //LR hide filteraction on started in 480x640 2282 //LR hide filteraction on started in 480x640
2282 if (QApplication::desktop()->width() == 480 ) { 2283 if (QApplication::desktop()->width() == 480 ) {
2283 mViewManager->getFilterAction()->setComboWidth( 0 ); 2284 mViewManager->getFilterAction()->setComboWidth( 0 );
2284 } 2285 }
2285 mActionUndo->plug( tb ); 2286 mActionUndo->plug( tb );
2286 mActionDelete->plug( tb ); 2287 mActionDelete->plug( tb );
2287 mActionRedo->plug( tb ); 2288 mActionRedo->plug( tb );
2288 } else { 2289 } else {
2289 mActionSave->plug( tb ); 2290 mActionSave->plug( tb );
2290 tb->enableMoving(false); 2291 tb->enableMoving(false);
2291 } 2292 }
2292 //mActionQuit->plug ( tb ); 2293 //mActionQuit->plug ( tb );
2293 // tb->insertWidget(-1, 0, mIncSearchWidget, 6); 2294 // tb->insertWidget(-1, 0, mIncSearchWidget, 6);
2294 2295
2295 //US link the searchwidget first to this. 2296 //US link the searchwidget first to this.
2296 // The real linkage to the toolbar happens later. 2297 // The real linkage to the toolbar happens later.
2297//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE); 2298//US mIncSearchWidget->reparent(tb, 0, QPoint(50,0), TRUE);
2298//US tb->insertItem( mIncSearchWidget ); 2299//US tb->insertItem( mIncSearchWidget );
2299/*US 2300/*US
2300 mIncSearchWidget = new IncSearchWidget( tb ); 2301 mIncSearchWidget = new IncSearchWidget( tb );
2301 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 2302 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
2302 SLOT( incrementalSearch( const QString& ) ) ); 2303 SLOT( incrementalSearch( const QString& ) ) );
2303 2304
2304 mJumpButtonBar = new JumpButtonBar( this, this ); 2305 mJumpButtonBar = new JumpButtonBar( this, this );
2305 2306
2306//US topLayout->addWidget( mJumpButtonBar ); 2307//US topLayout->addWidget( mJumpButtonBar );
2307 this->layout()->add( mJumpButtonBar ); 2308 this->layout()->add( mJumpButtonBar );
2308*/ 2309*/
2309 2310
2310#endif //KAB_EMBEDDED 2311#endif //KAB_EMBEDDED
2311 2312
2312 mActionExport2phone->plug( ExportMenu ); 2313 mActionExport2phone->plug( ExportMenu );
2313 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 2314 connect ( syncMenu, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
2314 syncManager->fillSyncMenu(); 2315 syncManager->fillSyncMenu();
2315 2316
2316} 2317}
2317void KABCore::showLicence() 2318void KABCore::showLicence()
2318{ 2319{
2319 KApplication::showLicence(); 2320 KApplication::showLicence();
2320} 2321}
2321 2322
2322void KABCore::manageCategories( ) 2323void KABCore::manageCategories( )
2323{ 2324{
2324 KABCatPrefs* cp = new KABCatPrefs(); 2325 KABCatPrefs* cp = new KABCatPrefs();
2325 cp->show(); 2326 cp->show();
2326 int w =cp->sizeHint().width() ; 2327 int w =cp->sizeHint().width() ;
2327 int h = cp->sizeHint().height() ; 2328 int h = cp->sizeHint().height() ;
2328 int dw = QApplication::desktop()->width(); 2329 int dw = QApplication::desktop()->width();
2329 int dh = QApplication::desktop()->height(); 2330 int dh = QApplication::desktop()->height();
2330 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2331 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2331 if ( !cp->exec() ) { 2332 if ( !cp->exec() ) {
2332 delete cp; 2333 delete cp;
2333 return; 2334 return;
2334 } 2335 }
2335 int count = 0; 2336 int count = 0;
2336 int cc = 0; 2337 int cc = 0;
2337 message( i18n("Please wait, processing categories...")); 2338 message( i18n("Please wait, processing categories..."));
2338 if ( cp->addCat() ) { 2339 if ( cp->addCat() ) {
2339 KABC::AddressBook::Iterator it; 2340 KABC::AddressBook::Iterator it;
2340 QStringList catList = KABPrefs::instance()->mCustomCategories; 2341 QStringList catList = KABPrefs::instance()->mCustomCategories;
2341 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2342 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2342 ++cc; 2343 ++cc;
2343 if ( cc %10 == 0) 2344 if ( cc %10 == 0)
2344 message(i18n("Processing contact #%1").arg(cc)); 2345 message(i18n("Processing contact #%1").arg(cc));
2345 QStringList catIncList = (*it).categories(); 2346 QStringList catIncList = (*it).categories();
2346 int i; 2347 int i;
2347 for( i = 0; i< catIncList.count(); ++i ) { 2348 for( i = 0; i< catIncList.count(); ++i ) {
2348 if ( !catList.contains (catIncList[i])) { 2349 if ( !catList.contains (catIncList[i])) {
2349 catList.append( catIncList[i] ); 2350 catList.append( catIncList[i] );
2350 //qDebug("add cat %s ", catIncList[i].latin1()); 2351 //qDebug("add cat %s ", catIncList[i].latin1());
2351 ++count; 2352 ++count;
2352 } 2353 }
2353 } 2354 }
2354 } 2355 }
2355 catList.sort(); 2356 catList.sort();
2356 KABPrefs::instance()->mCustomCategories = catList; 2357 KABPrefs::instance()->mCustomCategories = catList;
2357 KABPrefs::instance()->writeConfig(); 2358 KABPrefs::instance()->writeConfig();
2358 message(QString::number( count )+ i18n(" categories added to list! ")); 2359 message(QString::number( count )+ i18n(" categories added to list! "));
2359 } else { 2360 } else {
2360 QStringList catList = KABPrefs::instance()->mCustomCategories; 2361 QStringList catList = KABPrefs::instance()->mCustomCategories;
2361 QStringList catIncList; 2362 QStringList catIncList;
2362 QStringList newCatList; 2363 QStringList newCatList;
2363 KABC::AddressBook::Iterator it; 2364 KABC::AddressBook::Iterator it;
2364 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2365 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2365 ++cc; 2366 ++cc;
2366 if ( cc %10 == 0) 2367 if ( cc %10 == 0)
2367 message(i18n("Processing contact #%1").arg(cc)); 2368 message(i18n("Processing contact #%1").arg(cc));
2368 QStringList catIncList = (*it).categories(); 2369 QStringList catIncList = (*it).categories();
2369 int i; 2370 int i;
2370 if ( catIncList.count() ) { 2371 if ( catIncList.count() ) {
2371 newCatList.clear(); 2372 newCatList.clear();
2372 for( i = 0; i< catIncList.count(); ++i ) { 2373 for( i = 0; i< catIncList.count(); ++i ) {
2373 if ( catList.contains (catIncList[i])) { 2374 if ( catList.contains (catIncList[i])) {
2374 newCatList.append( catIncList[i] ); 2375 newCatList.append( catIncList[i] );
2375 } 2376 }
2376 } 2377 }
2377 newCatList.sort(); 2378 newCatList.sort();
2378 (*it).setCategories( newCatList ); 2379 (*it).setCategories( newCatList );
2379 mAddressBook->insertAddressee( (*it) ); 2380 mAddressBook->insertAddressee( (*it) );
2380 } 2381 }
2381 } 2382 }
2382 setModified( true ); 2383 setModified( true );
2383 mViewManager->refreshView(); 2384 mViewManager->refreshView();
2384 message( i18n("Removing categories done!")); 2385 message( i18n("Removing categories done!"));
2385 } 2386 }
2386 delete cp; 2387 delete cp;
2387} 2388}
2388void KABCore::removeVoice() 2389void KABCore::removeVoice()
2389{ 2390{
2390 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 ) 2391 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 )
2391 return; 2392 return;
2392 XXPortSelectDialog dlg( this, false, this ); 2393 XXPortSelectDialog dlg( this, false, this );
2393 if ( !dlg.exec() ) 2394 if ( !dlg.exec() )
2394 return; 2395 return;
2395 mAddressBook->setUntagged(); 2396 mAddressBook->setUntagged();
2396 dlg.tagSelected(); 2397 dlg.tagSelected();
2397 message(i18n("Removing voice..."), false ); 2398 message(i18n("Removing voice..."), false );
2398 KABC::AddressBook::Iterator it; 2399 KABC::AddressBook::Iterator it;
2399 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2400 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2400 if ( (*it).tagged() ) { 2401 if ( (*it).tagged() ) {
2401 (*it).removeVoice(); 2402 (*it).removeVoice();
2402 } 2403 }
2403 } 2404 }
2404 message(i18n("Refreshing view...") ); 2405 message(i18n("Refreshing view...") );
2405 qApp->processEvents(); 2406 qApp->processEvents();
2406 mViewManager->refreshView( "" ); 2407 mViewManager->refreshView( "" );
2407 Addressee add; 2408 Addressee add;
2408 mDetails->setAddressee( add ); 2409 mDetails->setAddressee( add );
2409 message(i18n("Remove voice completed!") ); 2410 message(i18n("Remove voice completed!") );
2410 2411
2411 2412
2412 2413
2413} 2414}
2414 2415
2415void KABCore::setFormattedName() 2416void KABCore::setFormattedName()
2416{ 2417{
2417 KABFormatPrefs setpref; 2418 KABFormatPrefs setpref;
2418 if ( !setpref.exec() ) { 2419 if ( !setpref.exec() ) {
2419 return; 2420 return;
2420 } 2421 }
2421 XXPortSelectDialog dlg( this, false, this ); 2422 XXPortSelectDialog dlg( this, false, this );
2422 if ( !dlg.exec() ) 2423 if ( !dlg.exec() )
2423 return; 2424 return;
2424 mAddressBook->setUntagged(); 2425 mAddressBook->setUntagged();
2425 dlg.tagSelected(); 2426 dlg.tagSelected();
2426 int count = 0; 2427 int count = 0;
2427 KABC::AddressBook::Iterator it; 2428 KABC::AddressBook::Iterator it;
2428 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2429 for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2429 if ( (*it).tagged() ) { 2430 if ( (*it).tagged() ) {
2430 ++count; 2431 ++count;
2431 if ( count %10 == 0 ) 2432 if ( count %10 == 0 )
2432 message(i18n("Changing contact #%1").arg( count ) ); 2433 message(i18n("Changing contact #%1").arg( count ) );
2433 qApp->processEvents(); 2434 qApp->processEvents();
2434 QString fName; 2435 QString fName;
2435 if ( setpref.simple->isChecked() ) 2436 if ( setpref.simple->isChecked() )
2436 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); 2437 fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName );
2437 else if ( setpref.full->isChecked() ) 2438 else if ( setpref.full->isChecked() )
2438 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); 2439 fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName );
2439 else if ( setpref.reverse->isChecked() ) 2440 else if ( setpref.reverse->isChecked() )
2440 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); 2441 fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName );
2441 else 2442 else
2442 fName = (*it).organization(); 2443 fName = (*it).organization();
2443 if ( setpref.setCompany->isChecked() ) 2444 if ( setpref.setCompany->isChecked() )
2444 if ( fName.isEmpty() || fName =="," ) 2445 if ( fName.isEmpty() || fName =="," )
2445 fName = (*it).organization(); 2446 fName = (*it).organization();
2446 (*it).setFormattedName( fName ); 2447 (*it).setFormattedName( fName );
2447 } 2448 }
2448 } 2449 }
2449 message(i18n("Refreshing view...") ); 2450 message(i18n("Refreshing view...") );
2450 qApp->processEvents(); 2451 qApp->processEvents();
2451 mViewManager->refreshView( "" ); 2452 mViewManager->refreshView( "" );
2452 Addressee add; 2453 Addressee add;
2453 mDetails->setAddressee( add ); 2454 mDetails->setAddressee( add );
2454 message(i18n("Setting formatted name completed!") ); 2455 message(i18n("Setting formatted name completed!") );
2455} 2456}
2456 2457
2457void KABCore::clipboardDataChanged() 2458void KABCore::clipboardDataChanged()
2458{ 2459{
2459 2460
2460 if ( mReadWrite ) 2461 if ( mReadWrite )
2461 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 2462 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
2462 2463
2463} 2464}
2464 2465
2465void KABCore::updateActionMenu() 2466void KABCore::updateActionMenu()
2466{ 2467{
2467 UndoStack *undo = UndoStack::instance(); 2468 UndoStack *undo = UndoStack::instance();
2468 RedoStack *redo = RedoStack::instance(); 2469 RedoStack *redo = RedoStack::instance();
2469 2470
2470 if ( undo->isEmpty() ) 2471 if ( undo->isEmpty() )
2471 mActionUndo->setText( i18n( "Undo" ) ); 2472 mActionUndo->setText( i18n( "Undo" ) );
2472 else 2473 else
2473 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 2474 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
2474 2475
2475 mActionUndo->setEnabled( !undo->isEmpty() ); 2476 mActionUndo->setEnabled( !undo->isEmpty() );
2476 2477
2477 if ( !redo->top() ) 2478 if ( !redo->top() )
2478 mActionRedo->setText( i18n( "Redo" ) ); 2479 mActionRedo->setText( i18n( "Redo" ) );
2479 else 2480 else
2480 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 2481 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
2481 2482
2482 mActionRedo->setEnabled( !redo->isEmpty() ); 2483 mActionRedo->setEnabled( !redo->isEmpty() );
2483} 2484}
2484 2485
2485void KABCore::configureKeyBindings() 2486void KABCore::configureKeyBindings()
2486{ 2487{
2487#ifndef KAB_EMBEDDED 2488#ifndef KAB_EMBEDDED
2488 KKeyDialog::configure( actionCollection(), true ); 2489 KKeyDialog::configure( actionCollection(), true );
2489#else //KAB_EMBEDDED 2490#else //KAB_EMBEDDED
2490 qDebug("KABCore::configureKeyBindings() not implemented"); 2491 qDebug("KABCore::configureKeyBindings() not implemented");
2491#endif //KAB_EMBEDDED 2492#endif //KAB_EMBEDDED
2492} 2493}
2493 2494
2494#ifdef KAB_EMBEDDED 2495#ifdef KAB_EMBEDDED
2495void KABCore::configureResources() 2496void KABCore::configureResources()
2496{ 2497{
2497 KRES::KCMKResources dlg( this, "" , 0 ); 2498 KRES::KCMKResources dlg( this, "" , 0 );
2498 2499
2499 if ( !dlg.exec() ) 2500 if ( !dlg.exec() )
2500 return; 2501 return;
2501 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2502 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2502} 2503}
2503#endif //KAB_EMBEDDED 2504#endif //KAB_EMBEDDED
2504 2505
2505 2506
2506/* this method will be called through the QCop interface from Ko/Pi to select addresses 2507/* this method will be called through the QCop interface from Ko/Pi to select addresses
2507 * for the attendees list of an event. 2508 * for the attendees list of an event.
2508 */ 2509 */
2509void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2510void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2510{ 2511{
2511 2512
2512 bool ok = false; 2513 bool ok = false;
2513 mEmailSourceChannel = sourceChannel; 2514 mEmailSourceChannel = sourceChannel;
2514 int wid = uid.toInt( &ok ); 2515 int wid = uid.toInt( &ok );
2515 qDebug("UID %s ", uid.latin1()); 2516 qDebug("UID %s ", uid.latin1());
2516 if ( ok ) { 2517 if ( ok ) {
2517 if ( wid != QApplication::desktop()->width() ) { 2518 if ( wid != QApplication::desktop()->width() ) {
2518 qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); 2519 qDebug("KA/Pi: Request from different desktop geometry. Resizing ...");
2519 message( i18n("Resizing, please wait...") ); 2520 message( i18n("Resizing, please wait...") );
2520 mMainWindow->showMinimized(); 2521 mMainWindow->showMinimized();
2521 /* 2522 /*
2522 { 2523 {
2523 QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); 2524 QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
2524 } 2525 }
2525 */ 2526 */
2526 QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); 2527 QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) );
2527 return; 2528 return;
2528 } 2529 }
2529 2530
2530 } else { 2531 } else {
2531 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); 2532 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid ");
2532 } 2533 }
2533 callContactdialog(); 2534 callContactdialog();
2534 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); 2535 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
2535 2536
2536} 2537}
2537void KABCore::resizeAndCallContactdialog() 2538void KABCore::resizeAndCallContactdialog()
2538{ 2539{
2539 updateMainWindow(); 2540 updateMainWindow();
2540 QTimer::singleShot( 100,this, SLOT ( callContactdialog() ) ); 2541 QTimer::singleShot( 100,this, SLOT ( callContactdialog() ) );
2541} 2542}
2542 2543
2543void KABCore::callContactdialog() 2544void KABCore::callContactdialog()
2544{ 2545{
2545 QStringList nameList; 2546 QStringList nameList;
2546 QStringList emailList; 2547 QStringList emailList;
2547 QStringList uidList; 2548 QStringList uidList;
2548 qDebug("WIDTH %d ", QApplication::desktop()->width() ); 2549 qDebug("WIDTH %d ", QApplication::desktop()->width() );
2549 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2550 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2550 uint i=0; 2551 uint i=0;
2551 for (i=0; i < list.count(); i++) 2552 for (i=0; i < list.count(); i++)
2552 { 2553 {
2553 nameList.append(list[i].realName()); 2554 nameList.append(list[i].realName());
2554 emailList.append(list[i].preferredEmail()); 2555 emailList.append(list[i].preferredEmail());
2555 uidList.append(list[i].uid()); 2556 uidList.append(list[i].uid());
2556 } 2557 }
2557 QString uid = "unnamed"; 2558 QString uid = "unnamed";
2558 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); 2559 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1());
2559 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); 2560 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList);
2560 2561
2561} 2562}
2562/* this method will be called through the QCop interface from Ko/Pi to select birthdays 2563/* this method will be called through the QCop interface from Ko/Pi to select birthdays
2563 * to put them into the calendar. 2564 * to put them into the calendar.
2564 */ 2565 */
2565void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) 2566void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
2566{ 2567{
2567 // qDebug("KABCore::requestForBirthdayList"); 2568 // qDebug("KABCore::requestForBirthdayList");
2568 QStringList birthdayList; 2569 QStringList birthdayList;
2569 QStringList anniversaryList; 2570 QStringList anniversaryList;
2570 QStringList realNameList; 2571 QStringList realNameList;
2571 QStringList preferredEmailList; 2572 QStringList preferredEmailList;
2572 QStringList assembledNameList; 2573 QStringList assembledNameList;
2573 QStringList uidList; 2574 QStringList uidList;
2574 2575
2575 KABC::AddressBook::Iterator it; 2576 KABC::AddressBook::Iterator it;
2576 2577
2577 int count = 0; 2578 int count = 0;
2578 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2579 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2579 ++count; 2580 ++count;
2580 } 2581 }
2581 QProgressBar bar(count,0 ); 2582 QProgressBar bar(count,0 );
2582 int w = 300; 2583 int w = 300;
2583 if ( QApplication::desktop()->width() < 320 ) 2584 if ( QApplication::desktop()->width() < 320 )
2584 w = 220; 2585 w = 220;
2585 int h = bar.sizeHint().height() ; 2586 int h = bar.sizeHint().height() ;
2586 int dw = QApplication::desktop()->width(); 2587 int dw = QApplication::desktop()->width();
2587 int dh = QApplication::desktop()->height(); 2588 int dh = QApplication::desktop()->height();
2588 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2589 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2589 bar.show(); 2590 bar.show();
2590 bar.setCaption (i18n("Collecting birthdays - close to abort!") ); 2591 bar.setCaption (i18n("Collecting birthdays - close to abort!") );
2591 qApp->processEvents(); 2592 qApp->processEvents();
2592 2593
2593 QDate bday; 2594 QDate bday;
2594 QString anni; 2595 QString anni;
2595 QString formattedbday; 2596 QString formattedbday;
2596 2597
2597 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) 2598 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it )
2598 { 2599 {
2599 if ( ! bar.isVisible() ) 2600 if ( ! bar.isVisible() )
2600 return; 2601 return;
2601 bar.setProgress( count++ ); 2602 bar.setProgress( count++ );
2602 qApp->processEvents(); 2603 qApp->processEvents();
2603 bday = (*it).birthday().date(); 2604 bday = (*it).birthday().date();
2604 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); 2605 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" );
2605 2606
2606 if ( bday.isValid() || !anni.isEmpty()) 2607 if ( bday.isValid() || !anni.isEmpty())
2607 { 2608 {
2608 if (bday.isValid()) 2609 if (bday.isValid())
2609 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); 2610 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate);
2610 else 2611 else
2611 formattedbday = "NOTVALID"; 2612 formattedbday = "NOTVALID";
2612 if (anni.isEmpty()) 2613 if (anni.isEmpty())
2613 anni = "INVALID"; 2614 anni = "INVALID";
2614 2615
2615 birthdayList.append(formattedbday); 2616 birthdayList.append(formattedbday);
2616 anniversaryList.append(anni); //should be ISODate 2617 anniversaryList.append(anni); //should be ISODate
2617 realNameList.append((*it).realName()); 2618 realNameList.append((*it).realName());
2618 preferredEmailList.append((*it).preferredEmail()); 2619 preferredEmailList.append((*it).preferredEmail());
2619 assembledNameList.append((*it).assembledName()); 2620 assembledNameList.append((*it).assembledName());
2620 uidList.append((*it).uid()); 2621 uidList.append((*it).uid());
2621 2622
2622 //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() ); 2623 //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() );
2623 } 2624 }
2624 } 2625 }
2625 2626
2626 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); 2627 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList);
2627 2628
2628} 2629}
2629 2630
2630/* this method will be called through the QCop interface from other apps to show details of a contact. 2631/* this method will be called through the QCop interface from other apps to show details of a contact.
2631 */ 2632 */
2632void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2633void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2633{ 2634{
2634 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); 2635 //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1());
2635 2636
2636 QString foundUid = QString::null; 2637 QString foundUid = QString::null;
2637 if ( ! uid.isEmpty() ) { 2638 if ( ! uid.isEmpty() ) {
2638 Addressee adrr = mAddressBook->findByUid( uid ); 2639 Addressee adrr = mAddressBook->findByUid( uid );
2639 if ( !adrr.isEmpty() ) { 2640 if ( !adrr.isEmpty() ) {
2640 foundUid = uid; 2641 foundUid = uid;
2641 } 2642 }
2642 if ( email == "sendbacklist" ) { 2643 if ( email == "sendbacklist" ) {
2643 //qDebug("ssssssssssssssssssssssend "); 2644 //qDebug("ssssssssssssssssssssssend ");
2644 QStringList nameList; 2645 QStringList nameList;
2645 QStringList emailList; 2646 QStringList emailList;
2646 QStringList uidList; 2647 QStringList uidList;
2647 nameList.append(adrr.realName()); 2648 nameList.append(adrr.realName());
2648 emailList = adrr.emails(); 2649 emailList = adrr.emails();
2649 uidList.append( adrr.preferredEmail()); 2650 uidList.append( adrr.preferredEmail());
2650 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); 2651 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList);
2651 return; 2652 return;
2652 } 2653 }
2653 2654
2654 } 2655 }
2655 2656
2656 if ( email == "sendbacklist" ) 2657 if ( email == "sendbacklist" )
2657 return; 2658 return;
2658 if (foundUid.isEmpty()) 2659 if (foundUid.isEmpty())
2659 { 2660 {
2660 //find the uid of the person first 2661 //find the uid of the person first
2661 Addressee::List namelist; 2662 Addressee::List namelist;
2662 Addressee::List emaillist; 2663 Addressee::List emaillist;
2663 2664
2664 if (!name.isEmpty()) 2665 if (!name.isEmpty())
2665 namelist = mAddressBook->findByName( name ); 2666 namelist = mAddressBook->findByName( name );
2666 2667
2667 if (!email.isEmpty()) 2668 if (!email.isEmpty())
2668 emaillist = mAddressBook->findByEmail( email ); 2669 emaillist = mAddressBook->findByEmail( email );
2669 //qDebug("count %d %d ", namelist.count(),emaillist.count() ); 2670 //qDebug("count %d %d ", namelist.count(),emaillist.count() );
2670 //check if we have a match in Namelist and Emaillist 2671 //check if we have a match in Namelist and Emaillist
2671 if ((namelist.count() == 0) && (emaillist.count() > 0)) { 2672 if ((namelist.count() == 0) && (emaillist.count() > 0)) {
2672 foundUid = emaillist[0].uid(); 2673 foundUid = emaillist[0].uid();
2673 } 2674 }
2674 else if ((namelist.count() > 0) && (emaillist.count() == 0)) 2675 else if ((namelist.count() > 0) && (emaillist.count() == 0))
2675 foundUid = namelist[0].uid(); 2676 foundUid = namelist[0].uid();
2676 else 2677 else
2677 { 2678 {
2678 for (int i = 0; i < namelist.count(); i++) 2679 for (int i = 0; i < namelist.count(); i++)
2679 { 2680 {
2680 for (int j = 0; j < emaillist.count(); j++) 2681 for (int j = 0; j < emaillist.count(); j++)
2681 { 2682 {
2682 if (namelist[i] == emaillist[j]) 2683 if (namelist[i] == emaillist[j])
2683 { 2684 {
2684 foundUid = namelist[i].uid(); 2685 foundUid = namelist[i].uid();
2685 } 2686 }
2686 } 2687 }
2687 } 2688 }
2688 } 2689 }
2689 } 2690 }
2690 else 2691 else
2691 { 2692 {
2692 foundUid = uid; 2693 foundUid = uid;
2693 } 2694 }
2694 2695
2695 if (!foundUid.isEmpty()) 2696 if (!foundUid.isEmpty())
2696 { 2697 {
2697 2698
2698 // raise Ka/Pi if it is in the background 2699 // raise Ka/Pi if it is in the background
2699#ifndef DESKTOP_VERSION 2700#ifndef DESKTOP_VERSION
2700#ifndef KORG_NODCOP 2701#ifndef KORG_NODCOP
2701 //QCopEnvelope e("QPE/Application/kapi", "raise()"); 2702 //QCopEnvelope e("QPE/Application/kapi", "raise()");
2702#endif 2703#endif
2703#endif 2704#endif
2704 2705
2705 mMainWindow->showMaximized(); 2706 mMainWindow->showMaximized();
2706 mMainWindow-> raise(); 2707 mMainWindow-> raise();
2707 2708
2708 mViewManager->setSelected( "", false); 2709 mViewManager->setSelected( "", false);
2709 mViewManager->refreshView( "" ); 2710 mViewManager->refreshView( "" );
2710 mViewManager->setSelected( foundUid, true ); 2711 mViewManager->setSelected( foundUid, true );
2711 mViewManager->refreshView( foundUid ); 2712 mViewManager->refreshView( foundUid );
2712 2713
2713 if ( !mMultipleViewsAtOnce ) 2714 if ( !mMultipleViewsAtOnce )
2714 { 2715 {
2715 setDetailsVisible( true ); 2716 setDetailsVisible( true );
2716 mActionDetails->setChecked(true); 2717 mActionDetails->setChecked(true);
2717 } 2718 }
2718 } 2719 }
2719} 2720}
2720 2721
2721void KABCore::whatsnew() 2722void KABCore::whatsnew()
2722{ 2723{
2723 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 2724 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
2724} 2725}
2725void KABCore::synchowto() 2726void KABCore::synchowto()
2726{ 2727{
2727 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 2728 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
2728} 2729}
2729void KABCore::kdesynchowto() 2730void KABCore::kdesynchowto()
2730{ 2731{
2731 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 2732 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
2732} 2733}
2733void KABCore::multisynchowto() 2734void KABCore::multisynchowto()
2734{ 2735{
2735 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 2736 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
2736} 2737}
2737void KABCore::faq() 2738void KABCore::faq()
2738{ 2739{
2739 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); 2740 KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" );
2740} 2741}
2741 2742
2742#include <libkcal/syncdefines.h> 2743#include <libkcal/syncdefines.h>
2743 2744
2744KABC::Addressee KABCore::getLastSyncAddressee() 2745KABC::Addressee KABCore::getLastSyncAddressee()
2745{ 2746{
2746 Addressee lse; 2747 Addressee lse;
2747 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2748 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2748 2749
2749 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 2750 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
2750 lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2751 lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice );
2751 if (lse.isEmpty()) { 2752 if (lse.isEmpty()) {
2752 qDebug("KA: Creating new last-syncAddressee "); 2753 qDebug("KA: Creating new last-syncAddressee ");
2753 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); 2754 lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice );
2754 QString sum = ""; 2755 QString sum = "";
2755 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 2756 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
2756 sum = "E: "; 2757 sum = "E: ";
2757 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); 2758 lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event"));
2758 lse.setRevision( mLastAddressbookSync ); 2759 lse.setRevision( mLastAddressbookSync );
2759 lse.setCategories( i18n("SyncEvent") ); 2760 lse.setCategories( i18n("SyncEvent") );
2760 mAddressBook->insertAddressee( lse ); 2761 mAddressBook->insertAddressee( lse );
2761 } 2762 }
2762 return lse; 2763 return lse;
2763} 2764}
2764int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) 2765int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full )
2765{ 2766{
2766 2767
2767 //void setZaurusId(int id); 2768 //void setZaurusId(int id);
2768 // int zaurusId() const; 2769 // int zaurusId() const;
2769 // void setZaurusUid(int id); 2770 // void setZaurusUid(int id);
2770 // int zaurusUid() const; 2771 // int zaurusUid() const;
2771 // void setZaurusStat(int id); 2772 // void setZaurusStat(int id);
2772 // int zaurusStat() const; 2773 // int zaurusStat() const;
2773 // 0 equal 2774 // 0 equal
2774 // 1 take local 2775 // 1 take local
2775 // 2 take remote 2776 // 2 take remote
2776 // 3 cancel 2777 // 3 cancel
2777 QDateTime lastSync = mLastAddressbookSync; 2778 QDateTime lastSync = mLastAddressbookSync;
2778 QDateTime localMod = local->revision(); 2779 QDateTime localMod = local->revision();
2779 QDateTime remoteMod = remote->revision(); 2780 QDateTime remoteMod = remote->revision();
2780 2781
2781 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2782 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2782 2783
2783 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2784 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2784 bool remCh, locCh; 2785 bool remCh, locCh;
2785 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 2786 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
2786 //if ( remCh ) 2787 //if ( remCh )
2787 // qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); 2788 // qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
2788 locCh = ( localMod > mLastAddressbookSync ); 2789 locCh = ( localMod > mLastAddressbookSync );
2789 //qDebug("cahnged rem %d loc %d",remCh, locCh ); 2790 //qDebug("cahnged rem %d loc %d",remCh, locCh );
2790 if ( !remCh && ! locCh ) { 2791 if ( !remCh && ! locCh ) {
2791 //qDebug("both not changed "); 2792 //qDebug("both not changed ");
2792 lastSync = localMod.addDays(1); 2793 lastSync = localMod.addDays(1);
2793 if ( mode <= SYNC_PREF_ASK ) 2794 if ( mode <= SYNC_PREF_ASK )
2794 return 0; 2795 return 0;
2795 } else { 2796 } else {
2796 if ( locCh ) { 2797 if ( locCh ) {
2797 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); 2798 //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1());
2798 lastSync = localMod.addDays( -1 ); 2799 lastSync = localMod.addDays( -1 );
2799 if ( !remCh ) 2800 if ( !remCh )
2800 remoteMod =( lastSync.addDays( -1 ) ); 2801 remoteMod =( lastSync.addDays( -1 ) );
2801 } else { 2802 } else {
2802 //qDebug(" not loc changed "); 2803 //qDebug(" not loc changed ");
2803 lastSync = localMod.addDays( 1 ); 2804 lastSync = localMod.addDays( 1 );
2804 if ( remCh ) { 2805 if ( remCh ) {
2805 //qDebug("rem changed "); 2806 //qDebug("rem changed ");
2806 remoteMod =( lastSync.addDays( 1 ) ); 2807 remoteMod =( lastSync.addDays( 1 ) );
2807 } 2808 }
2808 2809
2809 } 2810 }
2810 } 2811 }
2811 full = true; 2812 full = true;
2812 if ( mode < SYNC_PREF_ASK ) 2813 if ( mode < SYNC_PREF_ASK )
2813 mode = SYNC_PREF_ASK; 2814 mode = SYNC_PREF_ASK;
2814 } else { 2815 } else {
2815 if ( localMod == remoteMod ) 2816 if ( localMod == remoteMod )
2816 return 0; 2817 return 0;
2817 2818
2818 } 2819 }
2819 //qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec()); 2820 //qDebug("%s %s --- %d %d", localMod.toString().latin1() , remoteMod.toString().latin1(), localMod.time().msec(), remoteMod.time().msec());
2820 //qDebug("lastsync %s ", lastSync.toString().latin1() ); 2821 //qDebug("lastsync %s ", lastSync.toString().latin1() );
2821 //full = true; //debug only 2822 //full = true; //debug only
2822 if ( full ) { 2823 if ( full ) {
2823 bool equ = ( (*local) == (*remote) ); 2824 bool equ = ( (*local) == (*remote) );
2824 if ( equ ) { 2825 if ( equ ) {
2825 //qDebug("equal "); 2826 //qDebug("equal ");
2826 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2827 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2827 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 2828 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
2828 } 2829 }
2829 if ( mode < SYNC_PREF_FORCE_LOCAL ) 2830 if ( mode < SYNC_PREF_FORCE_LOCAL )
2830 return 0; 2831 return 0;
2831 2832
2832 }//else //debug only 2833 }//else //debug only
2833 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 2834 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
2834 } 2835 }
2835 int result; 2836 int result;
2836 bool localIsNew; 2837 bool localIsNew;
2837 //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() ); 2838 //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() );
2838 2839
2839 if ( full && mode < SYNC_PREF_NEWEST ) 2840 if ( full && mode < SYNC_PREF_NEWEST )
2840 mode = SYNC_PREF_ASK; 2841 mode = SYNC_PREF_ASK;
2841 2842
2842 switch( mode ) { 2843 switch( mode ) {
2843 case SYNC_PREF_LOCAL: 2844 case SYNC_PREF_LOCAL:
2844 if ( lastSync > remoteMod ) 2845 if ( lastSync > remoteMod )
2845 return 1; 2846 return 1;
2846 if ( lastSync > localMod ) 2847 if ( lastSync > localMod )
2847 return 2; 2848 return 2;
2848 return 1; 2849 return 1;
2849 break; 2850 break;
2850 case SYNC_PREF_REMOTE: 2851 case SYNC_PREF_REMOTE:
2851 if ( lastSync > remoteMod ) 2852 if ( lastSync > remoteMod )
2852 return 1; 2853 return 1;
2853 if ( lastSync > localMod ) 2854 if ( lastSync > localMod )
2854 return 2; 2855 return 2;
2855 return 2; 2856 return 2;
2856 break; 2857 break;
2857 case SYNC_PREF_NEWEST: 2858 case SYNC_PREF_NEWEST:
2858 if ( localMod > remoteMod ) 2859 if ( localMod > remoteMod )
2859 return 1; 2860 return 1;
2860 else 2861 else
2861 return 2; 2862 return 2;
2862 break; 2863 break;
2863 case SYNC_PREF_ASK: 2864 case SYNC_PREF_ASK:
2864 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 2865 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
2865 if ( lastSync > remoteMod ) 2866 if ( lastSync > remoteMod )
2866 return 1; 2867 return 1;
2867 if ( lastSync > localMod ) { 2868 if ( lastSync > localMod ) {
2868 return 2; 2869 return 2;
2869 } 2870 }
2870 localIsNew = localMod >= remoteMod; 2871 localIsNew = localMod >= remoteMod;
2871 //qDebug("conflict! ************************************** "); 2872 //qDebug("conflict! ************************************** ");
2872 { 2873 {
2873 KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this ); 2874 KABC::AddresseeChooser acd ( *local,*remote, localIsNew , this );
2874 result = acd.executeD(localIsNew); 2875 result = acd.executeD(localIsNew);
2875 return result; 2876 return result;
2876 } 2877 }
2877 break; 2878 break;
2878 case SYNC_PREF_FORCE_LOCAL: 2879 case SYNC_PREF_FORCE_LOCAL:
2879 return 1; 2880 return 1;
2880 break; 2881 break;
2881 case SYNC_PREF_FORCE_REMOTE: 2882 case SYNC_PREF_FORCE_REMOTE:
2882 return 2; 2883 return 2;
2883 break; 2884 break;
2884 2885
2885 default: 2886 default:
2886 // SYNC_PREF_TAKE_BOTH not implemented 2887 // SYNC_PREF_TAKE_BOTH not implemented
2887 break; 2888 break;
2888 } 2889 }
2889 return 0; 2890 return 0;
2890} 2891}
2891 2892
2892 2893
2893bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode) 2894bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode)
2894{ 2895{
2895 bool syncOK = true; 2896 bool syncOK = true;
2896 int addedAddressee = 0; 2897 int addedAddressee = 0;
2897 int addedAddresseeR = 0; 2898 int addedAddresseeR = 0;
2898 int deletedAddresseeR = 0; 2899 int deletedAddresseeR = 0;
2899 int deletedAddresseeL = 0; 2900 int deletedAddresseeL = 0;
2900 int changedLocal = 0; 2901 int changedLocal = 0;
2901 int changedRemote = 0; 2902 int changedRemote = 0;
2902 int filteredIN = 0; 2903 int filteredIN = 0;
2903 int filteredOUT = 0; 2904 int filteredOUT = 0;
2904 2905
2905 QString mCurrentSyncName = syncManager->getCurrentSyncName(); 2906 QString mCurrentSyncName = syncManager->getCurrentSyncName();
2906 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 2907 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
2907 2908
2908 //QPtrList<Addressee> el = local->rawAddressees(); 2909 //QPtrList<Addressee> el = local->rawAddressees();
2909 Addressee addresseeR; 2910 Addressee addresseeR;
2910 QString uid; 2911 QString uid;
2911 int take; 2912 int take;
2912 Addressee addresseeL; 2913 Addressee addresseeL;
2913 Addressee addresseeRSync; 2914 Addressee addresseeRSync;
2914 Addressee addresseeLSync; 2915 Addressee addresseeLSync;
2915 // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees(); 2916 // KABC::Addressee::List addresseeRSyncSharp = remote->getExternLastSyncAddressees();
2916 //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); 2917 //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees();
2917 bool fullDateRange = false; 2918 bool fullDateRange = false;
2918 local->resetTempSyncStat(); 2919 local->resetTempSyncStat();
2919 mLastAddressbookSync = QDateTime::currentDateTime(); 2920 mLastAddressbookSync = QDateTime::currentDateTime();
2920 if ( syncManager->syncWithDesktop() ) { 2921 if ( syncManager->syncWithDesktop() ) {
2921 // remote->removeSyncInfo( QString());//remove all info 2922 // remote->removeSyncInfo( QString());//remove all info
2922 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 2923 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
2923 mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; 2924 mLastAddressbookSync = KSyncManager::mRequestedSyncEvent;
2924 qDebug("KA: using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); 2925 qDebug("KA: using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() );
2925 } else { 2926 } else {
2926 qDebug("KA: KSyncManager::mRequestedSyncEvent has invalid datatime "); 2927 qDebug("KA: KSyncManager::mRequestedSyncEvent has invalid datatime ");
2927 } 2928 }
2928 } 2929 }
2929 QDateTime modifiedCalendar = mLastAddressbookSync; 2930 QDateTime modifiedCalendar = mLastAddressbookSync;
2930 addresseeLSync = getLastSyncAddressee(); 2931 addresseeLSync = getLastSyncAddressee();
2931 qDebug("KA: Last Sync %s ", addresseeLSync.revision().toString().latin1()); 2932 qDebug("KA: Last Sync %s ", addresseeLSync.revision().toString().latin1());
2932 addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); 2933 addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName );
2933 if ( !addresseeR.isEmpty() ) { 2934 if ( !addresseeR.isEmpty() ) {
2934 addresseeRSync = addresseeR; 2935 addresseeRSync = addresseeR;
2935 remote->removeAddressee(addresseeR ); 2936 remote->removeAddressee(addresseeR );
2936 2937
2937 } else { 2938 } else {
2938 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 2939 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
2939 addresseeRSync = addresseeLSync ; 2940 addresseeRSync = addresseeLSync ;
2940 } else { 2941 } else {
2941 //qDebug("FULLDATE 1"); 2942 //qDebug("FULLDATE 1");
2942 fullDateRange = true; 2943 fullDateRange = true;
2943 Addressee newAdd; 2944 Addressee newAdd;
2944 addresseeRSync = newAdd; 2945 addresseeRSync = newAdd;
2945 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee")); 2946 addresseeRSync.setFamilyName(mCurrentSyncName + i18n(" - sync addressee"));
2946 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName ); 2947 addresseeRSync.setUid("last-syncAddressee-"+mCurrentSyncName );
2947 addresseeRSync.setRevision( mLastAddressbookSync ); 2948 addresseeRSync.setRevision( mLastAddressbookSync );
2948 addresseeRSync.setCategories( i18n("SyncAddressee") ); 2949 addresseeRSync.setCategories( i18n("SyncAddressee") );
2949 } 2950 }
2950 } 2951 }
2951 if ( addresseeLSync.revision() == mLastAddressbookSync ) { 2952 if ( addresseeLSync.revision() == mLastAddressbookSync ) {
2952 // qDebug("FULLDATE 2"); 2953 // qDebug("FULLDATE 2");
2953 fullDateRange = true; 2954 fullDateRange = true;
2954 } 2955 }
2955 if ( ! fullDateRange ) { 2956 if ( ! fullDateRange ) {
2956 if ( addresseeLSync.revision() != addresseeRSync.revision() ) { 2957 if ( addresseeLSync.revision() != addresseeRSync.revision() ) {
2957 2958
2958 // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() ); 2959 // qDebug("set fulldate to true %s %s" ,addresseeLSync->dtStart().toString().latin1(), addresseeRSync->dtStart().toString().latin1() );
2959 //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec()); 2960 //qDebug("%d %d %d %d ", addresseeLSync->dtStart().time().second(), addresseeLSync->dtStart().time().msec() , addresseeRSync->dtStart().time().second(), addresseeRSync->dtStart().time().msec());
2960 fullDateRange = true; 2961 fullDateRange = true;
2961 //qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() ); 2962 //qDebug("FULLDATE 3 %s %s", addresseeLSync.revision().toString().latin1() , addresseeRSync.revision().toString().latin1() );
2962 } 2963 }
2963 } 2964 }
2964 // fullDateRange = true; // debug only! 2965 // fullDateRange = true; // debug only!
2965 if ( fullDateRange ) 2966 if ( fullDateRange )
2966 mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365); 2967 mLastAddressbookSync = QDateTime::currentDateTime().addDays( -100*365);
2967 else 2968 else
2968 mLastAddressbookSync = addresseeLSync.revision(); 2969 mLastAddressbookSync = addresseeLSync.revision();
2969 // for resyncing if own file has changed 2970 // for resyncing if own file has changed
2970 // PENDING fixme later when implemented 2971 // PENDING fixme later when implemented
2971#if 0 2972#if 0
2972 if ( mCurrentSyncDevice == "deleteaftersync" ) { 2973 if ( mCurrentSyncDevice == "deleteaftersync" ) {
2973 mLastAddressbookSync = loadedFileVersion; 2974 mLastAddressbookSync = loadedFileVersion;
2974 qDebug("setting mLastAddressbookSync "); 2975 qDebug("setting mLastAddressbookSync ");
2975 } 2976 }
2976#endif 2977#endif
2977 2978
2978 2979
2979 // ********** setting filters **************** 2980 // ********** setting filters ****************
2980 Filter filterIN = mViewManager->getFilterByName( syncManager->mFilterInAB ); 2981 Filter filterIN = mViewManager->getFilterByName( syncManager->mFilterInAB );
2981 Filter filterOUT = mViewManager->getFilterByName( syncManager->mFilterOutAB ); 2982 Filter filterOUT = mViewManager->getFilterByName( syncManager->mFilterOutAB );
2982 2983
2983 //qDebug("*************************** "); 2984 //qDebug("*************************** ");
2984 // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() ); 2985 // qDebug("mLastAddressbookSync %s ",mLastAddressbookSync.toString().latin1() );
2985 QStringList er = remote->uidList(); 2986 QStringList er = remote->uidList();
2986 Addressee inR ;//= er.first(); 2987 Addressee inR ;//= er.first();
2987 Addressee inL; 2988 Addressee inL;
2988 2989
2989 syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count()); 2990 syncManager->showProgressBar(0, i18n("Syncing - close to abort!"), er.count());
2990 2991
2991 int modulo = (er.count()/10)+1; 2992 int modulo = (er.count()/10)+1;
2992 int incCounter = 0; 2993 int incCounter = 0;
2993 while ( incCounter < er.count()) { 2994 while ( incCounter < er.count()) {
2994 if (syncManager->isProgressBarCanceled()) 2995 if (syncManager->isProgressBarCanceled())
2995 return false; 2996 return false;
2996 if ( incCounter % modulo == 0 ) 2997 if ( incCounter % modulo == 0 )
2997 syncManager->showProgressBar(incCounter); 2998 syncManager->showProgressBar(incCounter);
2998 2999
2999 uid = er[ incCounter ]; 3000 uid = er[ incCounter ];
3000 bool skipIncidence = false; 3001 bool skipIncidence = false;
3001 if ( uid.left(19) == QString("last-syncAddressee-") ) 3002 if ( uid.left(19) == QString("last-syncAddressee-") )
3002 skipIncidence = true; 3003 skipIncidence = true;
3003 QString idS,OidS; 3004 QString idS,OidS;
3004 qApp->processEvents(); 3005 qApp->processEvents();
3005 if ( !skipIncidence ) { 3006 if ( !skipIncidence ) {
3006 inL = local->findByUid( uid ); 3007 inL = local->findByUid( uid );
3007 inR = remote->findByUid( uid ); 3008 inR = remote->findByUid( uid );
3008 //inL.setResource( 0 ); 3009 //inL.setResource( 0 );
3009 //inR.setResource( 0 ); 3010 //inR.setResource( 0 );
3010 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars 3011 if ( !inL.isEmpty() ) { // maybe conflict - same uid in both calendars
3011 if ( !inL.resource() || inL.resource()->includeInSync() ) { 3012 if ( !inL.resource() || inL.resource()->includeInSync() ) {
3012 if ( (take = takeAddressee( &inL, &inR, mode, fullDateRange )) ) { 3013 if ( (take = takeAddressee( &inL, &inR, mode, fullDateRange )) ) {
3013 //qDebug("take %d %s ", take, inL.summary().latin1()); 3014 //qDebug("take %d %s ", take, inL.summary().latin1());
3014 if ( take == 3 ) 3015 if ( take == 3 )
3015 return false; 3016 return false;
3016 if ( take == 1 ) {// take local ********************** 3017 if ( take == 1 ) {// take local **********************
3017 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3018 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3018 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 3019 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
3019 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 3020 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
3020 local->insertAddressee( inL, false ); 3021 local->insertAddressee( inL, false );
3021 idS = inR.externalUID(); 3022 idS = inR.externalUID();
3022 OidS = inR.originalExternalUID(); 3023 OidS = inR.originalExternalUID();
3023 } 3024 }
3024 else 3025 else
3025 idS = inR.IDStr(); 3026 idS = inR.IDStr();
3026 remote->removeAddressee( inR ); 3027 remote->removeAddressee( inR );
3027 inR = inL; 3028 inR = inL;
3028 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 3029 inR.setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
3029 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3030 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3030 inR.setOriginalExternalUID( OidS ); 3031 inR.setOriginalExternalUID( OidS );
3031 inR.setExternalUID( idS ); 3032 inR.setExternalUID( idS );
3032 if ( syncManager->syncWithDesktop() ) { 3033 if ( syncManager->syncWithDesktop() ) {
3033 inR.setIDStr("changed" ); 3034 inR.setIDStr("changed" );
3034 } 3035 }
3035 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" ); 3036 //inR.insertCustom( "KADDRESSBOOK", "X-KDESYNC","changed" );
3036 } else { 3037 } else {
3037 inR.setIDStr( idS ); 3038 inR.setIDStr( idS );
3038 } 3039 }
3039 inR.setResource( 0 ); 3040 inR.setResource( 0 );
3040 remote->insertAddressee( inR , false); 3041 remote->insertAddressee( inR , false);
3041 ++changedRemote; 3042 ++changedRemote;
3042 } else { // take == 2 take remote ********************** 3043 } else { // take == 2 take remote **********************
3043 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3044 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3044 if ( inR.revision().date().year() < 2004 ) 3045 if ( inR.revision().date().year() < 2004 )
3045 inR.setRevision( modifiedCalendar ); 3046 inR.setRevision( modifiedCalendar );
3046 } 3047 }
3047 idS = inL.IDStr(); 3048 idS = inL.IDStr();
3048 local->removeAddressee( inL ); 3049 local->removeAddressee( inL );
3049 inL = inR; 3050 inL = inR;
3050 inL.setIDStr( idS ); 3051 inL.setIDStr( idS );
3051 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3052 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3052 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 3053 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
3053 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 3054 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
3054 } 3055 }
3055 inL.setResource( 0 ); 3056 inL.setResource( 0 );
3056 local->insertAddressee( inL , false ); 3057 local->insertAddressee( inL , false );
3057 ++changedLocal; 3058 ++changedLocal;
3058 } 3059 }
3059 } 3060 }
3060 } 3061 }
3061 } else { // no conflict ********** add or delete remote 3062 } else { // no conflict ********** add or delete remote
3062 if ( filterIN.name().isEmpty() || filterIN.filterAddressee( inR ) ) { 3063 if ( filterIN.name().isEmpty() || filterIN.filterAddressee( inR ) ) {
3063 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3064 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3064 QString des = addresseeLSync.note(); 3065 QString des = addresseeLSync.note();
3065 if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 3066 if ( des.find( inR.getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
3066 inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 3067 inR.setTempSyncStat( SYNC_TEMPSTATE_DELETE );
3067 remote->insertAddressee( inR, false ); 3068 remote->insertAddressee( inR, false );
3068 ++deletedAddresseeR; 3069 ++deletedAddresseeR;
3069 } else { 3070 } else {
3070 inR.setRevision( modifiedCalendar ); 3071 inR.setRevision( modifiedCalendar );
3071 remote->insertAddressee( inR, false ); 3072 remote->insertAddressee( inR, false );
3072 inL = inR; 3073 inL = inR;
3073 inL.setIDStr( ":" ); 3074 inL.setIDStr( ":" );
3074 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) ); 3075 inL.setCsum( mCurrentSyncDevice, inR.getCsum(mCurrentSyncDevice) );
3075 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) ); 3076 inL.setID( mCurrentSyncDevice, inR.getID(mCurrentSyncDevice) );
3076 inL.setResource( 0 ); 3077 inL.setResource( 0 );
3077 local->insertAddressee( inL , false); 3078 local->insertAddressee( inL , false);
3078 ++addedAddressee; 3079 ++addedAddressee;
3079 } 3080 }
3080 } else { 3081 } else {
3081 if ( inR.revision() > mLastAddressbookSync || mode == 5 ) { 3082 if ( inR.revision() > mLastAddressbookSync || mode == 5 ) {
3082 inR.setRevision( modifiedCalendar ); 3083 inR.setRevision( modifiedCalendar );
3083 remote->insertAddressee( inR, false ); 3084 remote->insertAddressee( inR, false );
3084 inR.setResource( 0 ); 3085 inR.setResource( 0 );
3085 local->insertAddressee( inR, false ); 3086 local->insertAddressee( inR, false );
3086 ++addedAddressee; 3087 ++addedAddressee;
3087 } else { 3088 } else {
3088 // pending checkExternSyncAddressee(addresseeRSyncSharp, inR); 3089 // pending checkExternSyncAddressee(addresseeRSyncSharp, inR);
3089 remote->removeAddressee( inR ); 3090 remote->removeAddressee( inR );
3090 ++deletedAddresseeR; 3091 ++deletedAddresseeR;
3091 } 3092 }
3092 } 3093 }
3093 } else { 3094 } else {
3094 ++filteredIN; 3095 ++filteredIN;
3095 } 3096 }
3096 } 3097 }
3097 } 3098 }
3098 ++incCounter; 3099 ++incCounter;
3099 } 3100 }
3100 er.clear(); 3101 er.clear();
3101 QStringList el = local->uidList(); 3102 QStringList el = local->uidList();
3102 modulo = (el.count()/10)+1; 3103 modulo = (el.count()/10)+1;
3103 3104
3104 syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count()); 3105 syncManager->showProgressBar(0, i18n("Add / remove addressees"), el.count());
3105 incCounter = 0; 3106 incCounter = 0;
3106 while ( incCounter < el.count()) { 3107 while ( incCounter < el.count()) {
3107 qApp->processEvents(); 3108 qApp->processEvents();
3108 if (syncManager->isProgressBarCanceled()) 3109 if (syncManager->isProgressBarCanceled())
3109 return false; 3110 return false;
3110 if ( incCounter % modulo == 0 ) 3111 if ( incCounter % modulo == 0 )
3111 syncManager->showProgressBar(incCounter); 3112 syncManager->showProgressBar(incCounter);
3112 uid = el[ incCounter ]; 3113 uid = el[ incCounter ];
3113 bool skipIncidence = false; 3114 bool skipIncidence = false;
3114 if ( uid.left(19) == QString("last-syncAddressee-") ) 3115 if ( uid.left(19) == QString("last-syncAddressee-") )
3115 skipIncidence = true; 3116 skipIncidence = true;
3116 if ( !skipIncidence ) { 3117 if ( !skipIncidence ) {
3117 inL = local->findByUid( uid ); 3118 inL = local->findByUid( uid );
3118 if ( !inL.resource() || inL.resource()->includeInSync() ) { 3119 if ( !inL.resource() || inL.resource()->includeInSync() ) {
3119 inR = remote->findByUid( uid ); 3120 inR = remote->findByUid( uid );
3120 if ( inR.isEmpty() ){ 3121 if ( inR.isEmpty() ){
3121 if ( filterOUT.name().isEmpty() || filterOUT.filterAddressee( inL ) ) { 3122 if ( filterOUT.name().isEmpty() || filterOUT.filterAddressee( inL ) ) {
3122 // no conflict ********** add or delete local 3123 // no conflict ********** add or delete local
3123 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 3124 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
3124 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 3125 if ( !inL.getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
3125 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 3126 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
3126 local->removeAddressee( inL ); 3127 local->removeAddressee( inL );
3127 ++deletedAddresseeL; 3128 ++deletedAddresseeL;
3128 } else { 3129 } else {
3129 if ( ! syncManager->mWriteBackExistingOnly ) { 3130 if ( ! syncManager->mWriteBackExistingOnly ) {
3130 inL.removeID(mCurrentSyncDevice ); 3131 inL.removeID(mCurrentSyncDevice );
3131 ++addedAddresseeR; 3132 ++addedAddresseeR;
3132 inL.setRevision( modifiedCalendar ); 3133 inL.setRevision( modifiedCalendar );
3133 local->insertAddressee( inL, false ); 3134 local->insertAddressee( inL, false );
3134 inR = inL; 3135 inR = inL;
3135 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL ); 3136 inR.setTempSyncStat( SYNC_TEMPSTATE_ADDED_EXTERNAL );
3136 inR.setResource( 0 ); 3137 inR.setResource( 0 );
3137 remote->insertAddressee( inR, false ); 3138 remote->insertAddressee( inR, false );
3138 } 3139 }
3139 } 3140 }
3140 } else { 3141 } else {
3141 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) { 3142 if ( inL.revision() < mLastAddressbookSync && mode != 4 ) {
3142 //qDebug("data %s ", inL.revision().toString().latin1()); 3143 //qDebug("data %s ", inL.revision().toString().latin1());
3143 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL); 3144 // pending checkExternSyncAddressee(addresseeLSyncSharp, inL);
3144 local->removeAddressee( inL ); 3145 local->removeAddressee( inL );
3145 ++deletedAddresseeL; 3146 ++deletedAddresseeL;
3146 } else { 3147 } else {
3147 if ( ! syncManager->mWriteBackExistingOnly ) { 3148 if ( ! syncManager->mWriteBackExistingOnly ) {
3148 ++addedAddresseeR; 3149 ++addedAddresseeR;
3149 inL.setRevision( modifiedCalendar ); 3150 inL.setRevision( modifiedCalendar );
3150 local->insertAddressee( inL, false ); 3151 local->insertAddressee( inL, false );
3151 inR = inL; 3152 inR = inL;
3152 inR.setIDStr( ":" ); 3153 inR.setIDStr( ":" );
3153 inR.setResource( 0 ); 3154 inR.setResource( 0 );
3154 remote->insertAddressee( inR, false ); 3155 remote->insertAddressee( inR, false );
3155 } 3156 }
3156 } 3157 }
3157 } 3158 }
3158 } else { 3159 } else {
3159 ++filteredOUT; 3160 ++filteredOUT;
3160 } 3161 }
3161 } 3162 }
3162 } 3163 }
3163 } 3164 }
3164 ++incCounter; 3165 ++incCounter;
3165 } 3166 }
3166 el.clear(); 3167 el.clear();
3167 syncManager->hideProgressBar(); 3168 syncManager->hideProgressBar();
3168 mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); 3169 mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 );
3169 // get rid of micro seconds 3170 // get rid of micro seconds
3170 QTime t = mLastAddressbookSync.time(); 3171 QTime t = mLastAddressbookSync.time();
3171 mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 3172 mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) );
3172 addresseeLSync.setRevision( mLastAddressbookSync ); 3173 addresseeLSync.setRevision( mLastAddressbookSync );
3173 addresseeRSync.setRevision( mLastAddressbookSync ); 3174 addresseeRSync.setRevision( mLastAddressbookSync );
3174 addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; 3175 addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ;
3175 addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); 3176 addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName );
3176 addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; 3177 addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ;
3177 addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); 3178 addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") );
3178 addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; 3179 addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ;
3179 addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); 3180 addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() );
3180 addresseeRSync.setNote( "" ) ; 3181 addresseeRSync.setNote( "" ) ;
3181 addresseeLSync.setNote( "" ); 3182 addresseeLSync.setNote( "" );
3182 3183
3183 if ( mGlobalSyncMode == SYNC_MODE_NORMAL) 3184 if ( mGlobalSyncMode == SYNC_MODE_NORMAL)
3184 remote->insertAddressee( addresseeRSync, false ); 3185 remote->insertAddressee( addresseeRSync, false );
3185 local->insertAddressee( addresseeLSync, false ); 3186 local->insertAddressee( addresseeLSync, false );
3186 QString mes; 3187 QString mes;
3187 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT ); 3188 mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT );
3188 qDebug( mes ); 3189 qDebug( mes );
3189 mes = i18n("Local addressbook changed!\n") +mes; 3190 mes = i18n("Local addressbook changed!\n") +mes;
3190 if ( syncManager->mShowSyncSummary ) { 3191 if ( syncManager->mShowSyncSummary ) {
3191 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 3192 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
3192 i18n("KA/Pi Synchronization"),i18n("Write back"))) { 3193 i18n("KA/Pi Synchronization"),i18n("Write back"))) {
3193 qDebug("KA: WB cancelled "); 3194 qDebug("KA: WB cancelled ");
3194 syncManager->mWriteBackFile = false; 3195 syncManager->mWriteBackFile = false;
3195 return syncOK; 3196 return syncOK;
3196 } 3197 }
3197 } 3198 }
3198 return syncOK; 3199 return syncOK;
3199} 3200}
3200 3201
3201 3202
3202//this is a overwritten callbackmethods from the syncinterface 3203//this is a overwritten callbackmethods from the syncinterface
3203bool KABCore::sync(KSyncManager* manager, QString filename, int mode) 3204bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
3204{ 3205{
3205 3206
3206 //pending prepare addresseeview for output 3207 //pending prepare addresseeview for output
3207 //pending detect, if remote file has REV field. if not switch to external sync 3208 //pending detect, if remote file has REV field. if not switch to external sync
3208 mGlobalSyncMode = SYNC_MODE_NORMAL; 3209 mGlobalSyncMode = SYNC_MODE_NORMAL;
3209 if ( manager != syncManager ) 3210 if ( manager != syncManager )
3210 qDebug("KABCore::sync:: ERROR! :: manager != syncManager "); 3211 qDebug("KABCore::sync:: ERROR! :: manager != syncManager ");
3211 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 3212 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
3212 3213
3213 AddressBook abLocal(filename,"syncContact"); 3214 AddressBook abLocal(filename,"syncContact");
3214 bool syncOK = false; 3215 bool syncOK = false;
3215 if ( abLocal.load() ) { 3216 if ( abLocal.load() ) {
3216 qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode ); 3217 qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode );
3217 bool external = false; 3218 bool external = false;
3218 bool isXML = false; 3219 bool isXML = false;
3219 if ( filename.right(4) == ".xml") { 3220 if ( filename.right(4) == ".xml") {
3220 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3221 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3221 isXML = true; 3222 isXML = true;
3222 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3223 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3223 } else { 3224 } else {
3224 external = !manager->mIsKapiFile; 3225 external = !manager->mIsKapiFile;
3225 if ( external ) { 3226 if ( external ) {
3226 qDebug("KA: Sync::Setting vcf mode to external "); 3227 qDebug("KA: Sync::Setting vcf mode to external ");
3227 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3228 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3228 AddressBook::Iterator it; 3229 AddressBook::Iterator it;
3229 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 3230 for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
3230 (*it).setID( mCurrentSyncDevice, (*it).uid() ); 3231 (*it).setID( mCurrentSyncDevice, (*it).uid() );
3231 (*it).computeCsum( mCurrentSyncDevice ); 3232 (*it).computeCsum( mCurrentSyncDevice );
3232 } 3233 }
3233 } 3234 }
3234 } 3235 }
3235 //AddressBook::Iterator it; 3236 //AddressBook::Iterator it;
3236 //QStringList vcards; 3237 //QStringList vcards;
3237 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { 3238 //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) {
3238 // qDebug("Name %s ", (*it).familyName().latin1()); 3239 // qDebug("Name %s ", (*it).familyName().latin1());
3239 //} 3240 //}
3240 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); 3241 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode );
3241 syncManager->hideProgressBar(); 3242 syncManager->hideProgressBar();
3242 if ( syncOK ) { 3243 if ( syncOK ) {
3243 if ( syncManager->mWriteBackFile ) 3244 if ( syncManager->mWriteBackFile )
3244 { 3245 {
3245 if ( external ) 3246 if ( external )
3246 abLocal.removeSyncAddressees( !isXML); 3247 abLocal.removeSyncAddressees( !isXML);
3247 qDebug("KA: Sync::Saving remote AB "); 3248 qDebug("KA: Sync::Saving remote AB ");
3248 if ( ! abLocal.saveAB()) 3249 if ( ! abLocal.saveAB())
3249 qDebug("KA: sync::Error writing back AB to file "); 3250 qDebug("KA: sync::Error writing back AB to file ");
3250 if ( external ) { 3251 if ( external ) {
3251 // afterwrite processing 3252 // afterwrite processing
3252 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); 3253 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML);
3253 } 3254 }
3254 } 3255 }
3255 } 3256 }
3256 setModified(); 3257 setModified();
3257 3258
3258 } 3259 }
3259 abLocal.removeResources(); 3260 abLocal.removeResources();
3260 if ( syncOK ) 3261 if ( syncOK )
3261 mViewManager->refreshView(); 3262 mViewManager->refreshView();
3262 return syncOK; 3263 return syncOK;
3263 3264
3264} 3265}
3265void KABCore::removeSyncInfo( QString syncProfile) 3266void KABCore::removeSyncInfo( QString syncProfile)
3266{ 3267{
3267 qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1()); 3268 qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1());
3268 mAddressBook->removeSyncInfo( syncProfile ); 3269 mAddressBook->removeSyncInfo( syncProfile );
3269 setModified(); 3270 setModified();
3270} 3271}
3271 3272
3272 3273
3273//this is a overwritten callbackmethods from the syncinterface 3274//this is a overwritten callbackmethods from the syncinterface
3274bool KABCore::syncExternal(KSyncManager* manager, QString resource) 3275bool KABCore::syncExternal(KSyncManager* manager, QString resource)
3275{ 3276{
3276 if ( resource == "phone" ) 3277 if ( resource == "phone" )
3277 return syncPhone(); 3278 return syncPhone();
3278 disableBR( true ); 3279 disableBR( true );
3279 if ( manager != syncManager ) 3280 if ( manager != syncManager )
3280 qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); 3281 qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager ");
3281 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 3282 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
3282 3283
3283 AddressBook abLocal( resource,"syncContact"); 3284 AddressBook abLocal( resource,"syncContact");
3284 bool syncOK = false; 3285 bool syncOK = false;
3285 message(i18n("Loading DTM address data..."), false); 3286 message(i18n("Loading DTM address data..."), false);
3286 if ( abLocal.load() ) { 3287 if ( abLocal.load() ) {
3287 qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3288 qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
3288 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3289 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3289 message(i18n("Sync preprocessing..."),false); 3290 message(i18n("Sync preprocessing..."),false);
3290 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); 3291 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false );
3291 message(i18n("Synchronizing..."),false); 3292 message(i18n("Synchronizing..."),false);
3292 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3293 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3293 syncManager->hideProgressBar(); 3294 syncManager->hideProgressBar();
3294 if ( syncOK ) { 3295 if ( syncOK ) {
3295 if ( syncManager->mWriteBackFile ) { 3296 if ( syncManager->mWriteBackFile ) {
3296 abLocal.removeSyncAddressees( false ); 3297 abLocal.removeSyncAddressees( false );
3297 message(i18n("Saving DTM address data..."),false); 3298 message(i18n("Saving DTM address data..."),false);
3298 abLocal.saveAB(); 3299 abLocal.saveAB();
3299 message(i18n("Sync postprocessing..."),false); 3300 message(i18n("Sync postprocessing..."),false);
3300 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3301 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3301 } 3302 }
3302 } else 3303 } else
3303 message( i18n("Sync cancelled or failed.") ); 3304 message( i18n("Sync cancelled or failed.") );
3304 setModified(); 3305 setModified();
3305 } 3306 }
3306 abLocal.removeResources(); 3307 abLocal.removeResources();
3307 if ( syncOK ) { 3308 if ( syncOK ) {
3308 mViewManager->refreshView(); 3309 mViewManager->refreshView();
3309 message(i18n("DTM syncing finished.")); 3310 message(i18n("DTM syncing finished."));
3310 } 3311 }
3311 disableBR( false ); 3312 disableBR( false );
3312 return syncOK; 3313 return syncOK;
3313 3314
3314} 3315}
3315void KABCore::message( QString m, bool startTimer) 3316void KABCore::message( QString m, bool startTimer)
3316{ 3317{
3317 topLevelWidget()->setCaption( m ); 3318 topLevelWidget()->setCaption( m );
3318 qApp->processEvents(); 3319 qApp->processEvents();
3319 if ( startTimer ) 3320 if ( startTimer )
3320 mMessageTimer->start( 15000, true ); 3321 mMessageTimer->start( 15000, true );
3321 else 3322 else
3322 mMessageTimer->stop(); 3323 mMessageTimer->stop();
3323} 3324}
3324bool KABCore::syncPhone() 3325bool KABCore::syncPhone()
3325{ 3326{
3326 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 3327 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
3327 QString fileName = getPhoneFile(); 3328 QString fileName = getPhoneFile();
3328 if ( !PhoneAccess::readFromPhone( fileName) ) { 3329 if ( !PhoneAccess::readFromPhone( fileName) ) {
3329 message(i18n("Phone access failed!")); 3330 message(i18n("Phone access failed!"));
3330 return false; 3331 return false;
3331 } 3332 }
3332 AddressBook abLocal( fileName,"syncContact"); 3333 AddressBook abLocal( fileName,"syncContact");
3333 bool syncOK = false; 3334 bool syncOK = false;
3334 { 3335 {
3335 abLocal.importFromFile( fileName ); 3336 abLocal.importFromFile( fileName );
3336 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3337 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
3337 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3338 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3338 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 3339 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
3339 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3340 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3340 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3341 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3341 syncManager->hideProgressBar(); 3342 syncManager->hideProgressBar();
3342 if ( syncOK ) { 3343 if ( syncOK ) {
3343 if ( syncManager->mWriteBackFile ) { 3344 if ( syncManager->mWriteBackFile ) {
3344 abLocal.removeSyncAddressees( true ); 3345 abLocal.removeSyncAddressees( true );
3345 abLocal.saveABphone( fileName ); 3346 abLocal.saveABphone( fileName );
3346 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 3347 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
3347 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 3348 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
3348 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3349 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3349 } 3350 }
3350 } 3351 }
3351 setModified(); 3352 setModified();
3352 } 3353 }
3353 abLocal.removeResources(); 3354 abLocal.removeResources();
3354 if ( syncOK ) 3355 if ( syncOK )
3355 mViewManager->refreshView(); 3356 mViewManager->refreshView();
3356 return syncOK; 3357 return syncOK;
3357} 3358}
3358void KABCore::getFile( bool success ) 3359void KABCore::getFile( bool success )
3359{ 3360{
3360 if ( ! success ) { 3361 if ( ! success ) {
3361 message( i18n("Error receiving file. Nothing changed!") ); 3362 message( i18n("Error receiving file. Nothing changed!") );
3362 return; 3363 return;
3363 } 3364 }
3364 int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); 3365 int count = mAddressBook->importFromFile( sentSyncFile() , false, true );
3365 if ( count ) 3366 if ( count )
3366 setModified( true ); 3367 setModified( true );
3367 message( i18n("Pi-Sync successful!") ); 3368 message( i18n("Pi-Sync successful!") );
3368 mViewManager->refreshView(); 3369 mViewManager->refreshView();
3369} 3370}
3370void KABCore::syncFileRequest() 3371void KABCore::syncFileRequest()
3371{ 3372{
3372 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { 3373 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) {
3373 syncManager->slotSyncMenu( 999 ); 3374 syncManager->slotSyncMenu( 999 );
3374 } 3375 }
3375 mAddressBook->export2File( sentSyncFile() ); 3376 mAddressBook->export2File( sentSyncFile() );
3376} 3377}
3377QString KABCore::sentSyncFile() 3378QString KABCore::sentSyncFile()
3378{ 3379{
3379#ifdef DESKTOP_VERSION 3380#ifdef DESKTOP_VERSION
3380 return locateLocal( "tmp", "copysyncab.vcf" ); 3381 return locateLocal( "tmp", "copysyncab.vcf" );
3381#else 3382#else
3382 return QString( "/tmp/copysyncab.vcf" ); 3383 return QString( "/tmp/copysyncab.vcf" );
3383#endif 3384#endif
3384} 3385}
3385 3386
3386void KABCore::setCaptionBack() 3387void KABCore::setCaptionBack()
3387{ 3388{
3388 mMessageTimer->stop(); 3389 mMessageTimer->stop();
3389 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); 3390 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") );
3390} 3391}
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 8752636..53cd011 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -1,799 +1,799 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 2001 4 Copyright (c) 2001
5 Cornelius Schumacher <schumacher@kde.org> 5 Cornelius Schumacher <schumacher@kde.org>
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <qwidgetstack.h> 26#include <qwidgetstack.h>
27 27
28#include <kconfig.h> 28#include <kconfig.h>
29#include <kglobal.h> 29#include <kglobal.h>
30#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
32#else 32#else
33#include <qapplication.h> 33#include <qapplication.h>
34#endif 34#endif
35#include <qdatetime.h> 35#include <qdatetime.h>
36#include "calendarview.h" 36#include "calendarview.h"
37#include "datenavigator.h" 37#include "datenavigator.h"
38#include "kotodoview.h" 38#include "kotodoview.h"
39#include "koagendaview.h" 39#include "koagendaview.h"
40#include "kodialogmanager.h" 40#include "kodialogmanager.h"
41#include "komonthview.h" 41#include "komonthview.h"
42#include "kolistview.h" 42#include "kolistview.h"
43#include "kowhatsnextview.h" 43#include "kowhatsnextview.h"
44#include "kojournalview.h" 44#include "kojournalview.h"
45#include "kotimespanview.h" 45#include "kotimespanview.h"
46#include "koprefs.h" 46#include "koprefs.h"
47#include "navigatorbar.h" 47#include "navigatorbar.h"
48#include "kdatenavigator.h" 48#include "kdatenavigator.h"
49 49
50#include "koviewmanager.h" 50#include "koviewmanager.h"
51//extern bool externFlagMonthviewBlockPainting; 51//extern bool externFlagMonthviewBlockPainting;
52 52
53//bool globalFlagBlockPainting = false; 53//bool globalFlagBlockPainting = false;
54int globalFlagBlockAgenda = 0; 54int globalFlagBlockAgenda = 0;
55int globalFlagBlockLabel = 0; 55int globalFlagBlockLabel = 0;
56int globalFlagBlockAgendaItemPaint = 1; 56int globalFlagBlockAgendaItemPaint = 1;
57int globalFlagBlockAgendaItemUpdate = 1; 57int globalFlagBlockAgendaItemUpdate = 1;
58 58
59 59
60KOViewManager::KOViewManager( CalendarView *mainView ) : 60KOViewManager::KOViewManager( CalendarView *mainView ) :
61 QObject(), mMainView( mainView ) 61 QObject(), mMainView( mainView )
62{ 62{
63 mCurrentView = 0; 63 mCurrentView = 0;
64 64
65 mWhatsNextView = 0; 65 mWhatsNextView = 0;
66 mTodoView = 0; 66 mTodoView = 0;
67 mAgendaView = 0; 67 mAgendaView = 0;
68 mMonthView = 0; 68 mMonthView = 0;
69 mListView = 0; 69 mListView = 0;
70 mJournalView = 0; 70 mJournalView = 0;
71 mTimeSpanView = 0; 71 mTimeSpanView = 0;
72 mCurrentAgendaView = 0 ; 72 mCurrentAgendaView = 0 ;
73 mFlagShowNextxDays = false; 73 mFlagShowNextxDays = false;
74} 74}
75 75
76KOViewManager::~KOViewManager() 76KOViewManager::~KOViewManager()
77{ 77{
78} 78}
79 79
80 80
81KOrg::BaseView *KOViewManager::currentView() 81KOrg::BaseView *KOViewManager::currentView()
82{ 82{
83 return mCurrentView; 83 return mCurrentView;
84} 84}
85 85
86void KOViewManager::readSettings(KConfig *config) 86void KOViewManager::readSettings(KConfig *config)
87{ 87{
88 config->setGroup("General"); 88 config->setGroup("General");
89 QString view = config->readEntry("Current View"); 89 QString view = config->readEntry("Current View");
90 if (view == "WhatsNext") showWhatsNextView(); 90 if (view == "WhatsNext") showWhatsNextView();
91 else if (view == "Month") { 91 else if (view == "Month") {
92 if ( !KOPrefs::instance()->mMonthViewWeek ) 92 if ( !KOPrefs::instance()->mMonthViewWeek )
93 showMonthView(); 93 showMonthView();
94 else 94 else
95 showMonthViewWeek(); 95 showMonthViewWeek();
96 } 96 }
97 else if (view == "List") showListView(); 97 else if (view == "List") showListView();
98 else if (view == "Journal") showJournalView(); 98 else if (view == "Journal") showJournalView();
99 else if (view == "TimeSpan") showTimeSpanView(); 99 else if (view == "TimeSpan") showTimeSpanView();
100 else if (view == "Todo") showTodoView(); 100 else if (view == "Todo") showTodoView();
101 else { 101 else {
102 config->setGroup( "Views" ); 102 config->setGroup( "Views" );
103 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 103 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
104 mCurrentAgendaView = dateCount; 104 mCurrentAgendaView = dateCount;
105 showAgendaView(); 105 showAgendaView();
106 mCurrentAgendaView = dateCount; 106 mCurrentAgendaView = dateCount;
107#ifdef DESKTOP_VERSION 107#ifdef DESKTOP_VERSION
108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) ); 108 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) );
109#endif 109#endif
110 } 110 }
111} 111}
112 112
113void KOViewManager::showDateView( int view, QDate date) 113void KOViewManager::showDateView( int view, QDate date)
114{ 114{
115 static int lastMode = 0; 115 static int lastMode = 0;
116 static int lastCount = 0; 116 static int lastCount = 0;
117 static bool lastNDMode = false; 117 static bool lastNDMode = false;
118 static QDate lastDate; 118 static QDate lastDate;
119 //qDebug("date %d %s", view, date.toString().latin1()); 119 //qDebug("date %d %s", view, date.toString().latin1());
120 120
121 if (view != 9) 121 if (view != 9)
122 lastMode = 0; 122 lastMode = 0;
123 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); 123 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays );
124 bool savemFlagShowNextxDays = mFlagShowNextxDays; 124 bool savemFlagShowNextxDays = mFlagShowNextxDays;
125 mFlagShowNextxDays = false; 125 mFlagShowNextxDays = false;
126 if ( view == 3 ) { 126 if ( view == 3 ) {
127 //mCurrentAgendaView = 1 ; 127 //mCurrentAgendaView = 1 ;
128 lastDate = mMainView->dateNavigator()->selectedDates().first(); 128 lastDate = mMainView->dateNavigator()->selectedDates().first();
129 lastCount = mMainView->dateNavigator()->selectedDates().count(); 129 lastCount = mMainView->dateNavigator()->selectedDates().count();
130 lastNDMode = savemFlagShowNextxDays; 130 lastNDMode = savemFlagShowNextxDays;
131 mMainView->dateNavigator()->selectDate( date ); 131 mMainView->dateNavigator()->selectDate( date );
132 lastMode = 1; 132 lastMode = 1;
133 mCurrentAgendaView = 1 ; 133 mCurrentAgendaView = 1 ;
134 } else if (view == 4 ) { 134 } else if (view == 4 ) {
135 mCurrentAgendaView = 7 ; 135 mCurrentAgendaView = 7 ;
136 mMainView->dateNavigator()->selectDates( date, 7 ); 136 mMainView->dateNavigator()->selectDates( date, 7 );
137 } else if (view == 5 ) { 137 } else if (view == 5 ) {
138 mCurrentAgendaView = 14 ; 138 mCurrentAgendaView = 14 ;
139 mMainView->dateNavigator()->selectDates( date, 14); 139 mMainView->dateNavigator()->selectDates( date, 14);
140 } else if (view == 6 ) { 140 } else if (view == 6 ) {
141 //mMainView->dateNavigator()->selectDates( date, 7 ); 141 //mMainView->dateNavigator()->selectDates( date, 7 );
142 showMonthView(); 142 showMonthView();
143 } else if (view == 7 ) { 143 } else if (view == 7 ) {
144 mMainView->dateNavigator()->selectDate( date ); 144 mMainView->dateNavigator()->selectDate( date );
145 showJournalView(); 145 showJournalView();
146 } else if (view == 8 ) { 146 } else if (view == 8 ) {
147 globalFlagBlockAgenda = 1; 147 globalFlagBlockAgenda = 1;
148 if ( mCurrentAgendaView != 3 ) 148 if ( mCurrentAgendaView != 3 )
149 mCurrentAgendaView = -1; 149 mCurrentAgendaView = -1;
150 showAgendaView(KOPrefs::instance()->mFullViewMonth); 150 showAgendaView(KOPrefs::instance()->mFullViewMonth);
151 globalFlagBlockAgenda = 2; 151 globalFlagBlockAgenda = 2;
152 mMainView->dateNavigator()->selectDates( date , 152 mMainView->dateNavigator()->selectDates( date ,
153 KOPrefs::instance()->mNextXDays ); 153 KOPrefs::instance()->mNextXDays );
154 mFlagShowNextxDays = true; 154 mFlagShowNextxDays = true;
155 mCurrentAgendaView = 3 ; 155 mCurrentAgendaView = 3 ;
156 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) 156 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode )
157 if ( lastMode ) { 157 if ( lastMode ) {
158 mCurrentAgendaView = lastCount ; 158 mCurrentAgendaView = lastCount ;
159 mMainView->dateNavigator()->selectDates( lastDate, lastCount); 159 mMainView->dateNavigator()->selectDates( lastDate, lastCount);
160 mFlagShowNextxDays = lastNDMode; 160 mFlagShowNextxDays = lastNDMode;
161 if ( mFlagShowNextxDays ) { 161 if ( mFlagShowNextxDays ) {
162 mCurrentAgendaView = 3 ; 162 mCurrentAgendaView = 3 ;
163 } 163 }
164 } else 164 } else
165 showWeekView(); 165 showWeekView();
166 } else if (view == 10) { 166 } else if (view == 10) {
167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); 167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() );
168 } 168 }
169} 169}
170 170
171 171
172 172
173void KOViewManager::writeSettings(KConfig *config) 173void KOViewManager::writeSettings(KConfig *config)
174{ 174{
175 config->setGroup("General"); 175 config->setGroup("General");
176 176
177 QString view; 177 QString view;
178 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 178 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
179 else if (mCurrentView == mMonthView) view = "Month"; 179 else if (mCurrentView == mMonthView) view = "Month";
180 else if (mCurrentView == mListView) view = "List"; 180 else if (mCurrentView == mListView) view = "List";
181 else if (mCurrentView == mJournalView) view = "Journal"; 181 else if (mCurrentView == mJournalView) view = "Journal";
182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
183 else if (mCurrentView == mTodoView) view = "Todo"; 183 else if (mCurrentView == mTodoView) view = "Todo";
184 else view = "Agenda"; 184 else view = "Agenda";
185 185
186 config->writeEntry("Current View",view); 186 config->writeEntry("Current View",view);
187 187
188 if (mAgendaView) { 188 if (mAgendaView) {
189 mAgendaView->writeSettings(config); 189 mAgendaView->writeSettings(config);
190 } 190 }
191 if (mTimeSpanView) { 191 if (mTimeSpanView) {
192 mTimeSpanView->writeSettings(config); 192 mTimeSpanView->writeSettings(config);
193 } 193 }
194 if (mListView) { 194 if (mListView) {
195 mListView->writeSettings(config); 195 mListView->writeSettings(config);
196 } 196 }
197 if (mTodoView) { 197 if (mTodoView) {
198 mTodoView->saveLayout(config,"Todo View"); 198 mTodoView->saveLayout(config,"Todo View");
199 } 199 }
200} 200}
201void KOViewManager::showNextView() 201void KOViewManager::showNextView()
202{ 202{
203 if (mCurrentView == mWhatsNextView) goto NEXT_X; 203 if (mCurrentView == mWhatsNextView) goto NEXT_X;
204 204
205 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL; 205 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto JOURNAL;
206 206
207 if (mCurrentView == mJournalView ) goto DAY_1; 207 if (mCurrentView == mJournalView ) goto DAY_1;
208 208
209 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5; 209 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5;
210 210
211 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7; 211 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7;
212 212
213 if (mCurrentView == mAgendaView ) goto DAY_6; 213 if (mCurrentView == mAgendaView ) goto DAY_6;
214 214
215 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH; 215 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH;
216 216
217 if (mCurrentView == mMonthView ) goto LIST; 217 if (mCurrentView == mMonthView ) goto LIST;
218 218
219 if (mCurrentView == mListView ) goto TODO; 219 if (mCurrentView == mListView ) goto TODO;
220 220
221 // if (mCurrentView == mTodoView ) goto LIST; 221 // if (mCurrentView == mTodoView ) goto LIST;
222 222
223 223
224 NEXT: 224 NEXT:
225 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} 225 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
226 NEXT_X: 226 NEXT_X:
227 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} 227 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
228 JOURNAL: 228 JOURNAL:
229 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} 229 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
230 DAY_1: 230 DAY_1:
231 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} 231 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
232 DAY_5: 232 DAY_5:
233 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} 233 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
234 DAY_7: 234 DAY_7:
235 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} 235 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
236 DAY_6: 236 DAY_6:
237 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} 237 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
238 MONTH: 238 MONTH:
239 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} 239 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
240 LIST: 240 LIST:
241 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} 241 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
242 TODO: 242 TODO:
243 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} 243 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
244 244
245 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;} 245 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
246 246
247 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;} 247 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
248 248
249 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;} 249 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
250 250
251 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;} 251 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
252 252
253 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;} 253 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
254 254
255 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;} 255 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
256 256
257 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;} 257 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
258 258
259 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;} 259 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
260 260
261 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;} 261 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
262 262
263 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;} 263 //if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
264 264
265 265
266 266
267} 267}
268void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 268void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
269{ 269{
270 270
271 //mFlagShowNextxDays = false; 271 //mFlagShowNextxDays = false;
272 //if(view == mCurrentView) return; 272 //if(view == mCurrentView) return;
273 if ( view == 0 ) { 273 if ( view == 0 ) {
274 view = mCurrentView; 274 view = mCurrentView;
275 if ( view == 0 ) 275 if ( view == 0 )
276 return; 276 return;
277 } 277 }
278 bool callupdate = !(view == mCurrentView); 278 bool callupdate = !(view == mCurrentView);
279 bool full = fullScreen; 279 bool full = fullScreen;
280 if(view == mCurrentView && view != mWhatsNextView ) { 280 if(view == mCurrentView && view != mWhatsNextView ) {
281 if ( mCurrentAgendaView < 0 ) 281 if ( mCurrentAgendaView < 0 )
282 return; 282 return;
283 if ( view != mMonthView ) 283 if ( view != mMonthView )
284 full = mMainView->leftFrame()->isVisible(); 284 full = mMainView->leftFrame()->isVisible();
285 } else { 285 } else {
286 if ( view == mMonthView && mMonthView) 286 if ( view == mMonthView && mMonthView)
287 ;//mMonthView->skipResize = true ; 287 ;//mMonthView->skipResize = true ;
288 mCurrentView = view; 288 mCurrentView = view;
289 // bool full = fullScreen; 289 // bool full = fullScreen;
290 bool isFull = !mMainView->leftFrame()->isVisible(); 290 bool isFull = !mMainView->leftFrame()->isVisible();
291 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 291 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
292 full = true; 292 full = true;
293 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 293 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
294 full = false; 294 full = false;
295 } 295 }
296 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 296 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
297 //raiseCurrentView( full ); 297 //raiseCurrentView( full );
298 mMainView->processIncidenceSelection( 0 ); 298 mMainView->processIncidenceSelection( 0 );
299 //mMainView->updateView(); 299 //mMainView->updateView();
300 raiseCurrentView( full, callupdate ); 300 raiseCurrentView( full, callupdate );
301 mMainView->adaptNavigationUnits(); 301 mMainView->adaptNavigationUnits();
302} 302}
303 303
304void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 304void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
305{ 305{
306 mCurrentAgendaView = 0; 306 mCurrentAgendaView = 0;
307 if ( fullScreen ) { 307 if ( fullScreen ) {
308 mMainView->leftFrame()->hide(); 308 mMainView->leftFrame()->hide();
309 } else { 309 } else {
310 mMainView->leftFrame()->show(); 310 mMainView->leftFrame()->show();
311 } 311 }
312 //if ( mCurrentView == mMonthView ) qApp->processEvents(); 312 //if ( mCurrentView == mMonthView ) qApp->processEvents();
313 emit signalFullScreen( !fullScreen ); 313 emit signalFullScreen( !fullScreen );
314 if ( callUpdateView ) 314 if ( callUpdateView )
315 mMainView->updateView(); 315 mMainView->updateView();
316 316
317 if ( globalFlagBlockAgenda == 5 ) { 317 if ( globalFlagBlockAgenda == 5 ) {
318 globalFlagBlockAgenda = 4; 318 globalFlagBlockAgenda = 4;
319 globalFlagBlockAgendaItemPaint = 1; 319 globalFlagBlockAgendaItemPaint = 1;
320 } 320 }
321 mMainView->viewStack()->raiseWidget(mCurrentView); 321 mMainView->viewStack()->raiseWidget(mCurrentView);
322 if ( globalFlagBlockAgenda == 4 ) { 322 if ( globalFlagBlockAgenda == 4 ) {
323 if ( mCurrentView == mAgendaView ) { 323 if ( mCurrentView == mAgendaView ) {
324 //globalFlagBlockAgenda =1 ; 324 //globalFlagBlockAgenda =1 ;
325 if ( KOPrefs::instance()->mSetTimeToDayStartAt ) 325 if ( KOPrefs::instance()->mSetTimeToDayStartAt )
326 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); 326 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins );
327 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 327 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
328 mAgendaView->setStartHour( QTime::currentTime ().hour() ); 328 mAgendaView->setStartHour( QTime::currentTime ().hour() );
329 qApp->processEvents(); 329 qApp->processEvents();
330 //qDebug("qApp->processEvents() "); 330 //qDebug("qApp->processEvents() ");
331 globalFlagBlockAgenda = 0; 331 globalFlagBlockAgenda = 0;
332 mAgendaView->repaintAgenda(); 332 mAgendaView->repaintAgenda();
333 333
334 } 334 }
335 globalFlagBlockAgenda = 0; 335 globalFlagBlockAgenda = 0;
336 } 336 }
337 emit signalAgendaView( mCurrentView == mAgendaView ); 337 emit signalAgendaView( mCurrentView == mAgendaView );
338 //qDebug("raiseCurrentView ende "); 338 //qDebug("raiseCurrentView ende ");
339 339
340} 340}
341 341
342void KOViewManager::updateView() 342void KOViewManager::updateView()
343{ 343{
344 // qDebug("KOViewManager::updateView() "); 344 // qDebug("KOViewManager::updateView() ");
345 // if we are updating mTodoView, we get endless recursion 345 // if we are updating mTodoView, we get endless recursion
346 if ( mTodoView == mCurrentView ) 346 if ( mTodoView == mCurrentView )
347 return; 347 return;
348 if ( mCurrentView ) mCurrentView->updateView(); 348 if ( mCurrentView ) mCurrentView->updateView();
349 349
350} 350}
351 351
352void KOViewManager::updateView(const QDate &start, const QDate &end) 352void KOViewManager::updateView(const QDate &start, const QDate &end)
353{ 353{
354 // kdDebug() << "KOViewManager::updateView()" << endl; 354 // kdDebug() << "KOViewManager::updateView()" << endl;
355 355
356 if (mCurrentView) mCurrentView->showDates(start, end); 356 if (mCurrentView) mCurrentView->showDates(start, end);
357 357
358 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); 358 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView();
359} 359}
360 360
361 361
362void KOViewManager::updateWNview() 362void KOViewManager::updateWNview()
363{ 363{
364 if ( mCurrentView == mWhatsNextView && mWhatsNextView ) 364 if ( mCurrentView == mWhatsNextView && mWhatsNextView )
365 mWhatsNextView->updateView(); 365 mWhatsNextView->updateView();
366 366
367} 367}
368void KOViewManager::showWhatsNextView() 368void KOViewManager::showWhatsNextView()
369{ 369{
370 if (!mWhatsNextView) { 370 if (!mWhatsNextView) {
371 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), 371 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(),
372 "KOViewManager::WhatsNextView"); 372 "KOViewManager::WhatsNextView");
373 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); 373 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog());
374 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); 374 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig()));
375 addView(mWhatsNextView); 375 addView(mWhatsNextView);
376 connect(this, SIGNAL( printWNV() ), 376 connect(this, SIGNAL( printWNV() ),
377 mWhatsNextView, SLOT( printMe() ) ); 377 mWhatsNextView, SLOT( printMe() ) );
378 } 378 }
379 globalFlagBlockAgenda = 1; 379 globalFlagBlockAgenda = 1;
380 showView(mWhatsNextView, true ); 380 showView(mWhatsNextView, true );
381 //mWhatsNextView->updateView(); 381 //mWhatsNextView->updateView();
382 382
383} 383}
384 384
385void KOViewManager::slotprintWNV() 385void KOViewManager::slotprintWNV()
386{ 386{
387 if (!mWhatsNextView) 387 if (!mWhatsNextView)
388 showWhatsNextView(); 388 showWhatsNextView();
389 emit printWNV(); 389 emit printWNV();
390 390
391} 391}
392void KOViewManager::showListView() 392void KOViewManager::showListView()
393{ 393{
394 if (!mListView) { 394 if (!mListView) {
395 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); 395 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView");
396 addView(mListView); 396 addView(mListView);
397 397
398 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), 398 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)),
399 mMainView, SLOT(showIncidence(Incidence *))); 399 mMainView, SLOT(showIncidence(Incidence *)));
400 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), 400 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)),
401 mMainView, SLOT(editIncidence(Incidence *))); 401 mMainView, SLOT(editIncidence(Incidence *)));
402 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), 402 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)),
403 mMainView, SLOT(deleteIncidence(Incidence *))); 403 mMainView, SLOT(deleteIncidence(Incidence *)));
404 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), 404 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ),
405 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 405 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
406 connect( mListView, SIGNAL( signalNewEvent() ), 406 connect( mListView, SIGNAL( signalNewEvent() ),
407 mMainView, SLOT( newEvent() ) ); 407 mMainView, SLOT( newEvent() ) );
408 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); 408 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig()));
409 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 409 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
410 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 410 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
411 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 411 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
412 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 412 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
413 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 413 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
414 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 414 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
415 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 415 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
416 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 416 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
417 } 417 }
418 // bool temp = mFlagShowNextxDays; 418 // bool temp = mFlagShowNextxDays;
419 //globalFlagBlockPainting = true; 419 //globalFlagBlockPainting = true;
420 globalFlagBlockAgenda = 1; 420 globalFlagBlockAgenda = 1;
421 if ( KOPrefs::instance()->mListViewMonthTimespan ) { 421 if ( KOPrefs::instance()->mListViewMonthTimespan ) {
422 mMainView->setBlockShowDates( true ); 422 mMainView->setBlockShowDates( true );
423 mMainView->dateNavigator()->selectMonth(); 423 mMainView->dateNavigator()->selectMonth();
424 mMainView->setBlockShowDates( false ); 424 mMainView->setBlockShowDates( false );
425 } 425 }
426 showView(mListView, KOPrefs::instance()->mFullViewTodo); 426 showView(mListView, KOPrefs::instance()->mFullViewTodo);
427 //mFlagShowNextxDays = temp; 427 //mFlagShowNextxDays = temp;
428} 428}
429 429
430void KOViewManager::showAgendaView( bool fullScreen ) 430void KOViewManager::showAgendaView( bool fullScreen )
431{ 431{
432 432
433 mMainView->dialogManager()->hideSearchDialog(); 433 mMainView->dialogManager()->hideSearchDialog();
434 // qDebug("KOViewManager::showAgendaView "); 434 // qDebug("KOViewManager::showAgendaView ");
435 bool full; 435 bool full;
436 full = fullScreen; 436 full = fullScreen;
437 if (!mAgendaView) { 437 if (!mAgendaView) {
438 full = false; 438 full = false;
439 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); 439 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
440 addView(mAgendaView); 440 addView(mAgendaView);
441#ifndef DESKTOP_VERSION 441#ifndef DESKTOP_VERSION
442 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); 442 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
443#endif 443#endif
444 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), 444 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
445 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); 445 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
446 446
447 // SIGNALS/SLOTS FOR DAY/WEEK VIEW 447 // SIGNALS/SLOTS FOR DAY/WEEK VIEW
448 448
449 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); 449 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate )));
450 450
451 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), 451 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)),
452 mMainView, SLOT(newTodoDateTime(QDateTime,bool))); 452 mMainView, SLOT(newTodoDateTime(QDateTime,bool)));
453 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), 453 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
454 mMainView, SLOT(newEvent(QDateTime))); 454 mMainView, SLOT(newEvent(QDateTime)));
455 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), 455 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
456 mMainView, SLOT(newEvent(QDateTime,QDateTime))); 456 mMainView, SLOT(newEvent(QDateTime,QDateTime)));
457 connect(mAgendaView,SIGNAL(newEventSignal(QDate)), 457 connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
458 mMainView, SLOT(newEvent(QDate))); 458 mMainView, SLOT(newEvent(QDate)));
459 459
460 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), 460 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)),
461 mMainView, SLOT(editIncidence(Incidence *))); 461 mMainView, SLOT(editIncidence(Incidence *)));
462 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), 462 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)),
463 mMainView, SLOT(showIncidence(Incidence *))); 463 mMainView, SLOT(showIncidence(Incidence *)));
464 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), 464 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
465 mMainView, SLOT(deleteIncidence(Incidence *))); 465 mMainView, SLOT(deleteIncidence(Incidence *)));
466 466
467 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), 467 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ),
468 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 468 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
469 469
470 connect(mAgendaView, SIGNAL( toggleExpand() ), 470 connect(mAgendaView, SIGNAL( toggleExpand() ),
471 mMainView, SLOT( toggleExpand() ) ); 471 mMainView, SLOT( toggleExpand() ) );
472 472
473 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), 473 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ),
474 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; 474 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ;
475 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), 475 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ),
476 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; 476 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ;
477 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); 477 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig()));
478 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, 478 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView,
479 SLOT( updateTodo( Todo *, int ) ) ); 479 SLOT( updateTodo( Todo *, int ) ) );
480 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), 480 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )),
481 mMainView, SIGNAL( todoModified( Todo *, int ))); 481 mMainView, SIGNAL( todoModified( Todo *, int )));
482 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 482 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
483 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 483 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
484 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 484 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
485 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 485 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
486 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), 486 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
487 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); 487 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
488 mAgendaView->readSettings(); 488 mAgendaView->readSettings();
489 mAgendaView->updateConfig(); 489 mAgendaView->updateConfig();
490 } 490 }
491 491
492 showView( mAgendaView, full); 492 showView( mAgendaView, full);
493 493
494} 494}
495 495
496void KOViewManager::showDayView() 496void KOViewManager::showDayView()
497{ 497{
498 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 498 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
499 mFlagShowNextxDays = false; 499 mFlagShowNextxDays = false;
500 globalFlagBlockLabel = 1; 500 globalFlagBlockLabel = 1;
501 globalFlagBlockAgenda = 1; 501 globalFlagBlockAgenda = 1;
502 if ( mCurrentAgendaView != 1 ) 502 if ( mCurrentAgendaView != 1 )
503 mCurrentAgendaView = -1; 503 mCurrentAgendaView = -1;
504 showAgendaView(); 504 showAgendaView();
505 qApp->processEvents(); 505 qApp->processEvents();
506 globalFlagBlockAgenda = 2; 506 globalFlagBlockAgenda = 2;
507 globalFlagBlockLabel = 0; 507 globalFlagBlockLabel = 0;
508 mMainView->dateNavigator()->selectDates( 1 ); 508 mMainView->dateNavigator()->selectDates( 1 );
509 mCurrentAgendaView = 1 ; 509 mCurrentAgendaView = 1 ;
510 510
511} 511}
512 512
513void KOViewManager::showWorkWeekView() 513void KOViewManager::showWorkWeekView()
514{ 514{
515 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 515 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
516 mFlagShowNextxDays = false; 516 mFlagShowNextxDays = false;
517 globalFlagBlockAgenda = 1; 517 globalFlagBlockAgenda = 1;
518 globalFlagBlockLabel = 1; 518 globalFlagBlockLabel = 1;
519 if ( mCurrentAgendaView != 5 ) 519 if ( mCurrentAgendaView != 5 )
520 mCurrentAgendaView = -1; 520 mCurrentAgendaView = -1;
521 showAgendaView(); 521 showAgendaView();
522 qApp->processEvents(); 522 qApp->processEvents();
523 globalFlagBlockAgenda = 2; 523 globalFlagBlockAgenda = 2;
524 globalFlagBlockLabel = 0; 524 globalFlagBlockLabel = 0;
525 mMainView->dateNavigator()->selectWorkWeek(); 525 mMainView->dateNavigator()->selectWorkWeek();
526 mCurrentAgendaView = 5 ; 526 mCurrentAgendaView = 5 ;
527 527
528} 528}
529 529
530void KOViewManager::showWeekView() 530void KOViewManager::showWeekView()
531{ 531{
532 /* 532 /*
533 globalFlagBlockAgenda = 2; 533 globalFlagBlockAgenda = 2;
534 qDebug("4globalFlagBlockAgenda = 2; "); 534 qDebug("4globalFlagBlockAgenda = 2; ");
535 //globalFlagBlockPainting = true; 535 //globalFlagBlockPainting = true;
536 mMainView->dateNavigator()->selectWeek(); 536 mMainView->dateNavigator()->selectWeek();
537 showAgendaView(); 537 showAgendaView();
538 */ 538 */
539 539
540 540
541 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count(); 541 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
542 mFlagShowNextxDays = false; 542 mFlagShowNextxDays = false;
543 globalFlagBlockAgenda = 1; 543 globalFlagBlockAgenda = 1;
544 globalFlagBlockLabel = 1; 544 globalFlagBlockLabel = 1;
545 if ( mCurrentAgendaView != 7 ) 545 if ( mCurrentAgendaView != 7 )
546 mCurrentAgendaView = -1; 546 mCurrentAgendaView = -1;
547 showAgendaView(); 547 showAgendaView();
548 qApp->processEvents(); 548 qApp->processEvents();
549 globalFlagBlockAgenda = 2; 549 globalFlagBlockAgenda = 2;
550 globalFlagBlockLabel = 0; 550 globalFlagBlockLabel = 0;
551 mMainView->dateNavigator()->selectWeek(); 551 mMainView->dateNavigator()->selectWeek();
552 mCurrentAgendaView = 7 ; 552 mCurrentAgendaView = 7 ;
553} 553}
554 554
555void KOViewManager::showNextXView() 555void KOViewManager::showNextXView()
556{ 556{
557 557
558 globalFlagBlockAgenda = 1; 558 globalFlagBlockAgenda = 1;
559 if ( mCurrentAgendaView != 3 ) 559 if ( mCurrentAgendaView != 3 )
560 mCurrentAgendaView = -1; 560 mCurrentAgendaView = -1;
561 showAgendaView(KOPrefs::instance()->mFullViewMonth); 561 showAgendaView(KOPrefs::instance()->mFullViewMonth);
562 globalFlagBlockAgenda = 2; 562 globalFlagBlockAgenda = 2;
563 mMainView->dateNavigator()->selectDates( QDate::currentDate(), 563 mMainView->dateNavigator()->selectDates( QDate::currentDate(),
564 KOPrefs::instance()->mNextXDays ); 564 KOPrefs::instance()->mNextXDays );
565 mFlagShowNextxDays = true; 565 mFlagShowNextxDays = true;
566 mCurrentAgendaView = 3 ; 566 mCurrentAgendaView = 3 ;
567} 567}
568bool KOViewManager::showsNextDays() 568bool KOViewManager::showsNextDays()
569{ 569{
570 return mFlagShowNextxDays; 570 return mFlagShowNextxDays;
571} 571}
572void KOViewManager::createMonthView() 572void KOViewManager::createMonthView()
573{ 573{
574if (!mMonthView) { 574if (!mMonthView) {
575 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 575 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
576 576
577 addView(mMonthView); 577 addView(mMonthView);
578 // mMonthView->show(); 578 // mMonthView->show();
579 // SIGNALS/SLOTS FOR MONTH VIEW 579 // SIGNALS/SLOTS FOR MONTH VIEW
580 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 580 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
581 mMainView, SLOT(newEvent(QDateTime))); 581 mMainView, SLOT(newEvent(QDateTime)));
582 582
583 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), 583 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)),
584 mMainView, SLOT(showIncidence(Incidence *))); 584 mMainView, SLOT(showIncidence(Incidence *)));
585 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 585 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
586 mMainView, SLOT(editIncidence(Incidence *))); 586 mMainView, SLOT(editIncidence(Incidence *)));
587 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 587 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
588 mMainView, SLOT(deleteIncidence(Incidence *))); 588 mMainView, SLOT(deleteIncidence(Incidence *)));
589 589
590 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), 590 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ),
591 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 591 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
592 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 592 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
593 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 593 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
594 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 594 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
595 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 595 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
596 596
597 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 597 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
598 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 598 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
599 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 599 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
600 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 600 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
601 connect( mMonthView, SIGNAL( selectWeekNum( int ) ), 601 connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
602 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) ); 602 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) );
603 connect( mMonthView, SIGNAL( selectMonth() ), 603 connect( mMonthView, SIGNAL( selectMonth() ),
604 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) ); 604 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) );
605 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), 605 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
606 mMainView, SLOT ( showDay( QDate ) ) ); 606 mMainView, SLOT ( showDay( QDate ) ) );
607 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); 607 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
608 connect( mMonthView, SIGNAL(nextMonth() ), 608 connect( mMonthView, SIGNAL(nextMonth() ),
609 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); 609 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) );
610 connect( mMonthView, SIGNAL(prevMonth() ), 610 connect( mMonthView, SIGNAL(prevMonth() ),
611 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); 611 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) );
612 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), 612 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ),
613 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); 613 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) );
614 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), 614 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ),
615 mMainView->dateNavigator(), SLOT( selectNextYear() ) ); 615 mMainView->dateNavigator(), SLOT( selectNextYear() ) );
616 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), 616 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ),
617 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); 617 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) );
618 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), 618 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ),
619 mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); 619 mMainView->dateNavigator(), SLOT( selectNextMonth() ) );
620 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), 620 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ),
621 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); 621 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) );
622 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), 622 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ),
623 mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); 623 mMainView->dateNavigator(), SLOT( selectNextWeek() ) );
624 624
625 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 625 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
626 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); 626 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) );
627 627
628 628
629 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), 629 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ),
630 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); 630 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) );
631 631
632 } 632 }
633} 633}
634void KOViewManager::showMonthViewWeek() 634void KOViewManager::showMonthViewWeek()
635{ 635{
636 createMonthView(); 636 createMonthView();
637 globalFlagBlockAgenda = 1; 637 globalFlagBlockAgenda = 1;
638 bool full = true; 638 bool full = true;
639 if ( mCurrentView == mMonthView) 639 if ( mCurrentView == mMonthView)
640 full = mMainView->leftFrame()->isVisible(); 640 full = mMainView->leftFrame()->isVisible();
641 if ( !KOPrefs::instance()->mMonthViewWeek ) { 641 if ( !KOPrefs::instance()->mMonthViewWeek ) {
642 mMonthView->switchView(); 642 mMonthView->switchView();
643 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 643 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
644 full = false; 644 full = false;
645 else 645 else
646 full = true; 646 full = true;
647 } 647 }
648 mMainView->dateNavigator()->selectWeek(); 648 mMainView->dateNavigator()->selectWeek();
649 showView(mMonthView, full ); 649 showView(mMonthView, full );
650} 650}
651 651
652void KOViewManager::showMonth( const QDate & date ) 652void KOViewManager::showMonth( const QDate & date )
653{ 653{
654 mMainView->dateNavigator()->blockSignals( true ); 654 mMainView->dateNavigator()->blockSignals( true );
655 mMainView->dateNavigator()->selectDate( date ); 655 mMainView->dateNavigator()->selectDate( date );
656 mMainView->dateNavigator()->blockSignals( false ); 656 mMainView->dateNavigator()->blockSignals( false );
657 showMonthView(); 657 showMonthView();
658} 658}
659void KOViewManager::showMonthView() 659void KOViewManager::showMonthView()
660 { 660 {
661 661
662 createMonthView(); 662 createMonthView();
663 globalFlagBlockAgenda = 1; 663 globalFlagBlockAgenda = 1;
664 //mFlagShowNextxDays = false; 664 //mFlagShowNextxDays = false;
665 bool full = true; 665 bool full = true;
666 if ( mCurrentView == mMonthView) 666 if ( mCurrentView == mMonthView)
667 full = mMainView->leftFrame()->isVisible(); 667 full = mMainView->leftFrame()->isVisible();
668 // if(mMonthView == mCurrentView) return; 668 // if(mMonthView == mCurrentView) return;
669 if ( KOPrefs::instance()->mMonthViewWeek ) { 669 if ( KOPrefs::instance()->mMonthViewWeek ) {
670 mMonthView->switchView(); 670 mMonthView->switchView();
671 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 671 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
672 full = false; 672 full = false;
673 else 673 else
674 full = true; 674 full = true;
675 } 675 }
676 mMainView->dateNavigator()->selectMonth(); 676 mMainView->dateNavigator()->selectMonth();
677 677
678 showView(mMonthView, full ); 678 showView(mMonthView, full );
679 679
680} 680}
681 681
682void KOViewManager::showTodoView() 682void KOViewManager::showTodoView()
683{ 683{
684 //mFlagShowNextxDays = false; 684 //mFlagShowNextxDays = false;
685 if ( !mTodoView ) { 685 if ( !mTodoView ) {
686 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 686 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
687 "KOViewManager::TodoView" ); 687 "KOViewManager::TodoView" );
688 688
689 addView( mTodoView ); 689 addView( mTodoView );
690 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 690 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
691 691
692 // SIGNALS/SLOTS FOR TODO VIEW 692 // SIGNALS/SLOTS FOR TODO VIEW
693 connect( mTodoView, SIGNAL( newTodoSignal() ), 693 connect( mTodoView, SIGNAL( newTodoSignal() ),
694 mMainView, SLOT( newTodo() ) ); 694 mMainView, SLOT( newTodo() ) );
695 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), 695 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
696 mMainView, SLOT( newSubTodo( Todo *) ) ); 696 mMainView, SLOT( newSubTodo( Todo *) ) );
697 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), 697 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
698 mMainView, SLOT( showTodo( Todo * ) ) ); 698 mMainView, SLOT( showTodo( Todo * ) ) );
699 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), 699 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
700 mMainView, SLOT( editTodo( Todo * ) ) ); 700 mMainView, SLOT( editTodo( Todo * ) ) );
701 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), 701 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
702 mMainView, SLOT( deleteTodo( Todo * ) ) ); 702 mMainView, SLOT( deleteTodo( Todo * ) ) );
703 connect( mTodoView, SIGNAL( purgeCompletedSignal() ), 703 connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
704 mMainView, SLOT( purgeCompleted() ) ); 704 mMainView, SLOT( purgeCompleted() ) );
705 705
706 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 706 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
707 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 707 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
708 708
709 connect( mMainView, SIGNAL( configChanged() ), mTodoView, 709 connect( mMainView, SIGNAL( configChanged() ), mTodoView,
710 SLOT( updateConfig() ) ); 710 SLOT( updateConfig() ) );
711 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, 711 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView,
712 SLOT( updateTodo( Todo *, int ) ) ); 712 SLOT( updateTodo( Todo *, int ) ) );
713 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), 713 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ),
714 mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); 714 mMainView, SIGNAL ( todoModified( Todo *, int ) ) );
715 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), 715 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ),
716 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 716 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
717 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), 717 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ),
718 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 718 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
719 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), 719 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ),
720 mMainView, SLOT ( todo_unsub( Todo * ) ) ); 720 mMainView, SLOT ( todo_unsub( Todo * ) ) );
721 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 721 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
722 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); 722 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) );
723 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), 723 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ),
724 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 724 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
725 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), 725 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ),
726 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 726 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
727 KConfig *config = KOGlobals::config(); 727 KConfig *config = KOGlobals::config();
728 mTodoView->restoreLayout(config,"Todo View"); 728 mTodoView->restoreLayout(config,"Todo View");
729 mTodoView->setNavigator( mMainView->dateNavigator() ); 729 mTodoView->setNavigator( mMainView->dateNavigator() );
730 } 730 }
731 731
732 globalFlagBlockAgenda = 1; 732 globalFlagBlockAgenda = 1;
733 showView( mTodoView, true ); 733 showView( mTodoView, true );
734 734
735} 735}
736 736
737void KOViewManager::showJournalView() 737void KOViewManager::showJournalView()
738{ 738{
739 //mFlagShowNextxDays = false; 739 //mFlagShowNextxDays = false;
740 if (!mJournalView) { 740 if (!mJournalView) {
741 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), 741 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(),
742 "KOViewManager::JournalView"); 742 "KOViewManager::JournalView");
743 connect( mMainView, SIGNAL( configChanged() ), mJournalView, 743 connect( mMainView, SIGNAL( configChanged() ), mJournalView,
744 SLOT( updateConfig() ) ); 744 SLOT( updateConfig() ) );
745 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); 745 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) );
746 addView(mJournalView); 746 addView(mJournalView);
747 } 747 }
748 748
749 showView(mJournalView); 749 showView(mJournalView);
750 mMainView->dateNavigator()->selectDates( 1 ); 750 mMainView->dateNavigator()->selectDates( 1 );
751} 751}
752 752
753void KOViewManager::showTimeSpanView() 753void KOViewManager::showTimeSpanView()
754{ 754{
755 //mFlagShowNextxDays = false; 755 //mFlagShowNextxDays = false;
756 if (!mTimeSpanView) { 756 if (!mTimeSpanView) {
757 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), 757 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(),
758 "KOViewManager::TimeSpanView"); 758 "KOViewManager::TimeSpanView");
759 addView(mTimeSpanView); 759 addView(mTimeSpanView);
760 760
761 mTimeSpanView->readSettings(); 761 mTimeSpanView->readSettings();
762 } 762 }
763 763
764 showView(mTimeSpanView); 764 showView(mTimeSpanView);
765} 765}
766 766
767Incidence *KOViewManager::currentSelection() 767Incidence *KOViewManager::currentSelection()
768{ 768{
769 if (!mCurrentView) return 0; 769 if (!mCurrentView) return 0;
770 if ( mCurrentView == mListView ) { 770 if ( mCurrentView == mListView ) {
771 if ( mListView->currentItem() ) 771 if ( mListView->currentItem() )
772 return mListView->currentItem(); 772 return mListView->currentItem();
773 } 773 }
774 return mCurrentView->selectedIncidences().first(); 774 return mCurrentView->selectedIncidences().first();
775} 775}
776 776
777QDate KOViewManager::currentSelectionDate() 777QDate KOViewManager::currentSelectionDate()
778{ 778{
779 QDate qd; 779 QDate qd;
780 if (mCurrentView) { 780 if (mCurrentView) {
781 DateList qvl = mCurrentView->selectedDates(); 781 DateList qvl = mCurrentView->selectedDates();
782 if (!qvl.isEmpty()) qd = qvl.first(); 782 if (!qvl.isEmpty()) qd = qvl.first();
783 } 783 }
784 return qd; 784 return qd;
785} 785}
786 786
787void KOViewManager::addView(KOrg::BaseView *view) 787void KOViewManager::addView(KOrg::BaseView *view)
788{ 788{
789#if QT_VERSION >= 0x030000 789#if QT_VERSION >= 0x030000
790 mMainView->viewStack()->addWidget( view ); 790 mMainView->viewStack()->addWidget( view );
791#else 791#else
792 mMainView->viewStack()->addWidget( view, 1 ); 792 mMainView->viewStack()->addWidget( view, 1 );
793#endif 793#endif
794} 794}
795 795
796void KOViewManager::setDocumentId( const QString &id ) 796void KOViewManager::setDocumentId( const QString &id )
797{ 797{
798 if (mTodoView) mTodoView->setDocumentId( id ); 798 if (mTodoView) mTodoView->setDocumentId( id );
799} 799}