author | zautrix <zautrix> | 2005-03-29 17:05:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-29 17:05:50 (UTC) |
commit | a7c827aa0e555206b60dec3bc07f7afab4352883 (patch) (unidiff) | |
tree | 56dbda15314f27ffabd143d09ea036b092444198 | |
parent | 3116f249fc6ccd0e067213e826d3d924f6986972 (diff) | |
download | kdepimpi-a7c827aa0e555206b60dec3bc07f7afab4352883.zip kdepimpi-a7c827aa0e555206b60dec3bc07f7afab4352883.tar.gz kdepimpi-a7c827aa0e555206b60dec3bc07f7afab4352883.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | kabc/addresseedialog.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 38 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 13 | ||||
-rw-r--r-- | libkdepim/externalapphandler.cpp | 7 | ||||
-rw-r--r-- | libkdepim/externalapphandler.h | 1 |
7 files changed, 57 insertions, 10 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index b3a406c..1a045f3 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1136,196 +1136,196 @@ | |||
1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, | 1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, |
1137 | { "Alt+D","Alt+D" }, | 1137 | { "Alt+D","Alt+D" }, |
1138 | { "&Use colors","Nutze Farben" }, | 1138 | { "&Use colors","Nutze Farben" }, |
1139 | { "Alt+U","Alt+U" }, | 1139 | { "Alt+U","Alt+U" }, |
1140 | { "Print week","Drucke Woche" }, | 1140 | { "Print week","Drucke Woche" }, |
1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, | 1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, |
1142 | { "Use &colors","Nutze Farben" }, | 1142 | { "Use &colors","Nutze Farben" }, |
1143 | { "Type of View","Typ der Ansicht" }, | 1143 | { "Type of View","Typ der Ansicht" }, |
1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, | 1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, |
1145 | { "Alt+F","Alt+F" }, | 1145 | { "Alt+F","Alt+F" }, |
1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, | 1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, |
1147 | { "Alt+T","Alt+T" }, | 1147 | { "Alt+T","Alt+T" }, |
1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, | 1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, |
1149 | { "Print month","Drucke Monat" }, | 1149 | { "Print month","Drucke Monat" }, |
1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, | 1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, |
1151 | { "&Start month:","&Startmonat:" }, | 1151 | { "&Start month:","&Startmonat:" }, |
1152 | { "&End month:","&Endmonat:" }, | 1152 | { "&End month:","&Endmonat:" }, |
1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, | 1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, |
1154 | { "Print todos","Drucke Todos" }, | 1154 | { "Print todos","Drucke Todos" }, |
1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, | 1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, |
1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, | 1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, |
1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, | 1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, |
1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, | 1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, |
1159 | { "Items to Print","Zu druckende Items" }, | 1159 | { "Items to Print","Zu druckende Items" }, |
1160 | { "&From:","Von:" }, | 1160 | { "&From:","Von:" }, |
1161 | { "&To:","Bis:" }, | 1161 | { "&To:","Bis:" }, |
1162 | { "Print &all todo items","Drucke alle Todo Items" }, | 1162 | { "Print &all todo items","Drucke alle Todo Items" }, |
1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, | 1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, |
1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, | 1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, |
1165 | { "Todo List","Todo Liste" }, | 1165 | { "Todo List","Todo Liste" }, |
1166 | { "&Title:","&Titel:" }, | 1166 | { "&Title:","&Titel:" }, |
1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, | 1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, |
1168 | { "Todo list","Todo Liste" }, | 1168 | { "Todo list","Todo Liste" }, |
1169 | { "&Print...","Drucke..." }, | 1169 | { "&Print...","Drucke..." }, |
1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1171 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1171 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1172 | { "OK","OK" }, | 1172 | { "OK","OK" }, |
1173 | { "FilterEditor","FilterEditor" }, | 1173 | { "FilterEditor","FilterEditor" }, |
1174 | { "Include","Inclusive" }, | 1174 | { "Include","Inclusive" }, |
1175 | { "Exclude","Exclusive" }, | 1175 | { "Exclude","Exclusive" }, |
1176 | { "Edit Selection...","Editiere Auswahl" }, | 1176 | { "Edit Selection...","Editiere Auswahl" }, |
1177 | { "recurring events","wiederholende Termine" }, | 1177 | { "recurring events","wiederholende Termine" }, |
1178 | { "recurr. events","wiederh.Termine" }, | 1178 | { "recurr. events","wiederh.Termine" }, |
1179 | { "completed to-dos","erledigte Todos" }, | 1179 | { "completed to-dos","erledigte Todos" }, |
1180 | { "events","Termine" }, | 1180 | { "events","Termine" }, |
1181 | { "todos","Todos" }, | 1181 | { "todos","Todos" }, |
1182 | { "journals","Journale" }, | 1182 | { "journals","Journale" }, |
1183 | { "public","öffentl." }, | 1183 | { "public","öffentl." }, |
1184 | { "private","privat" }, | 1184 | { "private","privat" }, |
1185 | { "confidential","vertraul." }, | 1185 | { "confidential","vertraul." }, |
1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, | 1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, |
1187 | { "Yesterday","Gestern" }, | 1187 | { "Yesterday","Gestern" }, |
1188 | { "Day after tomorrow","Übermorgen" }, | 1188 | { "Day after tomorrow","Übermorgen" }, |
1189 | { "Tomorrow","Morgen" }, | 1189 | { "Tomorrow","Morgen" }, |
1190 | { "Day before yesterday","Vorgestern" }, | 1190 | { "Day before yesterday","Vorgestern" }, |
1191 | { "Size %1","Größe %1" }, | 1191 | { "Size %1","Größe %1" }, |
1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1193 | { " (%1 y.)"," (%1 J.)" }, | 1193 | { " (%1 y.)"," (%1 J.)" }, |
1194 | { "Allday:","Ganztägig:" }, | 1194 | { "Allday:","Ganztägig:" }, |
1195 | { "compl.todos","erled.Todos" }, | 1195 | { "compl.todos","erled.Todos" }, |
1196 | { "Day view","Tagesansicht" }, | 1196 | { "Day view","Tagesansicht" }, |
1197 | { "Next days","Nächste Tage" }, | 1197 | { "Next days","Nächste Tage" }, |
1198 | { "Next week","Nächste Woche" }, | 1198 | { "Next week","Nächste Woche" }, |
1199 | { "Next two weeks","Nächste zwei Wochen" }, | 1199 | { "Next two weeks","Nächste zwei Wochen" }, |
1200 | { "Next month","Nächster Monat" }, | 1200 | { "Next month","Nächster Monat" }, |
1201 | { "Journal view","Journal" }, | 1201 | { "Journal view","Journal" }, |
1202 | { "Display all opened","Zeige alle geöffnet" }, | 1202 | { "Display all opened","Zeige alle geöffnet" }, |
1203 | { "Display all closed","Zeige alle geschlossen" }, | 1203 | { "Display all closed","Zeige alle geschlossen" }, |
1204 | { "Display all flat","Zeige alle flach" }, | 1204 | { "Display all flat","Zeige alle flach" }, |
1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, | 1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, |
1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, | 1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, |
1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, | 1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, |
1208 | { "Select Week","Wähle Woche" }, | 1208 | { "Select Week","Wähle Woche" }, |
1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, | 1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, |
1210 | { "Set Alarm!","Setze Alarm!" }, | 1210 | { "Set Alarm!","Setze Alarm!" }, |
1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, | 1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, |
1212 | { " and "," und " }, | 1212 | { " and "," und " }, |
1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, | 1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, |
1214 | { "Mail to selected","Mail an Ausgewählte" }, | 1214 | { "Mail to selected","Mail an Ausgewählte" }, |
1215 | { "Mail to all","Mail an Alle" }, | 1215 | { "Mail to all","Mail an Alle" }, |
1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, | 1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, |
1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1218 | { " on"," am" }, | 1218 | { " on"," am" }, |
1219 | { " completed on "," erledigt am " }, | 1219 | { " completed on "," erledigt am " }, |
1220 | { "Save as Event template","Speichere als Vorlage" }, | 1220 | { "Save as Event template","Speichere als Vorlage" }, |
1221 | { "Load Event template","Lade Termin Vorlage" }, | 1221 | { "Load Event template","Lade Termin Vorlage" }, |
1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, | 1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, |
1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, | 1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, |
1224 | { "Sub todos:<br>","Unter Todos:<br>" }, | 1224 | { "Sub todos:<br>","Unter Todos:<br>" }, |
1225 | { "Parent todo:<br>","Über Todo:<br>" }, | 1225 | { "Parent todo:<br>","Über Todo:<br>" }, |
1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, | 1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, |
1227 | { " completed"," erledigt" }, | 1227 | { " completed"," erledigt" }, |
1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, | 1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, |
1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
1232 | { "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?" }, | 1232 | { "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?" }, |
1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
1234 | { "Error","Fehler" }, | 1234 | { "Error","Fehler" }, |
1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
1237 | { "Warning","Warnung" }, | 1237 | { "Warning","Warnung" }, |
1238 | { "Select week number","Wähle Wochen Nummer" }, | 1238 | { "Select week number","Wähle Wochen Nummer" }, |
1239 | { "Februar","Februar" }, | 1239 | { "Februar","Februar" }, |
1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, | 1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, |
1241 | { "W","W" }, | 1241 | { "W","W" }, |
1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, | 1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, |
1243 | { "T: %1","T: %1" }, | 1243 | { "T: %1","T: %1" }, |
1244 | { "Start: ","Start: " }, | 1244 | { "Start: ","Start: " }, |
1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
1247 | { "Remote IP address:","Ferne IP Adresse:" }, | 1247 | { "Remote IP address:","Ferne IP Adresse:" }, |
1248 | { "Remote port number:","Ferne Port Nummer:" }, | 1248 | { "Remote port number:","Ferne Port Nummer:" }, |
1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
1250 | { "Remote from: ","Fern von: " }, | 1250 | { "Remote from: ","Fern von: " }, |
1251 | { "Local from: ","Lokal von: " }, | 1251 | { "Local from: ","Lokal von: " }, |
1252 | { "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" }, | 1252 | { "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" }, |
1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
1254 | { "Write back","Schreibe zurück" }, | 1254 | { "Write back","Schreibe zurück" }, |
1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, | 1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, |
1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
1257 | { "Received sync request","Sync Anfrage erhalten" }, | 1257 | { "Received sync request","Sync Anfrage erhalten" }, |
1258 | { "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." }, | 1258 | { "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." }, |
1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
1261 | { "Sending file...","Sende Datei..." }, | 1261 | { "Sending file...","Sende Datei..." }, |
1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
1264 | { "Received %1 bytes","%1 Bytes erhalten" }, | 1264 | { "Received %1 bytes","%1 Bytes erhalten" }, |
1265 | { "Writing file to disk...","Speichere Datei..." }, | 1265 | { "Writing file to disk...","Speichere Datei..." }, |
1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
1268 | { "Synchronize!","Synchronisiere!" }, | 1268 | { "Synchronize!","Synchronisiere!" }, |
1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
1271 | { "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!" }, | 1271 | { "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!" }, |
1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, | 1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, |
1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, | 1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, |
1274 | { "List week view","Listenwochenansicht" }, | 1274 | { "List week view","Listenwochenansicht" }, |
1275 | { "List week","Listenwochenansicht" }, | 1275 | { "List week","Listenwochenansicht" }, |
1276 | { "Next Week","Nächste Woche" }, | 1276 | { "Next Week","Nächste Woche" }, |
1277 | { "Previous Week","Vorherige Woche" }, | 1277 | { "Previous Week","Vorherige Woche" }, |
1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, | 1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, |
1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, | 1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, |
1280 | { "Details","Details" }, | 1280 | { "Details","Details" }, |
1281 | { "Created time","Erstellt Zeit" }, | 1281 | { "Created time","Erstellt Zeit" }, |
1282 | { "Last modified time","Geändert Zeit" }, | 1282 | { "Last modified time","Geändert Zeit" }, |
1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, | 1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, |
1284 | { "View Options","Anzeige Optionen" }, | 1284 | { "View Options","Anzeige Optionen" }, |
1285 | { "<b>Created: ","<b>Erstellt am: " }, | 1285 | { "<b>Created: ","<b>Erstellt am: " }, |
1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, | 1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, |
1287 | { "Journal: ","Journal: " }, | 1287 | { "Journal: ","Journal: " }, |
1288 | { "yearly","jährlich" }, | 1288 | { "yearly","jährlich" }, |
1289 | { "(%1) ","%1-" }, | 1289 | { "(%1) ","%1-" }, |
1290 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, | 1290 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, |
1291 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, | 1291 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, |
1292 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, | 1292 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, |
1293 | { "Summary/Loc.","Titel/Ort" }, | 1293 | { "Summary/Loc.","Titel/Ort" }, |
1294 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, | 1294 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, |
1295 | { "Week Number","Wochennummer" }, | 1295 | { "Week Number","Wochennummer" }, |
1296 | { "Import","Importiere" }, | 1296 | { "Import","Importiere" }, |
1297 | { "Export","Exportiere" }, | 1297 | { "Export","Exportiere" }, |
1298 | { "Beam","Beame" }, | 1298 | { "Beam","Beame" }, |
1299 | { "Export selected","Exportiere Selektierte" }, | 1299 | { "Export selected","Exportiere Selektierte" }, |
1300 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, | 1300 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, |
1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, | 1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, |
1302 | { "Journal/Details...","Journale/Details..." }, | 1302 | { "Journal/Details...","Journale/Details..." }, |
1303 | { "Agenda View","Agenda Ansicht" }, | 1303 | { "Agenda View","Agenda Ansicht" }, |
1304 | { "Show current time","Zeige aktuelle Zeit" }, | 1304 | { "Show current time","Zeige aktuelle Zeit" }, |
1305 | { "Edit new item","Bearbeite neuen Eintrag" }, | 1305 | { "Edit new item","Bearbeite neuen Eintrag" }, |
1306 | { "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, | 1306 | { "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, |
1307 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, | 1307 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, |
1308 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, | 1308 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, |
1309 | { "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, | 1309 | { "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, |
1310 | { "%1 days\n","%1 Tagen\n" }, | 1310 | { "%1 days\n","%1 Tagen\n" }, |
1311 | { "1 day\n","1 Tag\n" }, | 1311 | { "1 day\n","1 Tag\n" }, |
1312 | { "%1 hours\n","%1 Stunden\n" }, | 1312 | { "%1 hours\n","%1 Stunden\n" }, |
1313 | { "1 hour\n","1 Stunde\n" }, | 1313 | { "1 hour\n","1 Stunde\n" }, |
1314 | { "%1 minutes\n","%1 Minuten\n" }, | 1314 | { "%1 minutes\n","%1 Minuten\n" }, |
1315 | { "1 minute\n","1 Minute\n" }, | 1315 | { "1 minute\n","1 Minute\n" }, |
1316 | { "Only one toolbar","Nur eine Toolbar" }, | 1316 | { "Only one toolbar","Nur eine Toolbar" }, |
1317 | { "Print","Drucke" }, | 1317 | { "Print","Drucke" }, |
1318 | { "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, | 1318 | { "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, |
1319 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, | 1319 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, |
1320 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, | 1320 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, |
1321 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, | 1321 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, |
1322 | { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, | 1322 | { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, |
1323 | { "KO/Pi Printout","KO/Pi Ausdruck" }, | 1323 | { "KO/Pi Printout","KO/Pi Ausdruck" }, |
1324 | { "Print unscaled","Drucke unskaliert" }, | 1324 | { "Print unscaled","Drucke unskaliert" }, |
1325 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, | 1325 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, |
1326 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, | 1326 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, |
1327 | { "Printout Mode","Druck Modus" }, | 1327 | { "Printout Mode","Druck Modus" }, |
1328 | { "","" }, | 1328 | { "Filter menu icon","Filtermenu Icon" }, |
1329 | { "","" }, | 1329 | { "","" }, |
1330 | { "","" }, | 1330 | { "","" }, |
1331 | { "","" }, \ No newline at end of file | 1331 | { "","" }, \ No newline at end of file |
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index b3429e3..648e780 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp | |||
@@ -1,309 +1,311 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <qlayout.h> | 21 | #include <qlayout.h> |
22 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
23 | #include <qgroupbox.h> | 23 | #include <qgroupbox.h> |
24 | #include <qapplication.h> | 24 | #include <qapplication.h> |
25 | #include <qregexp.h> | 25 | #include <qregexp.h> |
26 | #include <qvbox.h> | 26 | #include <qvbox.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | 28 | ||
29 | #include <klocale.h> | 29 | #include <klocale.h> |
30 | #include <kdebug.h> | 30 | #include <kdebug.h> |
31 | #include <kglobalsettings.h> | 31 | #include <kglobalsettings.h> |
32 | 32 | ||
33 | #include "stdaddressbook.h" | 33 | #include "stdaddressbook.h" |
34 | 34 | ||
35 | #include "addresseedialog.h" | 35 | #include "addresseedialog.h" |
36 | #include "KDGanttMinimizeSplitter.h" | 36 | #include "KDGanttMinimizeSplitter.h" |
37 | //#include "addresseedialog.moc" | 37 | //#include "addresseedialog.moc" |
38 | 38 | ||
39 | using namespace KABC; | 39 | using namespace KABC; |
40 | 40 | ||
41 | AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : | 41 | AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : |
42 | QListViewItem( parent ), | 42 | QListViewItem( parent ), |
43 | mAddressee( addressee ) | 43 | mAddressee( addressee ) |
44 | { | 44 | { |
45 | QString name = addressee.familyName()+", "+ addressee.givenName(); | 45 | QString name = addressee.familyName()+", "+ addressee.givenName(); |
46 | if ( name.length() == 2 ) | 46 | if ( name.length() == 2 ) |
47 | name = addressee.organization(); | 47 | name = addressee.organization(); |
48 | setText( Name,name); | 48 | setText( Name,name); |
49 | setText( Email, addressee.preferredEmail() ); | 49 | setText( Email, addressee.preferredEmail() ); |
50 | } | 50 | } |
51 | 51 | ||
52 | QString AddresseeItem::key( int column, bool ) const | 52 | QString AddresseeItem::key( int column, bool ) const |
53 | { | 53 | { |
54 | 54 | ||
55 | if (column == Email) { | 55 | if (column == Email) { |
56 | QString value = text(Email); | 56 | QString value = text(Email); |
57 | int val = value.findRev("@"); | 57 | int val = value.findRev("@"); |
58 | return value.mid( val) + value.left( val ); | 58 | return value.mid( val) + value.left( val ); |
59 | } | 59 | } |
60 | return text(column).lower(); | 60 | return text(column).lower(); |
61 | } | 61 | } |
62 | 62 | ||
63 | AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : | 63 | AddresseeDialog::AddresseeDialog( QWidget *parent, bool multiple ) : |
64 | KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), | 64 | KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), |
65 | Ok|Cancel, No, parent ), mMultiple( multiple ) | 65 | Ok|Cancel, No, parent ), mMultiple( multiple ) |
66 | { | 66 | { |
67 | qDebug("NEW AddresseeDialog "); | ||
67 | QWidget *topWidget = plainPage(); | 68 | QWidget *topWidget = plainPage(); |
68 | 69 | ||
69 | QBoxLayout *topLayout = new QHBoxLayout( topWidget ); | 70 | QBoxLayout *topLayout = new QHBoxLayout( topWidget ); |
70 | 71 | ||
71 | 72 | ||
72 | KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget); | 73 | KDGanttMinimizeSplitter* mMiniSplitter = new KDGanttMinimizeSplitter( Qt::Horizontal, topWidget); |
73 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 74 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
74 | 75 | ||
75 | topLayout->addWidget(mMiniSplitter ); | 76 | topLayout->addWidget(mMiniSplitter ); |
76 | 77 | ||
77 | QWidget *listWidget = new QWidget( mMiniSplitter ); | 78 | QWidget *listWidget = new QWidget( mMiniSplitter ); |
78 | 79 | ||
79 | QBoxLayout *listLayout = new QVBoxLayout (listWidget) ; | 80 | QBoxLayout *listLayout = new QVBoxLayout (listWidget) ; |
80 | //topLayout->addLayout( listLayout ); | 81 | //topLayout->addLayout( listLayout ); |
81 | 82 | ||
82 | mAddresseeList = new KListView( listWidget ); | 83 | mAddresseeList = new KListView( listWidget ); |
83 | mAddresseeList->addColumn( i18n("Name") ); | 84 | mAddresseeList->addColumn( i18n("Name") ); |
84 | mAddresseeList->addColumn( i18n("Email") ); | 85 | mAddresseeList->addColumn( i18n("Email") ); |
85 | mAddresseeList->setAllColumnsShowFocus( true ); | 86 | mAddresseeList->setAllColumnsShowFocus( true ); |
86 | mAddresseeList->setFullWidth( true ); | 87 | mAddresseeList->setFullWidth( true ); |
87 | listLayout->addWidget( mAddresseeList ); | 88 | listLayout->addWidget( mAddresseeList ); |
88 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), | 89 | connect( mAddresseeList, SIGNAL( doubleClicked( QListViewItem * ) ), |
89 | SLOT( slotOk() ) ); | 90 | SLOT( slotOk() ) ); |
90 | 91 | ||
91 | mAddresseeEdit = new QLineEdit( listWidget ); | 92 | mAddresseeEdit = new QLineEdit( listWidget ); |
92 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), | 93 | connect( mAddresseeEdit, SIGNAL( returnPressed() ), |
93 | SLOT( loadAddressBook() ) ); | 94 | SLOT( loadAddressBook() ) ); |
94 | mAddresseeEdit->setFocus(); | 95 | mAddresseeEdit->setFocus(); |
95 | 96 | ||
96 | listLayout->addWidget( mAddresseeEdit ); | 97 | listLayout->addWidget( mAddresseeEdit ); |
97 | 98 | ||
98 | if ( mMultiple ) { | 99 | if ( mMultiple ) { |
99 | //QBoxLayout *selectedLayout = new QVBoxLayout; | 100 | //QBoxLayout *selectedLayout = new QVBoxLayout; |
100 | //topLayout->addLayout( selectedLayout ); | 101 | //topLayout->addLayout( selectedLayout ); |
101 | //topLayout->setSpacing( spacingHint() ); | 102 | //topLayout->setSpacing( spacingHint() ); |
102 | 103 | ||
103 | QVBox *selectedGroup = new QVBox( mMiniSplitter ); | 104 | QVBox *selectedGroup = new QVBox( mMiniSplitter ); |
104 | new QLabel ( i18n("Selected:"), selectedGroup ); | 105 | new QLabel ( i18n("Selected:"), selectedGroup ); |
105 | //selectedLayout->addWidget( selectedGroup ); | 106 | //selectedLayout->addWidget( selectedGroup ); |
106 | 107 | ||
107 | mSelectedList = new KListView( selectedGroup ); | 108 | mSelectedList = new KListView( selectedGroup ); |
108 | mSelectedList->addColumn( i18n("Name") ); | 109 | mSelectedList->addColumn( i18n("Name") ); |
109 | mSelectedList->addColumn( i18n("Email") ); | 110 | mSelectedList->addColumn( i18n("Email") ); |
110 | mSelectedList->setAllColumnsShowFocus( true ); | 111 | mSelectedList->setAllColumnsShowFocus( true ); |
111 | mSelectedList->setFullWidth( true ); | 112 | mSelectedList->setFullWidth( true ); |
112 | connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), | 113 | connect( mSelectedList, SIGNAL( doubleClicked( QListViewItem * ) ), |
113 | SLOT( removeSelected() ) ); | 114 | SLOT( removeSelected() ) ); |
114 | 115 | ||
115 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); | 116 | QPushButton *unselectButton = new QPushButton( i18n("Unselect"), selectedGroup ); |
116 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); | 117 | connect ( unselectButton, SIGNAL( clicked() ), SLOT( removeSelected() ) ); |
117 | 118 | ||
118 | connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), | 119 | connect( mAddresseeList, SIGNAL( clicked( QListViewItem * ) ), |
119 | SLOT( addSelected( QListViewItem * ) ) ); | 120 | SLOT( addSelected( QListViewItem * ) ) ); |
120 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), | 121 | connect( mAddresseeList, SIGNAL( returnPressed( QListViewItem * ) ), |
121 | SLOT( selectNextItem( QListViewItem * ) ) ); | 122 | SLOT( selectNextItem( QListViewItem * ) ) ); |
122 | 123 | ||
123 | } | 124 | } |
124 | 125 | ||
125 | mAddressBook = StdAddressBook::self( true ); | 126 | mAddressBook = StdAddressBook::self( true ); |
126 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), | 127 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook* ) ), |
127 | SLOT( addressBookChanged() ) ); | 128 | SLOT( addressBookChanged() ) ); |
128 | connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), | 129 | connect( mAddressBook, SIGNAL( loadingFinished( Resource* ) ), |
129 | SLOT( addressBookChanged() ) ); | 130 | SLOT( addressBookChanged() ) ); |
130 | 131 | ||
131 | loadAddressBook(); | 132 | loadAddressBook(); |
132 | QValueList<int> splitterSize; | 133 | QValueList<int> splitterSize; |
133 | splitterSize.append( ( width() / 5 ) * 3 ); | 134 | splitterSize.append( ( width() / 5 ) * 3 ); |
134 | splitterSize.append( ( width() / 5 ) *2 ); | 135 | splitterSize.append( ( width() / 5 ) *2 ); |
135 | mMiniSplitter->setSizes( splitterSize ); | 136 | mMiniSplitter->setSizes( splitterSize ); |
136 | } | 137 | } |
137 | 138 | ||
138 | AddresseeDialog::~AddresseeDialog() | 139 | AddresseeDialog::~AddresseeDialog() |
139 | { | 140 | { |
141 | qDebug("DELETE AddresseeDialog "); | ||
140 | } | 142 | } |
141 | 143 | ||
142 | void AddresseeDialog::loadAddressBook() | 144 | void AddresseeDialog::loadAddressBook() |
143 | { | 145 | { |
144 | mAddresseeList->clear(); | 146 | mAddresseeList->clear(); |
145 | mItemDict.clear(); | 147 | mItemDict.clear(); |
146 | if ( mAddresseeEdit->text().isEmpty() ) { | 148 | if ( mAddresseeEdit->text().isEmpty() ) { |
147 | AddressBook::Iterator it; | 149 | AddressBook::Iterator it; |
148 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 150 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
149 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 151 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
150 | continue; | 152 | continue; |
151 | new AddresseeItem( mAddresseeList, (*it) ); | 153 | new AddresseeItem( mAddresseeList, (*it) ); |
152 | } | 154 | } |
153 | return; | 155 | return; |
154 | } | 156 | } |
155 | //mAddresseeEdit->completionObject()->clear(); | 157 | //mAddresseeEdit->completionObject()->clear(); |
156 | QRegExp re; | 158 | QRegExp re; |
157 | re.setWildcard(true); // most people understand these better. | 159 | re.setWildcard(true); // most people understand these better. |
158 | re.setCaseSensitive(false); | 160 | re.setCaseSensitive(false); |
159 | re.setPattern( "*"+ mAddresseeEdit->text() + "*"); | 161 | re.setPattern( "*"+ mAddresseeEdit->text() + "*"); |
160 | 162 | ||
161 | AddressBook::Iterator it; | 163 | AddressBook::Iterator it; |
162 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 164 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
163 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 165 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
164 | continue; | 166 | continue; |
165 | QString name = (*it).familyName()+", "+ (*it).givenName(); | 167 | QString name = (*it).familyName()+", "+ (*it).givenName(); |
166 | if ( name.length() == 2 ) | 168 | if ( name.length() == 2 ) |
167 | name = (*it).realName(); | 169 | name = (*it).realName(); |
168 | name += (*it).preferredEmail(); | 170 | name += (*it).preferredEmail(); |
169 | #if QT_VERSION >= 0x030000 | 171 | #if QT_VERSION >= 0x030000 |
170 | if (re.search(name) != -1) | 172 | if (re.search(name) != -1) |
171 | #else | 173 | #else |
172 | if (re.match(name) != -1) | 174 | if (re.match(name) != -1) |
173 | #endif | 175 | #endif |
174 | AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); | 176 | AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); |
175 | } | 177 | } |
176 | } | 178 | } |
177 | 179 | ||
178 | void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item ) | 180 | void AddresseeDialog::addCompletionItem( const QString &str, QListViewItem *item ) |
179 | { | 181 | { |
180 | if ( str.isEmpty() ) return; | 182 | if ( str.isEmpty() ) return; |
181 | 183 | ||
182 | mItemDict.insert( str, item ); | 184 | mItemDict.insert( str, item ); |
183 | //mAddresseeEdit->completionObject()->addItem( str ); | 185 | //mAddresseeEdit->completionObject()->addItem( str ); |
184 | } | 186 | } |
185 | 187 | ||
186 | void AddresseeDialog::selectItem( const QString &str ) | 188 | void AddresseeDialog::selectItem( const QString &str ) |
187 | { | 189 | { |
188 | if ( str.isEmpty() ) return; | 190 | if ( str.isEmpty() ) return; |
189 | 191 | ||
190 | QListViewItem *item = mItemDict.find( str ); | 192 | QListViewItem *item = mItemDict.find( str ); |
191 | if ( item ) { | 193 | if ( item ) { |
192 | mAddresseeList->blockSignals( true ); | 194 | mAddresseeList->blockSignals( true ); |
193 | mAddresseeList->setSelected( item, true ); | 195 | mAddresseeList->setSelected( item, true ); |
194 | mAddresseeList->ensureItemVisible( item ); | 196 | mAddresseeList->ensureItemVisible( item ); |
195 | mAddresseeList->blockSignals( false ); | 197 | mAddresseeList->blockSignals( false ); |
196 | } | 198 | } |
197 | } | 199 | } |
198 | 200 | ||
199 | void AddresseeDialog::updateEdit( QListViewItem *item ) | 201 | void AddresseeDialog::updateEdit( QListViewItem *item ) |
200 | { | 202 | { |
201 | mAddresseeEdit->setText( item->text( 0 ) ); | 203 | mAddresseeEdit->setText( item->text( 0 ) ); |
202 | mAddresseeEdit->setSelection( 0, item->text( 0 ).length() ); | 204 | mAddresseeEdit->setSelection( 0, item->text( 0 ).length() ); |
203 | } | 205 | } |
204 | 206 | ||
205 | void AddresseeDialog::selectNextItem( QListViewItem *item ) | 207 | void AddresseeDialog::selectNextItem( QListViewItem *item ) |
206 | { | 208 | { |
207 | addSelected( item ); | 209 | addSelected( item ); |
208 | QListViewItem *next = item->nextSibling(); | 210 | QListViewItem *next = item->nextSibling(); |
209 | if ( next ) { | 211 | if ( next ) { |
210 | next->setSelected( true ); | 212 | next->setSelected( true ); |
211 | item->setSelected( false ); | 213 | item->setSelected( false ); |
212 | mAddresseeList->setCurrentItem( next ); | 214 | mAddresseeList->setCurrentItem( next ); |
213 | } | 215 | } |
214 | } | 216 | } |
215 | void AddresseeDialog::addSelected( QListViewItem *item ) | 217 | void AddresseeDialog::addSelected( QListViewItem *item ) |
216 | { | 218 | { |
217 | AddresseeItem *addrItem = (AddresseeItem *)( item ); | 219 | AddresseeItem *addrItem = (AddresseeItem *)( item ); |
218 | if ( !addrItem ) return; | 220 | if ( !addrItem ) return; |
219 | 221 | ||
220 | Addressee a = addrItem->addressee(); | 222 | Addressee a = addrItem->addressee(); |
221 | 223 | ||
222 | QListViewItem *selectedItem = mSelectedDict.find( a.uid() ); | 224 | QListViewItem *selectedItem = mSelectedDict.find( a.uid() ); |
223 | if ( !selectedItem ) { | 225 | if ( !selectedItem ) { |
224 | selectedItem = new AddresseeItem( mSelectedList, a ); | 226 | selectedItem = new AddresseeItem( mSelectedList, a ); |
225 | mSelectedDict.insert( a.uid(), selectedItem ); | 227 | mSelectedDict.insert( a.uid(), selectedItem ); |
226 | } | 228 | } |
227 | 229 | ||
228 | } | 230 | } |
229 | 231 | ||
230 | void AddresseeDialog::removeSelected() | 232 | void AddresseeDialog::removeSelected() |
231 | { | 233 | { |
232 | QListViewItem *item = mSelectedList->selectedItem(); | 234 | QListViewItem *item = mSelectedList->selectedItem(); |
233 | AddresseeItem *addrItem = (AddresseeItem *)( item ); | 235 | AddresseeItem *addrItem = (AddresseeItem *)( item ); |
234 | if ( !addrItem ) return; | 236 | if ( !addrItem ) return; |
235 | QListViewItem *next = item->nextSibling(); | 237 | QListViewItem *next = item->nextSibling(); |
236 | mSelectedDict.remove( addrItem->addressee().uid() ); | 238 | mSelectedDict.remove( addrItem->addressee().uid() ); |
237 | delete addrItem; | 239 | delete addrItem; |
238 | if ( next ) | 240 | if ( next ) |
239 | next->setSelected( true ); | 241 | next->setSelected( true ); |
240 | } | 242 | } |
241 | 243 | ||
242 | Addressee AddresseeDialog::addressee() | 244 | Addressee AddresseeDialog::addressee() |
243 | { | 245 | { |
244 | AddresseeItem *aItem = 0; | 246 | AddresseeItem *aItem = 0; |
245 | 247 | ||
246 | if ( mMultiple ) | 248 | if ( mMultiple ) |
247 | aItem = (AddresseeItem *)( mSelectedList->firstChild() ); | 249 | aItem = (AddresseeItem *)( mSelectedList->firstChild() ); |
248 | else | 250 | else |
249 | aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); | 251 | aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); |
250 | 252 | ||
251 | if (aItem) return aItem->addressee(); | 253 | if (aItem) return aItem->addressee(); |
252 | return Addressee(); | 254 | return Addressee(); |
253 | } | 255 | } |
254 | 256 | ||
255 | Addressee::List AddresseeDialog::addressees() | 257 | Addressee::List AddresseeDialog::addressees() |
256 | { | 258 | { |
257 | Addressee::List al; | 259 | Addressee::List al; |
258 | AddresseeItem *aItem = 0; | 260 | AddresseeItem *aItem = 0; |
259 | 261 | ||
260 | if ( mMultiple ) { | 262 | if ( mMultiple ) { |
261 | QListViewItem *item = mSelectedList->firstChild(); | 263 | QListViewItem *item = mSelectedList->firstChild(); |
262 | while( item ) { | 264 | while( item ) { |
263 | aItem = (AddresseeItem *)( item ); | 265 | aItem = (AddresseeItem *)( item ); |
264 | if ( aItem ) al.append( aItem->addressee() ); | 266 | if ( aItem ) al.append( aItem->addressee() ); |
265 | item = item->nextSibling(); | 267 | item = item->nextSibling(); |
266 | } | 268 | } |
267 | } | 269 | } |
268 | else | 270 | else |
269 | { | 271 | { |
270 | aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); | 272 | aItem = (AddresseeItem *)( mAddresseeList->selectedItem() ); |
271 | if (aItem) al.append( aItem->addressee() ); | 273 | if (aItem) al.append( aItem->addressee() ); |
272 | } | 274 | } |
273 | 275 | ||
274 | return al; | 276 | return al; |
275 | } | 277 | } |
276 | 278 | ||
277 | Addressee AddresseeDialog::getAddressee( QWidget *parent ) | 279 | Addressee AddresseeDialog::getAddressee( QWidget *parent ) |
278 | { | 280 | { |
279 | AddresseeDialog *dlg = new AddresseeDialog( parent ); | 281 | AddresseeDialog *dlg = new AddresseeDialog( parent ); |
280 | Addressee addressee; | 282 | Addressee addressee; |
281 | int result = dlg->exec(); | 283 | int result = dlg->exec(); |
282 | 284 | ||
283 | if ( result == QDialog::Accepted ) { | 285 | if ( result == QDialog::Accepted ) { |
284 | addressee = dlg->addressee(); | 286 | addressee = dlg->addressee(); |
285 | } | 287 | } |
286 | 288 | ||
287 | delete dlg; | 289 | delete dlg; |
288 | return addressee; | 290 | return addressee; |
289 | } | 291 | } |
290 | 292 | ||
291 | Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) | 293 | Addressee::List AddresseeDialog::getAddressees( QWidget *parent ) |
292 | { | 294 | { |
293 | AddresseeDialog *dlg = new AddresseeDialog( parent, true ); | 295 | AddresseeDialog *dlg = new AddresseeDialog( parent, true ); |
294 | Addressee::List addressees; | 296 | Addressee::List addressees; |
295 | if ( QApplication::desktop()->width() <= 640 ) | 297 | if ( QApplication::desktop()->width() <= 640 ) |
296 | dlg->showMaximized(); | 298 | dlg->showMaximized(); |
297 | int result = dlg->exec(); | 299 | int result = dlg->exec(); |
298 | if ( result == QDialog::Accepted ) { | 300 | if ( result == QDialog::Accepted ) { |
299 | addressees = dlg->addressees(); | 301 | addressees = dlg->addressees(); |
300 | } | 302 | } |
301 | 303 | ||
302 | delete dlg; | 304 | delete dlg; |
303 | return addressees; | 305 | return addressees; |
304 | } | 306 | } |
305 | 307 | ||
306 | void AddresseeDialog::addressBookChanged() | 308 | void AddresseeDialog::addressBookChanged() |
307 | { | 309 | { |
308 | loadAddressBook(); | 310 | loadAddressBook(); |
309 | } | 311 | } |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 27aca2d..3f9b546 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -185,384 +185,385 @@ class KABCatPrefs : public QDialog | |||
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(); } |
197 | private: | 197 | private: |
198 | QRadioButton* addCatBut; | 198 | QRadioButton* addCatBut; |
199 | }; | 199 | }; |
200 | 200 | ||
201 | class KABFormatPrefs : public QDialog | 201 | class 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 | } |
232 | public: | 232 | public: |
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 | ||
239 | class KAex2phonePrefs : public QDialog | 239 | class 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 | ||
279 | public: | 279 | public: |
280 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 280 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
281 | QCheckBox* mWriteToSim; | 281 | QCheckBox* mWriteToSim; |
282 | }; | 282 | }; |
283 | 283 | ||
284 | 284 | ||
285 | bool pasteWithNewUid = true; | 285 | bool pasteWithNewUid = true; |
286 | 286 | ||
287 | #ifdef KAB_EMBEDDED | 287 | #ifdef KAB_EMBEDDED |
288 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) | 288 | KABCore::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 |
293 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) | 293 | KABCore::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 | 378 | ||
378 | 379 | ||
379 | #ifndef KAB_EMBEDDED | 380 | #ifndef KAB_EMBEDDED |
380 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 381 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
381 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 382 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
382 | 383 | ||
383 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 384 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
384 | SLOT( browse( const QString& ) ) ); | 385 | SLOT( browse( const QString& ) ) ); |
385 | 386 | ||
386 | 387 | ||
387 | mAddressBookService = new KAddressBookService( this ); | 388 | mAddressBookService = new KAddressBookService( this ); |
388 | 389 | ||
389 | #endif //KAB_EMBEDDED | 390 | #endif //KAB_EMBEDDED |
390 | 391 | ||
391 | mMessageTimer = new QTimer( this ); | 392 | mMessageTimer = new QTimer( this ); |
392 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); | 393 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); |
393 | mEditorDialog = 0; | 394 | mEditorDialog = 0; |
394 | createAddresseeEditorDialog( this ); | 395 | createAddresseeEditorDialog( this ); |
395 | setModified( false ); | 396 | setModified( false ); |
396 | mBRdisabled = false; | 397 | mBRdisabled = false; |
397 | #ifndef DESKTOP_VERSION | 398 | #ifndef DESKTOP_VERSION |
398 | infrared = 0; | 399 | infrared = 0; |
399 | #endif | 400 | #endif |
400 | //toggleBeamReceive( ); | 401 | //toggleBeamReceive( ); |
401 | //mMainWindow->toolBar()->show(); | 402 | //mMainWindow->toolBar()->show(); |
402 | // 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 |
403 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); | 404 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); |
404 | } | 405 | } |
405 | 406 | ||
406 | void KABCore::updateToolBar() | 407 | void KABCore::updateToolBar() |
407 | { | 408 | { |
408 | static int iii = 0; | 409 | static int iii = 0; |
409 | ++iii; | 410 | ++iii; |
410 | mMainWindow->toolBar()->repaintMe(); | 411 | mMainWindow->toolBar()->repaintMe(); |
411 | if ( iii < 4 ) | 412 | if ( iii < 4 ) |
412 | QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); | 413 | QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); |
413 | } | 414 | } |
414 | KABCore::~KABCore() | 415 | KABCore::~KABCore() |
415 | { | 416 | { |
416 | // save(); | 417 | // save(); |
417 | //saveSettings(); | 418 | //saveSettings(); |
418 | //KABPrefs::instance()->writeConfig(); | 419 | //KABPrefs::instance()->writeConfig(); |
419 | delete AddresseeConfig::instance(); | 420 | delete AddresseeConfig::instance(); |
420 | mAddressBook = 0; | 421 | mAddressBook = 0; |
421 | KABC::StdAddressBook::close(); | 422 | KABC::StdAddressBook::close(); |
422 | 423 | ||
423 | delete syncManager; | 424 | delete syncManager; |
424 | #ifndef DESKTOP_VERSION | 425 | #ifndef DESKTOP_VERSION |
425 | if ( infrared ) | 426 | if ( infrared ) |
426 | delete infrared; | 427 | delete infrared; |
427 | #endif | 428 | #endif |
428 | } | 429 | } |
429 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 430 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) |
430 | { | 431 | { |
431 | //qDebug("KA: QCOP message received: %s ", cmsg.data() ); | 432 | //qDebug("KA: QCOP message received: %s ", cmsg.data() ); |
432 | if ( cmsg == "setDocument(QString)" ) { | 433 | if ( cmsg == "setDocument(QString)" ) { |
433 | QDataStream stream( data, IO_ReadOnly ); | 434 | QDataStream stream( data, IO_ReadOnly ); |
434 | QString fileName; | 435 | QString fileName; |
435 | stream >> fileName; | 436 | stream >> fileName; |
436 | recieve( fileName ); | 437 | recieve( fileName ); |
437 | return; | 438 | return; |
438 | } | 439 | } |
439 | } | 440 | } |
440 | void KABCore::toggleBeamReceive( ) | 441 | void KABCore::toggleBeamReceive( ) |
441 | { | 442 | { |
442 | if ( mBRdisabled ) | 443 | if ( mBRdisabled ) |
443 | return; | 444 | return; |
444 | #ifndef DESKTOP_VERSION | 445 | #ifndef DESKTOP_VERSION |
445 | if ( infrared ) { | 446 | if ( infrared ) { |
446 | qDebug("KA: AB disable BeamReceive "); | 447 | qDebug("KA: AB disable BeamReceive "); |
447 | delete infrared; | 448 | delete infrared; |
448 | infrared = 0; | 449 | infrared = 0; |
449 | mActionBR->setChecked(false); | 450 | mActionBR->setChecked(false); |
450 | return; | 451 | return; |
451 | } | 452 | } |
452 | qDebug("KA: AB enable BeamReceive "); | 453 | qDebug("KA: AB enable BeamReceive "); |
453 | mActionBR->setChecked(true); | 454 | mActionBR->setChecked(true); |
454 | 455 | ||
455 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 456 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
456 | 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& ))); |
457 | #endif | 458 | #endif |
458 | } | 459 | } |
459 | 460 | ||
460 | 461 | ||
461 | void KABCore::disableBR(bool b) | 462 | void KABCore::disableBR(bool b) |
462 | { | 463 | { |
463 | #ifndef DESKTOP_VERSION | 464 | #ifndef DESKTOP_VERSION |
464 | if ( b ) { | 465 | if ( b ) { |
465 | if ( infrared ) { | 466 | if ( infrared ) { |
466 | toggleBeamReceive( ); | 467 | toggleBeamReceive( ); |
467 | } | 468 | } |
468 | mBRdisabled = true; | 469 | mBRdisabled = true; |
469 | } else { | 470 | } else { |
470 | if ( mBRdisabled ) { | 471 | if ( mBRdisabled ) { |
471 | mBRdisabled = false; | 472 | mBRdisabled = false; |
472 | //toggleBeamReceive( ); | 473 | //toggleBeamReceive( ); |
473 | } | 474 | } |
474 | } | 475 | } |
475 | #endif | 476 | #endif |
476 | 477 | ||
477 | } | 478 | } |
478 | void KABCore::recieve( QString fn ) | 479 | void KABCore::recieve( QString fn ) |
479 | { | 480 | { |
480 | //qDebug("KABCore::recieve "); | 481 | //qDebug("KABCore::recieve "); |
481 | int count = mAddressBook->importFromFile( fn, true ); | 482 | int count = mAddressBook->importFromFile( fn, true ); |
482 | if ( count ) | 483 | if ( count ) |
483 | setModified( true ); | 484 | setModified( true ); |
484 | mViewManager->refreshView(); | 485 | mViewManager->refreshView(); |
485 | message(i18n("%1 contact(s) received!").arg( count )); | 486 | message(i18n("%1 contact(s) received!").arg( count )); |
486 | topLevelWidget()->showMaximized(); | 487 | topLevelWidget()->showMaximized(); |
487 | topLevelWidget()->raise(); | 488 | topLevelWidget()->raise(); |
488 | } | 489 | } |
489 | void KABCore::restoreSettings() | 490 | void KABCore::restoreSettings() |
490 | { | 491 | { |
491 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; | 492 | mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; |
492 | 493 | ||
493 | bool state; | 494 | bool state; |
494 | 495 | ||
495 | if (mMultipleViewsAtOnce) | 496 | if (mMultipleViewsAtOnce) |
496 | state = KABPrefs::instance()->mDetailsPageVisible; | 497 | state = KABPrefs::instance()->mDetailsPageVisible; |
497 | else | 498 | else |
498 | state = false; | 499 | state = false; |
499 | 500 | ||
500 | mActionDetails->setChecked( state ); | 501 | mActionDetails->setChecked( state ); |
501 | setDetailsVisible( state ); | 502 | setDetailsVisible( state ); |
502 | 503 | ||
503 | state = KABPrefs::instance()->mJumpButtonBarVisible; | 504 | state = KABPrefs::instance()->mJumpButtonBarVisible; |
504 | 505 | ||
505 | mActionJumpBar->setChecked( state ); | 506 | mActionJumpBar->setChecked( state ); |
506 | setJumpButtonBarVisible( state ); | 507 | setJumpButtonBarVisible( state ); |
507 | /*US | 508 | /*US |
508 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; | 509 | QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; |
509 | if ( splitterSize.count() == 0 ) { | 510 | if ( splitterSize.count() == 0 ) { |
510 | splitterSize.append( width() / 2 ); | 511 | splitterSize.append( width() / 2 ); |
511 | splitterSize.append( width() / 2 ); | 512 | splitterSize.append( width() / 2 ); |
512 | } | 513 | } |
513 | mMiniSplitter->setSizes( splitterSize ); | 514 | mMiniSplitter->setSizes( splitterSize ); |
514 | if ( mExtensionBarSplitter ) { | 515 | if ( mExtensionBarSplitter ) { |
515 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 516 | splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
516 | if ( splitterSize.count() == 0 ) { | 517 | if ( splitterSize.count() == 0 ) { |
517 | splitterSize.append( width() / 2 ); | 518 | splitterSize.append( width() / 2 ); |
518 | splitterSize.append( width() / 2 ); | 519 | splitterSize.append( width() / 2 ); |
519 | } | 520 | } |
520 | mExtensionBarSplitter->setSizes( splitterSize ); | 521 | mExtensionBarSplitter->setSizes( splitterSize ); |
521 | 522 | ||
522 | } | 523 | } |
523 | */ | 524 | */ |
524 | mViewManager->restoreSettings(); | 525 | mViewManager->restoreSettings(); |
525 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); | 526 | mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); |
526 | mExtensionManager->restoreSettings(); | 527 | mExtensionManager->restoreSettings(); |
527 | #ifdef DESKTOP_VERSION | 528 | #ifdef DESKTOP_VERSION |
528 | int wid = width(); | 529 | int wid = width(); |
529 | if ( wid < 10 ) | 530 | if ( wid < 10 ) |
530 | wid = 400; | 531 | wid = 400; |
531 | #else | 532 | #else |
532 | int wid = QApplication::desktop()->width(); | 533 | int wid = QApplication::desktop()->width(); |
533 | if ( wid < 640 ) | 534 | if ( wid < 640 ) |
534 | wid = QApplication::desktop()->height(); | 535 | wid = QApplication::desktop()->height(); |
535 | #endif | 536 | #endif |
536 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; | 537 | QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; |
537 | if ( true /*splitterSize.count() == 0*/ ) { | 538 | if ( true /*splitterSize.count() == 0*/ ) { |
538 | splitterSize.append( wid / 2 ); | 539 | splitterSize.append( wid / 2 ); |
539 | splitterSize.append( wid / 2 ); | 540 | splitterSize.append( wid / 2 ); |
540 | } | 541 | } |
541 | mMiniSplitter->setSizes( splitterSize ); | 542 | mMiniSplitter->setSizes( splitterSize ); |
542 | if ( mExtensionBarSplitter ) { | 543 | if ( mExtensionBarSplitter ) { |
543 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; | 544 | //splitterSize = KABPrefs::instance()->mExtensionsSplitter; |
544 | if ( true /*splitterSize.count() == 0*/ ) { | 545 | if ( true /*splitterSize.count() == 0*/ ) { |
545 | splitterSize.append( wid / 2 ); | 546 | splitterSize.append( wid / 2 ); |
546 | splitterSize.append( wid / 2 ); | 547 | splitterSize.append( wid / 2 ); |
547 | } | 548 | } |
548 | mExtensionBarSplitter->setSizes( splitterSize ); | 549 | mExtensionBarSplitter->setSizes( splitterSize ); |
549 | 550 | ||
550 | } | 551 | } |
551 | 552 | ||
552 | 553 | ||
553 | } | 554 | } |
554 | 555 | ||
555 | void KABCore::saveSettings() | 556 | void KABCore::saveSettings() |
556 | { | 557 | { |
557 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); | 558 | KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); |
558 | if ( mExtensionBarSplitter ) | 559 | if ( mExtensionBarSplitter ) |
559 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 560 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
560 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); | 561 | KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); |
561 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); | 562 | KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); |
562 | #ifndef KAB_EMBEDDED | 563 | #ifndef KAB_EMBEDDED |
563 | 564 | ||
564 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 565 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
565 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 566 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
566 | #endif //KAB_EMBEDDED | 567 | #endif //KAB_EMBEDDED |
567 | mExtensionManager->saveSettings(); | 568 | mExtensionManager->saveSettings(); |
568 | mViewManager->saveSettings(); | 569 | mViewManager->saveSettings(); |
@@ -646,410 +647,412 @@ void KABCore::createAboutData() | |||
646 | about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); | 647 | about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); |
647 | 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" ), |
648 | "michel@klaralvdalens-datakonsult.se" ); | 649 | "michel@klaralvdalens-datakonsult.se" ); |
649 | about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), | 650 | about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), |
650 | "hansen@kde.org" ); | 651 | "hansen@kde.org" ); |
651 | 652 | ||
652 | return about; | 653 | return about; |
653 | #endif //KAB_EMBEDDED | 654 | #endif //KAB_EMBEDDED |
654 | 655 | ||
655 | QString version; | 656 | QString version; |
656 | #include <../version> | 657 | #include <../version> |
657 | QMessageBox::about( this, "About KAddressbook/Pi", | 658 | QMessageBox::about( this, "About KAddressbook/Pi", |
658 | "KAddressbook/Platform-independent\n" | 659 | "KAddressbook/Platform-independent\n" |
659 | "(KA/Pi) " +version + " - " + | 660 | "(KA/Pi) " +version + " - " + |
660 | #ifdef DESKTOP_VERSION | 661 | #ifdef DESKTOP_VERSION |
661 | "Desktop Edition\n" | 662 | "Desktop Edition\n" |
662 | #else | 663 | #else |
663 | "PDA-Edition\n" | 664 | "PDA-Edition\n" |
664 | "for: Zaurus 5500 / 7x0 / 8x0\n" | 665 | "for: Zaurus 5500 / 7x0 / 8x0\n" |
665 | #endif | 666 | #endif |
666 | 667 | ||
667 | "(c) 2004 Ulf Schenk\n" | 668 | "(c) 2004 Ulf Schenk\n" |
668 | "(c) 2004 Lutz Rogowski\n" | 669 | "(c) 2004 Lutz Rogowski\n" |
669 | "(c) 1997-2003, The KDE PIM Team\n" | 670 | "(c) 1997-2003, The KDE PIM Team\n" |
670 | "Tobias Koenig Current maintainer\ntokoe@kde.org\n" | 671 | "Tobias Koenig Current maintainer\ntokoe@kde.org\n" |
671 | "Don Sanders Original author\n" | 672 | "Don Sanders Original author\n" |
672 | "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" | 673 | "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" |
673 | "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" | 674 | "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" |
674 | "Greg Stern DCOP interface\n" | 675 | "Greg Stern DCOP interface\n" |
675 | "Mark Westcot Contact pinning\n" | 676 | "Mark Westcot Contact pinning\n" |
676 | "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" |
677 | "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" | 678 | "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" |
678 | #ifdef _WIN32_ | 679 | #ifdef _WIN32_ |
679 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" | 680 | "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" |
680 | #endif | 681 | #endif |
681 | ); | 682 | ); |
682 | } | 683 | } |
683 | 684 | ||
684 | void KABCore::setContactSelected( const QString &uid ) | 685 | void KABCore::setContactSelected( const QString &uid ) |
685 | { | 686 | { |
686 | KABC::Addressee addr = mAddressBook->findByUid( uid ); | 687 | KABC::Addressee addr = mAddressBook->findByUid( uid ); |
687 | if ( !mDetails->isHidden() ) | 688 | if ( !mDetails->isHidden() ) |
688 | mDetails->setAddressee( addr ); | 689 | mDetails->setAddressee( addr ); |
689 | 690 | ||
690 | if ( !addr.isEmpty() ) { | 691 | if ( !addr.isEmpty() ) { |
691 | emit contactSelected( addr.formattedName() ); | 692 | emit contactSelected( addr.formattedName() ); |
692 | KABC::Picture pic = addr.photo(); | 693 | KABC::Picture pic = addr.photo(); |
693 | if ( pic.isIntern() ) { | 694 | if ( pic.isIntern() ) { |
694 | //US emit contactSelected( pic.data() ); | 695 | //US emit contactSelected( pic.data() ); |
695 | //US instead use: | 696 | //US instead use: |
696 | QPixmap px; | 697 | QPixmap px; |
697 | if (pic.data().isNull() != true) | 698 | if (pic.data().isNull() != true) |
698 | { | 699 | { |
699 | px.convertFromImage(pic.data()); | 700 | px.convertFromImage(pic.data()); |
700 | } | 701 | } |
701 | 702 | ||
702 | emit contactSelected( px ); | 703 | emit contactSelected( px ); |
703 | } | 704 | } |
704 | } | 705 | } |
705 | 706 | ||
706 | 707 | ||
707 | mExtensionManager->setSelectionChanged(); | 708 | mExtensionManager->setSelectionChanged(); |
708 | 709 | ||
709 | // update the actions | 710 | // update the actions |
710 | bool selected = !uid.isEmpty(); | 711 | bool selected = !uid.isEmpty(); |
711 | 712 | ||
712 | if ( mReadWrite ) { | 713 | if ( mReadWrite ) { |
713 | mActionCut->setEnabled( selected ); | 714 | mActionCut->setEnabled( selected ); |
714 | mActionPaste->setEnabled( selected ); | 715 | mActionPaste->setEnabled( selected ); |
715 | } | 716 | } |
716 | 717 | ||
717 | mActionCopy->setEnabled( selected ); | 718 | mActionCopy->setEnabled( selected ); |
718 | mActionDelete->setEnabled( selected ); | 719 | mActionDelete->setEnabled( selected ); |
719 | mActionEditAddressee->setEnabled( selected ); | 720 | mActionEditAddressee->setEnabled( selected ); |
720 | mActionMail->setEnabled( selected ); | 721 | mActionMail->setEnabled( selected ); |
721 | mActionMailVCard->setEnabled( selected ); | 722 | mActionMailVCard->setEnabled( selected ); |
722 | //if (mActionBeam) | 723 | //if (mActionBeam) |
723 | //mActionBeam->setEnabled( selected ); | 724 | //mActionBeam->setEnabled( selected ); |
724 | mActionWhoAmI->setEnabled( selected ); | 725 | mActionWhoAmI->setEnabled( selected ); |
725 | } | 726 | } |
726 | 727 | ||
727 | void KABCore::sendMail() | 728 | void KABCore::sendMail() |
728 | { | 729 | { |
729 | sendMail( mViewManager->selectedEmails().join( ", " ) ); | 730 | sendMail( mViewManager->selectedEmails().join( ", " ) ); |
730 | } | 731 | } |
731 | 732 | ||
732 | void KABCore::sendMail( const QString& emaillist ) | 733 | void KABCore::sendMail( const QString& emaillist ) |
733 | { | 734 | { |
734 | // 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>;... " |
735 | if (emaillist.contains(",") > 0) | 736 | if (emaillist.contains(",") > 0) |
736 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); | 737 | ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); |
737 | else | 738 | else |
738 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); | 739 | ExternalAppHandler::instance()->mailToOneContact( emaillist ); |
739 | } | 740 | } |
740 | 741 | ||
741 | 742 | ||
742 | 743 | ||
743 | void KABCore::mailVCard() | 744 | void KABCore::mailVCard() |
744 | { | 745 | { |
745 | QStringList uids = mViewManager->selectedUids(); | 746 | QStringList uids = mViewManager->selectedUids(); |
746 | if ( !uids.isEmpty() ) | 747 | if ( !uids.isEmpty() ) |
747 | mailVCard( uids ); | 748 | mailVCard( uids ); |
748 | } | 749 | } |
749 | 750 | ||
750 | void KABCore::mailVCard( const QStringList& uids ) | 751 | void KABCore::mailVCard( const QStringList& uids ) |
751 | { | 752 | { |
752 | QStringList urls; | 753 | QStringList urls; |
753 | 754 | ||
754 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); | 755 | // QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); |
755 | 756 | ||
756 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); | 757 | QString dirName = "/tmp/" + KApplication::randomString( 8 ); |
757 | 758 | ||
758 | 759 | ||
759 | 760 | ||
760 | QDir().mkdir( dirName, true ); | 761 | QDir().mkdir( dirName, true ); |
761 | 762 | ||
762 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 763 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
763 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 764 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
764 | 765 | ||
765 | if ( a.isEmpty() ) | 766 | if ( a.isEmpty() ) |
766 | continue; | 767 | continue; |
767 | 768 | ||
768 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; | 769 | QString name = a.givenName() + "_" + a.familyName() + ".vcf"; |
769 | 770 | ||
770 | QString fileName = dirName + "/" + name; | 771 | QString fileName = dirName + "/" + name; |
771 | 772 | ||
772 | QFile outFile(fileName); | 773 | QFile outFile(fileName); |
773 | 774 | ||
774 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully | 775 | if ( outFile.open(IO_WriteOnly) ) { // file opened successfully |
775 | KABC::VCardConverter converter; | 776 | KABC::VCardConverter converter; |
776 | QString vcard; | 777 | QString vcard; |
777 | 778 | ||
778 | converter.addresseeToVCard( a, vcard ); | 779 | converter.addresseeToVCard( a, vcard ); |
779 | 780 | ||
780 | QTextStream t( &outFile ); // use a text stream | 781 | QTextStream t( &outFile ); // use a text stream |
781 | t.setEncoding( QTextStream::UnicodeUTF8 ); | 782 | t.setEncoding( QTextStream::UnicodeUTF8 ); |
782 | t << vcard; | 783 | t << vcard; |
783 | 784 | ||
784 | outFile.close(); | 785 | outFile.close(); |
785 | 786 | ||
786 | urls.append( fileName ); | 787 | urls.append( fileName ); |
787 | } | 788 | } |
788 | } | 789 | } |
789 | 790 | ||
790 | bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); | 791 | bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); |
791 | 792 | ||
792 | 793 | ||
793 | /*US | 794 | /*US |
794 | kapp->invokeMailer( QString::null, QString::null, QString::null, | 795 | kapp->invokeMailer( QString::null, QString::null, QString::null, |
795 | QString::null, // subject | 796 | QString::null, // subject |
796 | QString::null, // body | 797 | QString::null, // body |
797 | QString::null, | 798 | QString::null, |
798 | urls ); // attachments | 799 | urls ); // attachments |
799 | */ | 800 | */ |
800 | 801 | ||
801 | } | 802 | } |
802 | 803 | ||
803 | /** | 804 | /** |
804 | Beams the "WhoAmI contact. | 805 | Beams the "WhoAmI contact. |
805 | */ | 806 | */ |
806 | void KABCore::beamMySelf() | 807 | void KABCore::beamMySelf() |
807 | { | 808 | { |
808 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); | 809 | KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI(); |
809 | if (!a.isEmpty()) | 810 | if (!a.isEmpty()) |
810 | { | 811 | { |
811 | QStringList uids; | 812 | QStringList uids; |
812 | uids << a.uid(); | 813 | uids << a.uid(); |
813 | 814 | ||
814 | beamVCard(uids); | 815 | beamVCard(uids); |
815 | } else { | 816 | } else { |
816 | 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" ) ); |
817 | 818 | ||
818 | 819 | ||
819 | } | 820 | } |
820 | } | 821 | } |
821 | void KABCore::updateMainWindow() | 822 | void KABCore::updateMainWindow() |
822 | { | 823 | { |
823 | mMainWindow->showMaximized(); | 824 | mMainWindow->showMaximized(); |
824 | mMainWindow->update(); | 825 | mMainWindow->update(); |
825 | } | 826 | } |
826 | void KABCore::resizeEvent(QResizeEvent* e ) | 827 | void KABCore::resizeEvent(QResizeEvent* e ) |
827 | { | 828 | { |
828 | if ( !mMiniSplitter ) | 829 | if ( !mMiniSplitter ) |
829 | return; | 830 | return; |
830 | //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); | 831 | //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); |
831 | if ( QApplication::desktop()->width() >= 480 ) { | 832 | if ( QApplication::desktop()->width() >= 480 ) { |
832 | if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 | 833 | if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 |
833 | if ( mMiniSplitter->orientation() == Qt::Vertical ) { | 834 | if ( mMiniSplitter->orientation() == Qt::Vertical ) { |
834 | mMiniSplitter->setOrientation( Qt::Horizontal); | 835 | mMiniSplitter->setOrientation( Qt::Horizontal); |
835 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 836 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
836 | } | 837 | } |
837 | if ( QApplication::desktop()->width() <= 640 ) { | 838 | if ( QApplication::desktop()->width() <= 640 ) { |
839 | mMainWindow->showMinimized(); | ||
838 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | 840 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); |
839 | mViewManager->getFilterAction()->setComboWidth( 150 ); | 841 | mViewManager->getFilterAction()->setComboWidth( 150 ); |
840 | if ( mIncSearchWidget ) | 842 | if ( mIncSearchWidget ) |
841 | mIncSearchWidget->setSize(); | 843 | mIncSearchWidget->setSize(); |
842 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | 844 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); |
843 | } | 845 | } |
844 | 846 | ||
845 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 | 847 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 |
846 | if ( mMiniSplitter->orientation() == Qt::Horizontal ) { | 848 | if ( mMiniSplitter->orientation() == Qt::Horizontal ) { |
847 | mMiniSplitter->setOrientation( Qt::Vertical ); | 849 | mMiniSplitter->setOrientation( Qt::Vertical ); |
848 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 850 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
849 | } | 851 | } |
850 | if ( QApplication::desktop()->width() <= 640 ) { | 852 | if ( QApplication::desktop()->width() <= 640 ) { |
851 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | 853 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); |
852 | mMainWindow->showMinimized(); | 854 | mMainWindow->showMinimized(); |
853 | if ( KABPrefs::instance()->mHideSearchOnSwitch ) { | 855 | if ( KABPrefs::instance()->mHideSearchOnSwitch ) { |
854 | if ( mIncSearchWidget ) { | 856 | if ( mIncSearchWidget ) { |
855 | mIncSearchWidget->setSize(); | 857 | mIncSearchWidget->setSize(); |
856 | } | 858 | } |
857 | } else { | 859 | } else { |
858 | mViewManager->getFilterAction()->setComboWidth( 0 ); | 860 | mViewManager->getFilterAction()->setComboWidth( 0 ); |
859 | } | 861 | } |
860 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | 862 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); |
861 | } | 863 | } |
862 | } | 864 | } |
863 | } | 865 | } |
866 | QWidget::resizeEvent( e ); | ||
864 | 867 | ||
865 | } | 868 | } |
866 | void KABCore::export2phone() | 869 | void KABCore::export2phone() |
867 | { | 870 | { |
868 | 871 | ||
869 | QStringList uids; | 872 | QStringList uids; |
870 | XXPortSelectDialog dlg( this, false, this ); | 873 | XXPortSelectDialog dlg( this, false, this ); |
871 | if ( dlg.exec() ) | 874 | if ( dlg.exec() ) |
872 | uids = dlg.uids(); | 875 | uids = dlg.uids(); |
873 | else | 876 | else |
874 | return; | 877 | return; |
875 | if ( uids.isEmpty() ) | 878 | if ( uids.isEmpty() ) |
876 | return; | 879 | return; |
877 | // qDebug("count %d ", uids.count()); | 880 | // qDebug("count %d ", uids.count()); |
878 | 881 | ||
879 | KAex2phonePrefs ex2phone; | 882 | KAex2phonePrefs ex2phone; |
880 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 883 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
881 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 884 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
882 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 885 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
883 | 886 | ||
884 | if ( !ex2phone.exec() ) { | 887 | if ( !ex2phone.exec() ) { |
885 | return; | 888 | return; |
886 | } | 889 | } |
887 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 890 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
888 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 891 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
889 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 892 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
890 | 893 | ||
891 | 894 | ||
892 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 895 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
893 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 896 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
894 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 897 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
895 | 898 | ||
896 | QString fileName = getPhoneFile(); | 899 | QString fileName = getPhoneFile(); |
897 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) | 900 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) |
898 | return; | 901 | return; |
899 | 902 | ||
900 | message(i18n("Exporting to phone...")); | 903 | message(i18n("Exporting to phone...")); |
901 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); | 904 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); |
902 | 905 | ||
903 | } | 906 | } |
904 | QString KABCore::getPhoneFile() | 907 | QString KABCore::getPhoneFile() |
905 | { | 908 | { |
906 | #ifdef DESKTOP_VERSION | 909 | #ifdef DESKTOP_VERSION |
907 | return locateLocal("tmp", "phonefile.vcf"); | 910 | return locateLocal("tmp", "phonefile.vcf"); |
908 | #else | 911 | #else |
909 | return "/tmp/phonefile.vcf"; | 912 | return "/tmp/phonefile.vcf"; |
910 | #endif | 913 | #endif |
911 | 914 | ||
912 | } | 915 | } |
913 | void KABCore::writeToPhone( ) | 916 | void KABCore::writeToPhone( ) |
914 | { | 917 | { |
915 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) | 918 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) |
916 | message(i18n("Export to phone finished!")); | 919 | message(i18n("Export to phone finished!")); |
917 | else | 920 | else |
918 | qDebug(i18n("KA: Error exporting to phone")); | 921 | qDebug(i18n("KA: Error exporting to phone")); |
919 | } | 922 | } |
920 | void KABCore::beamVCard() | 923 | void KABCore::beamVCard() |
921 | { | 924 | { |
922 | QStringList uids; | 925 | QStringList uids; |
923 | XXPortSelectDialog dlg( this, false, this ); | 926 | XXPortSelectDialog dlg( this, false, this ); |
924 | if ( dlg.exec() ) | 927 | if ( dlg.exec() ) |
925 | uids = dlg.uids(); | 928 | uids = dlg.uids(); |
926 | else | 929 | else |
927 | return; | 930 | return; |
928 | if ( uids.isEmpty() ) | 931 | if ( uids.isEmpty() ) |
929 | return; | 932 | return; |
930 | beamVCard( uids ); | 933 | beamVCard( uids ); |
931 | } | 934 | } |
932 | 935 | ||
933 | 936 | ||
934 | void KABCore::beamVCard(const QStringList& uids) | 937 | void KABCore::beamVCard(const QStringList& uids) |
935 | { | 938 | { |
936 | 939 | ||
937 | // LR: we should use the /tmp dir on the Zaurus, | 940 | // LR: we should use the /tmp dir on the Zaurus, |
938 | // because: /tmp = RAM, (HOME)/kdepim = flash memory | 941 | // because: /tmp = RAM, (HOME)/kdepim = flash memory |
939 | 942 | ||
940 | #ifdef DESKTOP_VERSION | 943 | #ifdef DESKTOP_VERSION |
941 | QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); | 944 | QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); |
942 | #else | 945 | #else |
943 | QString fileName = "/tmp/kapibeamfile.vcf"; | 946 | QString fileName = "/tmp/kapibeamfile.vcf"; |
944 | #endif | 947 | #endif |
945 | 948 | ||
946 | KABC::VCardConverter converter; | 949 | KABC::VCardConverter converter; |
947 | QString description; | 950 | QString description; |
948 | QString datastream; | 951 | QString datastream; |
949 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 952 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
950 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 953 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
951 | 954 | ||
952 | if ( a.isEmpty() ) | 955 | if ( a.isEmpty() ) |
953 | continue; | 956 | continue; |
954 | 957 | ||
955 | if (description.isEmpty()) | 958 | if (description.isEmpty()) |
956 | description = a.formattedName(); | 959 | description = a.formattedName(); |
957 | 960 | ||
958 | QString vcard; | 961 | QString vcard; |
959 | converter.addresseeToVCard( a, vcard ); | 962 | converter.addresseeToVCard( a, vcard ); |
960 | int start = 0; | 963 | int start = 0; |
961 | int next; | 964 | int next; |
962 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { | 965 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { |
963 | int semi = vcard.find(";", next); | 966 | int semi = vcard.find(";", next); |
964 | int dopp = vcard.find(":", next); | 967 | int dopp = vcard.find(":", next); |
965 | int sep; | 968 | int sep; |
966 | if ( semi < dopp && semi >= 0 ) | 969 | if ( semi < dopp && semi >= 0 ) |
967 | sep = semi ; | 970 | sep = semi ; |
968 | else | 971 | else |
969 | sep = dopp; | 972 | sep = dopp; |
970 | datastream +=vcard.mid( start, next - start); | 973 | datastream +=vcard.mid( start, next - start); |
971 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); | 974 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); |
972 | start = sep; | 975 | start = sep; |
973 | } | 976 | } |
974 | datastream += vcard.mid( start,vcard.length() ); | 977 | datastream += vcard.mid( start,vcard.length() ); |
975 | } | 978 | } |
976 | #ifndef DESKTOP_VERSION | 979 | #ifndef DESKTOP_VERSION |
977 | QFile outFile(fileName); | 980 | QFile outFile(fileName); |
978 | if ( outFile.open(IO_WriteOnly) ) { | 981 | if ( outFile.open(IO_WriteOnly) ) { |
979 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); | 982 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); |
980 | QTextStream t( &outFile ); // use a text stream | 983 | QTextStream t( &outFile ); // use a text stream |
981 | //t.setEncoding( QTextStream::UnicodeUTF8 ); | 984 | //t.setEncoding( QTextStream::UnicodeUTF8 ); |
982 | t.setEncoding( QTextStream::Latin1 ); | 985 | t.setEncoding( QTextStream::Latin1 ); |
983 | t <<datastream.latin1(); | 986 | t <<datastream.latin1(); |
984 | outFile.close(); | 987 | outFile.close(); |
985 | Ir *ir = new Ir( this ); | 988 | Ir *ir = new Ir( this ); |
986 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); | 989 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); |
987 | ir->send( fileName, description, "text/x-vCard" ); | 990 | ir->send( fileName, description, "text/x-vCard" ); |
988 | } else { | 991 | } else { |
989 | qDebug("KA: Error open temp beam file "); | 992 | qDebug("KA: Error open temp beam file "); |
990 | return; | 993 | return; |
991 | } | 994 | } |
992 | #endif | 995 | #endif |
993 | 996 | ||
994 | } | 997 | } |
995 | 998 | ||
996 | void KABCore::beamDone( Ir *ir ) | 999 | void KABCore::beamDone( Ir *ir ) |
997 | { | 1000 | { |
998 | #ifndef DESKTOP_VERSION | 1001 | #ifndef DESKTOP_VERSION |
999 | delete ir; | 1002 | delete ir; |
1000 | #endif | 1003 | #endif |
1001 | topLevelWidget()->raise(); | 1004 | topLevelWidget()->raise(); |
1002 | message( i18n("Beaming finished!") ); | 1005 | message( i18n("Beaming finished!") ); |
1003 | } | 1006 | } |
1004 | 1007 | ||
1005 | 1008 | ||
1006 | void KABCore::browse( const QString& url ) | 1009 | void KABCore::browse( const QString& url ) |
1007 | { | 1010 | { |
1008 | #ifndef KAB_EMBEDDED | 1011 | #ifndef KAB_EMBEDDED |
1009 | kapp->invokeBrowser( url ); | 1012 | kapp->invokeBrowser( url ); |
1010 | #else //KAB_EMBEDDED | 1013 | #else //KAB_EMBEDDED |
1011 | qDebug("KABCore::browse must be fixed"); | 1014 | qDebug("KABCore::browse must be fixed"); |
1012 | #endif //KAB_EMBEDDED | 1015 | #endif //KAB_EMBEDDED |
1013 | } | 1016 | } |
1014 | 1017 | ||
1015 | void KABCore::selectAllContacts() | 1018 | void KABCore::selectAllContacts() |
1016 | { | 1019 | { |
1017 | mViewManager->setSelected( QString::null, true ); | 1020 | mViewManager->setSelected( QString::null, true ); |
1018 | } | 1021 | } |
1019 | 1022 | ||
1020 | void KABCore::deleteContacts() | 1023 | void KABCore::deleteContacts() |
1021 | { | 1024 | { |
1022 | QStringList uidList = mViewManager->selectedUids(); | 1025 | QStringList uidList = mViewManager->selectedUids(); |
1023 | deleteContacts( uidList ); | 1026 | deleteContacts( uidList ); |
1024 | } | 1027 | } |
1025 | 1028 | ||
1026 | void KABCore::deleteContacts( const QStringList &uids ) | 1029 | void KABCore::deleteContacts( const QStringList &uids ) |
1027 | { | 1030 | { |
1028 | if ( uids.count() > 0 ) { | 1031 | if ( uids.count() > 0 ) { |
1029 | PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); | 1032 | PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); |
1030 | UndoStack::instance()->push( command ); | 1033 | UndoStack::instance()->push( command ); |
1031 | RedoStack::instance()->clear(); | 1034 | RedoStack::instance()->clear(); |
1032 | 1035 | ||
1033 | // now if we deleted anything, refresh | 1036 | // now if we deleted anything, refresh |
1034 | setContactSelected( QString::null ); | 1037 | setContactSelected( QString::null ); |
1035 | setModified( true ); | 1038 | setModified( true ); |
1036 | } | 1039 | } |
1037 | } | 1040 | } |
1038 | 1041 | ||
1039 | void KABCore::copyContacts() | 1042 | void KABCore::copyContacts() |
1040 | { | 1043 | { |
1041 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); | 1044 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); |
1042 | 1045 | ||
1043 | QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); | 1046 | QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); |
1044 | 1047 | ||
1045 | kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; | 1048 | kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; |
1046 | 1049 | ||
1047 | QClipboard *cb = QApplication::clipboard(); | 1050 | QClipboard *cb = QApplication::clipboard(); |
1048 | cb->setText( clipText ); | 1051 | cb->setText( clipText ); |
1049 | } | 1052 | } |
1050 | 1053 | ||
1051 | void KABCore::cutContacts() | 1054 | void KABCore::cutContacts() |
1052 | { | 1055 | { |
1053 | QStringList uidList = mViewManager->selectedUids(); | 1056 | QStringList uidList = mViewManager->selectedUids(); |
1054 | 1057 | ||
1055 | //US if ( uidList.size() > 0 ) { | 1058 | //US if ( uidList.size() > 0 ) { |
@@ -2316,414 +2319,435 @@ void KABCore::showLicence() | |||
2316 | KApplication::showLicence(); | 2319 | KApplication::showLicence(); |
2317 | } | 2320 | } |
2318 | 2321 | ||
2319 | void KABCore::manageCategories( ) | 2322 | void KABCore::manageCategories( ) |
2320 | { | 2323 | { |
2321 | KABCatPrefs* cp = new KABCatPrefs(); | 2324 | KABCatPrefs* cp = new KABCatPrefs(); |
2322 | cp->show(); | 2325 | cp->show(); |
2323 | int w =cp->sizeHint().width() ; | 2326 | int w =cp->sizeHint().width() ; |
2324 | int h = cp->sizeHint().height() ; | 2327 | int h = cp->sizeHint().height() ; |
2325 | int dw = QApplication::desktop()->width(); | 2328 | int dw = QApplication::desktop()->width(); |
2326 | int dh = QApplication::desktop()->height(); | 2329 | int dh = QApplication::desktop()->height(); |
2327 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2330 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2328 | if ( !cp->exec() ) { | 2331 | if ( !cp->exec() ) { |
2329 | delete cp; | 2332 | delete cp; |
2330 | return; | 2333 | return; |
2331 | } | 2334 | } |
2332 | int count = 0; | 2335 | int count = 0; |
2333 | int cc = 0; | 2336 | int cc = 0; |
2334 | message( i18n("Please wait, processing categories...")); | 2337 | message( i18n("Please wait, processing categories...")); |
2335 | if ( cp->addCat() ) { | 2338 | if ( cp->addCat() ) { |
2336 | KABC::AddressBook::Iterator it; | 2339 | KABC::AddressBook::Iterator it; |
2337 | QStringList catList = KABPrefs::instance()->mCustomCategories; | 2340 | QStringList catList = KABPrefs::instance()->mCustomCategories; |
2338 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2341 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2339 | ++cc; | 2342 | ++cc; |
2340 | if ( cc %10 == 0) | 2343 | if ( cc %10 == 0) |
2341 | message(i18n("Processing contact #%1").arg(cc)); | 2344 | message(i18n("Processing contact #%1").arg(cc)); |
2342 | QStringList catIncList = (*it).categories(); | 2345 | QStringList catIncList = (*it).categories(); |
2343 | int i; | 2346 | int i; |
2344 | for( i = 0; i< catIncList.count(); ++i ) { | 2347 | for( i = 0; i< catIncList.count(); ++i ) { |
2345 | if ( !catList.contains (catIncList[i])) { | 2348 | if ( !catList.contains (catIncList[i])) { |
2346 | catList.append( catIncList[i] ); | 2349 | catList.append( catIncList[i] ); |
2347 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2350 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2348 | ++count; | 2351 | ++count; |
2349 | } | 2352 | } |
2350 | } | 2353 | } |
2351 | } | 2354 | } |
2352 | catList.sort(); | 2355 | catList.sort(); |
2353 | KABPrefs::instance()->mCustomCategories = catList; | 2356 | KABPrefs::instance()->mCustomCategories = catList; |
2354 | KABPrefs::instance()->writeConfig(); | 2357 | KABPrefs::instance()->writeConfig(); |
2355 | message(QString::number( count )+ i18n(" categories added to list! ")); | 2358 | message(QString::number( count )+ i18n(" categories added to list! ")); |
2356 | } else { | 2359 | } else { |
2357 | QStringList catList = KABPrefs::instance()->mCustomCategories; | 2360 | QStringList catList = KABPrefs::instance()->mCustomCategories; |
2358 | QStringList catIncList; | 2361 | QStringList catIncList; |
2359 | QStringList newCatList; | 2362 | QStringList newCatList; |
2360 | KABC::AddressBook::Iterator it; | 2363 | KABC::AddressBook::Iterator it; |
2361 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2364 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2362 | ++cc; | 2365 | ++cc; |
2363 | if ( cc %10 == 0) | 2366 | if ( cc %10 == 0) |
2364 | message(i18n("Processing contact #%1").arg(cc)); | 2367 | message(i18n("Processing contact #%1").arg(cc)); |
2365 | QStringList catIncList = (*it).categories(); | 2368 | QStringList catIncList = (*it).categories(); |
2366 | int i; | 2369 | int i; |
2367 | if ( catIncList.count() ) { | 2370 | if ( catIncList.count() ) { |
2368 | newCatList.clear(); | 2371 | newCatList.clear(); |
2369 | for( i = 0; i< catIncList.count(); ++i ) { | 2372 | for( i = 0; i< catIncList.count(); ++i ) { |
2370 | if ( catList.contains (catIncList[i])) { | 2373 | if ( catList.contains (catIncList[i])) { |
2371 | newCatList.append( catIncList[i] ); | 2374 | newCatList.append( catIncList[i] ); |
2372 | } | 2375 | } |
2373 | } | 2376 | } |
2374 | newCatList.sort(); | 2377 | newCatList.sort(); |
2375 | (*it).setCategories( newCatList ); | 2378 | (*it).setCategories( newCatList ); |
2376 | mAddressBook->insertAddressee( (*it) ); | 2379 | mAddressBook->insertAddressee( (*it) ); |
2377 | } | 2380 | } |
2378 | } | 2381 | } |
2379 | setModified( true ); | 2382 | setModified( true ); |
2380 | mViewManager->refreshView(); | 2383 | mViewManager->refreshView(); |
2381 | message( i18n("Removing categories done!")); | 2384 | message( i18n("Removing categories done!")); |
2382 | } | 2385 | } |
2383 | delete cp; | 2386 | delete cp; |
2384 | } | 2387 | } |
2385 | void KABCore::removeVoice() | 2388 | void KABCore::removeVoice() |
2386 | { | 2389 | { |
2387 | 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 ) | 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 ) |
2388 | return; | 2391 | return; |
2389 | XXPortSelectDialog dlg( this, false, this ); | 2392 | XXPortSelectDialog dlg( this, false, this ); |
2390 | if ( !dlg.exec() ) | 2393 | if ( !dlg.exec() ) |
2391 | return; | 2394 | return; |
2392 | mAddressBook->setUntagged(); | 2395 | mAddressBook->setUntagged(); |
2393 | dlg.tagSelected(); | 2396 | dlg.tagSelected(); |
2394 | message(i18n("Removing voice..."), false ); | 2397 | message(i18n("Removing voice..."), false ); |
2395 | KABC::AddressBook::Iterator it; | 2398 | KABC::AddressBook::Iterator it; |
2396 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2399 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2397 | if ( (*it).tagged() ) { | 2400 | if ( (*it).tagged() ) { |
2398 | (*it).removeVoice(); | 2401 | (*it).removeVoice(); |
2399 | } | 2402 | } |
2400 | } | 2403 | } |
2401 | message(i18n("Refreshing view...") ); | 2404 | message(i18n("Refreshing view...") ); |
2402 | qApp->processEvents(); | 2405 | qApp->processEvents(); |
2403 | mViewManager->refreshView( "" ); | 2406 | mViewManager->refreshView( "" ); |
2404 | Addressee add; | 2407 | Addressee add; |
2405 | mDetails->setAddressee( add ); | 2408 | mDetails->setAddressee( add ); |
2406 | message(i18n("Remove voice completed!") ); | 2409 | message(i18n("Remove voice completed!") ); |
2407 | 2410 | ||
2408 | 2411 | ||
2409 | 2412 | ||
2410 | } | 2413 | } |
2411 | 2414 | ||
2412 | void KABCore::setFormattedName() | 2415 | void KABCore::setFormattedName() |
2413 | { | 2416 | { |
2414 | KABFormatPrefs setpref; | 2417 | KABFormatPrefs setpref; |
2415 | if ( !setpref.exec() ) { | 2418 | if ( !setpref.exec() ) { |
2416 | return; | 2419 | return; |
2417 | } | 2420 | } |
2418 | XXPortSelectDialog dlg( this, false, this ); | 2421 | XXPortSelectDialog dlg( this, false, this ); |
2419 | if ( !dlg.exec() ) | 2422 | if ( !dlg.exec() ) |
2420 | return; | 2423 | return; |
2421 | mAddressBook->setUntagged(); | 2424 | mAddressBook->setUntagged(); |
2422 | dlg.tagSelected(); | 2425 | dlg.tagSelected(); |
2423 | int count = 0; | 2426 | int count = 0; |
2424 | KABC::AddressBook::Iterator it; | 2427 | KABC::AddressBook::Iterator it; |
2425 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2428 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2426 | if ( (*it).tagged() ) { | 2429 | if ( (*it).tagged() ) { |
2427 | ++count; | 2430 | ++count; |
2428 | if ( count %10 == 0 ) | 2431 | if ( count %10 == 0 ) |
2429 | message(i18n("Changing contact #%1").arg( count ) ); | 2432 | message(i18n("Changing contact #%1").arg( count ) ); |
2430 | qApp->processEvents(); | 2433 | qApp->processEvents(); |
2431 | QString fName; | 2434 | QString fName; |
2432 | if ( setpref.simple->isChecked() ) | 2435 | if ( setpref.simple->isChecked() ) |
2433 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); | 2436 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); |
2434 | else if ( setpref.full->isChecked() ) | 2437 | else if ( setpref.full->isChecked() ) |
2435 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); | 2438 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); |
2436 | else if ( setpref.reverse->isChecked() ) | 2439 | else if ( setpref.reverse->isChecked() ) |
2437 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); | 2440 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::ReverseName ); |
2438 | else | 2441 | else |
2439 | fName = (*it).organization(); | 2442 | fName = (*it).organization(); |
2440 | if ( setpref.setCompany->isChecked() ) | 2443 | if ( setpref.setCompany->isChecked() ) |
2441 | if ( fName.isEmpty() || fName =="," ) | 2444 | if ( fName.isEmpty() || fName =="," ) |
2442 | fName = (*it).organization(); | 2445 | fName = (*it).organization(); |
2443 | (*it).setFormattedName( fName ); | 2446 | (*it).setFormattedName( fName ); |
2444 | } | 2447 | } |
2445 | } | 2448 | } |
2446 | message(i18n("Refreshing view...") ); | 2449 | message(i18n("Refreshing view...") ); |
2447 | qApp->processEvents(); | 2450 | qApp->processEvents(); |
2448 | mViewManager->refreshView( "" ); | 2451 | mViewManager->refreshView( "" ); |
2449 | Addressee add; | 2452 | Addressee add; |
2450 | mDetails->setAddressee( add ); | 2453 | mDetails->setAddressee( add ); |
2451 | message(i18n("Setting formatted name completed!") ); | 2454 | message(i18n("Setting formatted name completed!") ); |
2452 | } | 2455 | } |
2453 | 2456 | ||
2454 | void KABCore::clipboardDataChanged() | 2457 | void KABCore::clipboardDataChanged() |
2455 | { | 2458 | { |
2456 | 2459 | ||
2457 | if ( mReadWrite ) | 2460 | if ( mReadWrite ) |
2458 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 2461 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
2459 | 2462 | ||
2460 | } | 2463 | } |
2461 | 2464 | ||
2462 | void KABCore::updateActionMenu() | 2465 | void KABCore::updateActionMenu() |
2463 | { | 2466 | { |
2464 | UndoStack *undo = UndoStack::instance(); | 2467 | UndoStack *undo = UndoStack::instance(); |
2465 | RedoStack *redo = RedoStack::instance(); | 2468 | RedoStack *redo = RedoStack::instance(); |
2466 | 2469 | ||
2467 | if ( undo->isEmpty() ) | 2470 | if ( undo->isEmpty() ) |
2468 | mActionUndo->setText( i18n( "Undo" ) ); | 2471 | mActionUndo->setText( i18n( "Undo" ) ); |
2469 | else | 2472 | else |
2470 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); | 2473 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); |
2471 | 2474 | ||
2472 | mActionUndo->setEnabled( !undo->isEmpty() ); | 2475 | mActionUndo->setEnabled( !undo->isEmpty() ); |
2473 | 2476 | ||
2474 | if ( !redo->top() ) | 2477 | if ( !redo->top() ) |
2475 | mActionRedo->setText( i18n( "Redo" ) ); | 2478 | mActionRedo->setText( i18n( "Redo" ) ); |
2476 | else | 2479 | else |
2477 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); | 2480 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); |
2478 | 2481 | ||
2479 | mActionRedo->setEnabled( !redo->isEmpty() ); | 2482 | mActionRedo->setEnabled( !redo->isEmpty() ); |
2480 | } | 2483 | } |
2481 | 2484 | ||
2482 | void KABCore::configureKeyBindings() | 2485 | void KABCore::configureKeyBindings() |
2483 | { | 2486 | { |
2484 | #ifndef KAB_EMBEDDED | 2487 | #ifndef KAB_EMBEDDED |
2485 | KKeyDialog::configure( actionCollection(), true ); | 2488 | KKeyDialog::configure( actionCollection(), true ); |
2486 | #else //KAB_EMBEDDED | 2489 | #else //KAB_EMBEDDED |
2487 | qDebug("KABCore::configureKeyBindings() not implemented"); | 2490 | qDebug("KABCore::configureKeyBindings() not implemented"); |
2488 | #endif //KAB_EMBEDDED | 2491 | #endif //KAB_EMBEDDED |
2489 | } | 2492 | } |
2490 | 2493 | ||
2491 | #ifdef KAB_EMBEDDED | 2494 | #ifdef KAB_EMBEDDED |
2492 | void KABCore::configureResources() | 2495 | void KABCore::configureResources() |
2493 | { | 2496 | { |
2494 | KRES::KCMKResources dlg( this, "" , 0 ); | 2497 | KRES::KCMKResources dlg( this, "" , 0 ); |
2495 | 2498 | ||
2496 | if ( !dlg.exec() ) | 2499 | if ( !dlg.exec() ) |
2497 | return; | 2500 | return; |
2498 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 2501 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
2499 | } | 2502 | } |
2500 | #endif //KAB_EMBEDDED | 2503 | #endif //KAB_EMBEDDED |
2501 | 2504 | ||
2502 | 2505 | ||
2503 | /* this method will be called through the QCop interface from Ko/Pi to select addresses | 2506 | /* this method will be called through the QCop interface from Ko/Pi to select addresses |
2504 | * for the attendees list of an event. | 2507 | * for the attendees list of an event. |
2505 | */ | 2508 | */ |
2506 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) | 2509 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) |
2507 | { | 2510 | { |
2508 | QStringList nameList; | 2511 | |
2509 | QStringList emailList; | ||
2510 | QStringList uidList; | ||
2511 | bool ok = false; | 2512 | bool ok = false; |
2513 | mEmailSourceChannel = sourceChannel; | ||
2512 | int wid = uid.toInt( &ok ); | 2514 | int wid = uid.toInt( &ok ); |
2515 | qDebug("UID %s ", uid.latin1()); | ||
2513 | if ( ok ) { | 2516 | if ( ok ) { |
2514 | if ( wid != QApplication::desktop()->width() ) { | 2517 | if ( wid != QApplication::desktop()->width() ) { |
2515 | qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); | 2518 | qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); |
2516 | message( i18n("Resizing, please wait...") ); | 2519 | message( i18n("Resizing, please wait...") ); |
2517 | raise(); | 2520 | mMainWindow->showMinimized(); |
2518 | qApp->processEvents(); | 2521 | /* |
2522 | { | ||
2523 | QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); | ||
2524 | } | ||
2525 | */ | ||
2526 | QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); | ||
2527 | return; | ||
2519 | } | 2528 | } |
2520 | 2529 | ||
2521 | } else { | 2530 | } else { |
2522 | qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); | 2531 | qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); |
2523 | } | 2532 | } |
2533 | callContactdialog(); | ||
2534 | //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); | ||
2535 | |||
2536 | } | ||
2537 | void KABCore::resizeAndCallContactdialog() | ||
2538 | { | ||
2539 | updateMainWindow(); | ||
2540 | QTimer::singleShot( 100,this, SLOT ( callContactdialog() ) ); | ||
2541 | } | ||
2524 | 2542 | ||
2543 | void KABCore::callContactdialog() | ||
2544 | { | ||
2545 | QStringList nameList; | ||
2546 | QStringList emailList; | ||
2547 | QStringList uidList; | ||
2548 | qDebug("WIDTH %d ", QApplication::desktop()->width() ); | ||
2525 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 2549 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
2526 | uint i=0; | 2550 | uint i=0; |
2527 | for (i=0; i < list.count(); i++) | 2551 | for (i=0; i < list.count(); i++) |
2528 | { | 2552 | { |
2529 | nameList.append(list[i].realName()); | 2553 | nameList.append(list[i].realName()); |
2530 | emailList.append(list[i].preferredEmail()); | 2554 | emailList.append(list[i].preferredEmail()); |
2531 | uidList.append(list[i].uid()); | 2555 | uidList.append(list[i].uid()); |
2532 | } | 2556 | } |
2557 | QString uid = "unnamed"; | ||
2533 | //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); | 2558 | //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); |
2534 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); | 2559 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); |
2535 | 2560 | ||
2536 | } | 2561 | } |
2537 | |||
2538 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays | 2562 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays |
2539 | * to put them into the calendar. | 2563 | * to put them into the calendar. |
2540 | */ | 2564 | */ |
2541 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) | 2565 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) |
2542 | { | 2566 | { |
2543 | // qDebug("KABCore::requestForBirthdayList"); | 2567 | // qDebug("KABCore::requestForBirthdayList"); |
2544 | QStringList birthdayList; | 2568 | QStringList birthdayList; |
2545 | QStringList anniversaryList; | 2569 | QStringList anniversaryList; |
2546 | QStringList realNameList; | 2570 | QStringList realNameList; |
2547 | QStringList preferredEmailList; | 2571 | QStringList preferredEmailList; |
2548 | QStringList assembledNameList; | 2572 | QStringList assembledNameList; |
2549 | QStringList uidList; | 2573 | QStringList uidList; |
2550 | 2574 | ||
2551 | KABC::AddressBook::Iterator it; | 2575 | KABC::AddressBook::Iterator it; |
2552 | 2576 | ||
2553 | int count = 0; | 2577 | int count = 0; |
2554 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2578 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2555 | ++count; | 2579 | ++count; |
2556 | } | 2580 | } |
2557 | QProgressBar bar(count,0 ); | 2581 | QProgressBar bar(count,0 ); |
2558 | int w = 300; | 2582 | int w = 300; |
2559 | if ( QApplication::desktop()->width() < 320 ) | 2583 | if ( QApplication::desktop()->width() < 320 ) |
2560 | w = 220; | 2584 | w = 220; |
2561 | int h = bar.sizeHint().height() ; | 2585 | int h = bar.sizeHint().height() ; |
2562 | int dw = QApplication::desktop()->width(); | 2586 | int dw = QApplication::desktop()->width(); |
2563 | int dh = QApplication::desktop()->height(); | 2587 | int dh = QApplication::desktop()->height(); |
2564 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2588 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2565 | bar.show(); | 2589 | bar.show(); |
2566 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); | 2590 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); |
2567 | qApp->processEvents(); | 2591 | qApp->processEvents(); |
2568 | 2592 | ||
2569 | QDate bday; | 2593 | QDate bday; |
2570 | QString anni; | 2594 | QString anni; |
2571 | QString formattedbday; | 2595 | QString formattedbday; |
2572 | 2596 | ||
2573 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) | 2597 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) |
2574 | { | 2598 | { |
2575 | if ( ! bar.isVisible() ) | 2599 | if ( ! bar.isVisible() ) |
2576 | return; | 2600 | return; |
2577 | bar.setProgress( count++ ); | 2601 | bar.setProgress( count++ ); |
2578 | qApp->processEvents(); | 2602 | qApp->processEvents(); |
2579 | bday = (*it).birthday().date(); | 2603 | bday = (*it).birthday().date(); |
2580 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); | 2604 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); |
2581 | 2605 | ||
2582 | if ( bday.isValid() || !anni.isEmpty()) | 2606 | if ( bday.isValid() || !anni.isEmpty()) |
2583 | { | 2607 | { |
2584 | if (bday.isValid()) | 2608 | if (bday.isValid()) |
2585 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); | 2609 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); |
2586 | else | 2610 | else |
2587 | formattedbday = "NOTVALID"; | 2611 | formattedbday = "NOTVALID"; |
2588 | if (anni.isEmpty()) | 2612 | if (anni.isEmpty()) |
2589 | anni = "INVALID"; | 2613 | anni = "INVALID"; |
2590 | 2614 | ||
2591 | birthdayList.append(formattedbday); | 2615 | birthdayList.append(formattedbday); |
2592 | anniversaryList.append(anni); //should be ISODate | 2616 | anniversaryList.append(anni); //should be ISODate |
2593 | realNameList.append((*it).realName()); | 2617 | realNameList.append((*it).realName()); |
2594 | preferredEmailList.append((*it).preferredEmail()); | 2618 | preferredEmailList.append((*it).preferredEmail()); |
2595 | assembledNameList.append((*it).assembledName()); | 2619 | assembledNameList.append((*it).assembledName()); |
2596 | uidList.append((*it).uid()); | 2620 | uidList.append((*it).uid()); |
2597 | 2621 | ||
2598 | //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() ); | 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() ); |
2599 | } | 2623 | } |
2600 | } | 2624 | } |
2601 | 2625 | ||
2602 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); | 2626 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); |
2603 | 2627 | ||
2604 | } | 2628 | } |
2605 | 2629 | ||
2606 | /* this method will be called through the QCop interface from other apps to show details of a contact. | 2630 | /* this method will be called through the QCop interface from other apps to show details of a contact. |
2607 | */ | 2631 | */ |
2608 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) | 2632 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) |
2609 | { | 2633 | { |
2610 | //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); | 2634 | //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); |
2611 | 2635 | ||
2612 | QString foundUid = QString::null; | 2636 | QString foundUid = QString::null; |
2613 | if ( ! uid.isEmpty() ) { | 2637 | if ( ! uid.isEmpty() ) { |
2614 | Addressee adrr = mAddressBook->findByUid( uid ); | 2638 | Addressee adrr = mAddressBook->findByUid( uid ); |
2615 | if ( !adrr.isEmpty() ) { | 2639 | if ( !adrr.isEmpty() ) { |
2616 | foundUid = uid; | 2640 | foundUid = uid; |
2617 | } | 2641 | } |
2618 | if ( email == "sendbacklist" ) { | 2642 | if ( email == "sendbacklist" ) { |
2619 | //qDebug("ssssssssssssssssssssssend "); | 2643 | //qDebug("ssssssssssssssssssssssend "); |
2620 | QStringList nameList; | 2644 | QStringList nameList; |
2621 | QStringList emailList; | 2645 | QStringList emailList; |
2622 | QStringList uidList; | 2646 | QStringList uidList; |
2623 | nameList.append(adrr.realName()); | 2647 | nameList.append(adrr.realName()); |
2624 | emailList = adrr.emails(); | 2648 | emailList = adrr.emails(); |
2625 | uidList.append( adrr.preferredEmail()); | 2649 | uidList.append( adrr.preferredEmail()); |
2626 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); | 2650 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); |
2627 | return; | 2651 | return; |
2628 | } | 2652 | } |
2629 | 2653 | ||
2630 | } | 2654 | } |
2631 | 2655 | ||
2632 | if ( email == "sendbacklist" ) | 2656 | if ( email == "sendbacklist" ) |
2633 | return; | 2657 | return; |
2634 | if (foundUid.isEmpty()) | 2658 | if (foundUid.isEmpty()) |
2635 | { | 2659 | { |
2636 | //find the uid of the person first | 2660 | //find the uid of the person first |
2637 | Addressee::List namelist; | 2661 | Addressee::List namelist; |
2638 | Addressee::List emaillist; | 2662 | Addressee::List emaillist; |
2639 | 2663 | ||
2640 | if (!name.isEmpty()) | 2664 | if (!name.isEmpty()) |
2641 | namelist = mAddressBook->findByName( name ); | 2665 | namelist = mAddressBook->findByName( name ); |
2642 | 2666 | ||
2643 | if (!email.isEmpty()) | 2667 | if (!email.isEmpty()) |
2644 | emaillist = mAddressBook->findByEmail( email ); | 2668 | emaillist = mAddressBook->findByEmail( email ); |
2645 | //qDebug("count %d %d ", namelist.count(),emaillist.count() ); | 2669 | //qDebug("count %d %d ", namelist.count(),emaillist.count() ); |
2646 | //check if we have a match in Namelist and Emaillist | 2670 | //check if we have a match in Namelist and Emaillist |
2647 | if ((namelist.count() == 0) && (emaillist.count() > 0)) { | 2671 | if ((namelist.count() == 0) && (emaillist.count() > 0)) { |
2648 | foundUid = emaillist[0].uid(); | 2672 | foundUid = emaillist[0].uid(); |
2649 | } | 2673 | } |
2650 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) | 2674 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) |
2651 | foundUid = namelist[0].uid(); | 2675 | foundUid = namelist[0].uid(); |
2652 | else | 2676 | else |
2653 | { | 2677 | { |
2654 | for (int i = 0; i < namelist.count(); i++) | 2678 | for (int i = 0; i < namelist.count(); i++) |
2655 | { | 2679 | { |
2656 | for (int j = 0; j < emaillist.count(); j++) | 2680 | for (int j = 0; j < emaillist.count(); j++) |
2657 | { | 2681 | { |
2658 | if (namelist[i] == emaillist[j]) | 2682 | if (namelist[i] == emaillist[j]) |
2659 | { | 2683 | { |
2660 | foundUid = namelist[i].uid(); | 2684 | foundUid = namelist[i].uid(); |
2661 | } | 2685 | } |
2662 | } | 2686 | } |
2663 | } | 2687 | } |
2664 | } | 2688 | } |
2665 | } | 2689 | } |
2666 | else | 2690 | else |
2667 | { | 2691 | { |
2668 | foundUid = uid; | 2692 | foundUid = uid; |
2669 | } | 2693 | } |
2670 | 2694 | ||
2671 | if (!foundUid.isEmpty()) | 2695 | if (!foundUid.isEmpty()) |
2672 | { | 2696 | { |
2673 | 2697 | ||
2674 | // raise Ka/Pi if it is in the background | 2698 | // raise Ka/Pi if it is in the background |
2675 | #ifndef DESKTOP_VERSION | 2699 | #ifndef DESKTOP_VERSION |
2676 | #ifndef KORG_NODCOP | 2700 | #ifndef KORG_NODCOP |
2677 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); | 2701 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); |
2678 | #endif | 2702 | #endif |
2679 | #endif | 2703 | #endif |
2680 | 2704 | ||
2681 | mMainWindow->showMaximized(); | 2705 | mMainWindow->showMaximized(); |
2682 | mMainWindow-> raise(); | 2706 | mMainWindow-> raise(); |
2683 | 2707 | ||
2684 | mViewManager->setSelected( "", false); | 2708 | mViewManager->setSelected( "", false); |
2685 | mViewManager->refreshView( "" ); | 2709 | mViewManager->refreshView( "" ); |
2686 | mViewManager->setSelected( foundUid, true ); | 2710 | mViewManager->setSelected( foundUid, true ); |
2687 | mViewManager->refreshView( foundUid ); | 2711 | mViewManager->refreshView( foundUid ); |
2688 | 2712 | ||
2689 | if ( !mMultipleViewsAtOnce ) | 2713 | if ( !mMultipleViewsAtOnce ) |
2690 | { | 2714 | { |
2691 | setDetailsVisible( true ); | 2715 | setDetailsVisible( true ); |
2692 | mActionDetails->setChecked(true); | 2716 | mActionDetails->setChecked(true); |
2693 | } | 2717 | } |
2694 | } | 2718 | } |
2695 | } | 2719 | } |
2696 | 2720 | ||
2697 | void KABCore::whatsnew() | 2721 | void KABCore::whatsnew() |
2698 | { | 2722 | { |
2699 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 2723 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
2700 | } | 2724 | } |
2701 | void KABCore::synchowto() | 2725 | void KABCore::synchowto() |
2702 | { | 2726 | { |
2703 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 2727 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
2704 | } | 2728 | } |
2705 | void KABCore::kdesynchowto() | 2729 | void KABCore::kdesynchowto() |
2706 | { | 2730 | { |
2707 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 2731 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
2708 | } | 2732 | } |
2709 | void KABCore::multisynchowto() | 2733 | void KABCore::multisynchowto() |
2710 | { | 2734 | { |
2711 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 2735 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
2712 | } | 2736 | } |
2713 | void KABCore::faq() | 2737 | void KABCore::faq() |
2714 | { | 2738 | { |
2715 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); | 2739 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); |
2716 | } | 2740 | } |
2717 | 2741 | ||
2718 | #include <libkcal/syncdefines.h> | 2742 | #include <libkcal/syncdefines.h> |
2719 | 2743 | ||
2720 | KABC::Addressee KABCore::getLastSyncAddressee() | 2744 | KABC::Addressee KABCore::getLastSyncAddressee() |
2721 | { | 2745 | { |
2722 | Addressee lse; | 2746 | Addressee lse; |
2723 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2747 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2724 | 2748 | ||
2725 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); | 2749 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); |
2726 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2750 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2727 | if (lse.isEmpty()) { | 2751 | if (lse.isEmpty()) { |
2728 | qDebug("KA: Creating new last-syncAddressee "); | 2752 | qDebug("KA: Creating new last-syncAddressee "); |
2729 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2753 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index c185117..47ea152 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -179,342 +179,346 @@ class KABCore : public QWidget, public KSyncInterface | |||
179 | */ | 179 | */ |
180 | void beamMySelf(); | 180 | void beamMySelf(); |
181 | 181 | ||
182 | void beamVCard(); | 182 | void beamVCard(); |
183 | void export2phone(); | 183 | void export2phone(); |
184 | void beamVCard(const QStringList& uids); | 184 | void beamVCard(const QStringList& uids); |
185 | void beamDone( Ir *ir ); | 185 | void beamDone( Ir *ir ); |
186 | 186 | ||
187 | 187 | ||
188 | /** | 188 | /** |
189 | Starts the preferred web browser with the given URL as argument. | 189 | Starts the preferred web browser with the given URL as argument. |
190 | */ | 190 | */ |
191 | void browse( const QString& url ); | 191 | void browse( const QString& url ); |
192 | 192 | ||
193 | /** | 193 | /** |
194 | Select all contacts in the view. | 194 | Select all contacts in the view. |
195 | */ | 195 | */ |
196 | void selectAllContacts(); | 196 | void selectAllContacts(); |
197 | 197 | ||
198 | /** | 198 | /** |
199 | Deletes all selected contacts from the address book. | 199 | Deletes all selected contacts from the address book. |
200 | */ | 200 | */ |
201 | void deleteContacts(); | 201 | void deleteContacts(); |
202 | 202 | ||
203 | /** | 203 | /** |
204 | Deletes given contacts from the address book. | 204 | Deletes given contacts from the address book. |
205 | 205 | ||
206 | @param uids The uids of the contacts, which shall be deleted. | 206 | @param uids The uids of the contacts, which shall be deleted. |
207 | */ | 207 | */ |
208 | void deleteContacts( const QStringList &uids ); | 208 | void deleteContacts( const QStringList &uids ); |
209 | 209 | ||
210 | /** | 210 | /** |
211 | Copys the selected contacts into clipboard for later pasting. | 211 | Copys the selected contacts into clipboard for later pasting. |
212 | */ | 212 | */ |
213 | void copyContacts(); | 213 | void copyContacts(); |
214 | 214 | ||
215 | /** | 215 | /** |
216 | Cuts the selected contacts and stores them for later pasting. | 216 | Cuts the selected contacts and stores them for later pasting. |
217 | */ | 217 | */ |
218 | void cutContacts(); | 218 | void cutContacts(); |
219 | 219 | ||
220 | /** | 220 | /** |
221 | Paste contacts from clipboard into the address book. | 221 | Paste contacts from clipboard into the address book. |
222 | */ | 222 | */ |
223 | void pasteContacts(); | 223 | void pasteContacts(); |
224 | 224 | ||
225 | /** | 225 | /** |
226 | Paste given contacts into the address book. | 226 | Paste given contacts into the address book. |
227 | 227 | ||
228 | @param list The list of addressee, which shall be pasted. | 228 | @param list The list of addressee, which shall be pasted. |
229 | */ | 229 | */ |
230 | void pasteContacts( KABC::Addressee::List &list ); | 230 | void pasteContacts( KABC::Addressee::List &list ); |
231 | 231 | ||
232 | /** | 232 | /** |
233 | Sets the whoAmI contact, that is used by many other programs to | 233 | Sets the whoAmI contact, that is used by many other programs to |
234 | get personal information about the current user. | 234 | get personal information about the current user. |
235 | */ | 235 | */ |
236 | void setWhoAmI(); | 236 | void setWhoAmI(); |
237 | 237 | ||
238 | /** | 238 | /** |
239 | Displays the category dialog and applies the result to all | 239 | Displays the category dialog and applies the result to all |
240 | selected contacts. | 240 | selected contacts. |
241 | */ | 241 | */ |
242 | void setCategories(); | 242 | void setCategories(); |
243 | void manageCategories(); | 243 | void manageCategories(); |
244 | void editCategories(); | 244 | void editCategories(); |
245 | 245 | ||
246 | /** | 246 | /** |
247 | Sets the field list of the Incremental Search Widget. | 247 | Sets the field list of the Incremental Search Widget. |
248 | */ | 248 | */ |
249 | void setSearchFields( const KABC::Field::List &fields ); | 249 | void setSearchFields( const KABC::Field::List &fields ); |
250 | 250 | ||
251 | /** | 251 | /** |
252 | Search with the current search field for a contact, that matches | 252 | Search with the current search field for a contact, that matches |
253 | the given text, and selects it in the view. | 253 | the given text, and selects it in the view. |
254 | */ | 254 | */ |
255 | void incrementalSearch( const QString& text ); | 255 | void incrementalSearch( const QString& text ); |
256 | 256 | ||
257 | /** | 257 | /** |
258 | Marks the address book as modified. | 258 | Marks the address book as modified. |
259 | */ | 259 | */ |
260 | void setModified(); | 260 | void setModified(); |
261 | /** | 261 | /** |
262 | Marks the address book as modified without refreshing the view. | 262 | Marks the address book as modified without refreshing the view. |
263 | */ | 263 | */ |
264 | void setModifiedWOrefresh(); | 264 | void setModifiedWOrefresh(); |
265 | 265 | ||
266 | /** | 266 | /** |
267 | Marks the address book as modified concerning the argument. | 267 | Marks the address book as modified concerning the argument. |
268 | */ | 268 | */ |
269 | void setModified( bool modified ); | 269 | void setModified( bool modified ); |
270 | 270 | ||
271 | /** | 271 | /** |
272 | Returns whether the address book is modified. | 272 | Returns whether the address book is modified. |
273 | */ | 273 | */ |
274 | bool modified() const; | 274 | bool modified() const; |
275 | 275 | ||
276 | /** | 276 | /** |
277 | Called whenever an contact is modified in the contact editor | 277 | Called whenever an contact is modified in the contact editor |
278 | dialog or the quick edit. | 278 | dialog or the quick edit. |
279 | */ | 279 | */ |
280 | void contactModified( const KABC::Addressee &addr ); | 280 | void contactModified( const KABC::Addressee &addr ); |
281 | void addrModified( const KABC::Addressee &addr, bool updateDetails = true ); | 281 | void addrModified( const KABC::Addressee &addr, bool updateDetails = true ); |
282 | 282 | ||
283 | /** | 283 | /** |
284 | DCOP METHODS. | 284 | DCOP METHODS. |
285 | */ | 285 | */ |
286 | void addEmail( QString addr ); | 286 | void addEmail( QString addr ); |
287 | void importVCard( const KURL& url, bool showPreview ); | 287 | void importVCard( const KURL& url, bool showPreview ); |
288 | void importVCard( const QString& vCard, bool showPreview ); | 288 | void importVCard( const QString& vCard, bool showPreview ); |
289 | void newContact(); | 289 | void newContact(); |
290 | QString getNameByPhone( const QString& phone ); | 290 | QString getNameByPhone( const QString& phone ); |
291 | /** | 291 | /** |
292 | END DCOP METHODS | 292 | END DCOP METHODS |
293 | */ | 293 | */ |
294 | 294 | ||
295 | /** | 295 | /** |
296 | Saves the contents of the AddressBook back to disk. | 296 | Saves the contents of the AddressBook back to disk. |
297 | */ | 297 | */ |
298 | void save(); | 298 | void save(); |
299 | 299 | ||
300 | /** | 300 | /** |
301 | Undos the last command using the undo stack. | 301 | Undos the last command using the undo stack. |
302 | */ | 302 | */ |
303 | void undo(); | 303 | void undo(); |
304 | 304 | ||
305 | /** | 305 | /** |
306 | Redos the last command that was undone, using the redo stack. | 306 | Redos the last command that was undone, using the redo stack. |
307 | */ | 307 | */ |
308 | void redo(); | 308 | void redo(); |
309 | 309 | ||
310 | /** | 310 | /** |
311 | Shows the edit dialog for the given uid. If the uid is QString::null, | 311 | Shows the edit dialog for the given uid. If the uid is QString::null, |
312 | the method will try to find a selected addressee in the view. | 312 | the method will try to find a selected addressee in the view. |
313 | */ | 313 | */ |
314 | void editContact( const QString &uid /*US = QString::null*/ ); | 314 | void editContact( const QString &uid /*US = QString::null*/ ); |
315 | //US added a second method without defaultparameter | 315 | //US added a second method without defaultparameter |
316 | void editContact2(); | 316 | void editContact2(); |
317 | 317 | ||
318 | /** | 318 | /** |
319 | Shows or edits the detail view for the given uid. If the uid is QString::null, | 319 | Shows or edits the detail view for the given uid. If the uid is QString::null, |
320 | the method will try to find a selected addressee in the view. | 320 | the method will try to find a selected addressee in the view. |
321 | */ | 321 | */ |
322 | void executeContact( const QString &uid /*US = QString::null*/ ); | 322 | void executeContact( const QString &uid /*US = QString::null*/ ); |
323 | 323 | ||
324 | /** | 324 | /** |
325 | Launches the configuration dialog. | 325 | Launches the configuration dialog. |
326 | */ | 326 | */ |
327 | void openConfigDialog(); | 327 | void openConfigDialog(); |
328 | 328 | ||
329 | /** | 329 | /** |
330 | Launches the ldap search dialog. | 330 | Launches the ldap search dialog. |
331 | */ | 331 | */ |
332 | void openLDAPDialog(); | 332 | void openLDAPDialog(); |
333 | 333 | ||
334 | /** | 334 | /** |
335 | Creates a KAddressBookPrinter, which will display the print | 335 | Creates a KAddressBookPrinter, which will display the print |
336 | dialog and do the printing. | 336 | dialog and do the printing. |
337 | */ | 337 | */ |
338 | void print(); | 338 | void print(); |
339 | 339 | ||
340 | /** | 340 | /** |
341 | Registers a new GUI client, so plugins can register its actions. | 341 | Registers a new GUI client, so plugins can register its actions. |
342 | */ | 342 | */ |
343 | void addGUIClient( KXMLGUIClient *client ); | 343 | void addGUIClient( KXMLGUIClient *client ); |
344 | 344 | ||
345 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); | 345 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); |
346 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); | 346 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); |
347 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); | 347 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); |
348 | 348 | ||
349 | 349 | ||
350 | signals: | 350 | signals: |
351 | void contactSelected( const QString &name ); | 351 | void contactSelected( const QString &name ); |
352 | void contactSelected( const QPixmap &pixmap ); | 352 | void contactSelected( const QPixmap &pixmap ); |
353 | public slots: | 353 | public slots: |
354 | void recieve(QString cmsg ); | 354 | void recieve(QString cmsg ); |
355 | void getFile( bool success ); | 355 | void getFile( bool success ); |
356 | void syncFileRequest(); | 356 | void syncFileRequest(); |
357 | void setDetailsVisible( bool visible ); | 357 | void setDetailsVisible( bool visible ); |
358 | void setDetailsToState(); | 358 | void setDetailsToState(); |
359 | 359 | ||
360 | void saveSettings(); | 360 | void saveSettings(); |
361 | 361 | ||
362 | private slots: | 362 | private slots: |
363 | void updateToolBar(); | 363 | void updateToolBar(); |
364 | void updateMainWindow(); | 364 | void updateMainWindow(); |
365 | void receive( const QCString& cmsg, const QByteArray& data ); | 365 | void receive( const QCString& cmsg, const QByteArray& data ); |
366 | void toggleBeamReceive( ); | 366 | void toggleBeamReceive( ); |
367 | void disableBR(bool); | 367 | void disableBR(bool); |
368 | void setJumpButtonBarVisible( bool visible ); | 368 | void setJumpButtonBarVisible( bool visible ); |
369 | void setJumpButtonBar( bool visible ); | 369 | void setJumpButtonBar( bool visible ); |
370 | void setCaptionBack(); | 370 | void setCaptionBack(); |
371 | void resizeAndCallContactdialog(); | ||
372 | void callContactdialog(); | ||
373 | |||
371 | void importFromOL(); | 374 | void importFromOL(); |
372 | void extensionModified( const KABC::Addressee::List &list ); | 375 | void extensionModified( const KABC::Addressee::List &list ); |
373 | void extensionChanged( int id ); | 376 | void extensionChanged( int id ); |
374 | void clipboardDataChanged(); | 377 | void clipboardDataChanged(); |
375 | void updateActionMenu(); | 378 | void updateActionMenu(); |
376 | void configureKeyBindings(); | 379 | void configureKeyBindings(); |
377 | void removeVoice(); | 380 | void removeVoice(); |
378 | void setFormattedName(); | 381 | void setFormattedName(); |
379 | #ifdef KAB_EMBEDDED | 382 | #ifdef KAB_EMBEDDED |
380 | void configureResources(); | 383 | void configureResources(); |
381 | #endif //KAB_EMBEDDED | 384 | #endif //KAB_EMBEDDED |
382 | 385 | ||
383 | void slotEditorDestroyed( const QString &uid ); | 386 | void slotEditorDestroyed( const QString &uid ); |
384 | void configurationChanged(); | 387 | void configurationChanged(); |
385 | void addressBookChanged(); | 388 | void addressBookChanged(); |
386 | 389 | ||
387 | private: | 390 | private: |
391 | QString mEmailSourceChannel; | ||
388 | void resizeEvent(QResizeEvent* e ); | 392 | void resizeEvent(QResizeEvent* e ); |
389 | bool mBRdisabled; | 393 | bool mBRdisabled; |
390 | #ifndef DESKTOP_VERSION | 394 | #ifndef DESKTOP_VERSION |
391 | QCopChannel* infrared; | 395 | QCopChannel* infrared; |
392 | #endif | 396 | #endif |
393 | QTimer *mMessageTimer; | 397 | QTimer *mMessageTimer; |
394 | void initGUI(); | 398 | void initGUI(); |
395 | void initActions(); | 399 | void initActions(); |
396 | QString getPhoneFile(); | 400 | QString getPhoneFile(); |
397 | 401 | ||
398 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, | 402 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, |
399 | const char *name = 0 ); | 403 | const char *name = 0 ); |
400 | 404 | ||
401 | KXMLGUIClient *mGUIClient; | 405 | KXMLGUIClient *mGUIClient; |
402 | 406 | ||
403 | KABC::AddressBook *mAddressBook; | 407 | KABC::AddressBook *mAddressBook; |
404 | 408 | ||
405 | ViewManager *mViewManager; | 409 | ViewManager *mViewManager; |
406 | // QSplitter *mDetailsSplitter; | 410 | // QSplitter *mDetailsSplitter; |
407 | KDGanttMinimizeSplitter *mExtensionBarSplitter; | 411 | KDGanttMinimizeSplitter *mExtensionBarSplitter; |
408 | ViewContainer *mDetails; | 412 | ViewContainer *mDetails; |
409 | KDGanttMinimizeSplitter* mMiniSplitter; | 413 | KDGanttMinimizeSplitter* mMiniSplitter; |
410 | XXPortManager *mXXPortManager; | 414 | XXPortManager *mXXPortManager; |
411 | JumpButtonBar *mJumpButtonBar; | 415 | JumpButtonBar *mJumpButtonBar; |
412 | IncSearchWidget *mIncSearchWidget; | 416 | IncSearchWidget *mIncSearchWidget; |
413 | ExtensionManager *mExtensionManager; | 417 | ExtensionManager *mExtensionManager; |
414 | 418 | ||
415 | KCMultiDialog *mConfigureDialog; | 419 | KCMultiDialog *mConfigureDialog; |
416 | 420 | ||
417 | #ifndef KAB_EMBEDDED | 421 | #ifndef KAB_EMBEDDED |
418 | LDAPSearchDialog *mLdapSearchDialog; | 422 | LDAPSearchDialog *mLdapSearchDialog; |
419 | #endif //KAB_EMBEDDED | 423 | #endif //KAB_EMBEDDED |
420 | // QDict<AddresseeEditorDialog> mEditorDict; | 424 | // QDict<AddresseeEditorDialog> mEditorDict; |
421 | AddresseeEditorDialog *mEditorDialog; | 425 | AddresseeEditorDialog *mEditorDialog; |
422 | bool mReadWrite; | 426 | bool mReadWrite; |
423 | bool mModified; | 427 | bool mModified; |
424 | bool mIsPart; | 428 | bool mIsPart; |
425 | bool mMultipleViewsAtOnce; | 429 | bool mMultipleViewsAtOnce; |
426 | 430 | ||
427 | 431 | ||
428 | //US file menu | 432 | //US file menu |
429 | KAction *mActionMail; | 433 | KAction *mActionMail; |
430 | KAction *mActionBeam; | 434 | KAction *mActionBeam; |
431 | KToggleAction *mActionBR; | 435 | KToggleAction *mActionBR; |
432 | KAction *mActionExport2phone; | 436 | KAction *mActionExport2phone; |
433 | KAction* mActionPrint; | 437 | KAction* mActionPrint; |
434 | KAction* mActionPrintDetails; | 438 | KAction* mActionPrintDetails; |
435 | KAction* mActionNewContact; | 439 | KAction* mActionNewContact; |
436 | KAction *mActionSave; | 440 | KAction *mActionSave; |
437 | KAction *mActionEditAddressee; | 441 | KAction *mActionEditAddressee; |
438 | KAction *mActionMailVCard; | 442 | KAction *mActionMailVCard; |
439 | KAction *mActionBeamVCard; | 443 | KAction *mActionBeamVCard; |
440 | 444 | ||
441 | KAction *mActionQuit; | 445 | KAction *mActionQuit; |
442 | 446 | ||
443 | //US edit menu | 447 | //US edit menu |
444 | KAction *mActionCopy; | 448 | KAction *mActionCopy; |
445 | KAction *mActionCut; | 449 | KAction *mActionCut; |
446 | KAction *mActionPaste; | 450 | KAction *mActionPaste; |
447 | KAction *mActionSelectAll; | 451 | KAction *mActionSelectAll; |
448 | KAction *mActionUndo; | 452 | KAction *mActionUndo; |
449 | KAction *mActionRedo; | 453 | KAction *mActionRedo; |
450 | KAction *mActionDelete; | 454 | KAction *mActionDelete; |
451 | 455 | ||
452 | //US settings menu | 456 | //US settings menu |
453 | KAction *mActionConfigResources; | 457 | KAction *mActionConfigResources; |
454 | KAction *mActionConfigKAddressbook; | 458 | KAction *mActionConfigKAddressbook; |
455 | KAction *mActionConfigShortcuts; | 459 | KAction *mActionConfigShortcuts; |
456 | KAction *mActionConfigureToolbars; | 460 | KAction *mActionConfigureToolbars; |
457 | KAction *mActionKeyBindings; | 461 | KAction *mActionKeyBindings; |
458 | KToggleAction *mActionJumpBar; | 462 | KToggleAction *mActionJumpBar; |
459 | KToggleAction *mActionDetails; | 463 | KToggleAction *mActionDetails; |
460 | KAction *mActionWhoAmI; | 464 | KAction *mActionWhoAmI; |
461 | KAction *mActionCategories; | 465 | KAction *mActionCategories; |
462 | KAction *mActionEditCategories; | 466 | KAction *mActionEditCategories; |
463 | KAction *mActionManageCategories; | 467 | KAction *mActionManageCategories; |
464 | KAction *mActionAboutKAddressbook; | 468 | KAction *mActionAboutKAddressbook; |
465 | KAction *mActionLicence; | 469 | KAction *mActionLicence; |
466 | KAction *mActionFaq; | 470 | KAction *mActionFaq; |
467 | KAction *mActionWN; | 471 | KAction *mActionWN; |
468 | KAction *mActionSyncHowto; | 472 | KAction *mActionSyncHowto; |
469 | KAction *mActionKdeSyncHowto; | 473 | KAction *mActionKdeSyncHowto; |
470 | KAction *mActionMultiSyncHowto; | 474 | KAction *mActionMultiSyncHowto; |
471 | 475 | ||
472 | KAction *mActionDeleteView; | 476 | KAction *mActionDeleteView; |
473 | 477 | ||
474 | QPopupMenu *viewMenu; | 478 | QPopupMenu *viewMenu; |
475 | QPopupMenu *filterMenu; | 479 | QPopupMenu *filterMenu; |
476 | QPopupMenu *settingsMenu; | 480 | QPopupMenu *settingsMenu; |
477 | QPopupMenu *changeMenu; | 481 | QPopupMenu *changeMenu; |
478 | QPopupMenu *beamMenu; | 482 | QPopupMenu *beamMenu; |
479 | //US QAction *mActionSave; | 483 | //US QAction *mActionSave; |
480 | QPopupMenu *ImportMenu; | 484 | QPopupMenu *ImportMenu; |
481 | QPopupMenu *ExportMenu; | 485 | QPopupMenu *ExportMenu; |
482 | //LR additional methods | 486 | //LR additional methods |
483 | KAction *mActionRemoveVoice; | 487 | KAction *mActionRemoveVoice; |
484 | KAction *mActionSetFormattedName; | 488 | KAction *mActionSetFormattedName; |
485 | KAction * mActionImportOL; | 489 | KAction * mActionImportOL; |
486 | 490 | ||
487 | #ifndef KAB_EMBEDDED | 491 | #ifndef KAB_EMBEDDED |
488 | KAddressBookService *mAddressBookService; | 492 | KAddressBookService *mAddressBookService; |
489 | #endif //KAB_EMBEDDED | 493 | #endif //KAB_EMBEDDED |
490 | 494 | ||
491 | class KABCorePrivate; | 495 | class KABCorePrivate; |
492 | KABCorePrivate *d; | 496 | KABCorePrivate *d; |
493 | //US bool mBlockSaveFlag; | 497 | //US bool mBlockSaveFlag; |
494 | 498 | ||
495 | #ifdef KAB_EMBEDDED | 499 | #ifdef KAB_EMBEDDED |
496 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient | 500 | KAddressBookMain *mMainWindow; // should be the same like mGUIClient |
497 | #endif //KAB_EMBEDDED | 501 | #endif //KAB_EMBEDDED |
498 | 502 | ||
499 | //this are the overwritten callbackmethods from the syncinterface | 503 | //this are the overwritten callbackmethods from the syncinterface |
500 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 504 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
501 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 505 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
502 | virtual void removeSyncInfo( QString syncProfile); | 506 | virtual void removeSyncInfo( QString syncProfile); |
503 | bool syncPhone(); | 507 | bool syncPhone(); |
504 | void message( QString m , bool startTimer = true); | 508 | void message( QString m , bool startTimer = true); |
505 | 509 | ||
506 | // LR ******************************* | 510 | // LR ******************************* |
507 | // sync stuff! | 511 | // sync stuff! |
508 | QString sentSyncFile(); | 512 | QString sentSyncFile(); |
509 | QPopupMenu *syncMenu; | 513 | QPopupMenu *syncMenu; |
510 | KSyncManager* syncManager; | 514 | KSyncManager* syncManager; |
511 | int mGlobalSyncMode; | 515 | int mGlobalSyncMode; |
512 | bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); | 516 | bool synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBook* remote,int mode); |
513 | KABC::Addressee getLastSyncAddressee(); | 517 | KABC::Addressee getLastSyncAddressee(); |
514 | QDateTime mLastAddressbookSync; | 518 | QDateTime mLastAddressbookSync; |
515 | int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); | 519 | int takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ); |
516 | // ********************* | 520 | // ********************* |
517 | 521 | ||
518 | }; | 522 | }; |
519 | 523 | ||
520 | #endif | 524 | #endif |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 8a4c7eb..6ddced0 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -555,419 +555,428 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
555 | else if ( msg == "-showKO" ) { | 555 | else if ( msg == "-showKO" ) { |
556 | mView->viewManager()->showNextXView(); | 556 | mView->viewManager()->showNextXView(); |
557 | } | 557 | } |
558 | else if ( msg == "-showWNext" ) { | 558 | else if ( msg == "-showWNext" ) { |
559 | mView->viewManager()->showWhatsNextView(); | 559 | mView->viewManager()->showWhatsNextView(); |
560 | } | 560 | } |
561 | else if ( msg == "nextView()" ) { | 561 | else if ( msg == "nextView()" ) { |
562 | mView->viewManager()->showNextView(); | 562 | mView->viewManager()->showNextView(); |
563 | } | 563 | } |
564 | else if ( msg == "-showNextXView" ) { | 564 | else if ( msg == "-showNextXView" ) { |
565 | mView->viewManager()->showNextXView(); | 565 | mView->viewManager()->showNextXView(); |
566 | } | 566 | } |
567 | 567 | ||
568 | 568 | ||
569 | } | 569 | } |
570 | 570 | ||
571 | showMaximized(); | 571 | showMaximized(); |
572 | raise(); | 572 | raise(); |
573 | } | 573 | } |
574 | 574 | ||
575 | QPixmap MainWindow::loadPixmap( QString name ) | 575 | QPixmap MainWindow::loadPixmap( QString name ) |
576 | { | 576 | { |
577 | return SmallIcon( name ); | 577 | return SmallIcon( name ); |
578 | 578 | ||
579 | } | 579 | } |
580 | void MainWindow::initActions() | 580 | void MainWindow::initActions() |
581 | { | 581 | { |
582 | //KOPrefs::instance()->mShowFullMenu | 582 | //KOPrefs::instance()->mShowFullMenu |
583 | iconToolBar->clear(); | 583 | iconToolBar->clear(); |
584 | KOPrefs *p = KOPrefs::instance(); | 584 | KOPrefs *p = KOPrefs::instance(); |
585 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 585 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
586 | 586 | ||
587 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 587 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
588 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 588 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
589 | QPopupMenu *importMenu = new QPopupMenu( this ); | 589 | QPopupMenu *importMenu = new QPopupMenu( this ); |
590 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 590 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
591 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 591 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
592 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 592 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
593 | selectFilterMenu = new QPopupMenu( this ); | 593 | selectFilterMenu = new QPopupMenu( this ); |
594 | selectFilterMenu->setCheckable( true ); | 594 | selectFilterMenu->setCheckable( true ); |
595 | syncMenu = new QPopupMenu( this ); | 595 | syncMenu = new QPopupMenu( this ); |
596 | configureAgendaMenu = new QPopupMenu( this ); | 596 | configureAgendaMenu = new QPopupMenu( this ); |
597 | configureToolBarMenu = new QPopupMenu( this ); | 597 | configureToolBarMenu = new QPopupMenu( this ); |
598 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 598 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
599 | QIconSet icon; | 599 | QIconSet icon; |
600 | int pixWid = 22, pixHei = 22; | 600 | int pixWid = 22, pixHei = 22; |
601 | QString pathString = ""; | 601 | QString pathString = ""; |
602 | if ( !p->mToolBarMiniIcons ) { | 602 | if ( !p->mToolBarMiniIcons ) { |
603 | if ( QApplication::desktop()->width() < 480 ) { | 603 | if ( QApplication::desktop()->width() < 480 ) { |
604 | pathString += "icons16/"; | 604 | pathString += "icons16/"; |
605 | pixWid = 18; pixHei = 16; | 605 | pixWid = 18; pixHei = 16; |
606 | } | 606 | } |
607 | } else { | 607 | } else { |
608 | pathString += "iconsmini/"; | 608 | pathString += "iconsmini/"; |
609 | pixWid = 18; pixHei = 16; | 609 | pixWid = 18; pixHei = 16; |
610 | } | 610 | } |
611 | if ( KOPrefs::instance()->mShowFullMenu ) { | 611 | if ( KOPrefs::instance()->mShowFullMenu ) { |
612 | QMenuBar *menuBar1; | 612 | QMenuBar *menuBar1; |
613 | menuBar1 = menuBar(); | 613 | menuBar1 = menuBar(); |
614 | menuBar1->insertItem( i18n("File"), importMenu ); | 614 | menuBar1->insertItem( i18n("File"), importMenu ); |
615 | menuBar1->insertItem( i18n("View"), viewMenu ); | 615 | menuBar1->insertItem( i18n("View"), viewMenu ); |
616 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 616 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
617 | #ifdef DESKTOP_VERSION | 617 | #ifdef DESKTOP_VERSION |
618 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 618 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
619 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 619 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
620 | #else | 620 | #else |
621 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 621 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
622 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 622 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
623 | #endif | 623 | #endif |
624 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 624 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
625 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 625 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
626 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 626 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
627 | } else { | 627 | } else { |
628 | QPEMenuBar *menuBar1; | 628 | QPEMenuBar *menuBar1; |
629 | menuBar1 = new QPEMenuBar( iconToolBar ); | 629 | menuBar1 = new QPEMenuBar( iconToolBar ); |
630 | QPopupMenu *menuBar = new QPopupMenu( this ); | 630 | QPopupMenu *menuBar = new QPopupMenu( this ); |
631 | icon = loadPixmap( pathString + "z_menu" ); | 631 | icon = loadPixmap( pathString + "z_menu" ); |
632 | menuBar1->insertItem( icon.pixmap(), menuBar); | 632 | menuBar1->insertItem( icon.pixmap(), menuBar); |
633 | //menuBar1->insertItem( i18n("ME"), menuBar); | 633 | //menuBar1->insertItem( i18n("ME"), menuBar); |
634 | menuBar->insertItem( i18n("File"), importMenu ); | 634 | menuBar->insertItem( i18n("File"), importMenu ); |
635 | menuBar->insertItem( i18n("View"), viewMenu ); | 635 | menuBar->insertItem( i18n("View"), viewMenu ); |
636 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 636 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
637 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 637 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
638 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 638 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
639 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 639 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
640 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 640 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
641 | menuBar->insertItem( i18n("Help"), helpMenu ); | 641 | menuBar->insertItem( i18n("Help"), helpMenu ); |
642 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 642 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
643 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 643 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
644 | } | 644 | } |
645 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 645 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
646 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 646 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
647 | mWeekBgColor = iconToolBar->backgroundColor(); | 647 | mWeekBgColor = iconToolBar->backgroundColor(); |
648 | mWeekPixmap.resize( pixWid , pixHei ); | 648 | mWeekPixmap.resize( pixWid , pixHei ); |
649 | mWeekPixmap.fill( mWeekBgColor ); | 649 | mWeekPixmap.fill( mWeekBgColor ); |
650 | icon = mWeekPixmap; | 650 | icon = mWeekPixmap; |
651 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 651 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
652 | if ( p-> mShowIconWeekNum ) | 652 | if ( p-> mShowIconWeekNum ) |
653 | mWeekAction->addTo( iconToolBar ); | 653 | mWeekAction->addTo( iconToolBar ); |
654 | mWeekFont = font(); | 654 | mWeekFont = font(); |
655 | 655 | ||
656 | int fontPoint = mWeekFont.pointSize(); | 656 | int fontPoint = mWeekFont.pointSize(); |
657 | QFontMetrics f( mWeekFont ); | 657 | QFontMetrics f( mWeekFont ); |
658 | int fontWid = f.width( "30" ); | 658 | int fontWid = f.width( "30" ); |
659 | while ( fontWid > pixWid ) { | 659 | while ( fontWid > pixWid ) { |
660 | --fontPoint; | 660 | --fontPoint; |
661 | mWeekFont.setPointSize( fontPoint ); | 661 | mWeekFont.setPointSize( fontPoint ); |
662 | QFontMetrics f( mWeekFont ); | 662 | QFontMetrics f( mWeekFont ); |
663 | fontWid = f.width( "30" ); | 663 | fontWid = f.width( "30" ); |
664 | //qDebug("dec-- "); | 664 | //qDebug("dec-- "); |
665 | } | 665 | } |
666 | 666 | ||
667 | connect( mWeekAction, SIGNAL( activated() ), | 667 | connect( mWeekAction, SIGNAL( activated() ), |
668 | this, SLOT( weekAction() ) ); | 668 | this, SLOT( weekAction() ) ); |
669 | 669 | ||
670 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 670 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
671 | 671 | ||
672 | //#endif | 672 | //#endif |
673 | // ****************** | 673 | // ****************** |
674 | QAction *action; | 674 | QAction *action; |
675 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 675 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
676 | configureToolBarMenu->setCheckable( true ); | 676 | configureToolBarMenu->setCheckable( true ); |
677 | 677 | ||
678 | 678 | ||
679 | configureAgendaMenu->setCheckable( true ); | 679 | configureAgendaMenu->setCheckable( true ); |
680 | int iii ; | 680 | int iii ; |
681 | for ( iii = 1;iii<= 10 ;++iii ){ | 681 | for ( iii = 1;iii<= 10 ;++iii ){ |
682 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 682 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
683 | } | 683 | } |
684 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 684 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
685 | 685 | ||
686 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 686 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
687 | this, SLOT( showConfigureAgenda( ) ) ); | 687 | this, SLOT( showConfigureAgenda( ) ) ); |
688 | 688 | ||
689 | icon = loadPixmap( pathString + "configure" ); | 689 | icon = loadPixmap( pathString + "configure" ); |
690 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 690 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
691 | action->addTo( actionMenu ); | 691 | action->addTo( actionMenu ); |
692 | connect( action, SIGNAL( activated() ), | 692 | connect( action, SIGNAL( activated() ), |
693 | mView, SLOT( edit_options() ) ); | 693 | mView, SLOT( edit_options() ) ); |
694 | actionMenu->insertSeparator(); | 694 | actionMenu->insertSeparator(); |
695 | 695 | ||
696 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 696 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
697 | action->addTo( actionMenu ); | 697 | action->addTo( actionMenu ); |
698 | connect( action, SIGNAL( activated() ), | 698 | connect( action, SIGNAL( activated() ), |
699 | mView, SLOT( undo_delete() ) ); | 699 | mView, SLOT( undo_delete() ) ); |
700 | actionMenu->insertSeparator(); | 700 | actionMenu->insertSeparator(); |
701 | 701 | ||
702 | icon = loadPixmap( pathString + "newevent" ); | 702 | icon = loadPixmap( pathString + "newevent" ); |
703 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 703 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
704 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 704 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
705 | configureToolBarMenu->insertSeparator(); | 705 | configureToolBarMenu->insertSeparator(); |
706 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 706 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
707 | configureToolBarMenu->insertSeparator(); | 707 | configureToolBarMenu->insertSeparator(); |
708 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 708 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
709 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 709 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
710 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 710 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
711 | ne_action->addTo( actionMenu ); | 711 | ne_action->addTo( actionMenu ); |
712 | connect( ne_action, SIGNAL( activated() ), | 712 | connect( ne_action, SIGNAL( activated() ), |
713 | mView, SLOT( newEvent() ) ); | 713 | mView, SLOT( newEvent() ) ); |
714 | icon = loadPixmap( pathString + "newtodo" ); | 714 | icon = loadPixmap( pathString + "newtodo" ); |
715 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 715 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
716 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 716 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
717 | nt_action->addTo( actionMenu ); | 717 | nt_action->addTo( actionMenu ); |
718 | connect( nt_action, SIGNAL( activated() ), | 718 | connect( nt_action, SIGNAL( activated() ), |
719 | mView, SLOT( newTodo() ) ); | 719 | mView, SLOT( newTodo() ) ); |
720 | 720 | ||
721 | icon = loadPixmap( pathString + "today" ); | 721 | icon = loadPixmap( pathString + "today" ); |
722 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 722 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
723 | today_action->addTo( viewMenu ); | 723 | today_action->addTo( viewMenu ); |
724 | connect( today_action, SIGNAL( activated() ), | 724 | connect( today_action, SIGNAL( activated() ), |
725 | mView, SLOT( goToday() ) ); | 725 | mView, SLOT( goToday() ) ); |
726 | viewMenu->insertSeparator(); | 726 | viewMenu->insertSeparator(); |
727 | 727 | ||
728 | // *********************** | 728 | // *********************** |
729 | if ( KOPrefs::instance()->mVerticalScreen ) { | 729 | if ( KOPrefs::instance()->mVerticalScreen ) { |
730 | icon = SmallIcon( "1updownarrow" ); | 730 | icon = SmallIcon( "1updownarrow" ); |
731 | } else { | 731 | } else { |
732 | icon = SmallIcon("1leftrightarrow" ); | 732 | icon = SmallIcon("1leftrightarrow" ); |
733 | } | 733 | } |
734 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 734 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
735 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 735 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
736 | FSaction->addTo( viewMenu ); | 736 | FSaction->addTo( viewMenu ); |
737 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 737 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
738 | 738 | ||
739 | icon = loadPixmap( pathString + "navi" ); | 739 | icon = loadPixmap( pathString + "navi" ); |
740 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 740 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
741 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 741 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
742 | action->addTo( viewMenu ); | 742 | action->addTo( viewMenu ); |
743 | connect( action, SIGNAL( activated() ), | 743 | connect( action, SIGNAL( activated() ), |
744 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 744 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
745 | mToggleNav = action ; | 745 | mToggleNav = action ; |
746 | icon = loadPixmap( pathString + "filter" ); | 746 | icon = loadPixmap( pathString + "filter" ); |
747 | configureToolBarMenu->insertItem(icon, i18n("Toggle FilterView"), 26 ); | 747 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
748 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 748 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
749 | action->addTo( viewMenu ); | 749 | action->addTo( viewMenu ); |
750 | connect( action, SIGNAL( activated() ), | 750 | connect( action, SIGNAL( activated() ), |
751 | mView, SLOT( toggleFilter() ) ); | 751 | mView, SLOT( toggleFilter() ) ); |
752 | mToggleFilter = action; | 752 | mToggleFilter = action; |
753 | icon = loadPixmap( pathString + "allday" ); | 753 | icon = loadPixmap( pathString + "allday" ); |
754 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 754 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
755 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 755 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
756 | action->addTo( viewMenu ); | 756 | action->addTo( viewMenu ); |
757 | connect( action, SIGNAL( activated() ), | 757 | connect( action, SIGNAL( activated() ), |
758 | mView, SLOT( toggleAllDaySize() ) ); | 758 | mView, SLOT( toggleAllDaySize() ) ); |
759 | mToggleAllday = action; | 759 | mToggleAllday = action; |
760 | 760 | ||
761 | 761 | ||
762 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 762 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
763 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 763 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
764 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 764 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
765 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 765 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
766 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 766 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
767 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 767 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
768 | 768 | ||
769 | viewMenu->insertSeparator(); | 769 | viewMenu->insertSeparator(); |
770 | icon = loadPixmap( pathString + "picker" ); | 770 | icon = loadPixmap( pathString + "picker" ); |
771 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 771 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
772 | action->addTo( viewMenu ); | 772 | action->addTo( viewMenu ); |
773 | connect( action, SIGNAL( activated() ), | 773 | connect( action, SIGNAL( activated() ), |
774 | mView, SLOT( showDatePicker() ) ); | 774 | mView, SLOT( showDatePicker() ) ); |
775 | action->addTo( iconToolBar ); | 775 | action->addTo( iconToolBar ); |
776 | viewMenu->insertSeparator(); | 776 | viewMenu->insertSeparator(); |
777 | 777 | ||
778 | if ( p-> mShowIconToggleFull ) | 778 | if ( p-> mShowIconToggleFull ) |
779 | FSaction->addTo( iconToolBar ); | 779 | FSaction->addTo( iconToolBar ); |
780 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); | 780 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); |
781 | if ( p->mShowIconFilterview ) mToggleFilter->addTo( iconToolBar ); | 781 | if ( p->mShowIconFilterview ) { |
782 | icon = loadPixmap( pathString + "filter" ); | ||
783 | QPEMenuBar *menuBar111 = new QPEMenuBar( iconToolBar ); | ||
784 | menuBar111->insertItem( icon.pixmap(), selectFilterMenu); | ||
785 | int isi = 24; | ||
786 | if ( QApplication::desktop()->width() < 480 ) | ||
787 | isi = 18; | ||
788 | menuBar111->setFixedSize( QSize( isi, isi )) ; | ||
789 | } | ||
790 | //******************** | ||
782 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 791 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
783 | 792 | ||
784 | 793 | ||
785 | icon = loadPixmap( pathString + "whatsnext" ); | 794 | icon = loadPixmap( pathString + "whatsnext" ); |
786 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 795 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
787 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 796 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
788 | whatsnext_action->addTo( viewMenu ); | 797 | whatsnext_action->addTo( viewMenu ); |
789 | connect( whatsnext_action, SIGNAL( activated() ), | 798 | connect( whatsnext_action, SIGNAL( activated() ), |
790 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 799 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
791 | 800 | ||
792 | icon = loadPixmap( pathString + "xdays" ); | 801 | icon = loadPixmap( pathString + "xdays" ); |
793 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 802 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
794 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 803 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
795 | xdays_action->addTo( viewMenu ); | 804 | xdays_action->addTo( viewMenu ); |
796 | connect( xdays_action, SIGNAL( activated() ), | 805 | connect( xdays_action, SIGNAL( activated() ), |
797 | mView->viewManager(), SLOT( showNextXView() ) ); | 806 | mView->viewManager(), SLOT( showNextXView() ) ); |
798 | 807 | ||
799 | 808 | ||
800 | icon = loadPixmap( pathString + "journal" ); | 809 | icon = loadPixmap( pathString + "journal" ); |
801 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 810 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
802 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 811 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
803 | viewjournal_action->addTo( viewMenu ); | 812 | viewjournal_action->addTo( viewMenu ); |
804 | connect( viewjournal_action, SIGNAL( activated() ), | 813 | connect( viewjournal_action, SIGNAL( activated() ), |
805 | mView->viewManager(), SLOT( showJournalView() ) ); | 814 | mView->viewManager(), SLOT( showJournalView() ) ); |
806 | 815 | ||
807 | 816 | ||
808 | icon = loadPixmap( pathString + "day" ); | 817 | icon = loadPixmap( pathString + "day" ); |
809 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 818 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
810 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 819 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
811 | day1_action->addTo( viewMenu ); | 820 | day1_action->addTo( viewMenu ); |
812 | // action->addTo( toolBar ); | 821 | // action->addTo( toolBar ); |
813 | connect( day1_action, SIGNAL( activated() ), | 822 | connect( day1_action, SIGNAL( activated() ), |
814 | mView->viewManager(), SLOT( showDayView() ) ); | 823 | mView->viewManager(), SLOT( showDayView() ) ); |
815 | 824 | ||
816 | icon = loadPixmap( pathString + "workweek" ); | 825 | icon = loadPixmap( pathString + "workweek" ); |
817 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 826 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
818 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 827 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
819 | day5_action->addTo( viewMenu ); | 828 | day5_action->addTo( viewMenu ); |
820 | connect( day5_action, SIGNAL( activated() ), | 829 | connect( day5_action, SIGNAL( activated() ), |
821 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 830 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
822 | 831 | ||
823 | icon = loadPixmap( pathString + "week" ); | 832 | icon = loadPixmap( pathString + "week" ); |
824 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 833 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
825 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 834 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
826 | day7_action->addTo( viewMenu ); | 835 | day7_action->addTo( viewMenu ); |
827 | connect( day7_action, SIGNAL( activated() ), | 836 | connect( day7_action, SIGNAL( activated() ), |
828 | mView->viewManager(), SLOT( showWeekView() ) ); | 837 | mView->viewManager(), SLOT( showWeekView() ) ); |
829 | 838 | ||
830 | icon = loadPixmap( pathString + "workweek2" ); | 839 | icon = loadPixmap( pathString + "workweek2" ); |
831 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 840 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
832 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 841 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
833 | day6_action->addTo( viewMenu ); | 842 | day6_action->addTo( viewMenu ); |
834 | connect( day6_action, SIGNAL( activated() ), | 843 | connect( day6_action, SIGNAL( activated() ), |
835 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 844 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
836 | 845 | ||
837 | icon = loadPixmap( pathString + "month" ); | 846 | icon = loadPixmap( pathString + "month" ); |
838 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 847 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
839 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 848 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
840 | month_action->addTo( viewMenu ); | 849 | month_action->addTo( viewMenu ); |
841 | connect( month_action, SIGNAL( activated() ), | 850 | connect( month_action, SIGNAL( activated() ), |
842 | mView->viewManager(), SLOT( showMonthView() ) ); | 851 | mView->viewManager(), SLOT( showMonthView() ) ); |
843 | 852 | ||
844 | icon = loadPixmap( pathString + "list" ); | 853 | icon = loadPixmap( pathString + "list" ); |
845 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 854 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
846 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 855 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
847 | showlist_action->addTo( viewMenu ); | 856 | showlist_action->addTo( viewMenu ); |
848 | connect( showlist_action, SIGNAL( activated() ), | 857 | connect( showlist_action, SIGNAL( activated() ), |
849 | mView->viewManager(), SLOT( showListView() ) ); | 858 | mView->viewManager(), SLOT( showListView() ) ); |
850 | 859 | ||
851 | icon = loadPixmap( pathString + "todo" ); | 860 | icon = loadPixmap( pathString + "todo" ); |
852 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 861 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
853 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 862 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
854 | todoview_action->addTo( viewMenu ); | 863 | todoview_action->addTo( viewMenu ); |
855 | connect( todoview_action, SIGNAL( activated() ), | 864 | connect( todoview_action, SIGNAL( activated() ), |
856 | mView->viewManager(), SLOT( showTodoView() ) ); | 865 | mView->viewManager(), SLOT( showTodoView() ) ); |
857 | 866 | ||
858 | 867 | ||
859 | 868 | ||
860 | #if 0 | 869 | #if 0 |
861 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 870 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
862 | action->addTo( viewMenu ); | 871 | action->addTo( viewMenu ); |
863 | connect( action, SIGNAL( activated() ), | 872 | connect( action, SIGNAL( activated() ), |
864 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 873 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
865 | #endif | 874 | #endif |
866 | 875 | ||
867 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 876 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
868 | this ); | 877 | this ); |
869 | mNewSubTodoAction->addTo( actionMenu ); | 878 | mNewSubTodoAction->addTo( actionMenu ); |
870 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 879 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
871 | mView, SLOT( newSubTodo() ) ); | 880 | mView, SLOT( newSubTodo() ) ); |
872 | 881 | ||
873 | actionMenu->insertSeparator(); | 882 | actionMenu->insertSeparator(); |
874 | 883 | ||
875 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 884 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
876 | mShowAction->addTo( actionMenu ); | 885 | mShowAction->addTo( actionMenu ); |
877 | connect( mShowAction, SIGNAL( activated() ), | 886 | connect( mShowAction, SIGNAL( activated() ), |
878 | mView, SLOT( showIncidence() ) ); | 887 | mView, SLOT( showIncidence() ) ); |
879 | 888 | ||
880 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 889 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
881 | mEditAction->addTo( actionMenu ); | 890 | mEditAction->addTo( actionMenu ); |
882 | connect( mEditAction, SIGNAL( activated() ), | 891 | connect( mEditAction, SIGNAL( activated() ), |
883 | mView, SLOT( editIncidence() ) ); | 892 | mView, SLOT( editIncidence() ) ); |
884 | 893 | ||
885 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 894 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
886 | mDeleteAction->addTo( actionMenu ); | 895 | mDeleteAction->addTo( actionMenu ); |
887 | connect( mDeleteAction, SIGNAL( activated() ), | 896 | connect( mDeleteAction, SIGNAL( activated() ), |
888 | mView, SLOT( deleteIncidence() ) ); | 897 | mView, SLOT( deleteIncidence() ) ); |
889 | 898 | ||
890 | 899 | ||
891 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 900 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
892 | mCloneAction->addTo( actionMenu ); | 901 | mCloneAction->addTo( actionMenu ); |
893 | connect( mCloneAction, SIGNAL( activated() ), | 902 | connect( mCloneAction, SIGNAL( activated() ), |
894 | mView, SLOT( cloneIncidence() ) ); | 903 | mView, SLOT( cloneIncidence() ) ); |
895 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 904 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
896 | mMoveAction->addTo( actionMenu ); | 905 | mMoveAction->addTo( actionMenu ); |
897 | connect( mMoveAction, SIGNAL( activated() ), | 906 | connect( mMoveAction, SIGNAL( activated() ), |
898 | mView, SLOT( moveIncidence() ) ); | 907 | mView, SLOT( moveIncidence() ) ); |
899 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 908 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
900 | mBeamAction->addTo( actionMenu ); | 909 | mBeamAction->addTo( actionMenu ); |
901 | connect( mBeamAction, SIGNAL( activated() ), | 910 | connect( mBeamAction, SIGNAL( activated() ), |
902 | mView, SLOT( beamIncidence() ) ); | 911 | mView, SLOT( beamIncidence() ) ); |
903 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 912 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
904 | mCancelAction->addTo( actionMenu ); | 913 | mCancelAction->addTo( actionMenu ); |
905 | connect( mCancelAction, SIGNAL( activated() ), | 914 | connect( mCancelAction, SIGNAL( activated() ), |
906 | mView, SLOT( toggleCancelIncidence() ) ); | 915 | mView, SLOT( toggleCancelIncidence() ) ); |
907 | 916 | ||
908 | actionMenu->insertSeparator(); | 917 | actionMenu->insertSeparator(); |
909 | 918 | ||
910 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 919 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
911 | this ); | 920 | this ); |
912 | action->addTo( actionMenu ); | 921 | action->addTo( actionMenu ); |
913 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 922 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
914 | 923 | ||
915 | icon = loadPixmap( pathString + "search" ); | 924 | icon = loadPixmap( pathString + "search" ); |
916 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 925 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
917 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 926 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
918 | search_action->addTo( actionMenu ); | 927 | search_action->addTo( actionMenu ); |
919 | connect( search_action, SIGNAL( activated() ), | 928 | connect( search_action, SIGNAL( activated() ), |
920 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 929 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
921 | 930 | ||
922 | 931 | ||
923 | 932 | ||
924 | if ( KOPrefs::instance()->mShowFullMenu ) { | 933 | if ( KOPrefs::instance()->mShowFullMenu ) { |
925 | actionMenu->insertSeparator(); | 934 | actionMenu->insertSeparator(); |
926 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 935 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
927 | 936 | ||
928 | } | 937 | } |
929 | // actionMenu->insertSeparator(); | 938 | // actionMenu->insertSeparator(); |
930 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 939 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
931 | this ); | 940 | this ); |
932 | action->addTo( importMenu_X ); | 941 | action->addTo( importMenu_X ); |
933 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 942 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
934 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 943 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
935 | this ); | 944 | this ); |
936 | action->addTo( importMenu_X ); | 945 | action->addTo( importMenu_X ); |
937 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 946 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
938 | importMenu_X->insertSeparator(); | 947 | importMenu_X->insertSeparator(); |
939 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 948 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
940 | this ); | 949 | this ); |
941 | action->addTo( importMenu_X ); | 950 | action->addTo( importMenu_X ); |
942 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 951 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
943 | //#ifndef DESKTOP_VERSION | 952 | //#ifndef DESKTOP_VERSION |
944 | importMenu_X->insertSeparator(); | 953 | importMenu_X->insertSeparator(); |
945 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 954 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
946 | this ); | 955 | this ); |
947 | action->addTo( importMenu_X ); | 956 | action->addTo( importMenu_X ); |
948 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 957 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
949 | //#else | 958 | //#else |
950 | #ifdef _OL_IMPORT_ | 959 | #ifdef _OL_IMPORT_ |
951 | importMenu_X->insertSeparator(); | 960 | importMenu_X->insertSeparator(); |
952 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 961 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
953 | this ); | 962 | this ); |
954 | action->addTo( importMenu_X ); | 963 | action->addTo( importMenu_X ); |
955 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 964 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
956 | #endif | 965 | #endif |
957 | //#endif | 966 | //#endif |
958 | 967 | ||
959 | //importMenu->insertSeparator(); | 968 | //importMenu->insertSeparator(); |
960 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 969 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
961 | this ); | 970 | this ); |
962 | action->addTo( importMenu ); | 971 | action->addTo( importMenu ); |
963 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 972 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
964 | 973 | ||
965 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 974 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
966 | this ); | 975 | this ); |
967 | action->addTo( importMenu ); | 976 | action->addTo( importMenu ); |
968 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 977 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
969 | importMenu->insertSeparator(); | 978 | importMenu->insertSeparator(); |
970 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 979 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
971 | //importMenu->insertSeparator(); | 980 | //importMenu->insertSeparator(); |
972 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 981 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
973 | this ); | 982 | this ); |
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index f8f4c8a..0d66a5a 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp | |||
@@ -946,259 +946,266 @@ bool ExternalAppHandler::callByPager( const QString& pagernumber ) | |||
946 | 946 | ||
947 | /************************************************************************** | 947 | /************************************************************************** |
948 | * | 948 | * |
949 | **************************************************************************/ | 949 | **************************************************************************/ |
950 | 950 | ||
951 | //calls the faxapplication with the number | 951 | //calls the faxapplication with the number |
952 | bool ExternalAppHandler::callByFax( const QString& faxnumber ) | 952 | bool ExternalAppHandler::callByFax( const QString& faxnumber ) |
953 | { | 953 | { |
954 | #ifndef DESKTOP_VERSION | 954 | #ifndef DESKTOP_VERSION |
955 | QString channel; | 955 | QString channel; |
956 | QString message; | 956 | QString message; |
957 | QString parameters; | 957 | QString parameters; |
958 | 958 | ||
959 | 959 | ||
960 | int client = KPimGlobalPrefs::instance()->mFaxClient; | 960 | int client = KPimGlobalPrefs::instance()->mFaxClient; |
961 | if (client == KPimGlobalPrefs::OTHER_FAC) | 961 | if (client == KPimGlobalPrefs::OTHER_FAC) |
962 | { | 962 | { |
963 | channel = KPimGlobalPrefs::instance()->mFaxOtherChannel; | 963 | channel = KPimGlobalPrefs::instance()->mFaxOtherChannel; |
964 | message = KPimGlobalPrefs::instance()->mFaxOtherMessage; | 964 | message = KPimGlobalPrefs::instance()->mFaxOtherMessage; |
965 | parameters = KPimGlobalPrefs::instance()->mFaxOtherMessageParameters; | 965 | parameters = KPimGlobalPrefs::instance()->mFaxOtherMessageParameters; |
966 | } | 966 | } |
967 | else | 967 | else |
968 | { | 968 | { |
969 | DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(FAX, client); | 969 | DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(FAX, client); |
970 | if (!dai) | 970 | if (!dai) |
971 | { | 971 | { |
972 | qDebug("could not find configured fax application."); | 972 | qDebug("could not find configured fax application."); |
973 | return false; | 973 | return false; |
974 | } | 974 | } |
975 | channel = dai->_channel; | 975 | channel = dai->_channel; |
976 | message = dai->_message; | 976 | message = dai->_message; |
977 | parameters = dai->_parameters; | 977 | parameters = dai->_parameters; |
978 | } | 978 | } |
979 | 979 | ||
980 | 980 | ||
981 | //first check if one of the mailers need the emails right in the message. | 981 | //first check if one of the mailers need the emails right in the message. |
982 | message = translateMessage(message, faxnumber, ""); | 982 | message = translateMessage(message, faxnumber, ""); |
983 | 983 | ||
984 | 984 | ||
985 | #ifdef DEBUG_EXT_APP_HANDLER | 985 | #ifdef DEBUG_EXT_APP_HANDLER |
986 | qDebug("9Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); | 986 | qDebug("9Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); |
987 | qDebug("passing faxnumber(%s) as parameter in the form %s to QCopEnvelope", faxnumber.latin1(), parameters.latin1()); | 987 | qDebug("passing faxnumber(%s) as parameter in the form %s to QCopEnvelope", faxnumber.latin1(), parameters.latin1()); |
988 | #endif | 988 | #endif |
989 | 989 | ||
990 | QCopEnvelope e(channel.latin1(), message.latin1()); | 990 | QCopEnvelope e(channel.latin1(), message.latin1()); |
991 | //US we need no names in the To field. The emailadresses are enough | 991 | //US we need no names in the To field. The emailadresses are enough |
992 | 992 | ||
993 | passParameters(&e, parameters, faxnumber, ""); | 993 | passParameters(&e, parameters, faxnumber, ""); |
994 | 994 | ||
995 | 995 | ||
996 | #else | 996 | #else |
997 | KMessageBox::sorry( 0, i18n( "This version does not support the sending of faxes." ) ); | 997 | KMessageBox::sorry( 0, i18n( "This version does not support the sending of faxes." ) ); |
998 | #endif | 998 | #endif |
999 | 999 | ||
1000 | 1000 | ||
1001 | return true; | 1001 | return true; |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | /************************************************************************** | 1004 | /************************************************************************** |
1005 | * | 1005 | * |
1006 | **************************************************************************/ | 1006 | **************************************************************************/ |
1007 | 1007 | ||
1008 | //calls the sipapplication with the number | 1008 | //calls the sipapplication with the number |
1009 | bool ExternalAppHandler::callBySIP( const QString& sipnumber ) | 1009 | bool ExternalAppHandler::callBySIP( const QString& sipnumber ) |
1010 | { | 1010 | { |
1011 | #ifndef DESKTOP_VERSION | 1011 | #ifndef DESKTOP_VERSION |
1012 | QString channel; | 1012 | QString channel; |
1013 | QString message; | 1013 | QString message; |
1014 | QString parameters; | 1014 | QString parameters; |
1015 | 1015 | ||
1016 | 1016 | ||
1017 | int client = KPimGlobalPrefs::instance()->mSipClient; | 1017 | int client = KPimGlobalPrefs::instance()->mSipClient; |
1018 | if (client == KPimGlobalPrefs::OTHER_SIC) | 1018 | if (client == KPimGlobalPrefs::OTHER_SIC) |
1019 | { | 1019 | { |
1020 | channel = KPimGlobalPrefs::instance()->mSipOtherChannel; | 1020 | channel = KPimGlobalPrefs::instance()->mSipOtherChannel; |
1021 | message = KPimGlobalPrefs::instance()->mSipOtherMessage; | 1021 | message = KPimGlobalPrefs::instance()->mSipOtherMessage; |
1022 | parameters = KPimGlobalPrefs::instance()->mSipOtherMessageParameters; | 1022 | parameters = KPimGlobalPrefs::instance()->mSipOtherMessageParameters; |
1023 | } | 1023 | } |
1024 | else | 1024 | else |
1025 | { | 1025 | { |
1026 | DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SIP, client); | 1026 | DefaultAppItem* dai = ExternalAppHandler::getDefaultItem(SIP, client); |
1027 | if (!dai) | 1027 | if (!dai) |
1028 | { | 1028 | { |
1029 | qDebug("could not find configured sip application."); | 1029 | qDebug("could not find configured sip application."); |
1030 | return false; | 1030 | return false; |
1031 | } | 1031 | } |
1032 | channel = dai->_channel; | 1032 | channel = dai->_channel; |
1033 | message = dai->_message; | 1033 | message = dai->_message; |
1034 | parameters = dai->_parameters; | 1034 | parameters = dai->_parameters; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | 1037 | ||
1038 | //first check if one of the sip apps need the emails right in the message. | 1038 | //first check if one of the sip apps need the emails right in the message. |
1039 | message = translateMessage(message, sipnumber, ""); | 1039 | message = translateMessage(message, sipnumber, ""); |
1040 | 1040 | ||
1041 | 1041 | ||
1042 | #ifdef DEBUG_EXT_APP_HANDLER | 1042 | #ifdef DEBUG_EXT_APP_HANDLER |
1043 | qDebug("10Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); | 1043 | qDebug("10Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); |
1044 | qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1()); | 1044 | qDebug("passing sipnumber(%s) as parameter in the form %s to QCopEnvelope", sipnumber.latin1(), parameters.latin1()); |
1045 | #endif | 1045 | #endif |
1046 | 1046 | ||
1047 | QCopEnvelope e(channel.latin1(), message.latin1()); | 1047 | QCopEnvelope e(channel.latin1(), message.latin1()); |
1048 | //US we need no names in the To field. The emailadresses are enough | 1048 | //US we need no names in the To field. The emailadresses are enough |
1049 | 1049 | ||
1050 | passParameters(&e, parameters, sipnumber, ""); | 1050 | passParameters(&e, parameters, sipnumber, ""); |
1051 | 1051 | ||
1052 | 1052 | ||
1053 | #else | 1053 | #else |
1054 | KMessageBox::sorry( 0, i18n( "This version does not support sip." ) ); | 1054 | KMessageBox::sorry( 0, i18n( "This version does not support sip." ) ); |
1055 | #endif | 1055 | #endif |
1056 | 1056 | ||
1057 | 1057 | ||
1058 | return true; | 1058 | return true; |
1059 | } | 1059 | } |
1060 | 1060 | ||
1061 | 1061 | ||
1062 | /************************************************************************** | 1062 | /************************************************************************** |
1063 | * | 1063 | * |
1064 | **************************************************************************/ | 1064 | **************************************************************************/ |
1065 | 1065 | ||
1066 | 1066 | ||
1067 | QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const | 1067 | QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const |
1068 | { | 1068 | { |
1069 | message = message.replace( QRegExp("%1"), param1 ); | 1069 | message = message.replace( QRegExp("%1"), param1 ); |
1070 | return message.replace( QRegExp("%2"), param2 ); | 1070 | return message.replace( QRegExp("%2"), param2 ); |
1071 | } | 1071 | } |
1072 | 1072 | ||
1073 | /************************************************************************** | 1073 | /************************************************************************** |
1074 | * | 1074 | * |
1075 | **************************************************************************/ | 1075 | **************************************************************************/ |
1076 | 1076 | ||
1077 | void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1 , const QString& param2) const | 1077 | void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1 , const QString& param2) const |
1078 | { | 1078 | { |
1079 | #ifndef DESKTOP_VERSION | 1079 | #ifndef DESKTOP_VERSION |
1080 | QMap<QString, QString> valmap; | 1080 | QMap<QString, QString> valmap; |
1081 | bool useValMap = false; | 1081 | bool useValMap = false; |
1082 | 1082 | ||
1083 | // first extract all parts of the parameters. | 1083 | // first extract all parts of the parameters. |
1084 | QStringList paramlist = QStringList::split(";", parameters); | 1084 | QStringList paramlist = QStringList::split(";", parameters); |
1085 | 1085 | ||
1086 | //Now check how many parts we have. | 1086 | //Now check how many parts we have. |
1087 | //=0 :no params to pass | 1087 | //=0 :no params to pass |
1088 | //>0 :parameters to pass | 1088 | //>0 :parameters to pass |
1089 | for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it ) | 1089 | for ( QStringList::Iterator it = paramlist.begin(); it != paramlist.end(); ++it ) |
1090 | { | 1090 | { |
1091 | QString param = (*it); | 1091 | QString param = (*it); |
1092 | QStringList keyvallist = QStringList::split("=", param); | 1092 | QStringList keyvallist = QStringList::split("=", param); |
1093 | 1093 | ||
1094 | //if we have keyvalue pairs, we assume that we pass a map to the envelope | 1094 | //if we have keyvalue pairs, we assume that we pass a map to the envelope |
1095 | QStringList::Iterator it2 = keyvallist.begin(); | 1095 | QStringList::Iterator it2 = keyvallist.begin(); |
1096 | QString key = (*it2); | 1096 | QString key = (*it2); |
1097 | key = key.replace( QRegExp("%1"), param1 ); | 1097 | key = key.replace( QRegExp("%1"), param1 ); |
1098 | key = key.replace( QRegExp("%2"), param2 ); | 1098 | key = key.replace( QRegExp("%2"), param2 ); |
1099 | ++it2; | 1099 | ++it2; |
1100 | 1100 | ||
1101 | if(it2 != keyvallist.end()) | 1101 | if(it2 != keyvallist.end()) |
1102 | { | 1102 | { |
1103 | QString value = (*it2); | 1103 | QString value = (*it2); |
1104 | value = value.replace( QRegExp("%1"), param1 ); | 1104 | value = value.replace( QRegExp("%1"), param1 ); |
1105 | value = value.replace( QRegExp("%2"), param2 ); | 1105 | value = value.replace( QRegExp("%2"), param2 ); |
1106 | 1106 | ||
1107 | valmap.insert(key, value); | 1107 | valmap.insert(key, value); |
1108 | useValMap = true; | 1108 | useValMap = true; |
1109 | } | 1109 | } |
1110 | else | 1110 | else |
1111 | { | 1111 | { |
1112 | // qDebug("pass parameter << %s", key.latin1()); | 1112 | // qDebug("pass parameter << %s", key.latin1()); |
1113 | (*e) << key; | 1113 | (*e) << key; |
1114 | } | 1114 | } |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | if (useValMap == true) | 1117 | if (useValMap == true) |
1118 | (*e) << valmap; | 1118 | (*e) << valmap; |
1119 | 1119 | ||
1120 | #endif | 1120 | #endif |
1121 | 1121 | ||
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | 1124 | ||
1125 | 1125 | ||
1126 | /************************************************************************** | 1126 | /************************************************************************** |
1127 | * | 1127 | * |
1128 | **************************************************************************/ | 1128 | **************************************************************************/ |
1129 | 1129 | ||
1130 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) | 1130 | void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) |
1131 | { | 1131 | { |
1132 | 1132 | ||
1133 | if ( cmsg == "nextView()" ) { | 1133 | if ( cmsg == "nextView()" ) { |
1134 | qDebug("nextView()"); | 1134 | qDebug("nextView()"); |
1135 | emit nextView(); | 1135 | emit nextView(); |
1136 | return; | 1136 | return; |
1137 | } | 1137 | } |
1138 | if ( cmsg == "callContactdialog()" ) { | ||
1139 | qDebug("callContactdialog()"); | ||
1140 | emit callContactdialog(); | ||
1141 | return; | ||
1142 | } | ||
1138 | 1143 | ||
1139 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1144 | bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1140 | if (!res) | 1145 | if (!res) |
1141 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); | 1146 | res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data ); |
1142 | 1147 | ||
1143 | if (!res) | 1148 | if (!res) |
1144 | res = mDisplayDetails->appMessage( cmsg, data ); | 1149 | res = mDisplayDetails->appMessage( cmsg, data ); |
1145 | 1150 | ||
1146 | // if (!res) | 1151 | // if (!res) |
1147 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); | 1152 | // res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); |
1148 | } | 1153 | } |
1149 | 1154 | ||
1150 | 1155 | ||
1151 | 1156 | ||
1152 | bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) | 1157 | bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid) |
1153 | { | 1158 | { |
1154 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); | 1159 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); |
1155 | // maybe we are sending to KA/Pi fom a different worldd... | 1160 | // maybe we are sending to KA/Pi fom a different worldd... |
1156 | // it may be that the QAplication::desktop()->width() values in KA/Pi are not the same as in our application | 1161 | // it may be that the QAplication::desktop()->width() values in KA/Pi are not the same as in our application |
1157 | // for that reason we send the current QApplication::desktop()->width() to KA/Pi | 1162 | // for that reason we send the current QApplication::desktop()->width() to KA/Pi |
1163 | //qDebug("UID %s ", sessionuid.latin1()); | ||
1158 | return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(QString::number ( QApplication::desktop()->width() )); | 1164 | return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(QString::number ( QApplication::desktop()->width() )); |
1165 | //return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(sessionuid); | ||
1159 | } | 1166 | } |
1160 | 1167 | ||
1161 | bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) | 1168 | bool ExternalAppHandler::returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) |
1162 | { | 1169 | { |
1163 | QStringList list4, list5, list6; | 1170 | QStringList list4, list5, list6; |
1164 | 1171 | ||
1165 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); | 1172 | mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel); |
1166 | return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1173 | return mNameEmailUidListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1167 | } | 1174 | } |
1168 | 1175 | ||
1169 | bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) | 1176 | bool ExternalAppHandler::requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email) |
1170 | { | 1177 | { |
1171 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); | 1178 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); |
1172 | return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); | 1179 | return mFindByEmailFromKAPITransfer->sendMessageToTarget(sessionuid, email); |
1173 | } | 1180 | } |
1174 | 1181 | ||
1175 | bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) | 1182 | bool ExternalAppHandler::returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3) |
1176 | { | 1183 | { |
1177 | QStringList list4, list5, list6; | 1184 | QStringList list4, list5, list6; |
1178 | 1185 | ||
1179 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); | 1186 | mFindByEmailFromKAPITransfer->setSourceChannel(sourceChannel); |
1180 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1187 | return mFindByEmailFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1181 | } | 1188 | } |
1182 | 1189 | ||
1183 | bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) | 1190 | bool ExternalAppHandler::requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid) |
1184 | { | 1191 | { |
1185 | mDisplayDetails->setSourceChannel(""); | 1192 | mDisplayDetails->setSourceChannel(""); |
1186 | return mDisplayDetails->sendMessageToTarget("", name, email, uid); | 1193 | return mDisplayDetails->sendMessageToTarget("", name, email, uid); |
1187 | } | 1194 | } |
1188 | 1195 | ||
1189 | bool ExternalAppHandler::requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid) | 1196 | bool ExternalAppHandler::requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid) |
1190 | { | 1197 | { |
1191 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); | 1198 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); |
1192 | return mBirthdayListFromKAPITransfer->sendMessageToTarget(sessionuid); | 1199 | return mBirthdayListFromKAPITransfer->sendMessageToTarget(sessionuid); |
1193 | } | 1200 | } |
1194 | 1201 | ||
1195 | bool ExternalAppHandler::returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6) | 1202 | bool ExternalAppHandler::returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6) |
1196 | { | 1203 | { |
1197 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); | 1204 | mBirthdayListFromKAPITransfer->setSourceChannel(sourceChannel); |
1198 | return mBirthdayListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); | 1205 | return mBirthdayListFromKAPITransfer->sendMessageToSource(sessionuid, list1, list2, list3, list4, list5, list6); |
1199 | } | 1206 | } |
1200 | 1207 | ||
1201 | 1208 | ||
1202 | 1209 | ||
1203 | 1210 | ||
1204 | 1211 | ||
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h index 52a64e1..097f306 100644 --- a/libkdepim/externalapphandler.h +++ b/libkdepim/externalapphandler.h | |||
@@ -44,249 +44,250 @@ class QCopTransferItem : public QObject | |||
44 | Q_OBJECT | 44 | Q_OBJECT |
45 | public: | 45 | public: |
46 | QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); | 46 | QCopTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); |
47 | QCopTransferItem(); | 47 | QCopTransferItem(); |
48 | 48 | ||
49 | bool sendMessageToTarget(const QString& uid, const QString& param1 = QString::null, const QString& param2 = QString::null, const QString& param3 = QString::null); | 49 | bool sendMessageToTarget(const QString& uid, const QString& param1 = QString::null, const QString& param2 = QString::null, const QString& param3 = QString::null); |
50 | 50 | ||
51 | void setSourceChannel(const QString& sourceChannel); | 51 | void setSourceChannel(const QString& sourceChannel); |
52 | 52 | ||
53 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); | 53 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); |
54 | 54 | ||
55 | 55 | ||
56 | signals: | 56 | signals: |
57 | void receivedMessageFromSource(const QString& sourceChannel, const QString& uid); | 57 | void receivedMessageFromSource(const QString& sourceChannel, const QString& uid); |
58 | void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1); | 58 | void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1); |
59 | void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2); | 59 | void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2); |
60 | void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2, const QString& param3); | 60 | void receivedMessageFromSource(const QString& sourceChannel, const QString& uid, const QString& param1, const QString& param2, const QString& param3); |
61 | 61 | ||
62 | public: | 62 | public: |
63 | int _usedSourceParameters; | 63 | int _usedSourceParameters; |
64 | QString _sourceChannel; | 64 | QString _sourceChannel; |
65 | QString _sourceMessage; | 65 | QString _sourceMessage; |
66 | QString _sourceMessageParameters; | 66 | QString _sourceMessageParameters; |
67 | QString _targetChannel; | 67 | QString _targetChannel; |
68 | QString _targetMessage; | 68 | QString _targetMessage; |
69 | QString _targetMessageParameters; | 69 | QString _targetMessageParameters; |
70 | 70 | ||
71 | }; | 71 | }; |
72 | 72 | ||
73 | /********************************************************************************* | 73 | /********************************************************************************* |
74 | * | 74 | * |
75 | ********************************************************************************/ | 75 | ********************************************************************************/ |
76 | 76 | ||
77 | class QCopMapTransferItem : public QCopTransferItem | 77 | class QCopMapTransferItem : public QCopTransferItem |
78 | { | 78 | { |
79 | Q_OBJECT | 79 | Q_OBJECT |
80 | public: | 80 | public: |
81 | QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); | 81 | QCopMapTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); |
82 | 82 | ||
83 | bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap); | 83 | bool sendMessageToSource(const QString& uid, const QMap<QString,QString>& nameEmailMap); |
84 | 84 | ||
85 | 85 | ||
86 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); | 86 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); |
87 | 87 | ||
88 | 88 | ||
89 | signals: | 89 | signals: |
90 | void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap); | 90 | void receivedMessageFromTarget(const QString& uid, const QMap<QString,QString>& nameEmailMap); |
91 | 91 | ||
92 | }; | 92 | }; |
93 | 93 | ||
94 | /********************************************************************************* | 94 | /********************************************************************************* |
95 | * | 95 | * |
96 | ********************************************************************************/ | 96 | ********************************************************************************/ |
97 | 97 | ||
98 | class QCopListTransferItem : public QCopTransferItem | 98 | class QCopListTransferItem : public QCopTransferItem |
99 | { | 99 | { |
100 | Q_OBJECT | 100 | Q_OBJECT |
101 | public: | 101 | public: |
102 | QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); | 102 | QCopListTransferItem(int usedSourceParameters, const QString& sourceMessage, const QString& targetChannel, const QString& targetMessage); |
103 | ~QCopListTransferItem(); | 103 | ~QCopListTransferItem(); |
104 | bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6); | 104 | bool sendMessageToSource(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4, const QStringList& list5, const QStringList& list6); |
105 | 105 | ||
106 | 106 | ||
107 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); | 107 | virtual bool appMessage( const QCString& msg, const QByteArray& data ); |
108 | 108 | ||
109 | 109 | ||
110 | signals: | 110 | signals: |
111 | void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4 , const QStringList& list5, const QStringList& list6); | 111 | void receivedMessageFromTarget(const QString& uid, const QStringList& list1, const QStringList& list2, const QStringList& list3, const QStringList& list4 , const QStringList& list5, const QStringList& list6); |
112 | 112 | ||
113 | }; | 113 | }; |
114 | 114 | ||
115 | /********************************************************************************* | 115 | /********************************************************************************* |
116 | * | 116 | * |
117 | ********************************************************************************/ | 117 | ********************************************************************************/ |
118 | 118 | ||
119 | 119 | ||
120 | class DefaultAppItem | 120 | class DefaultAppItem |
121 | { | 121 | { |
122 | public: | 122 | public: |
123 | DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) | 123 | DefaultAppItem(int type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2) |
124 | : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) | 124 | : _type(type), _id(id), _label(label), _channel(channel), _message(message), _parameters(parameters), _message2(message2), _parameters2(parameters2) |
125 | {} | 125 | {} |
126 | 126 | ||
127 | DefaultAppItem() | 127 | DefaultAppItem() |
128 | { } | 128 | { } |
129 | 129 | ||
130 | public: | 130 | public: |
131 | int _type; | 131 | int _type; |
132 | int _id; | 132 | int _id; |
133 | QString _label; | 133 | QString _label; |
134 | QString _channel; | 134 | QString _channel; |
135 | QString _message; | 135 | QString _message; |
136 | QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ; | 136 | QString _parameters;// a list of parameters in stringrepresentation. Delimiter is ; |
137 | QString _message2; | 137 | QString _message2; |
138 | QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ; | 138 | QString _parameters2; // a list of parameters in stringrepresentation. Delimiter is ; |
139 | 139 | ||
140 | }; | 140 | }; |
141 | 141 | ||
142 | /********************************************************************************* | 142 | /********************************************************************************* |
143 | * | 143 | * |
144 | ********************************************************************************/ | 144 | ********************************************************************************/ |
145 | 145 | ||
146 | class ExternalAppHandler : public QObject | 146 | class ExternalAppHandler : public QObject |
147 | { | 147 | { |
148 | Q_OBJECT | 148 | Q_OBJECT |
149 | public: | 149 | public: |
150 | virtual ~ExternalAppHandler(); | 150 | virtual ~ExternalAppHandler(); |
151 | 151 | ||
152 | static ExternalAppHandler *instance(); | 152 | static ExternalAppHandler *instance(); |
153 | 153 | ||
154 | enum Types { | 154 | enum Types { |
155 | EMAIL = 0, | 155 | EMAIL = 0, |
156 | PHONE = 1, | 156 | PHONE = 1, |
157 | SMS = 2, | 157 | SMS = 2, |
158 | FAX = 3, | 158 | FAX = 3, |
159 | PAGER = 4, | 159 | PAGER = 4, |
160 | SIP = 5 | 160 | SIP = 5 |
161 | }; | 161 | }; |
162 | 162 | ||
163 | enum Availability { | 163 | enum Availability { |
164 | UNDEFINED = -1, | 164 | UNDEFINED = -1, |
165 | UNAVAILABLE = 0, | 165 | UNAVAILABLE = 0, |
166 | AVAILABLE = 1 | 166 | AVAILABLE = 1 |
167 | }; | 167 | }; |
168 | 168 | ||
169 | //calls the emailapplication with a number of attachments that need to be send. | 169 | //calls the emailapplication with a number of attachments that need to be send. |
170 | //either parameter can be left empty. | 170 | //either parameter can be left empty. |
171 | bool mailToMultipleContacts( const QString& recipients, const QString& attachmenturls ); | 171 | bool mailToMultipleContacts( const QString& recipients, const QString& attachmenturls ); |
172 | 172 | ||
173 | //calls the emailapplication and creates a mail with parameter emailadress as recipients | 173 | //calls the emailapplication and creates a mail with parameter emailadress as recipients |
174 | bool mailToOneContact( const QString& name, const QString& emailadress ); | 174 | bool mailToOneContact( const QString& name, const QString& emailadress ); |
175 | 175 | ||
176 | //calls the emailapplication and creates a mail with parameter as recipients | 176 | //calls the emailapplication and creates a mail with parameter as recipients |
177 | // parameters format is | 177 | // parameters format is |
178 | // NAME <EMAIL>:SUBJECT | 178 | // NAME <EMAIL>:SUBJECT |
179 | bool mailToOneContact( const QString& adressline ); | 179 | bool mailToOneContact( const QString& adressline ); |
180 | 180 | ||
181 | //calls the phoneapplication with the number | 181 | //calls the phoneapplication with the number |
182 | bool callByPhone( const QString& phonenumber ); | 182 | bool callByPhone( const QString& phonenumber ); |
183 | 183 | ||
184 | //calls the smsapplication with the number | 184 | //calls the smsapplication with the number |
185 | bool callBySMS( const QString& phonenumber ); | 185 | bool callBySMS( const QString& phonenumber ); |
186 | 186 | ||
187 | //calls the pagerapplication with the number | 187 | //calls the pagerapplication with the number |
188 | bool callByPager( const QString& pagernumber ); | 188 | bool callByPager( const QString& pagernumber ); |
189 | 189 | ||
190 | //calls the faxapplication with the number | 190 | //calls the faxapplication with the number |
191 | bool callByFax( const QString& faxnumber ); | 191 | bool callByFax( const QString& faxnumber ); |
192 | 192 | ||
193 | //calls the sipapplication with the number | 193 | //calls the sipapplication with the number |
194 | bool callBySIP( const QString& sipnumber ); | 194 | bool callBySIP( const QString& sipnumber ); |
195 | 195 | ||
196 | bool isEmailAppAvailable(); | 196 | bool isEmailAppAvailable(); |
197 | bool isSMSAppAvailable(); | 197 | bool isSMSAppAvailable(); |
198 | bool isPhoneAppAvailable(); | 198 | bool isPhoneAppAvailable(); |
199 | bool isFaxAppAvailable(); | 199 | bool isFaxAppAvailable(); |
200 | bool isPagerAppAvailable(); | 200 | bool isPagerAppAvailable(); |
201 | bool isSIPAppAvailable(); | 201 | bool isSIPAppAvailable(); |
202 | 202 | ||
203 | 203 | ||
204 | //Call this method on the source when you want to select names from the addressbook by using QCop | 204 | //Call this method on the source when you want to select names from the addressbook by using QCop |
205 | bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid); | 205 | bool requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid); |
206 | //Call this method on the target when you want to return the name/email map to the source (client). | 206 | //Call this method on the target when you want to return the name/email map to the source (client). |
207 | bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); | 207 | bool returnNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); |
208 | 208 | ||
209 | 209 | ||
210 | 210 | ||
211 | bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email); | 211 | bool requestFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QString& email); |
212 | bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); | 212 | bool returnFindByEmailFromKAPI(const QString& sourceChannel, const QString& sessionuid, const QStringList& name, const QStringList& email, const QStringList& uid); |
213 | 213 | ||
214 | bool requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid); | 214 | bool requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid); |
215 | 215 | ||
216 | 216 | ||
217 | 217 | ||
218 | bool requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid); | 218 | bool requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid); |
219 | bool returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, | 219 | bool returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid, |
220 | const QStringList& birthdayList, const QStringList& anniversaryList, | 220 | const QStringList& birthdayList, const QStringList& anniversaryList, |
221 | const QStringList& realNameList, const QStringList& emailList, | 221 | const QStringList& realNameList, const QStringList& emailList, |
222 | const QStringList& assembledNameList, const QStringList& uidList); | 222 | const QStringList& assembledNameList, const QStringList& uidList); |
223 | 223 | ||
224 | 224 | ||
225 | //loadConfig clears the cache and checks again if the applications are available or not | 225 | //loadConfig clears the cache and checks again if the applications are available or not |
226 | void loadConfig(); | 226 | void loadConfig(); |
227 | 227 | ||
228 | QList<DefaultAppItem> getAvailableDefaultItems(Types); | 228 | QList<DefaultAppItem> getAvailableDefaultItems(Types); |
229 | DefaultAppItem* getDefaultItem(Types, int); | 229 | DefaultAppItem* getDefaultItem(Types, int); |
230 | 230 | ||
231 | public slots: | 231 | public slots: |
232 | void appMessage( const QCString& msg, const QByteArray& data ); | 232 | void appMessage( const QCString& msg, const QByteArray& data ); |
233 | 233 | ||
234 | 234 | ||
235 | signals: | 235 | signals: |
236 | void callContactdialog(); | ||
236 | void nextView(); | 237 | void nextView(); |
237 | // Emmitted when the target app receives a request from the source app | 238 | // Emmitted when the target app receives a request from the source app |
238 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid); | 239 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid); |
239 | 240 | ||
240 | // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi | 241 | // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi |
241 | // The first parameter is a uniqueid. It can be used to identify the event | 242 | // The first parameter is a uniqueid. It can be used to identify the event |
242 | void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); | 243 | void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); |
243 | 244 | ||
244 | void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email); | 245 | void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email); |
245 | void receivedFindByEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); | 246 | void receivedFindByEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList); |
246 | 247 | ||
247 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); | 248 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); |
248 | 249 | ||
249 | 250 | ||
250 | // Emmitted when the target app receives a request from the source app | 251 | // Emmitted when the target app receives a request from the source app |
251 | void requestForBirthdayList(const QString& sourceChannel, const QString& uid); | 252 | void requestForBirthdayList(const QString& sourceChannel, const QString& uid); |
252 | 253 | ||
253 | // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi | 254 | // Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi |
254 | // The first parameter is a uniqueid. It can be used to identify the event | 255 | // The first parameter is a uniqueid. It can be used to identify the event |
255 | void receivedBirthdayListEvent(const QString& uid, const QStringList& birthdayList, | 256 | void receivedBirthdayListEvent(const QString& uid, const QStringList& birthdayList, |
256 | const QStringList& anniversaryList, const QStringList& realNameList, | 257 | const QStringList& anniversaryList, const QStringList& realNameList, |
257 | const QStringList& emailList, const QStringList& assembledNameList, | 258 | const QStringList& emailList, const QStringList& assembledNameList, |
258 | const QStringList& uidList); | 259 | const QStringList& uidList); |
259 | 260 | ||
260 | 261 | ||
261 | private: | 262 | private: |
262 | ExternalAppHandler(); | 263 | ExternalAppHandler(); |
263 | QList<DefaultAppItem> mDefaultItems; | 264 | QList<DefaultAppItem> mDefaultItems; |
264 | 265 | ||
265 | Availability mEmailAppAvailable; | 266 | Availability mEmailAppAvailable; |
266 | Availability mPhoneAppAvailable; | 267 | Availability mPhoneAppAvailable; |
267 | Availability mFaxAppAvailable; | 268 | Availability mFaxAppAvailable; |
268 | Availability mSMSAppAvailable; | 269 | Availability mSMSAppAvailable; |
269 | Availability mPagerAppAvailable; | 270 | Availability mPagerAppAvailable; |
270 | Availability mSIPAppAvailable; | 271 | Availability mSIPAppAvailable; |
271 | 272 | ||
272 | QCopListTransferItem* mNameEmailUidListFromKAPITransfer; | 273 | QCopListTransferItem* mNameEmailUidListFromKAPITransfer; |
273 | QCopListTransferItem* mFindByEmailFromKAPITransfer; | 274 | QCopListTransferItem* mFindByEmailFromKAPITransfer; |
274 | QCopTransferItem* mDisplayDetails; | 275 | QCopTransferItem* mDisplayDetails; |
275 | QCopListTransferItem* mBirthdayListFromKAPITransfer; | 276 | QCopListTransferItem* mBirthdayListFromKAPITransfer; |
276 | 277 | ||
277 | 278 | ||
278 | void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2); | 279 | void addDefaultAppItem(Types type, int id, const QString& label, const QString& channel, const QString& message, const QString& parameters, const QString& message2, const QString& parameters2); |
279 | 280 | ||
280 | QString& translateMessage(QString& message, const QString& param1, const QString& param2) const; | 281 | QString& translateMessage(QString& message, const QString& param1, const QString& param2) const; |
281 | void passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1, const QString& param2) const; | 282 | void passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1, const QString& param2) const; |
282 | 283 | ||
283 | 284 | ||
284 | static ExternalAppHandler *sInstance; | 285 | static ExternalAppHandler *sInstance; |
285 | 286 | ||
286 | private slots: | 287 | private slots: |
287 | void receivedNameEmailUidList_Slot(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList, const QStringList&, const QStringList&, const QStringList& ); | 288 | void receivedNameEmailUidList_Slot(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList, const QStringList&, const QStringList&, const QStringList& ); |
288 | 289 | ||
289 | }; | 290 | }; |
290 | 291 | ||
291 | 292 | ||
292 | #endif | 293 | #endif |