author | zautrix <zautrix> | 2005-03-25 00:08:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-25 00:08:08 (UTC) |
commit | 7c2e130ddd194f1c4b5365af6999a27c08232f4b (patch) (unidiff) | |
tree | 75665681327ee49d7650f4d840b5c8c772180fb4 | |
parent | 5cf054b82738d65f9b0a34ccb51c993ee4a0189f (diff) | |
download | kdepimpi-7c2e130ddd194f1c4b5365af6999a27c08232f4b.zip kdepimpi-7c2e130ddd194f1c4b5365af6999a27c08232f4b.tar.gz kdepimpi-7c2e130ddd194f1c4b5365af6999a27c08232f4b.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | kaddressbook/filtereditdialog.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 3 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 3 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 15 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.h | 1 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 15 | ||||
-rw-r--r-- | microkde/kglobalsettings.cpp | 8 |
9 files changed, 37 insertions, 14 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 706fb7f..1c2bff8 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,102 +1,104 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.21 ************ | 3 | ********** VERSION 2.0.21 ************ |
4 | 4 | ||
5 | Fixed another SMTP problem in OM/Pi. | 5 | Fixed another SMTP problem in OM/Pi. |
6 | Some small changed in the new datenavigator in KO/Pi. | 6 | Some small changed in the new datenavigator in KO/Pi. |
7 | Changed default setting for new filter in KA/Pi to "exclude categories". | ||
8 | Changed the default font size for 640x480 display | ||
7 | 9 | ||
8 | ********** VERSION 2.0.20 ************ | 10 | ********** VERSION 2.0.20 ************ |
9 | 11 | ||
10 | Two small fixes in OM/Pi. | 12 | Two small fixes in OM/Pi. |
11 | 13 | ||
12 | Better resizing of the new datenavigator in KO/Pi. | 14 | Better resizing of the new datenavigator in KO/Pi. |
13 | 15 | ||
14 | ********** VERSION 2.0.19 ************ | 16 | ********** VERSION 2.0.19 ************ |
15 | KO/Pi: | 17 | KO/Pi: |
16 | Enhancements and bugfixes in the new datenavigator. | 18 | Enhancements and bugfixes in the new datenavigator. |
17 | Bugfix in this changelog: | 19 | Bugfix in this changelog: |
18 | The datenavigator was changed in version 2.0.18, not the datepicker. | 20 | The datenavigator was changed in version 2.0.18, not the datepicker. |
19 | 21 | ||
20 | ********** VERSION 2.0.18 ************ | 22 | ********** VERSION 2.0.18 ************ |
21 | KO/Pi: | 23 | KO/Pi: |
22 | Fixed some minor problems. | 24 | Fixed some minor problems. |
23 | Cleaned up the KO/Pi config dialog. | 25 | Cleaned up the KO/Pi config dialog. |
24 | Fixed problem moving events in aganda view. | 26 | Fixed problem moving events in aganda view. |
25 | Made datepicker scaleable, i.e. if the datenavigator shows now a | 27 | Made datepicker scaleable, i.e. if the datenavigator shows now a |
26 | datenavigator matrix depending on its size. | 28 | datenavigator matrix depending on its size. |
27 | Birthdays are now displayed green in the datenavigator. | 29 | Birthdays are now displayed green in the datenavigator. |
28 | What'sThis Help in datenavigator shows all events of the day. | 30 | What'sThis Help in datenavigator shows all events of the day. |
29 | 31 | ||
30 | OM/Pi: | 32 | OM/Pi: |
31 | Updated the backend mail library to the latest version. | 33 | Updated the backend mail library to the latest version. |
32 | Please backup your mail before using this version. | 34 | Please backup your mail before using this version. |
33 | 35 | ||
34 | ********** VERSION 2.0.17 ************ | 36 | ********** VERSION 2.0.17 ************ |
35 | 37 | ||
36 | KO/Pi: | 38 | KO/Pi: |
37 | Tooltips in month view were not sorted. Fixed. | 39 | Tooltips in month view were not sorted. Fixed. |
38 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. | 40 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. |
39 | Conflict display dialog for syncing was not on top of other windows. Fixed. | 41 | Conflict display dialog for syncing was not on top of other windows. Fixed. |
40 | Fixed some minor problems. | 42 | Fixed some minor problems. |
41 | 43 | ||
42 | Fixed an endless loop when importing vcs file with RESOURCES entry. | 44 | Fixed an endless loop when importing vcs file with RESOURCES entry. |
43 | 45 | ||
44 | ********** VERSION 2.0.16 ************ | 46 | ********** VERSION 2.0.16 ************ |
45 | OM/Pi: | 47 | OM/Pi: |
46 | Fixed the SMTP account setting the option. | 48 | Fixed the SMTP account setting the option. |
47 | Fixed something in mail sending. | 49 | Fixed something in mail sending. |
48 | 50 | ||
49 | KO/Pi: | 51 | KO/Pi: |
50 | Added possibility to export selected events/todos as vcal file. | 52 | Added possibility to export selected events/todos as vcal file. |
51 | 53 | ||
52 | ********** VERSION 2.0.15 ************ | 54 | ********** VERSION 2.0.15 ************ |
53 | 55 | ||
54 | PwM/Pi: | 56 | PwM/Pi: |
55 | Added keyboard shorcuts for | 57 | Added keyboard shorcuts for |
56 | - toggling summary view (space bar) | 58 | - toggling summary view (space bar) |
57 | - delete item (delete + backspace key) | 59 | - delete item (delete + backspace key) |
58 | - add new item ( i + n key) | 60 | - add new item ( i + n key) |
59 | Fixed length of info in the title. | 61 | Fixed length of info in the title. |
60 | 62 | ||
61 | KO/Pi-KA/Pi: | 63 | KO/Pi-KA/Pi: |
62 | Changed "ME" menu bar entry to an icon. | 64 | Changed "ME" menu bar entry to an icon. |
63 | 65 | ||
64 | KO/Pi: | 66 | KO/Pi: |
65 | Fixed two minor bugs in displaying todos. | 67 | Fixed two minor bugs in displaying todos. |
66 | If in month view a cell is selected, the key shortcut "d" shows now that date. | 68 | If in month view a cell is selected, the key shortcut "d" shows now that date. |
67 | Added complete info for a todo in month view as an icon left of the text. | 69 | Added complete info for a todo in month view as an icon left of the text. |
68 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. | 70 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. |
69 | Fixed problem of search dialog size when switching displays. | 71 | Fixed problem of search dialog size when switching displays. |
70 | Cancel key now closes date picker. | 72 | Cancel key now closes date picker. |
71 | Rearranged KO/Pi file menu structure. | 73 | Rearranged KO/Pi file menu structure. |
72 | 74 | ||
73 | OM/Pi: | 75 | OM/Pi: |
74 | Added to the SMTP account setting the option | 76 | Added to the SMTP account setting the option |
75 | "No secure connection". | 77 | "No secure connection". |
76 | You have to configure your SMTP accounts again, sorry. | 78 | You have to configure your SMTP accounts again, sorry. |
77 | 79 | ||
78 | KA/Pi: | 80 | KA/Pi: |
79 | Added support for importing quoted-printable. | 81 | Added support for importing quoted-printable. |
80 | Support was added by Peter P.. Thanks, Peter! | 82 | Support was added by Peter P.. Thanks, Peter! |
81 | 83 | ||
82 | 84 | ||
83 | ********** VERSION 2.0.14 ************ | 85 | ********** VERSION 2.0.14 ************ |
84 | 86 | ||
85 | Made Passwordmanager PwM/Pi more userfriendly: | 87 | Made Passwordmanager PwM/Pi more userfriendly: |
86 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 88 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
87 | Fixed bug in KO/Pi todo printing. | 89 | Fixed bug in KO/Pi todo printing. |
88 | Made Qtopia calendar import possible on desktop . | 90 | Made Qtopia calendar import possible on desktop . |
89 | 91 | ||
90 | ********** VERSION 2.0.13 ************ | 92 | ********** VERSION 2.0.13 ************ |
91 | 93 | ||
92 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. | 94 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. |
93 | 95 | ||
94 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". | 96 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". |
95 | 97 | ||
96 | OM/Pi: | 98 | OM/Pi: |
97 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. | 99 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. |
98 | Added missing German translation. | 100 | Added missing German translation. |
99 | Added warning if path is specified in local folder settings of account config. | 101 | Added warning if path is specified in local folder settings of account config. |
100 | 102 | ||
101 | ********** VERSION 2.0.12 ************ | 103 | ********** VERSION 2.0.12 ************ |
102 | 104 | ||
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index b976f1b..c6cd0ae 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1209,101 +1209,101 @@ | |||
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 | { "","" }, | 1305 | { "Edit new item","Bearbeite neuen Eintrag" }, |
1306 | { "","" }, | 1306 | { "","" }, |
1307 | { "","" }, | 1307 | { "","" }, |
1308 | { "","" }, | 1308 | { "","" }, |
1309 | { "","" }, | 1309 | { "","" }, |
diff --git a/kaddressbook/filtereditdialog.cpp b/kaddressbook/filtereditdialog.cpp index 1194406..ef9b979 100644 --- a/kaddressbook/filtereditdialog.cpp +++ b/kaddressbook/filtereditdialog.cpp | |||
@@ -65,195 +65,195 @@ FilterEditDialog::FilterEditDialog( QWidget *parent, const char *name ) | |||
65 | QStringList::Iterator iter; | 65 | QStringList::Iterator iter; |
66 | for ( iter = cats.begin(); iter != cats.end(); ++iter ) | 66 | for ( iter = cats.begin(); iter != cats.end(); ++iter ) |
67 | mCategoriesView->insertItem( new QCheckListItem( mCategoriesView, (*iter), QCheckListItem::CheckBox ) ); | 67 | mCategoriesView->insertItem( new QCheckListItem( mCategoriesView, (*iter), QCheckListItem::CheckBox ) ); |
68 | filterNameTextChanged( mNameEdit->text() ); | 68 | filterNameTextChanged( mNameEdit->text() ); |
69 | } | 69 | } |
70 | 70 | ||
71 | FilterEditDialog::~FilterEditDialog() | 71 | FilterEditDialog::~FilterEditDialog() |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | void FilterEditDialog::setFilter( const Filter &filter ) | 75 | void FilterEditDialog::setFilter( const Filter &filter ) |
76 | { | 76 | { |
77 | mNameEdit->setText( filter.name() ); | 77 | mNameEdit->setText( filter.name() ); |
78 | 78 | ||
79 | QStringList categories = filter.categories(); | 79 | QStringList categories = filter.categories(); |
80 | QListViewItem *item = mCategoriesView->firstChild(); | 80 | QListViewItem *item = mCategoriesView->firstChild(); |
81 | while ( item != 0 ) { | 81 | while ( item != 0 ) { |
82 | if ( categories.contains( item->text( 0 ) ) ) { | 82 | if ( categories.contains( item->text( 0 ) ) ) { |
83 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); | 83 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); |
84 | checkItem->setOn( true ); | 84 | checkItem->setOn( true ); |
85 | } | 85 | } |
86 | 86 | ||
87 | item = item->nextSibling(); | 87 | item = item->nextSibling(); |
88 | } | 88 | } |
89 | 89 | ||
90 | if ( filter.matchRule() == Filter::Matching ) | 90 | if ( filter.matchRule() == Filter::Matching ) |
91 | mMatchRuleGroup->setButton( 0 ); | 91 | mMatchRuleGroup->setButton( 0 ); |
92 | else | 92 | else |
93 | mMatchRuleGroup->setButton( 1 ); | 93 | mMatchRuleGroup->setButton( 1 ); |
94 | 94 | ||
95 | int c = filter.criteria() ; | 95 | int c = filter.criteria() ; |
96 | mPublic->setChecked(c &Filter::ShowPublic); | 96 | mPublic->setChecked(c &Filter::ShowPublic); |
97 | mPrivate->setChecked(c & Filter::ShowPrivate); | 97 | mPrivate->setChecked(c & Filter::ShowPrivate); |
98 | mConfidential->setChecked(c & Filter::ShowConfidential); | 98 | mConfidential->setChecked(c & Filter::ShowConfidential); |
99 | } | 99 | } |
100 | 100 | ||
101 | Filter FilterEditDialog::filter() | 101 | Filter FilterEditDialog::filter() |
102 | { | 102 | { |
103 | Filter filter; | 103 | Filter filter; |
104 | 104 | ||
105 | filter.setName( mNameEdit->text() ); | 105 | filter.setName( mNameEdit->text() ); |
106 | 106 | ||
107 | QStringList categories; | 107 | QStringList categories; |
108 | QListViewItem *item = mCategoriesView->firstChild(); | 108 | QListViewItem *item = mCategoriesView->firstChild(); |
109 | while ( item != 0 ) { | 109 | while ( item != 0 ) { |
110 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); | 110 | QCheckListItem *checkItem = static_cast<QCheckListItem*>( item ); |
111 | if ( checkItem->isOn() ) | 111 | if ( checkItem->isOn() ) |
112 | categories.append( item->text( 0 ) ); | 112 | categories.append( item->text( 0 ) ); |
113 | 113 | ||
114 | item = item->nextSibling(); | 114 | item = item->nextSibling(); |
115 | } | 115 | } |
116 | filter.setCategories( categories ); | 116 | filter.setCategories( categories ); |
117 | 117 | ||
118 | if ( mMatchRuleGroup->find( 0 )->isOn() ) | 118 | if ( mMatchRuleGroup->find( 0 )->isOn() ) |
119 | filter.setMatchRule( Filter::Matching ); | 119 | filter.setMatchRule( Filter::Matching ); |
120 | else | 120 | else |
121 | filter.setMatchRule( Filter::NotMatching ); | 121 | filter.setMatchRule( Filter::NotMatching ); |
122 | 122 | ||
123 | int c = 0; | 123 | int c = 0; |
124 | if (mPublic->isChecked()) c |= Filter::ShowPublic; | 124 | if (mPublic->isChecked()) c |= Filter::ShowPublic; |
125 | if (mPrivate->isChecked()) c |= Filter::ShowPrivate; | 125 | if (mPrivate->isChecked()) c |= Filter::ShowPrivate; |
126 | if (mConfidential->isChecked()) c |= Filter::ShowConfidential; | 126 | if (mConfidential->isChecked()) c |= Filter::ShowConfidential; |
127 | filter.setCriteria( c ) ; | 127 | filter.setCriteria( c ) ; |
128 | 128 | ||
129 | return filter; | 129 | return filter; |
130 | } | 130 | } |
131 | 131 | ||
132 | void FilterEditDialog::initGUI() | 132 | void FilterEditDialog::initGUI() |
133 | { | 133 | { |
134 | #ifndef KAB_EMBEDDED | 134 | #ifndef KAB_EMBEDDED |
135 | resize( 490, 300 ); | 135 | resize( 490, 300 ); |
136 | #else //KAB_EMBEDDED | 136 | #else //KAB_EMBEDDED |
137 | resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); | 137 | resize( KMIN(KGlobal::getDesktopWidth()-10, 490), KMIN(KGlobal::getDesktopHeight()-50, 300)); |
138 | #endif //KAB_EMBEDDED | 138 | #endif //KAB_EMBEDDED |
139 | 139 | ||
140 | 140 | ||
141 | QWidget *page = plainPage(); | 141 | QWidget *page = plainPage(); |
142 | QLabel *label; | 142 | QLabel *label; |
143 | 143 | ||
144 | QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); | 144 | QGridLayout *topLayout = new QGridLayout( page, 3, 2, 0, spacingHint() ); |
145 | 145 | ||
146 | label = new QLabel( i18n( "Name" ), page ); | 146 | label = new QLabel( i18n( "Name" ), page ); |
147 | mNameEdit = new KLineEdit( page ); | 147 | mNameEdit = new KLineEdit( page ); |
148 | mNameEdit->setFocus(); | 148 | mNameEdit->setFocus(); |
149 | topLayout->addWidget( label, 0, 0 ); | 149 | topLayout->addWidget( label, 0, 0 ); |
150 | topLayout->addWidget( mNameEdit, 0, 1 ); | 150 | topLayout->addWidget( mNameEdit, 0, 1 ); |
151 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), | 151 | connect( mNameEdit, SIGNAL( textChanged( const QString& ) ), |
152 | SLOT( filterNameTextChanged( const QString&) ) ); | 152 | SLOT( filterNameTextChanged( const QString&) ) ); |
153 | 153 | ||
154 | mCategoriesView = new KListView( page ); | 154 | mCategoriesView = new KListView( page ); |
155 | mCategoriesView->addColumn( i18n( "Categories" ) ); | 155 | mCategoriesView->addColumn( i18n( "Categories" ) ); |
156 | topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); | 156 | topLayout->addMultiCellWidget( mCategoriesView, 1, 1, 0, 1 ); |
157 | 157 | ||
158 | mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); | 158 | mMatchRuleGroup = new QHButtonGroup( i18n( "Category rule" ), page ); |
159 | mMatchRuleGroup->setExclusive( true ); | 159 | mMatchRuleGroup->setExclusive( true ); |
160 | QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); | 160 | QRadioButton *radio = new QRadioButton( i18n( "Include categories" ), mMatchRuleGroup ); |
161 | radio->setChecked( true ); | ||
162 | //mMatchRuleGroup->insert( radio ); | 161 | //mMatchRuleGroup->insert( radio ); |
163 | radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); | 162 | radio = new QRadioButton( i18n( "Exclude categories" ), mMatchRuleGroup ); |
163 | radio->setChecked( true ); | ||
164 | //mMatchRuleGroup->insert( radio ); | 164 | //mMatchRuleGroup->insert( radio ); |
165 | topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); | 165 | topLayout->addMultiCellWidget( mMatchRuleGroup, 2, 2, 0, 1 ); |
166 | 166 | ||
167 | QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); | 167 | QHButtonGroup * mMatchPPCGroup = new QHButtonGroup(i18n( "Include contacts, that are:" ), page ); |
168 | mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); | 168 | mPublic = new QCheckBox( i18n( "public" ), mMatchPPCGroup ); |
169 | mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); | 169 | mPrivate = new QCheckBox( i18n( "private" ), mMatchPPCGroup ); |
170 | mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); | 170 | mConfidential = new QCheckBox( i18n( "confidential" ), mMatchPPCGroup ); |
171 | mPublic->setChecked( true ); | 171 | mPublic->setChecked( true ); |
172 | mPrivate->setChecked( true ); | 172 | mPrivate->setChecked( true ); |
173 | mConfidential->setChecked( true ); | 173 | mConfidential->setChecked( true ); |
174 | topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 ); | 174 | topLayout->addMultiCellWidget( mMatchPPCGroup, 3, 3, 0, 1 ); |
175 | 175 | ||
176 | } | 176 | } |
177 | 177 | ||
178 | void FilterEditDialog::filterNameTextChanged( const QString &text ) | 178 | void FilterEditDialog::filterNameTextChanged( const QString &text ) |
179 | { | 179 | { |
180 | enableButtonOK( !text.isEmpty() ); | 180 | enableButtonOK( !text.isEmpty() ); |
181 | } | 181 | } |
182 | 182 | ||
183 | void FilterEditDialog::slotHelp() | 183 | void FilterEditDialog::slotHelp() |
184 | { | 184 | { |
185 | #ifndef KAB_EMBEDDED | 185 | #ifndef KAB_EMBEDDED |
186 | kapp->invokeHelp( "using-filters" ); | 186 | kapp->invokeHelp( "using-filters" ); |
187 | #endif //KAB_EMBEDDED | 187 | #endif //KAB_EMBEDDED |
188 | } | 188 | } |
189 | 189 | ||
190 | FilterDialog::FilterDialog( QWidget *parent, const char *name ) | 190 | FilterDialog::FilterDialog( QWidget *parent, const char *name ) |
191 | : KDialogBase( Plain, i18n( "Edit Address Book Filters" ), | 191 | : KDialogBase( Plain, i18n( "Edit Address Book Filters" ), |
192 | Ok | Cancel, Ok, parent, name, /*US false*/true, true ) | 192 | Ok | Cancel, Ok, parent, name, /*US false*/true, true ) |
193 | { | 193 | { |
194 | initGUI(); | 194 | initGUI(); |
195 | } | 195 | } |
196 | 196 | ||
197 | FilterDialog::~FilterDialog() | 197 | FilterDialog::~FilterDialog() |
198 | { | 198 | { |
199 | } | 199 | } |
200 | 200 | ||
201 | void FilterDialog::setFilters( const Filter::List &list ) | 201 | void FilterDialog::setFilters( const Filter::List &list ) |
202 | { | 202 | { |
203 | mFilterList.clear(); | 203 | mFilterList.clear(); |
204 | mInternalFilterList.clear(); | 204 | mInternalFilterList.clear(); |
205 | 205 | ||
206 | Filter::List::ConstIterator it; | 206 | Filter::List::ConstIterator it; |
207 | for ( it = list.begin(); it != list.end(); ++it ) { | 207 | for ( it = list.begin(); it != list.end(); ++it ) { |
208 | if ( (*it).isInternal() ) | 208 | if ( (*it).isInternal() ) |
209 | mInternalFilterList.append( *it ); | 209 | mInternalFilterList.append( *it ); |
210 | else | 210 | else |
211 | mFilterList.append( *it ); | 211 | mFilterList.append( *it ); |
212 | } | 212 | } |
213 | 213 | ||
214 | refresh(); | 214 | refresh(); |
215 | } | 215 | } |
216 | 216 | ||
217 | Filter::List FilterDialog::filters() const | 217 | Filter::List FilterDialog::filters() const |
218 | { | 218 | { |
219 | Filter::List list = mFilterList + mInternalFilterList; | 219 | Filter::List list = mFilterList + mInternalFilterList; |
220 | return list; | 220 | return list; |
221 | } | 221 | } |
222 | 222 | ||
223 | void FilterDialog::add() | 223 | void FilterDialog::add() |
224 | { | 224 | { |
225 | #ifndef KAB_EMBEDDED | 225 | #ifndef KAB_EMBEDDED |
226 | FilterEditDialog dlg( this ); | 226 | FilterEditDialog dlg( this ); |
227 | #else //KAB_EMBEDDED | 227 | #else //KAB_EMBEDDED |
228 | FilterEditDialog dlg( this->parentWidget() ); | 228 | FilterEditDialog dlg( this->parentWidget() ); |
229 | #endif //KAB_EMBEDDED | 229 | #endif //KAB_EMBEDDED |
230 | 230 | ||
231 | if ( dlg.exec() ) | 231 | if ( dlg.exec() ) |
232 | mFilterList.append( dlg.filter() ); | 232 | mFilterList.append( dlg.filter() ); |
233 | 233 | ||
234 | refresh(); | 234 | refresh(); |
235 | 235 | ||
236 | mFilterListBox->setCurrentItem( mFilterListBox->count() - 1 ); | 236 | mFilterListBox->setCurrentItem( mFilterListBox->count() - 1 ); |
237 | } | 237 | } |
238 | 238 | ||
239 | void FilterDialog::edit() | 239 | void FilterDialog::edit() |
240 | { | 240 | { |
241 | FilterEditDialog dlg( this ); | 241 | FilterEditDialog dlg( this ); |
242 | 242 | ||
243 | uint pos = mFilterListBox->currentItem(); | 243 | uint pos = mFilterListBox->currentItem(); |
244 | 244 | ||
245 | dlg.setFilter( mFilterList[ pos ] ); | 245 | dlg.setFilter( mFilterList[ pos ] ); |
246 | 246 | ||
247 | if ( dlg.exec() ) { | 247 | if ( dlg.exec() ) { |
248 | mFilterList.remove( mFilterList.at( pos ) ); | 248 | mFilterList.remove( mFilterList.at( pos ) ); |
249 | mFilterList.insert( mFilterList.at( pos ), dlg.filter() ); | 249 | mFilterList.insert( mFilterList.at( pos ), dlg.filter() ); |
250 | } | 250 | } |
251 | 251 | ||
252 | refresh(); | 252 | refresh(); |
253 | 253 | ||
254 | mFilterListBox->setCurrentItem( pos ); | 254 | mFilterListBox->setCurrentItem( pos ); |
255 | } | 255 | } |
256 | 256 | ||
257 | void FilterDialog::remove() | 257 | void FilterDialog::remove() |
258 | { | 258 | { |
259 | mFilterList.remove( mFilterList.at( mFilterListBox->currentItem() ) ); | 259 | mFilterList.remove( mFilterList.at( mFilterListBox->currentItem() ) ); |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index e8f6132..59aa5a5 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -3093,243 +3093,246 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
3093 | ++deletedAddresseeL; | 3093 | ++deletedAddresseeL; |
3094 | } else { | 3094 | } else { |
3095 | if ( ! syncManager->mWriteBackExistingOnly ) { | 3095 | if ( ! syncManager->mWriteBackExistingOnly ) { |
3096 | ++addedAddresseeR; | 3096 | ++addedAddresseeR; |
3097 | inL.setRevision( modifiedCalendar ); | 3097 | inL.setRevision( modifiedCalendar ); |
3098 | local->insertAddressee( inL, false ); | 3098 | local->insertAddressee( inL, false ); |
3099 | inR = inL; | 3099 | inR = inL; |
3100 | inR.setIDStr( ":" ); | 3100 | inR.setIDStr( ":" ); |
3101 | inR.setResource( 0 ); | 3101 | inR.setResource( 0 ); |
3102 | remote->insertAddressee( inR, false ); | 3102 | remote->insertAddressee( inR, false ); |
3103 | } | 3103 | } |
3104 | } | 3104 | } |
3105 | } | 3105 | } |
3106 | } else { | 3106 | } else { |
3107 | ++filteredOUT; | 3107 | ++filteredOUT; |
3108 | } | 3108 | } |
3109 | } | 3109 | } |
3110 | } | 3110 | } |
3111 | } | 3111 | } |
3112 | ++incCounter; | 3112 | ++incCounter; |
3113 | } | 3113 | } |
3114 | el.clear(); | 3114 | el.clear(); |
3115 | syncManager->hideProgressBar(); | 3115 | syncManager->hideProgressBar(); |
3116 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); | 3116 | mLastAddressbookSync = QDateTime::currentDateTime().addSecs( 1 ); |
3117 | // get rid of micro seconds | 3117 | // get rid of micro seconds |
3118 | QTime t = mLastAddressbookSync.time(); | 3118 | QTime t = mLastAddressbookSync.time(); |
3119 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); | 3119 | mLastAddressbookSync.setTime( QTime (t.hour (), t.minute (), t.second () ) ); |
3120 | addresseeLSync.setRevision( mLastAddressbookSync ); | 3120 | addresseeLSync.setRevision( mLastAddressbookSync ); |
3121 | addresseeRSync.setRevision( mLastAddressbookSync ); | 3121 | addresseeRSync.setRevision( mLastAddressbookSync ); |
3122 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; | 3122 | addresseeRSync.setRole( i18n("!Remote from: ")+mCurrentSyncName ) ; |
3123 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); | 3123 | addresseeLSync.setRole(i18n("!Local from: ") + mCurrentSyncName ); |
3124 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; | 3124 | addresseeRSync.setGivenName( i18n("!DO NOT EDIT!") ) ; |
3125 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); | 3125 | addresseeLSync.setGivenName(i18n("!DO NOT EDIT!") ); |
3126 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; | 3126 | addresseeRSync.setOrganization( "!"+mLastAddressbookSync.toString() ) ; |
3127 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); | 3127 | addresseeLSync.setOrganization("!"+ mLastAddressbookSync.toString() ); |
3128 | addresseeRSync.setNote( "" ) ; | 3128 | addresseeRSync.setNote( "" ) ; |
3129 | addresseeLSync.setNote( "" ); | 3129 | addresseeLSync.setNote( "" ); |
3130 | 3130 | ||
3131 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) | 3131 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL) |
3132 | remote->insertAddressee( addresseeRSync, false ); | 3132 | remote->insertAddressee( addresseeRSync, false ); |
3133 | local->insertAddressee( addresseeLSync, false ); | 3133 | local->insertAddressee( addresseeLSync, false ); |
3134 | QString mes; | 3134 | QString mes; |
3135 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT ); | 3135 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT ); |
3136 | qDebug( mes ); | 3136 | qDebug( mes ); |
3137 | mes = i18n("Local addressbook changed!\n") +mes; | 3137 | mes = i18n("Local addressbook changed!\n") +mes; |
3138 | if ( syncManager->mShowSyncSummary ) { | 3138 | if ( syncManager->mShowSyncSummary ) { |
3139 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, | 3139 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, |
3140 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { | 3140 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { |
3141 | qDebug("KA: WB cancelled "); | 3141 | qDebug("KA: WB cancelled "); |
3142 | syncManager->mWriteBackFile = false; | 3142 | syncManager->mWriteBackFile = false; |
3143 | return syncOK; | 3143 | return syncOK; |
3144 | } | 3144 | } |
3145 | } | 3145 | } |
3146 | return syncOK; | 3146 | return syncOK; |
3147 | } | 3147 | } |
3148 | 3148 | ||
3149 | 3149 | ||
3150 | //this is a overwritten callbackmethods from the syncinterface | 3150 | //this is a overwritten callbackmethods from the syncinterface |
3151 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | 3151 | bool KABCore::sync(KSyncManager* manager, QString filename, int mode) |
3152 | { | 3152 | { |
3153 | 3153 | ||
3154 | //pending prepare addresseeview for output | 3154 | //pending prepare addresseeview for output |
3155 | //pending detect, if remote file has REV field. if not switch to external sync | 3155 | //pending detect, if remote file has REV field. if not switch to external sync |
3156 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 3156 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
3157 | if ( manager != syncManager ) | 3157 | if ( manager != syncManager ) |
3158 | qDebug("KABCore::sync:: ERROR! :: manager != syncManager "); | 3158 | qDebug("KABCore::sync:: ERROR! :: manager != syncManager "); |
3159 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 3159 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
3160 | 3160 | ||
3161 | AddressBook abLocal(filename,"syncContact"); | 3161 | AddressBook abLocal(filename,"syncContact"); |
3162 | bool syncOK = false; | 3162 | bool syncOK = false; |
3163 | if ( abLocal.load() ) { | 3163 | if ( abLocal.load() ) { |
3164 | qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode ); | 3164 | qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode ); |
3165 | bool external = false; | 3165 | bool external = false; |
3166 | bool isXML = false; | 3166 | bool isXML = false; |
3167 | if ( filename.right(4) == ".xml") { | 3167 | if ( filename.right(4) == ".xml") { |
3168 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3168 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3169 | isXML = true; | 3169 | isXML = true; |
3170 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 3170 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
3171 | } else { | 3171 | } else { |
3172 | external = !manager->mIsKapiFile; | 3172 | external = !manager->mIsKapiFile; |
3173 | if ( external ) { | 3173 | if ( external ) { |
3174 | qDebug("KA: Sync::Setting vcf mode to external "); | 3174 | qDebug("KA: Sync::Setting vcf mode to external "); |
3175 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3175 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3176 | AddressBook::Iterator it; | 3176 | AddressBook::Iterator it; |
3177 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 3177 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
3178 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); | 3178 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); |
3179 | (*it).computeCsum( mCurrentSyncDevice ); | 3179 | (*it).computeCsum( mCurrentSyncDevice ); |
3180 | } | 3180 | } |
3181 | } | 3181 | } |
3182 | } | 3182 | } |
3183 | //AddressBook::Iterator it; | 3183 | //AddressBook::Iterator it; |
3184 | //QStringList vcards; | 3184 | //QStringList vcards; |
3185 | //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 3185 | //for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
3186 | // qDebug("Name %s ", (*it).familyName().latin1()); | 3186 | // qDebug("Name %s ", (*it).familyName().latin1()); |
3187 | //} | 3187 | //} |
3188 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); | 3188 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); |
3189 | syncManager->hideProgressBar(); | ||
3189 | if ( syncOK ) { | 3190 | if ( syncOK ) { |
3190 | if ( syncManager->mWriteBackFile ) | 3191 | if ( syncManager->mWriteBackFile ) |
3191 | { | 3192 | { |
3192 | if ( external ) | 3193 | if ( external ) |
3193 | abLocal.removeSyncAddressees( !isXML); | 3194 | abLocal.removeSyncAddressees( !isXML); |
3194 | qDebug("KA: Sync::Saving remote AB "); | 3195 | qDebug("KA: Sync::Saving remote AB "); |
3195 | if ( ! abLocal.saveAB()) | 3196 | if ( ! abLocal.saveAB()) |
3196 | qDebug("KA: sync::Error writing back AB to file "); | 3197 | qDebug("KA: sync::Error writing back AB to file "); |
3197 | if ( external ) { | 3198 | if ( external ) { |
3198 | // afterwrite processing | 3199 | // afterwrite processing |
3199 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); | 3200 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); |
3200 | } | 3201 | } |
3201 | } | 3202 | } |
3202 | } | 3203 | } |
3203 | setModified(); | 3204 | setModified(); |
3204 | 3205 | ||
3205 | } | 3206 | } |
3206 | abLocal.removeResources(); | 3207 | abLocal.removeResources(); |
3207 | if ( syncOK ) | 3208 | if ( syncOK ) |
3208 | mViewManager->refreshView(); | 3209 | mViewManager->refreshView(); |
3209 | return syncOK; | 3210 | return syncOK; |
3210 | 3211 | ||
3211 | } | 3212 | } |
3212 | void KABCore::removeSyncInfo( QString syncProfile) | 3213 | void KABCore::removeSyncInfo( QString syncProfile) |
3213 | { | 3214 | { |
3214 | qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1()); | 3215 | qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1()); |
3215 | mAddressBook->removeSyncInfo( syncProfile ); | 3216 | mAddressBook->removeSyncInfo( syncProfile ); |
3216 | setModified(); | 3217 | setModified(); |
3217 | } | 3218 | } |
3218 | 3219 | ||
3219 | 3220 | ||
3220 | //this is a overwritten callbackmethods from the syncinterface | 3221 | //this is a overwritten callbackmethods from the syncinterface |
3221 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) | 3222 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) |
3222 | { | 3223 | { |
3223 | if ( resource == "phone" ) | 3224 | if ( resource == "phone" ) |
3224 | return syncPhone(); | 3225 | return syncPhone(); |
3225 | disableBR( true ); | 3226 | disableBR( true ); |
3226 | if ( manager != syncManager ) | 3227 | if ( manager != syncManager ) |
3227 | qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); | 3228 | qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); |
3228 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 3229 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
3229 | 3230 | ||
3230 | AddressBook abLocal( resource,"syncContact"); | 3231 | AddressBook abLocal( resource,"syncContact"); |
3231 | bool syncOK = false; | 3232 | bool syncOK = false; |
3232 | message(i18n("Loading DTM address data..."), false); | 3233 | message(i18n("Loading DTM address data..."), false); |
3233 | if ( abLocal.load() ) { | 3234 | if ( abLocal.load() ) { |
3234 | qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 3235 | qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
3235 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3236 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3236 | message(i18n("Sync preprocessing..."),false); | 3237 | message(i18n("Sync preprocessing..."),false); |
3237 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); | 3238 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); |
3238 | message(i18n("Synchronizing..."),false); | 3239 | message(i18n("Synchronizing..."),false); |
3239 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 3240 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
3241 | syncManager->hideProgressBar(); | ||
3240 | if ( syncOK ) { | 3242 | if ( syncOK ) { |
3241 | if ( syncManager->mWriteBackFile ) { | 3243 | if ( syncManager->mWriteBackFile ) { |
3242 | abLocal.removeSyncAddressees( false ); | 3244 | abLocal.removeSyncAddressees( false ); |
3243 | message(i18n("Saving DTM address data..."),false); | 3245 | message(i18n("Saving DTM address data..."),false); |
3244 | abLocal.saveAB(); | 3246 | abLocal.saveAB(); |
3245 | message(i18n("Sync postprocessing..."),false); | 3247 | message(i18n("Sync postprocessing..."),false); |
3246 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); | 3248 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
3247 | } | 3249 | } |
3248 | } else | 3250 | } else |
3249 | message( i18n("Sync cancelled or failed.") ); | 3251 | message( i18n("Sync cancelled or failed.") ); |
3250 | setModified(); | 3252 | setModified(); |
3251 | } | 3253 | } |
3252 | abLocal.removeResources(); | 3254 | abLocal.removeResources(); |
3253 | if ( syncOK ) { | 3255 | if ( syncOK ) { |
3254 | mViewManager->refreshView(); | 3256 | mViewManager->refreshView(); |
3255 | message(i18n("DTM syncing finished.")); | 3257 | message(i18n("DTM syncing finished.")); |
3256 | } | 3258 | } |
3257 | disableBR( false ); | 3259 | disableBR( false ); |
3258 | return syncOK; | 3260 | return syncOK; |
3259 | 3261 | ||
3260 | } | 3262 | } |
3261 | void KABCore::message( QString m, bool startTimer) | 3263 | void KABCore::message( QString m, bool startTimer) |
3262 | { | 3264 | { |
3263 | topLevelWidget()->setCaption( m ); | 3265 | topLevelWidget()->setCaption( m ); |
3264 | qApp->processEvents(); | 3266 | qApp->processEvents(); |
3265 | if ( startTimer ) | 3267 | if ( startTimer ) |
3266 | mMessageTimer->start( 15000, true ); | 3268 | mMessageTimer->start( 15000, true ); |
3267 | else | 3269 | else |
3268 | mMessageTimer->stop(); | 3270 | mMessageTimer->stop(); |
3269 | } | 3271 | } |
3270 | bool KABCore::syncPhone() | 3272 | bool KABCore::syncPhone() |
3271 | { | 3273 | { |
3272 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 3274 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
3273 | QString fileName = getPhoneFile(); | 3275 | QString fileName = getPhoneFile(); |
3274 | if ( !PhoneAccess::readFromPhone( fileName) ) { | 3276 | if ( !PhoneAccess::readFromPhone( fileName) ) { |
3275 | message(i18n("Phone access failed!")); | 3277 | message(i18n("Phone access failed!")); |
3276 | return false; | 3278 | return false; |
3277 | } | 3279 | } |
3278 | AddressBook abLocal( fileName,"syncContact"); | 3280 | AddressBook abLocal( fileName,"syncContact"); |
3279 | bool syncOK = false; | 3281 | bool syncOK = false; |
3280 | { | 3282 | { |
3281 | abLocal.importFromFile( fileName ); | 3283 | abLocal.importFromFile( fileName ); |
3282 | qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 3284 | qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
3283 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3285 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3284 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); | 3286 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); |
3285 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 3287 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
3286 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 3288 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
3289 | syncManager->hideProgressBar(); | ||
3287 | if ( syncOK ) { | 3290 | if ( syncOK ) { |
3288 | if ( syncManager->mWriteBackFile ) { | 3291 | if ( syncManager->mWriteBackFile ) { |
3289 | abLocal.removeSyncAddressees( true ); | 3292 | abLocal.removeSyncAddressees( true ); |
3290 | abLocal.saveABphone( fileName ); | 3293 | abLocal.saveABphone( fileName ); |
3291 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); | 3294 | abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); |
3292 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); | 3295 | //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); |
3293 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); | 3296 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); |
3294 | } | 3297 | } |
3295 | } | 3298 | } |
3296 | setModified(); | 3299 | setModified(); |
3297 | } | 3300 | } |
3298 | abLocal.removeResources(); | 3301 | abLocal.removeResources(); |
3299 | if ( syncOK ) | 3302 | if ( syncOK ) |
3300 | mViewManager->refreshView(); | 3303 | mViewManager->refreshView(); |
3301 | return syncOK; | 3304 | return syncOK; |
3302 | } | 3305 | } |
3303 | void KABCore::getFile( bool success ) | 3306 | void KABCore::getFile( bool success ) |
3304 | { | 3307 | { |
3305 | if ( ! success ) { | 3308 | if ( ! success ) { |
3306 | message( i18n("Error receiving file. Nothing changed!") ); | 3309 | message( i18n("Error receiving file. Nothing changed!") ); |
3307 | return; | 3310 | return; |
3308 | } | 3311 | } |
3309 | int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); | 3312 | int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); |
3310 | if ( count ) | 3313 | if ( count ) |
3311 | setModified( true ); | 3314 | setModified( true ); |
3312 | message( i18n("Pi-Sync successful!") ); | 3315 | message( i18n("Pi-Sync successful!") ); |
3313 | mViewManager->refreshView(); | 3316 | mViewManager->refreshView(); |
3314 | } | 3317 | } |
3315 | void KABCore::syncFileRequest() | 3318 | void KABCore::syncFileRequest() |
3316 | { | 3319 | { |
3317 | if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { | 3320 | if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { |
3318 | syncManager->slotSyncMenu( 999 ); | 3321 | syncManager->slotSyncMenu( 999 ); |
3319 | } | 3322 | } |
3320 | mAddressBook->export2File( sentSyncFile() ); | 3323 | mAddressBook->export2File( sentSyncFile() ); |
3321 | } | 3324 | } |
3322 | QString KABCore::sentSyncFile() | 3325 | QString KABCore::sentSyncFile() |
3323 | { | 3326 | { |
3324 | #ifdef DESKTOP_VERSION | 3327 | #ifdef DESKTOP_VERSION |
3325 | return locateLocal( "tmp", "copysyncab.vcf" ); | 3328 | return locateLocal( "tmp", "copysyncab.vcf" ); |
3326 | #else | 3329 | #else |
3327 | return QString( "/tmp/copysyncab.vcf" ); | 3330 | return QString( "/tmp/copysyncab.vcf" ); |
3328 | #endif | 3331 | #endif |
3329 | } | 3332 | } |
3330 | 3333 | ||
3331 | void KABCore::setCaptionBack() | 3334 | void KABCore::setCaptionBack() |
3332 | { | 3335 | { |
3333 | mMessageTimer->stop(); | 3336 | mMessageTimer->stop(); |
3334 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); | 3337 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); |
3335 | } | 3338 | } |
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 5420822..2820ca2 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -455,192 +455,195 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
455 | if (object != viewport()) { | 455 | if (object != viewport()) { |
456 | if (me->button() == RightButton || rightButtonPressed ) { | 456 | if (me->button() == RightButton || rightButtonPressed ) { |
457 | if ( blockMoving ) { | 457 | if ( blockMoving ) { |
458 | mClickedItem = (KOAgendaItem *)object; | 458 | mClickedItem = (KOAgendaItem *)object; |
459 | if (mActionItem ) { | 459 | if (mActionItem ) { |
460 | endItemAction(); | 460 | endItemAction(); |
461 | } | 461 | } |
462 | leftMouseDown = false; // no more leftMouse computation | 462 | leftMouseDown = false; // no more leftMouse computation |
463 | if (mClickedItem) { | 463 | if (mClickedItem) { |
464 | selectItem(mClickedItem); | 464 | selectItem(mClickedItem); |
465 | emit showIncidencePopupSignal(mClickedItem->incidence()); | 465 | emit showIncidencePopupSignal(mClickedItem->incidence()); |
466 | } | 466 | } |
467 | } | 467 | } |
468 | } else if (me->button() == LeftButton && leftMouseDown) { | 468 | } else if (me->button() == LeftButton && leftMouseDown) { |
469 | if (mActionItem) { | 469 | if (mActionItem) { |
470 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 470 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
471 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); | 471 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); |
472 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { | 472 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { |
473 | mScrollUpTimer.stop(); | 473 | mScrollUpTimer.stop(); |
474 | mScrollDownTimer.stop(); | 474 | mScrollDownTimer.stop(); |
475 | mActionItem->resetMove(); | 475 | mActionItem->resetMove(); |
476 | placeSubCells( mActionItem ); | 476 | placeSubCells( mActionItem ); |
477 | // emit startDragSignal( mActionItem->incidence() ); | 477 | // emit startDragSignal( mActionItem->incidence() ); |
478 | setCursor( arrowCursor ); | 478 | setCursor( arrowCursor ); |
479 | mActionItem = 0; | 479 | mActionItem = 0; |
480 | mActionType = NOP; | 480 | mActionType = NOP; |
481 | mItemMoved = 0; | 481 | mItemMoved = 0; |
482 | leftMouseDown = false; | 482 | leftMouseDown = false; |
483 | return true; | 483 | return true; |
484 | } | 484 | } |
485 | endItemAction(); | 485 | endItemAction(); |
486 | } | 486 | } |
487 | } | 487 | } |
488 | 488 | ||
489 | } else { // ---------- viewport() | 489 | } else { // ---------- viewport() |
490 | if (me->button() == RightButton || rightButtonPressed ) { //right click | 490 | if (me->button() == RightButton || rightButtonPressed ) { //right click |
491 | if ( blockMoving ) { // we did mot moved the mouse much - popup menu | 491 | if ( blockMoving ) { // we did mot moved the mouse much - popup menu |
492 | if ( leftMouseDown ) { // we have a simulated right click - clear left mouse action | 492 | if ( leftMouseDown ) { // we have a simulated right click - clear left mouse action |
493 | endSelectAction( false ); // do not emit new event signal | 493 | endSelectAction( false ); // do not emit new event signal |
494 | leftMouseDown = false; // no more leftMouse computation | 494 | leftMouseDown = false; // no more leftMouse computation |
495 | } | 495 | } |
496 | int x,y; | 496 | int x,y; |
497 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 497 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
498 | int gx,gy; | 498 | int gx,gy; |
499 | contentsToGrid(x,y,gx,gy); | 499 | contentsToGrid(x,y,gx,gy); |
500 | mCurrentCellX = gx; | 500 | mCurrentCellX = gx; |
501 | mCurrentCellY = gy; | 501 | mCurrentCellY = gy; |
502 | mStartCellX = gx; | 502 | mStartCellX = gx; |
503 | mStartCellY = gy; | 503 | mStartCellY = gy; |
504 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); | 504 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); |
505 | } | 505 | } |
506 | } | 506 | } |
507 | else if (me->button() == LeftButton && leftMouseDown ) { //left click | 507 | else if (me->button() == LeftButton && leftMouseDown ) { //left click |
508 | endSelectAction( true ); // emit new event signal | 508 | endSelectAction( true ); // emit new event signal |
509 | } | 509 | } |
510 | } | 510 | } |
511 | if (me->button() == LeftButton) | 511 | if (me->button() == LeftButton) |
512 | leftMouseDown = false; | 512 | leftMouseDown = false; |
513 | else if (me->button() == RightButton) | 513 | else if (me->button() == RightButton) |
514 | rightMouseDown = false; | 514 | rightMouseDown = false; |
515 | break; | 515 | break; |
516 | 516 | ||
517 | case QEvent::MouseMove: | 517 | case QEvent::MouseMove: |
518 | if ( !rightMouseDown && !leftMouseDown ) | 518 | if ( !rightMouseDown && !leftMouseDown ) |
519 | return true; | 519 | return true; |
520 | if ( blockMoving ) { | 520 | if ( blockMoving ) { |
521 | int dX, dY; | 521 | int dX, dY; |
522 | dX = startX - viewportPos.x(); | 522 | dX = startX - viewportPos.x(); |
523 | if ( dX < 0 ) | 523 | if ( dX < 0 ) |
524 | dX = -dX; | 524 | dX = -dX; |
525 | dY = viewportPos.y() - startY; | 525 | dY = viewportPos.y() - startY; |
526 | if ( dY < 0 ) | 526 | if ( dY < 0 ) |
527 | dY = -dY; | 527 | dY = -dY; |
528 | //qDebug("%d %d %d ", dX, dY , blockmoveDist ); | 528 | //qDebug("%d %d %d ", dX, dY , blockmoveDist ); |
529 | if ( dX > blockmoveDist || dY > blockmoveDist ) { | 529 | if ( dX > blockmoveDist || dY > blockmoveDist ) { |
530 | blockMoving = false; | 530 | blockMoving = false; |
531 | } | 531 | } |
532 | } | 532 | } |
533 | if (object != viewport()) { | 533 | if (object != viewport()) { |
534 | KOAgendaItem *moveItem = (KOAgendaItem *)object; | 534 | KOAgendaItem *moveItem = (KOAgendaItem *)object; |
535 | if (!moveItem->incidence()->isReadOnly() ) { | 535 | if (!moveItem->incidence()->isReadOnly() ) { |
536 | if (!mActionItem) | 536 | if (!mActionItem) |
537 | setNoActionCursor(moveItem,viewportPos); | 537 | setNoActionCursor(moveItem,viewportPos); |
538 | else { | 538 | else { |
539 | if ( !blockMoving ) | 539 | if ( !blockMoving ) |
540 | performItemAction(viewportPos); | 540 | performItemAction(viewportPos); |
541 | } | 541 | } |
542 | } | 542 | } |
543 | } else { // ---------- viewport() | 543 | } else { // ---------- viewport() |
544 | if ( mActionType == SELECT ) { | 544 | if ( mActionType == SELECT ) { |
545 | performSelectAction( viewportPos ); | 545 | performSelectAction( viewportPos ); |
546 | } | 546 | } |
547 | } | 547 | } |
548 | break; | 548 | break; |
549 | 549 | ||
550 | case QEvent::MouseButtonDblClick: | 550 | case QEvent::MouseButtonDblClick: |
551 | blockMoving = false; | ||
552 | leftMouseDown = false; | ||
553 | rightMouseDown = false; | ||
551 | if (object == viewport()) { | 554 | if (object == viewport()) { |
552 | selectItem(0); | 555 | selectItem(0); |
553 | int x,y; | 556 | int x,y; |
554 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 557 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
555 | int gx,gy; | 558 | int gx,gy; |
556 | contentsToGrid(x,y,gx,gy); | 559 | contentsToGrid(x,y,gx,gy); |
557 | emit newEventSignal(gx,gy); | 560 | emit newEventSignal(gx,gy); |
558 | } else { | 561 | } else { |
559 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; | 562 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; |
560 | selectItem(doubleClickedItem); | 563 | selectItem(doubleClickedItem); |
561 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 564 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
562 | emit editIncidenceSignal(doubleClickedItem->incidence()); | 565 | emit editIncidenceSignal(doubleClickedItem->incidence()); |
563 | else | 566 | else |
564 | emit showIncidenceSignal(doubleClickedItem->incidence()); | 567 | emit showIncidenceSignal(doubleClickedItem->incidence()); |
565 | } | 568 | } |
566 | break; | 569 | break; |
567 | 570 | ||
568 | default: | 571 | default: |
569 | break; | 572 | break; |
570 | } | 573 | } |
571 | return true; | 574 | return true; |
572 | } | 575 | } |
573 | 576 | ||
574 | void KOAgenda::newItem( int item ) | 577 | void KOAgenda::newItem( int item ) |
575 | { | 578 | { |
576 | if ( item == 1 ) { //new event | 579 | if ( item == 1 ) { //new event |
577 | newEventSignal(mStartCellX ,mStartCellY ); | 580 | newEventSignal(mStartCellX ,mStartCellY ); |
578 | } else | 581 | } else |
579 | if ( item == 2 ) { //new event | 582 | if ( item == 2 ) { //new event |
580 | newTodoSignal(mStartCellX ,mStartCellY ); | 583 | newTodoSignal(mStartCellX ,mStartCellY ); |
581 | } else | 584 | } else |
582 | { | 585 | { |
583 | QDate day = mSelectedDates[mStartCellX]; | 586 | QDate day = mSelectedDates[mStartCellX]; |
584 | emit showDateView( item, day ); | 587 | emit showDateView( item, day ); |
585 | // 3Day view | 588 | // 3Day view |
586 | // 4Week view | 589 | // 4Week view |
587 | // 5Month view | 590 | // 5Month view |
588 | // 6Journal view | 591 | // 6Journal view |
589 | } | 592 | } |
590 | } | 593 | } |
591 | void KOAgenda::startSelectAction(QPoint viewportPos) | 594 | void KOAgenda::startSelectAction(QPoint viewportPos) |
592 | { | 595 | { |
593 | //emit newStartSelectSignal(); | 596 | //emit newStartSelectSignal(); |
594 | 597 | ||
595 | mActionType = SELECT; | 598 | mActionType = SELECT; |
596 | 599 | ||
597 | int x,y; | 600 | int x,y; |
598 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 601 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
599 | int gx,gy; | 602 | int gx,gy; |
600 | contentsToGrid(x,y,gx,gy); | 603 | contentsToGrid(x,y,gx,gy); |
601 | 604 | ||
602 | mStartCellX = gx; | 605 | mStartCellX = gx; |
603 | mStartCellY = gy; | 606 | mStartCellY = gy; |
604 | mCurrentCellX = gx; | 607 | mCurrentCellX = gx; |
605 | mCurrentCellY = gy; | 608 | mCurrentCellY = gy; |
606 | 609 | ||
607 | // Store coordinates of old selection | 610 | // Store coordinates of old selection |
608 | int selectionX = mSelectionCellX * mGridSpacingX; | 611 | int selectionX = mSelectionCellX * mGridSpacingX; |
609 | int selectionYTop = mSelectionYTop; | 612 | int selectionYTop = mSelectionYTop; |
610 | int selectionHeight = mSelectionHeight; | 613 | int selectionHeight = mSelectionHeight; |
611 | 614 | ||
612 | // Store new selection | 615 | // Store new selection |
613 | mSelectionCellX = gx; | 616 | mSelectionCellX = gx; |
614 | mSelectionYTop = gy * mGridSpacingY; | 617 | mSelectionYTop = gy * mGridSpacingY; |
615 | mSelectionHeight = mGridSpacingY; | 618 | mSelectionHeight = mGridSpacingY; |
616 | 619 | ||
617 | // Clear old selection | 620 | // Clear old selection |
618 | repaintContents( selectionX, selectionYTop, | 621 | repaintContents( selectionX, selectionYTop, |
619 | mGridSpacingX, selectionHeight,false ); | 622 | mGridSpacingX, selectionHeight,false ); |
620 | 623 | ||
621 | // Paint new selection | 624 | // Paint new selection |
622 | // repaintContents( mSelectionCellX * mGridSpacingX, mSelectionYTop, | 625 | // repaintContents( mSelectionCellX * mGridSpacingX, mSelectionYTop, |
623 | // mGridSpacingX, mSelectionHeight ); | 626 | // mGridSpacingX, mSelectionHeight ); |
624 | } | 627 | } |
625 | 628 | ||
626 | void KOAgenda::performSelectAction(QPoint viewportPos) | 629 | void KOAgenda::performSelectAction(QPoint viewportPos) |
627 | { | 630 | { |
628 | int x,y; | 631 | int x,y; |
629 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 632 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
630 | int gx,gy; | 633 | int gx,gy; |
631 | contentsToGrid(x,y,gx,gy); | 634 | contentsToGrid(x,y,gx,gy); |
632 | 635 | ||
633 | QPoint clipperPos = clipper()-> | 636 | QPoint clipperPos = clipper()-> |
634 | mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 637 | mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
635 | 638 | ||
636 | // Scroll if cursor was moved to upper or lower end of agenda. | 639 | // Scroll if cursor was moved to upper or lower end of agenda. |
637 | if (clipperPos.y() < mScrollBorderWidth) { | 640 | if (clipperPos.y() < mScrollBorderWidth) { |
638 | mScrollUpTimer.start(mScrollDelay); | 641 | mScrollUpTimer.start(mScrollDelay); |
639 | } else if (visibleHeight() - clipperPos.y() < | 642 | } else if (visibleHeight() - clipperPos.y() < |
640 | mScrollBorderWidth) { | 643 | mScrollBorderWidth) { |
641 | mScrollDownTimer.start(mScrollDelay); | 644 | mScrollDownTimer.start(mScrollDelay); |
642 | } else { | 645 | } else { |
643 | mScrollUpTimer.stop(); | 646 | mScrollUpTimer.stop(); |
644 | mScrollDownTimer.stop(); | 647 | mScrollDownTimer.stop(); |
645 | } | 648 | } |
646 | 649 | ||
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 496f125..4ee5292 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -132,361 +132,368 @@ void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) | |||
132 | 132 | ||
133 | mCategoriesButton = new QPushButton(parent); | 133 | mCategoriesButton = new QPushButton(parent); |
134 | mCategoriesButton->setText(i18n("Categories...")); | 134 | mCategoriesButton->setText(i18n("Categories...")); |
135 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); | 135 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); |
136 | categoriesLayout->addWidget(mCategoriesButton); | 136 | categoriesLayout->addWidget(mCategoriesButton); |
137 | 137 | ||
138 | mCategoriesLabel = new QLabel(parent); | 138 | mCategoriesLabel = new QLabel(parent); |
139 | mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); | 139 | mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); |
140 | categoriesLayout->addWidget(mCategoriesLabel,1); | 140 | categoriesLayout->addWidget(mCategoriesLabel,1); |
141 | } | 141 | } |
142 | 142 | ||
143 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) | 143 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) |
144 | { | 144 | { |
145 | QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); | 145 | QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); |
146 | 146 | ||
147 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); | 147 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); |
148 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); | 148 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); |
149 | secrecyLayout->addWidget(mCancelBox); | 149 | secrecyLayout->addWidget(mCancelBox); |
150 | secrecyLayout->addWidget(secrecyLabel); | 150 | secrecyLayout->addWidget(secrecyLabel); |
151 | 151 | ||
152 | mSecrecyCombo = new QComboBox(parent); | 152 | mSecrecyCombo = new QComboBox(parent); |
153 | mSecrecyCombo->insertStringList(Incidence::secrecyList()); | 153 | mSecrecyCombo->insertStringList(Incidence::secrecyList()); |
154 | secrecyLayout->addWidget(mSecrecyCombo); | 154 | secrecyLayout->addWidget(mSecrecyCombo); |
155 | } | 155 | } |
156 | 156 | ||
157 | void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) | 157 | void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) |
158 | { | 158 | { |
159 | mDescriptionEdit = new KTextEdit(parent); | 159 | mDescriptionEdit = new KTextEdit(parent); |
160 | mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); | 160 | mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); |
161 | mDescriptionEdit->append(""); | 161 | mDescriptionEdit->append(""); |
162 | mDescriptionEdit->setReadOnly(false); | 162 | mDescriptionEdit->setReadOnly(false); |
163 | mDescriptionEdit->setOverwriteMode(false); | 163 | mDescriptionEdit->setOverwriteMode(false); |
164 | mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); | 164 | mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); |
165 | topLayout->addWidget(mDescriptionEdit); | 165 | topLayout->addWidget(mDescriptionEdit); |
166 | #ifndef DESKTOP_VERSION | 166 | #ifndef DESKTOP_VERSION |
167 | QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); | 167 | QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); |
168 | #endif | 168 | #endif |
169 | 169 | ||
170 | } | 170 | } |
171 | 171 | ||
172 | void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) | 172 | void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) |
173 | { | 173 | { |
174 | QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); | 174 | QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); |
175 | 175 | ||
176 | //mAlarmBell = new QLabel(parent); | 176 | //mAlarmBell = new QLabel(parent); |
177 | //mAlarmBell->setPixmap(SmallIcon("bell")); | 177 | //mAlarmBell->setPixmap(SmallIcon("bell")); |
178 | //alarmLayout->addWidget(mAlarmBell); | 178 | //alarmLayout->addWidget(mAlarmBell); |
179 | if ( QApplication::desktop()->width() < 320 ) | 179 | if ( QApplication::desktop()->width() < 320 ) |
180 | mAlarmButton = new QCheckBox(i18n("Rem."),parent); | 180 | mAlarmButton = new QCheckBox(i18n("Rem."),parent); |
181 | else | 181 | else |
182 | mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); | 182 | mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); |
183 | 183 | ||
184 | connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); | 184 | connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); |
185 | alarmLayout->addWidget(mAlarmButton); | 185 | alarmLayout->addWidget(mAlarmButton); |
186 | 186 | ||
187 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; | 187 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; |
188 | alarmLayout->addWidget(mAlarmTimeEdit); | 188 | alarmLayout->addWidget(mAlarmTimeEdit); |
189 | mAlarmIncrCombo = new QComboBox(false, parent); | 189 | mAlarmIncrCombo = new QComboBox(false, parent); |
190 | if ( QApplication::desktop()->width() < 320 ) { | 190 | if ( QApplication::desktop()->width() < 320 ) { |
191 | mAlarmIncrCombo->insertItem(i18n("min")); | 191 | mAlarmIncrCombo->insertItem(i18n("min")); |
192 | mAlarmIncrCombo->insertItem(i18n("hou")); | 192 | mAlarmIncrCombo->insertItem(i18n("hou")); |
193 | mAlarmIncrCombo->insertItem(i18n("day")); | 193 | mAlarmIncrCombo->insertItem(i18n("day")); |
194 | mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); | 194 | mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); |
195 | mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); | 195 | mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); |
196 | } else { | 196 | } else { |
197 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); | 197 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); |
198 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); | 198 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); |
199 | mAlarmIncrCombo->insertItem(i18n("day(s)")); | 199 | mAlarmIncrCombo->insertItem(i18n("day(s)")); |
200 | } | 200 | } |
201 | 201 | ||
202 | // mAlarmIncrCombo->setMinimumHeight(20); | 202 | // mAlarmIncrCombo->setMinimumHeight(20); |
203 | alarmLayout->addWidget(mAlarmIncrCombo); | 203 | alarmLayout->addWidget(mAlarmIncrCombo); |
204 | mAlarmSoundButton = new QPushButton(parent); | 204 | mAlarmSoundButton = new QPushButton(parent); |
205 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); | 205 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); |
206 | mAlarmSoundButton->setToggleButton(true); | 206 | mAlarmSoundButton->setToggleButton(true); |
207 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); | 207 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); |
208 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); | 208 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); |
209 | alarmLayout->addWidget(mAlarmSoundButton); | 209 | alarmLayout->addWidget(mAlarmSoundButton); |
210 | 210 | ||
211 | mAlarmProgramButton = new QPushButton(parent); | 211 | mAlarmProgramButton = new QPushButton(parent); |
212 | mAlarmProgramButton->setPixmap(SmallIcon("run")); | 212 | mAlarmProgramButton->setPixmap(SmallIcon("run")); |
213 | mAlarmProgramButton->setToggleButton(true); | 213 | mAlarmProgramButton->setToggleButton(true); |
214 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); | 214 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); |
215 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); | 215 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); |
216 | alarmLayout->addWidget(mAlarmProgramButton); | 216 | alarmLayout->addWidget(mAlarmProgramButton); |
217 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); | 217 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); |
218 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); | 218 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); |
219 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 219 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
220 | // mAlarmSoundButton->hide(); | 220 | // mAlarmSoundButton->hide(); |
221 | // mAlarmProgramButton->hide(); | 221 | // mAlarmProgramButton->hide(); |
222 | // } | 222 | // } |
223 | } | 223 | } |
224 | 224 | ||
225 | void KOEditorGeneral::pickAlarmSound() | 225 | void KOEditorGeneral::pickAlarmSound() |
226 | { | 226 | { |
227 | 227 | ||
228 | qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); | ||
228 | //QString prefix = mAlarmSound; | 229 | //QString prefix = mAlarmSound; |
229 | if (!mAlarmSoundButton->isOn()) { | 230 | if (!mAlarmSoundButton->isOn()) { |
230 | //mAlarmSound = ""; | 231 | //mAlarmSound = ""; |
231 | QToolTip::remove(mAlarmSoundButton); | 232 | QToolTip::remove(mAlarmSoundButton); |
232 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); | 233 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); |
233 | mAlarmProgramButton->setOn(true); | 234 | mAlarmProgramButton->setOn(true); |
234 | mAlarmSoundButton->setOn(false); | 235 | mAlarmSoundButton->setOn(false); |
236 | pickAlarmProgram(); | ||
235 | } else { | 237 | } else { |
236 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, | 238 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, |
237 | i18n("*.wav|Wav Files"), 0)); | 239 | i18n("*.wav|Wav Files"), 0)); |
238 | if (!fileName.isEmpty()) { | 240 | if (!fileName.isEmpty()) { |
239 | mAlarmSound = fileName; | 241 | mAlarmSound = fileName; |
240 | QToolTip::remove(mAlarmSoundButton); | 242 | QToolTip::remove(mAlarmSoundButton); |
241 | QString dispStr = i18n("Playing '%1'").arg(fileName); | 243 | QString dispStr = i18n("Playing '%1'").arg(fileName); |
242 | QToolTip::add(mAlarmSoundButton, dispStr); | 244 | QToolTip::add(mAlarmSoundButton, dispStr); |
243 | mAlarmProgramButton->setOn(false); | 245 | mAlarmProgramButton->setOn(false); |
244 | mAlarmSoundButton->setOn(true); | 246 | mAlarmSoundButton->setOn(true); |
245 | } else { | 247 | } else { |
246 | mAlarmProgramButton->setOn(true); | 248 | mAlarmProgramButton->setOn(true); |
247 | mAlarmSoundButton->setOn(false); | 249 | mAlarmSoundButton->setOn(false); |
248 | 250 | ||
249 | } | 251 | } |
250 | } | 252 | } |
251 | 253 | ||
252 | if (mAlarmProgramButton->isOn()) | 254 | if (mAlarmProgramButton->isOn()) |
253 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 255 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
254 | if ( mAlarmSoundButton->isOn()) | 256 | if ( mAlarmSoundButton->isOn()) |
255 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio.Al.: ") + getFittingPath(mAlarmSound) ); | 257 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
256 | } | 258 | } |
257 | 259 | ||
258 | void KOEditorGeneral::pickAlarmProgram() | 260 | void KOEditorGeneral::pickAlarmProgram() |
259 | { | 261 | { |
260 | if (!mAlarmProgramButton->isOn()) { | 262 | if (!mAlarmProgramButton->isOn()) { |
261 | //mAlarmProgram = ""; | 263 | //mAlarmProgram = ""; |
262 | QToolTip::remove(mAlarmProgramButton); | 264 | QToolTip::remove(mAlarmProgramButton); |
263 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); | 265 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); |
264 | mAlarmProgramButton->setOn(false); | 266 | mAlarmProgramButton->setOn(false); |
265 | mAlarmSoundButton->setOn(true); | 267 | mAlarmSoundButton->setOn(true); |
268 | pickAlarmSound(); | ||
266 | } else { | 269 | } else { |
267 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm.: ") , 0)); | 270 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); |
268 | if (!fileName.isEmpty()) { | 271 | if (!fileName.isEmpty()) { |
269 | mAlarmProgram = fileName; | 272 | mAlarmProgram = fileName; |
270 | QToolTip::remove(mAlarmProgramButton); | 273 | QToolTip::remove(mAlarmProgramButton); |
271 | QString dispStr = i18n("Running '%1'").arg(fileName); | 274 | QString dispStr = i18n("Running '%1'").arg(fileName); |
272 | QToolTip::add(mAlarmProgramButton, dispStr); | 275 | QToolTip::add(mAlarmProgramButton, dispStr); |
273 | mAlarmSoundButton->setOn(false); | 276 | mAlarmSoundButton->setOn(false); |
274 | mAlarmProgramButton->setOn(true); | 277 | mAlarmProgramButton->setOn(true); |
275 | } else { | 278 | } else { |
276 | mAlarmProgramButton->setOn(false); | 279 | mAlarmProgramButton->setOn(false); |
277 | mAlarmSoundButton->setOn(true); | 280 | mAlarmSoundButton->setOn(true); |
278 | } | 281 | } |
279 | } | 282 | } |
280 | if (mAlarmProgramButton->isOn()) | 283 | if (mAlarmProgramButton->isOn()) |
281 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 284 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
282 | if ( mAlarmSoundButton->isOn()) | 285 | if ( mAlarmSoundButton->isOn()) |
283 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + getFittingPath(mAlarmSound) ); | 286 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
284 | } | 287 | } |
285 | 288 | ||
286 | 289 | ||
287 | QString KOEditorGeneral::getFittingPath( const QString s ) | 290 | QString KOEditorGeneral::getFittingPath( const QString s ) |
288 | { | 291 | { |
289 | int maxlen = 50; | 292 | int maxlen = 50; |
290 | if ( QApplication::desktop()->width() < 640 ) { | 293 | if ( QApplication::desktop()->width() < 640 ) { |
291 | if ( QApplication::desktop()->width() < 320 ) | 294 | if ( QApplication::desktop()->width() < 320 ) |
292 | maxlen = 22; | 295 | maxlen = 22; |
293 | else | 296 | else |
294 | maxlen = 35; | 297 | maxlen = 35; |
295 | } | 298 | } |
296 | if ( s.length() > maxlen ) { | 299 | if ( s.length() > maxlen ) { |
297 | return "..."+s.right(maxlen -3); | 300 | return "..."+s.right(maxlen -3); |
298 | } | 301 | } |
299 | return s; | 302 | return s; |
300 | } | 303 | } |
301 | 304 | ||
302 | void KOEditorGeneral::enableAlarmEdit(bool enable) | 305 | void KOEditorGeneral::enableAlarmEdit(bool enable) |
303 | { | 306 | { |
304 | if ( enable ) { | 307 | if ( enable ) { |
305 | if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { | 308 | if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { |
306 | mAlarmSoundButton->setOn( true ); | 309 | mAlarmSoundButton->setOn( true ); |
307 | if ( mAlarmSound.isEmpty() ) | 310 | if ( mAlarmSound.isEmpty() ) |
308 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 311 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
309 | else { | 312 | else { |
310 | if ( ! QFile::exists( mAlarmSound ) ) | 313 | if ( ! QFile::exists( mAlarmSound ) ) |
311 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 314 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
312 | } | 315 | } |
313 | } | 316 | } |
314 | if (mAlarmProgramButton->isOn()) | 317 | if (mAlarmProgramButton->isOn()) |
315 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 318 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
316 | if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) | 319 | if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) |
317 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | 320 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
318 | } | 321 | } |
319 | else { | 322 | else { |
320 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item")); | 323 | ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage); |
324 | //((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Edit item: ") + mSummaryEdit->currentText()); | ||
325 | |||
321 | 326 | ||
322 | } | 327 | } |
323 | mAlarmTimeEdit->setEnabled(enable); | 328 | mAlarmTimeEdit->setEnabled(enable); |
324 | mAlarmSoundButton->setEnabled(enable); | 329 | mAlarmSoundButton->setEnabled(enable); |
325 | mAlarmProgramButton->setEnabled(enable); | 330 | mAlarmProgramButton->setEnabled(enable); |
326 | mAlarmIncrCombo->setEnabled(enable); | 331 | mAlarmIncrCombo->setEnabled(enable); |
327 | } | 332 | } |
328 | 333 | ||
329 | void KOEditorGeneral::disableAlarmEdit(bool disable) | 334 | void KOEditorGeneral::disableAlarmEdit(bool disable) |
330 | { | 335 | { |
331 | enableAlarmEdit( !disable ); | 336 | enableAlarmEdit( !disable ); |
332 | } | 337 | } |
333 | 338 | ||
334 | void KOEditorGeneral::enableAlarm( bool enable ) | 339 | void KOEditorGeneral::enableAlarm( bool enable ) |
335 | { | 340 | { |
336 | enableAlarmEdit( enable ); | 341 | enableAlarmEdit( enable ); |
337 | } | 342 | } |
338 | 343 | ||
339 | void KOEditorGeneral::alarmDisable(bool disable) | 344 | void KOEditorGeneral::alarmDisable(bool disable) |
340 | { | 345 | { |
341 | if (!disable) { | 346 | if (!disable) { |
342 | //mAlarmBell->setEnabled(true); | 347 | //mAlarmBell->setEnabled(true); |
343 | mAlarmButton->setEnabled(true); | 348 | mAlarmButton->setEnabled(true); |
344 | } else { | 349 | } else { |
345 | //mAlarmBell->setEnabled(false); | 350 | //mAlarmBell->setEnabled(false); |
346 | mAlarmButton->setEnabled(false); | 351 | mAlarmButton->setEnabled(false); |
347 | mAlarmButton->setChecked(false); | 352 | mAlarmButton->setChecked(false); |
348 | mAlarmTimeEdit->setEnabled(false); | 353 | mAlarmTimeEdit->setEnabled(false); |
349 | mAlarmSoundButton->setEnabled(false); | 354 | mAlarmSoundButton->setEnabled(false); |
350 | mAlarmProgramButton->setEnabled(false); | 355 | mAlarmProgramButton->setEnabled(false); |
351 | mAlarmIncrCombo->setEnabled(false); | 356 | mAlarmIncrCombo->setEnabled(false); |
352 | } | 357 | } |
353 | } | 358 | } |
354 | 359 | ||
355 | void KOEditorGeneral::setCategories(const QString &str) | 360 | void KOEditorGeneral::setCategories(const QString &str) |
356 | { | 361 | { |
357 | mCategoriesLabel->setText(str); | 362 | mCategoriesLabel->setText(str); |
358 | } | 363 | } |
359 | 364 | ||
360 | void KOEditorGeneral::setDefaults(bool allDay) | 365 | void KOEditorGeneral::setDefaults(bool allDay) |
361 | { | 366 | { |
362 | #if 0 | 367 | #if 0 |
363 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); | 368 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); |
364 | #endif | 369 | #endif |
365 | 370 | ||
371 | mAlarmMessage = i18n("Edit new item"); | ||
366 | enableAlarmEdit( !allDay ); | 372 | enableAlarmEdit( !allDay ); |
367 | 373 | ||
368 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 374 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
369 | int alarmTime; | 375 | int alarmTime; |
370 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 376 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
371 | int index = KOPrefs::instance()->mAlarmTime; | 377 | int index = KOPrefs::instance()->mAlarmTime; |
372 | if (index < 0 || index > 7) { | 378 | if (index < 0 || index > 7) { |
373 | alarmTime = 15; | 379 | alarmTime = 15; |
374 | } else { | 380 | } else { |
375 | alarmTime = a[index]; | 381 | alarmTime = a[index]; |
376 | } | 382 | } |
377 | mAlarmButton ->setChecked( false ); | 383 | mAlarmButton ->setChecked( false ); |
378 | mAlarmTimeEdit->setValue(alarmTime); | 384 | mAlarmTimeEdit->setValue(alarmTime); |
379 | mAlarmIncrCombo->setCurrentItem(0); | 385 | mAlarmIncrCombo->setCurrentItem(0); |
380 | enableAlarmEdit( false ); | 386 | enableAlarmEdit( false ); |
381 | //alarmDisable (false); | 387 | //alarmDisable (false); |
382 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); | 388 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); |
383 | mCancelBox->setChecked( false ); | 389 | mCancelBox->setChecked( false ); |
384 | mSummaryEdit->setEditText(""); | 390 | mSummaryEdit->setEditText(""); |
385 | mLocationEdit->setEditText(""); | 391 | mLocationEdit->setEditText(""); |
386 | mDescriptionEdit->setText(""); | 392 | mDescriptionEdit->setText(""); |
387 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 393 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
388 | setCategories(""); | 394 | setCategories(""); |
389 | } | 395 | } |
390 | void KOEditorGeneral::setSecrecy( int num ) | 396 | void KOEditorGeneral::setSecrecy( int num ) |
391 | { | 397 | { |
392 | mSecrecyCombo->setCurrentItem(num); | 398 | mSecrecyCombo->setCurrentItem(num); |
393 | } | 399 | } |
394 | void KOEditorGeneral::readIncidence(Incidence *event) | 400 | void KOEditorGeneral::readIncidence(Incidence *event) |
395 | { | 401 | { |
396 | 402 | ||
403 | mAlarmMessage = i18n("Edit") +" "+event->summary(); | ||
397 | mAlarmIncrCombo->setCurrentItem(0); | 404 | mAlarmIncrCombo->setCurrentItem(0); |
398 | mSummaryEdit->setEditText(event->summary()); | 405 | mSummaryEdit->setEditText(event->summary()); |
399 | mLocationEdit->setEditText(event->location()); | 406 | mLocationEdit->setEditText(event->location()); |
400 | mDescriptionEdit->setText(event->description()); | 407 | mDescriptionEdit->setText(event->description()); |
401 | 408 | ||
402 | #if 0 | 409 | #if 0 |
403 | // organizer information | 410 | // organizer information |
404 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); | 411 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); |
405 | #endif | 412 | #endif |
406 | 413 | ||
407 | enableAlarmEdit( event->isAlarmEnabled() ); | 414 | enableAlarmEdit( event->isAlarmEnabled() ); |
408 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); | 415 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); |
409 | if(!event->isAlarmEnabled()) { | 416 | if(!event->isAlarmEnabled()) { |
410 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 417 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
411 | int alarmTime; | 418 | int alarmTime; |
412 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 419 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
413 | int index = KOPrefs::instance()->mAlarmTime; | 420 | int index = KOPrefs::instance()->mAlarmTime; |
414 | if (index < 0 || index > 7) { | 421 | if (index < 0 || index > 7) { |
415 | alarmTime = 15; | 422 | alarmTime = 15; |
416 | } else { | 423 | } else { |
417 | alarmTime = a[index]; | 424 | alarmTime = a[index]; |
418 | } | 425 | } |
419 | mAlarmTimeEdit->setValue(alarmTime); | 426 | mAlarmTimeEdit->setValue(alarmTime); |
420 | } | 427 | } |
421 | mAlarmButton->setChecked( event->isAlarmEnabled() ); | 428 | mAlarmButton->setChecked( event->isAlarmEnabled() ); |
422 | mSecrecyCombo->setCurrentItem(event->secrecy()); | 429 | mSecrecyCombo->setCurrentItem(event->secrecy()); |
423 | mCancelBox->setChecked( event->cancelled() ); | 430 | mCancelBox->setChecked( event->cancelled() ); |
424 | mAlarmProgramButton->setOn(false); | 431 | mAlarmProgramButton->setOn(false); |
425 | mAlarmSoundButton->setOn(false); | 432 | mAlarmSoundButton->setOn(false); |
426 | 433 | ||
427 | // set up alarm stuff | 434 | // set up alarm stuff |
428 | QPtrList<Alarm> alarms = event->alarms(); | 435 | QPtrList<Alarm> alarms = event->alarms(); |
429 | Alarm* alarm; | 436 | Alarm* alarm; |
430 | mAlarmIncrCombo->setCurrentItem(0); | 437 | mAlarmIncrCombo->setCurrentItem(0); |
431 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 438 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
432 | int offset; | 439 | int offset; |
433 | if ( alarm->hasTime() ) { | 440 | if ( alarm->hasTime() ) { |
434 | QDateTime t = alarm->time(); | 441 | QDateTime t = alarm->time(); |
435 | offset = event->dtStart().secsTo( t ); | 442 | offset = event->dtStart().secsTo( t ); |
436 | } else { | 443 | } else { |
437 | offset = alarm->startOffset().asSeconds(); | 444 | offset = alarm->startOffset().asSeconds(); |
438 | } | 445 | } |
439 | if ( offset != 0 ) { | 446 | if ( offset != 0 ) { |
440 | offset = offset / -60; // make minutes | 447 | offset = offset / -60; // make minutes |
441 | if (offset % 60 == 0) { // divides evenly into hours? | 448 | if (offset % 60 == 0) { // divides evenly into hours? |
442 | offset = offset / 60; | 449 | offset = offset / 60; |
443 | mAlarmIncrCombo->setCurrentItem(1); | 450 | mAlarmIncrCombo->setCurrentItem(1); |
444 | if (offset % 24 == 0) { // divides evenly into days? | 451 | if (offset % 24 == 0) { // divides evenly into days? |
445 | offset = offset / 24; | 452 | offset = offset / 24; |
446 | mAlarmIncrCombo->setCurrentItem(2); | 453 | mAlarmIncrCombo->setCurrentItem(2); |
447 | } | 454 | } |
448 | } | 455 | } |
449 | } | 456 | } |
450 | mAlarmTimeEdit->setValue( offset ); | 457 | mAlarmTimeEdit->setValue( offset ); |
451 | if (alarm->type() == Alarm::Procedure) { | 458 | if (alarm->type() == Alarm::Procedure) { |
452 | 459 | ||
453 | mAlarmProgram = alarm->programFile(); | 460 | mAlarmProgram = alarm->programFile(); |
454 | mAlarmProgramButton->setOn(true); | 461 | mAlarmProgramButton->setOn(true); |
455 | QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); | 462 | QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); |
456 | QToolTip::add(mAlarmProgramButton, dispStr); | 463 | QToolTip::add(mAlarmProgramButton, dispStr); |
457 | } | 464 | } |
458 | else if (alarm->type() == Alarm::Audio) { | 465 | else if (alarm->type() == Alarm::Audio) { |
459 | mAlarmSound = alarm->audioFile(); | 466 | mAlarmSound = alarm->audioFile(); |
460 | if ( ! QFile::exists( mAlarmSound ) ) | 467 | if ( ! QFile::exists( mAlarmSound ) ) |
461 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 468 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
462 | mAlarmSoundButton->setOn(true); | 469 | mAlarmSoundButton->setOn(true); |
463 | QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); | 470 | QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); |
464 | QToolTip::add(mAlarmSoundButton, dispStr); | 471 | QToolTip::add(mAlarmSoundButton, dispStr); |
465 | } | 472 | } |
466 | mAlarmButton->setChecked(alarm->enabled()); | 473 | mAlarmButton->setChecked(alarm->enabled()); |
467 | enableAlarmEdit( alarm->enabled() ); | 474 | enableAlarmEdit( alarm->enabled() ); |
468 | //qDebug("nableAlarmEdit( alarm->enabled() )********* "); | 475 | //qDebug("nableAlarmEdit( alarm->enabled() )********* "); |
469 | // TODO: Deal with multiple alarms | 476 | // TODO: Deal with multiple alarms |
470 | break; // For now, stop after the first alarm | 477 | break; // For now, stop after the first alarm |
471 | } | 478 | } |
472 | 479 | ||
473 | setCategories(event->categoriesStr()); | 480 | setCategories(event->categoriesStr()); |
474 | } | 481 | } |
475 | 482 | ||
476 | void KOEditorGeneral::writeIncidence(Incidence *event) | 483 | void KOEditorGeneral::writeIncidence(Incidence *event) |
477 | { | 484 | { |
478 | // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; | 485 | // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; |
479 | mLocationEdit->save(KOLocationBox::LOCATION); | 486 | mLocationEdit->save(KOLocationBox::LOCATION); |
480 | event->setSummary(mSummaryEdit->currentText()); | 487 | event->setSummary(mSummaryEdit->currentText()); |
481 | event->setLocation(mLocationEdit->currentText()); | 488 | event->setLocation(mLocationEdit->currentText()); |
482 | event->setDescription(mDescriptionEdit->text()); | 489 | event->setDescription(mDescriptionEdit->text()); |
483 | event->setCategories(mCategoriesLabel->text()); | 490 | event->setCategories(mCategoriesLabel->text()); |
484 | event->setSecrecy(mSecrecyCombo->currentItem()); | 491 | event->setSecrecy(mSecrecyCombo->currentItem()); |
485 | event->setCancelled(mCancelBox->isChecked() );; | 492 | event->setCancelled(mCancelBox->isChecked() );; |
486 | // alarm stuff | 493 | // alarm stuff |
487 | if (mAlarmButton->isChecked()) { | 494 | if (mAlarmButton->isChecked()) { |
488 | if (event->alarms().count() == 0) | 495 | if (event->alarms().count() == 0) |
489 | event->newAlarm(); | 496 | event->newAlarm(); |
490 | QPtrList<Alarm> alarms = event->alarms(); | 497 | QPtrList<Alarm> alarms = event->alarms(); |
491 | Alarm *alarm; | 498 | Alarm *alarm; |
492 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 499 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index de8edaf..f4728c7 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h | |||
@@ -15,99 +15,100 @@ | |||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOEDITORGENERAL_H | 23 | #ifndef KOEDITORGENERAL_H |
24 | #define KOEDITORGENERAL_H | 24 | #define KOEDITORGENERAL_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <qframe.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
29 | #include <qpushbutton.h> | 29 | #include <qpushbutton.h> |
30 | #include <qgroupbox.h> | 30 | #include <qgroupbox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qlistview.h> | 33 | #include <qlistview.h> |
34 | #include <qradiobutton.h> | 34 | #include <qradiobutton.h> |
35 | #include <qlayout.h> | 35 | #include <qlayout.h> |
36 | #include <qspinbox.h> | 36 | #include <qspinbox.h> |
37 | 37 | ||
38 | #include <ktextedit.h> | 38 | #include <ktextedit.h> |
39 | #include <krestrictedline.h> | 39 | #include <krestrictedline.h> |
40 | 40 | ||
41 | #include <libkcal/incidence.h> | 41 | #include <libkcal/incidence.h> |
42 | 42 | ||
43 | #include "ktimeedit.h" | 43 | #include "ktimeedit.h" |
44 | 44 | ||
45 | class KDateEdit; | 45 | class KDateEdit; |
46 | class KOLocationBox; | 46 | class KOLocationBox; |
47 | using namespace KCal; | 47 | using namespace KCal; |
48 | 48 | ||
49 | class KOEditorGeneral : public QObject | 49 | class KOEditorGeneral : public QObject |
50 | { | 50 | { |
51 | Q_OBJECT | 51 | Q_OBJECT |
52 | public: | 52 | public: |
53 | KOEditorGeneral (QObject* parent=0,const char* name=0); | 53 | KOEditorGeneral (QObject* parent=0,const char* name=0); |
54 | virtual ~KOEditorGeneral(); | 54 | virtual ~KOEditorGeneral(); |
55 | void setFocusOn( int i ); | 55 | void setFocusOn( int i ); |
56 | void initHeader(QWidget *,QBoxLayout *); | 56 | void initHeader(QWidget *,QBoxLayout *); |
57 | void initDescription(QWidget *,QBoxLayout *); | 57 | void initDescription(QWidget *,QBoxLayout *); |
58 | void initSecrecy(QWidget *,QBoxLayout *); | 58 | void initSecrecy(QWidget *,QBoxLayout *); |
59 | void initCategories(QWidget *,QBoxLayout *); | 59 | void initCategories(QWidget *,QBoxLayout *); |
60 | void initAlarm(QWidget *,QBoxLayout *); | 60 | void initAlarm(QWidget *,QBoxLayout *); |
61 | 61 | ||
62 | /** Set widgets to default values */ | 62 | /** Set widgets to default values */ |
63 | void setDefaults(bool allDay); | 63 | void setDefaults(bool allDay); |
64 | /** Read event object and setup widgets accordingly */ | 64 | /** Read event object and setup widgets accordingly */ |
65 | void readIncidence(Incidence *); | 65 | void readIncidence(Incidence *); |
66 | /** Write event settings to event object */ | 66 | /** Write event settings to event object */ |
67 | void writeIncidence(Incidence *); | 67 | void writeIncidence(Incidence *); |
68 | 68 | ||
69 | /** Check if the input is valid. */ | 69 | /** Check if the input is valid. */ |
70 | bool validateInput() { return true; } | 70 | bool validateInput() { return true; } |
71 | 71 | ||
72 | void enableAlarm( bool enable ); | 72 | void enableAlarm( bool enable ); |
73 | void setSecrecy( int num ); | 73 | void setSecrecy( int num ); |
74 | public slots: | 74 | public slots: |
75 | void setCategories(const QString &); | 75 | void setCategories(const QString &); |
76 | void editCategories(); | 76 | void editCategories(); |
77 | 77 | ||
78 | protected slots: | 78 | protected slots: |
79 | void enableAlarmEdit( bool enable ); | 79 | void enableAlarmEdit( bool enable ); |
80 | void disableAlarmEdit( bool disable ); | 80 | void disableAlarmEdit( bool disable ); |
81 | void alarmDisable( bool disable ); | 81 | void alarmDisable( bool disable ); |
82 | void pickAlarmSound(); | 82 | void pickAlarmSound(); |
83 | void pickAlarmProgram(); | 83 | void pickAlarmProgram(); |
84 | 84 | ||
85 | signals: | 85 | signals: |
86 | void openCategoryDialog(); | 86 | void openCategoryDialog(); |
87 | void allAccepted(); | 87 | void allAccepted(); |
88 | 88 | ||
89 | protected: | 89 | protected: |
90 | //QLineEdit *mSummaryEdit; | 90 | //QLineEdit *mSummaryEdit; |
91 | //QLineEdit *mLocationEdit; | 91 | //QLineEdit *mLocationEdit; |
92 | KOLocationBox *mSummaryEdit; | 92 | KOLocationBox *mSummaryEdit; |
93 | KOLocationBox *mLocationEdit; | 93 | KOLocationBox *mLocationEdit; |
94 | QLabel *mAlarmBell; | 94 | QLabel *mAlarmBell; |
95 | QCheckBox *mAlarmButton; | 95 | QCheckBox *mAlarmButton; |
96 | QSpinBox *mAlarmTimeEdit; | 96 | QSpinBox *mAlarmTimeEdit; |
97 | QPushButton *mAlarmSoundButton; | 97 | QPushButton *mAlarmSoundButton; |
98 | QPushButton *mAlarmProgramButton; | 98 | QPushButton *mAlarmProgramButton; |
99 | QComboBox *mAlarmIncrCombo; | 99 | QComboBox *mAlarmIncrCombo; |
100 | KTextEdit *mDescriptionEdit; | 100 | KTextEdit *mDescriptionEdit; |
101 | QLabel *mOwnerLabel; | 101 | QLabel *mOwnerLabel; |
102 | QComboBox *mSecrecyCombo; | 102 | QComboBox *mSecrecyCombo; |
103 | QCheckBox *mCancelBox; | 103 | QCheckBox *mCancelBox; |
104 | QPushButton *mCategoriesButton; | 104 | QPushButton *mCategoriesButton; |
105 | QLabel *mCategoriesLabel; | 105 | QLabel *mCategoriesLabel; |
106 | 106 | ||
107 | private: | 107 | private: |
108 | QString getFittingPath( const QString ) ; | 108 | QString getFittingPath( const QString ) ; |
109 | QString mAlarmSound; | 109 | QString mAlarmSound; |
110 | QString mAlarmProgram; | 110 | QString mAlarmProgram; |
111 | QString mAlarmMessage; | ||
111 | }; | 112 | }; |
112 | 113 | ||
113 | #endif | 114 | #endif |
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 7319285..184cb39 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -1,170 +1,164 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KDE-Pim/Pi. | 2 | This file is part of KDE-Pim/Pi. |
3 | Copyright (c) 2004 Ulf Schenk | 3 | Copyright (c) 2004 Ulf Schenk |
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 | // $Id$ | 21 | // $Id$ |
22 | 22 | ||
23 | #include "ksyncmanager.h" | 23 | #include "ksyncmanager.h" |
24 | 24 | ||
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | 26 | ||
27 | #ifndef _WIN32_ | 27 | #ifndef _WIN32_ |
28 | #include <unistd.h> | 28 | #include <unistd.h> |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | 31 | ||
32 | #include "ksyncprofile.h" | 32 | #include "ksyncprofile.h" |
33 | #include "ksyncprefsdialog.h" | 33 | #include "ksyncprefsdialog.h" |
34 | #include "kpimprefs.h" | 34 | #include "kpimprefs.h" |
35 | #include <kmessagebox.h> | 35 | #include <kmessagebox.h> |
36 | 36 | ||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qprogressbar.h> | 38 | #include <qprogressbar.h> |
39 | #include <qpopupmenu.h> | 39 | #include <qpopupmenu.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qradiobutton.h> | 41 | #include <qradiobutton.h> |
42 | #include <qbuttongroup.h> | 42 | #include <qbuttongroup.h> |
43 | #include <qtimer.h> | 43 | #include <qtimer.h> |
44 | #include <qmessagebox.h> | 44 | #include <qmessagebox.h> |
45 | #include <qapplication.h> | 45 | #include <qapplication.h> |
46 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
47 | #include <qdialog.h> | 47 | #include <qdialog.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qtextcodec.h> | 49 | #include <qtextcodec.h> |
50 | #include <qlabel.h> | 50 | #include <qlabel.h> |
51 | #include <qcheckbox.h> | 51 | #include <qcheckbox.h> |
52 | 52 | ||
53 | #include <klocale.h> | 53 | #include <klocale.h> |
54 | #include <kglobal.h> | 54 | #include <kglobal.h> |
55 | #include <kconfig.h> | 55 | #include <kconfig.h> |
56 | #include <kfiledialog.h> | 56 | #include <kfiledialog.h> |
57 | 57 | ||
58 | QDateTime KSyncManager::mRequestedSyncEvent; | 58 | QDateTime KSyncManager::mRequestedSyncEvent; |
59 | 59 | ||
60 | 60 | ||
61 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) | 61 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) |
62 | : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) | 62 | : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) |
63 | { | 63 | { |
64 | mServerSocket = 0; | 64 | mServerSocket = 0; |
65 | bar = new QProgressBar ( 1, 0 ); | 65 | bar = new QProgressBar ( 1, 0 ); |
66 | bar->setCaption (""); | 66 | bar->setCaption (""); |
67 | mWriteBackInPast = 2; | 67 | mWriteBackInPast = 2; |
68 | int w = 300; | 68 | |
69 | if ( QApplication::desktop()->width() < 320 ) | ||
70 | w = 220; | ||
71 | int h = bar->sizeHint().height() ; | ||
72 | int dw = QApplication::desktop()->width(); | ||
73 | int dh = QApplication::desktop()->height(); | ||
74 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
75 | 69 | ||
76 | } | 70 | } |
77 | 71 | ||
78 | KSyncManager::~KSyncManager() | 72 | KSyncManager::~KSyncManager() |
79 | { | 73 | { |
80 | delete bar; | 74 | delete bar; |
81 | } | 75 | } |
82 | 76 | ||
83 | void KSyncManager::setDefaultFileName( QString s) | 77 | void KSyncManager::setDefaultFileName( QString s) |
84 | { | 78 | { |
85 | mDefFileName = s ; | 79 | mDefFileName = s ; |
86 | if ( mPrefs->mPassiveSyncAutoStart ) | 80 | if ( mPrefs->mPassiveSyncAutoStart ) |
87 | enableQuick( false ); | 81 | enableQuick( false ); |
88 | } | 82 | } |
89 | 83 | ||
90 | void KSyncManager::fillSyncMenu() | 84 | void KSyncManager::fillSyncMenu() |
91 | { | 85 | { |
92 | if ( mSyncMenu->count() ) | 86 | if ( mSyncMenu->count() ) |
93 | mSyncMenu->clear(); | 87 | mSyncMenu->clear(); |
94 | 88 | ||
95 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); | 89 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); |
96 | mSyncMenu->insertSeparator(); | 90 | mSyncMenu->insertSeparator(); |
97 | QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); | 91 | QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); |
98 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); | 92 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); |
99 | clearMenu->insertItem( i18n("For all profiles"), 1 ); | 93 | clearMenu->insertItem( i18n("For all profiles"), 1 ); |
100 | clearMenu->insertSeparator(); | 94 | clearMenu->insertSeparator(); |
101 | connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) ); | 95 | connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) ); |
102 | mSyncMenu->insertSeparator(); | 96 | mSyncMenu->insertSeparator(); |
103 | if ( mServerSocket == 0 ) { | 97 | if ( mServerSocket == 0 ) { |
104 | mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); | 98 | mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); |
105 | } else { | 99 | } else { |
106 | mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); | 100 | mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); |
107 | } | 101 | } |
108 | mSyncMenu->insertSeparator(); | 102 | mSyncMenu->insertSeparator(); |
109 | mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); | 103 | mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); |
110 | mSyncMenu->insertSeparator(); | 104 | mSyncMenu->insertSeparator(); |
111 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 105 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
112 | config.setGroup("General"); | 106 | config.setGroup("General"); |
113 | QStringList prof = config.readListEntry("SyncProfileNames"); | 107 | QStringList prof = config.readListEntry("SyncProfileNames"); |
114 | mLocalMachineName = config.readEntry("LocalMachineName","undefined"); | 108 | mLocalMachineName = config.readEntry("LocalMachineName","undefined"); |
115 | if ( prof.count() < 2 ) { | 109 | if ( prof.count() < 2 ) { |
116 | prof.clear(); | 110 | prof.clear(); |
117 | QString externalName; | 111 | QString externalName; |
118 | #ifdef DESKTOP_VERSION | 112 | #ifdef DESKTOP_VERSION |
119 | #ifdef _WIN32_ | 113 | #ifdef _WIN32_ |
120 | externalName = "OutLook(not_implemented)"; | 114 | externalName = "OutLook(not_implemented)"; |
121 | #else | 115 | #else |
122 | externalName = "KDE_Desktop"; | 116 | externalName = "KDE_Desktop"; |
123 | #endif | 117 | #endif |
124 | #else | 118 | #else |
125 | externalName = "Sharp_DTM"; | 119 | externalName = "Sharp_DTM"; |
126 | #endif | 120 | #endif |
127 | prof << externalName; | 121 | prof << externalName; |
128 | prof << i18n("Local_file"); | 122 | prof << i18n("Local_file"); |
129 | prof << i18n("Last_file"); | 123 | prof << i18n("Last_file"); |
130 | KSyncProfile* temp = new KSyncProfile (); | 124 | KSyncProfile* temp = new KSyncProfile (); |
131 | temp->setName( prof[0] ); | 125 | temp->setName( prof[0] ); |
132 | temp->writeConfig(&config); | 126 | temp->writeConfig(&config); |
133 | temp->setName( prof[1] ); | 127 | temp->setName( prof[1] ); |
134 | temp->writeConfig(&config); | 128 | temp->writeConfig(&config); |
135 | temp->setName( prof[2] ); | 129 | temp->setName( prof[2] ); |
136 | temp->writeConfig(&config); | 130 | temp->writeConfig(&config); |
137 | config.setGroup("General"); | 131 | config.setGroup("General"); |
138 | config.writeEntry("SyncProfileNames",prof); | 132 | config.writeEntry("SyncProfileNames",prof); |
139 | config.writeEntry("ExternSyncProfiles",externalName); | 133 | config.writeEntry("ExternSyncProfiles",externalName); |
140 | config.sync(); | 134 | config.sync(); |
141 | delete temp; | 135 | delete temp; |
142 | } | 136 | } |
143 | mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); | 137 | mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); |
144 | mSyncProfileNames = prof; | 138 | mSyncProfileNames = prof; |
145 | unsigned int i; | 139 | unsigned int i; |
146 | for ( i = 0; i < prof.count(); ++i ) { | 140 | for ( i = 0; i < prof.count(); ++i ) { |
147 | mSyncMenu->insertItem( prof[i], 1000+i ); | 141 | mSyncMenu->insertItem( prof[i], 1000+i ); |
148 | clearMenu->insertItem( prof[i], 1000+i ); | 142 | clearMenu->insertItem( prof[i], 1000+i ); |
149 | if ( i == 2 ) | 143 | if ( i == 2 ) |
150 | mSyncMenu->insertSeparator(); | 144 | mSyncMenu->insertSeparator(); |
151 | } | 145 | } |
152 | QDir app_dir; | 146 | QDir app_dir; |
153 | //US do not display SharpDTM if app is pwmpi, or no sharpfiles available | 147 | //US do not display SharpDTM if app is pwmpi, or no sharpfiles available |
154 | if ( mTargetApp == PWMPI) { | 148 | if ( mTargetApp == PWMPI) { |
155 | mSyncMenu->removeItem( 1000 ); | 149 | mSyncMenu->removeItem( 1000 ); |
156 | clearMenu->removeItem( 1000 ); | 150 | clearMenu->removeItem( 1000 ); |
157 | } | 151 | } |
158 | #ifndef DESKTOP_VERSION | 152 | #ifndef DESKTOP_VERSION |
159 | else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { | 153 | else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { |
160 | mSyncMenu->removeItem( 1000 ); | 154 | mSyncMenu->removeItem( 1000 ); |
161 | clearMenu->removeItem( 1000 ); | 155 | clearMenu->removeItem( 1000 ); |
162 | } | 156 | } |
163 | #endif | 157 | #endif |
164 | mSyncMenu->removeItem( 1002 ); | 158 | mSyncMenu->removeItem( 1002 ); |
165 | clearMenu->removeItem( 1002 ); | 159 | clearMenu->removeItem( 1002 ); |
166 | } | 160 | } |
167 | void KSyncManager::slotClearMenu( int action ) | 161 | void KSyncManager::slotClearMenu( int action ) |
168 | { | 162 | { |
169 | QString syncDevice; | 163 | QString syncDevice; |
170 | if ( action > 999 ) { | 164 | if ( action > 999 ) { |
@@ -916,192 +910,199 @@ void KSyncManager::syncKDE() | |||
916 | { | 910 | { |
917 | #ifdef DESKTOP_VERSION | 911 | #ifdef DESKTOP_VERSION |
918 | QString command = qApp->applicationDirPath () + "/kdeabdump"; | 912 | QString command = qApp->applicationDirPath () + "/kdeabdump"; |
919 | #else | 913 | #else |
920 | QString command = "kdeabdump"; | 914 | QString command = "kdeabdump"; |
921 | #endif | 915 | #endif |
922 | if ( ! QFile::exists ( command ) ) | 916 | if ( ! QFile::exists ( command ) ) |
923 | command = "kdeabdump"; | 917 | command = "kdeabdump"; |
924 | QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf"; | 918 | QString fileName = QDir::homeDirPath ()+"/.kdeaddressbookdump.vcf"; |
925 | int result = system ( command.latin1()); | 919 | int result = system ( command.latin1()); |
926 | qDebug("AB dump command call result: %d ", result); | 920 | qDebug("AB dump command call result: %d ", result); |
927 | if ( result != 0 ) { | 921 | if ( result != 0 ) { |
928 | KMessageBox::error( 0, i18n("Error accessing KDE addressbook data.\nMake sure the file\n/opt/kdepimpi/kdeabdump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); | 922 | KMessageBox::error( 0, i18n("Error accessing KDE addressbook data.\nMake sure the file\n/opt/kdepimpi/kdeabdump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); |
929 | return; | 923 | return; |
930 | } | 924 | } |
931 | if ( syncWithFile( fileName,true ) ) { | 925 | if ( syncWithFile( fileName,true ) ) { |
932 | if ( mWriteBackFile ) { | 926 | if ( mWriteBackFile ) { |
933 | command += " --read"; | 927 | command += " --read"; |
934 | system ( command.latin1()); | 928 | system ( command.latin1()); |
935 | } | 929 | } |
936 | } | 930 | } |
937 | 931 | ||
938 | } | 932 | } |
939 | break; | 933 | break; |
940 | case (KOPI): | 934 | case (KOPI): |
941 | { | 935 | { |
942 | #ifdef DESKTOP_VERSION | 936 | #ifdef DESKTOP_VERSION |
943 | QString command = qApp->applicationDirPath () + "/kdecaldump"; | 937 | QString command = qApp->applicationDirPath () + "/kdecaldump"; |
944 | #else | 938 | #else |
945 | QString command = "kdecaldump"; | 939 | QString command = "kdecaldump"; |
946 | #endif | 940 | #endif |
947 | if ( ! QFile::exists ( command ) ) | 941 | if ( ! QFile::exists ( command ) ) |
948 | command = "kdecaldump"; | 942 | command = "kdecaldump"; |
949 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; | 943 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; |
950 | int result = system ( command.latin1()); | 944 | int result = system ( command.latin1()); |
951 | qDebug("Cal dump command call result result: %d ", result); | 945 | qDebug("Cal dump command call result result: %d ", result); |
952 | if ( result != 0 ) { | 946 | if ( result != 0 ) { |
953 | KMessageBox::error( 0, i18n("Error accessing KDE calendar data.\nMake sure the file\n/opt/kdepimpi/kdecaldump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); | 947 | KMessageBox::error( 0, i18n("Error accessing KDE calendar data.\nMake sure the file\n/opt/kdepimpi/kdecaldump\nexists.The standard version of this file\nis for syncing with KDE 3.4.x.\nIf you are running KDE 3.3.x please\ndownload the KDE 3.3.x version of this file\nat http://sourceforge.net/projects/kdepimpi/\nsection: general files for KDE/Pim.")); |
954 | return; | 948 | return; |
955 | } | 949 | } |
956 | if ( syncWithFile( fileName,true ) ) { | 950 | if ( syncWithFile( fileName,true ) ) { |
957 | if ( mWriteBackFile ) { | 951 | if ( mWriteBackFile ) { |
958 | command += " --read"; | 952 | command += " --read"; |
959 | system ( command.latin1()); | 953 | system ( command.latin1()); |
960 | } | 954 | } |
961 | } | 955 | } |
962 | 956 | ||
963 | } | 957 | } |
964 | break; | 958 | break; |
965 | case (PWMPI): | 959 | case (PWMPI): |
966 | 960 | ||
967 | break; | 961 | break; |
968 | default: | 962 | default: |
969 | qDebug("KSM::slotSyncMenu: invalid apptype selected"); | 963 | qDebug("KSM::slotSyncMenu: invalid apptype selected"); |
970 | break; | 964 | break; |
971 | 965 | ||
972 | } | 966 | } |
973 | } | 967 | } |
974 | 968 | ||
975 | void KSyncManager::syncSharp() | 969 | void KSyncManager::syncSharp() |
976 | { | 970 | { |
977 | 971 | ||
978 | if ( ! syncExternalApplication("sharp") ) | 972 | if ( ! syncExternalApplication("sharp") ) |
979 | qDebug("KSM::ERROR sync sharp "); | 973 | qDebug("KSM::ERROR sync sharp "); |
980 | } | 974 | } |
981 | 975 | ||
982 | bool KSyncManager::syncExternalApplication(QString resource) | 976 | bool KSyncManager::syncExternalApplication(QString resource) |
983 | { | 977 | { |
984 | 978 | ||
985 | emit save(); | 979 | emit save(); |
986 | 980 | ||
987 | if ( mAskForPreferences ) | 981 | if ( mAskForPreferences ) |
988 | if ( !edit_sync_options()) { | 982 | if ( !edit_sync_options()) { |
989 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); | 983 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); |
990 | return false; | 984 | return false; |
991 | } | 985 | } |
992 | 986 | ||
993 | qDebug("KSM::Sync extern %s", resource.latin1()); | 987 | qDebug("KSM::Sync extern %s", resource.latin1()); |
994 | 988 | ||
995 | bool syncOK = mImplementation->syncExternal(this, resource); | 989 | bool syncOK = mImplementation->syncExternal(this, resource); |
996 | 990 | ||
997 | return syncOK; | 991 | return syncOK; |
998 | 992 | ||
999 | } | 993 | } |
1000 | 994 | ||
1001 | void KSyncManager::syncPhone() | 995 | void KSyncManager::syncPhone() |
1002 | { | 996 | { |
1003 | 997 | ||
1004 | syncExternalApplication("phone"); | 998 | syncExternalApplication("phone"); |
1005 | 999 | ||
1006 | } | 1000 | } |
1007 | 1001 | ||
1008 | void KSyncManager::showProgressBar(int percentage, QString caption, int total) | 1002 | void KSyncManager::showProgressBar(int percentage, QString caption, int total) |
1009 | { | 1003 | { |
1010 | if (!bar->isVisible()) | 1004 | if (!bar->isVisible()) |
1011 | { | 1005 | { |
1006 | int w = 300; | ||
1007 | if ( QApplication::desktop()->width() < 320 ) | ||
1008 | w = 220; | ||
1009 | int h = bar->sizeHint().height() ; | ||
1010 | int dw = QApplication::desktop()->width(); | ||
1011 | int dh = QApplication::desktop()->height(); | ||
1012 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | ||
1012 | bar->setCaption (caption); | 1013 | bar->setCaption (caption); |
1013 | bar->setTotalSteps ( total ) ; | 1014 | bar->setTotalSteps ( total ) ; |
1014 | bar->show(); | 1015 | bar->show(); |
1015 | } | 1016 | } |
1016 | bar->raise(); | 1017 | bar->raise(); |
1017 | bar->setProgress( percentage ); | 1018 | bar->setProgress( percentage ); |
1018 | qApp->processEvents(); | 1019 | qApp->processEvents(); |
1019 | } | 1020 | } |
1020 | 1021 | ||
1021 | void KSyncManager::hideProgressBar() | 1022 | void KSyncManager::hideProgressBar() |
1022 | { | 1023 | { |
1023 | bar->hide(); | 1024 | bar->hide(); |
1024 | qApp->processEvents(); | 1025 | qApp->processEvents(); |
1025 | } | 1026 | } |
1026 | 1027 | ||
1027 | bool KSyncManager::isProgressBarCanceled() | 1028 | bool KSyncManager::isProgressBarCanceled() |
1028 | { | 1029 | { |
1029 | return !bar->isVisible(); | 1030 | return !bar->isVisible(); |
1030 | } | 1031 | } |
1031 | 1032 | ||
1032 | QString KSyncManager::syncFileName() | 1033 | QString KSyncManager::syncFileName() |
1033 | { | 1034 | { |
1034 | 1035 | ||
1035 | QString fn = "tempfile"; | 1036 | QString fn = "tempfile"; |
1036 | switch(mTargetApp) | 1037 | switch(mTargetApp) |
1037 | { | 1038 | { |
1038 | case (KAPI): | 1039 | case (KAPI): |
1039 | fn = "tempsyncab.vcf"; | 1040 | fn = "tempsyncab.vcf"; |
1040 | break; | 1041 | break; |
1041 | case (KOPI): | 1042 | case (KOPI): |
1042 | fn = "tempsynccal.ics"; | 1043 | fn = "tempsynccal.ics"; |
1043 | break; | 1044 | break; |
1044 | case (PWMPI): | 1045 | case (PWMPI): |
1045 | fn = "tempsyncpw.pwm"; | 1046 | fn = "tempsyncpw.pwm"; |
1046 | break; | 1047 | break; |
1047 | default: | 1048 | default: |
1048 | break; | 1049 | break; |
1049 | } | 1050 | } |
1050 | #ifdef _WIN32_ | 1051 | #ifdef _WIN32_ |
1051 | return locateLocal( "tmp", fn ); | 1052 | return locateLocal( "tmp", fn ); |
1052 | #else | 1053 | #else |
1053 | return (QString( "/tmp/" )+ fn ); | 1054 | return (QString( "/tmp/" )+ fn ); |
1054 | #endif | 1055 | #endif |
1055 | } | 1056 | } |
1056 | 1057 | ||
1057 | void KSyncManager::syncPi() | 1058 | void KSyncManager::syncPi() |
1058 | { | 1059 | { |
1059 | mIsKapiFile = true; | 1060 | mIsKapiFile = true; |
1060 | mPisyncFinished = false; | 1061 | mPisyncFinished = false; |
1061 | qApp->processEvents(); | 1062 | qApp->processEvents(); |
1062 | if ( mAskForPreferences ) | 1063 | if ( mAskForPreferences ) |
1063 | if ( !edit_pisync_options()) { | 1064 | if ( !edit_pisync_options()) { |
1064 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); | 1065 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); |
1065 | mPisyncFinished = true; | 1066 | mPisyncFinished = true; |
1066 | return; | 1067 | return; |
1067 | } | 1068 | } |
1068 | bool ok; | 1069 | bool ok; |
1069 | Q_UINT16 port = mActiveSyncPort.toUInt(&ok); | 1070 | Q_UINT16 port = mActiveSyncPort.toUInt(&ok); |
1070 | if ( ! ok ) { | 1071 | if ( ! ok ) { |
1071 | mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") ); | 1072 | mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") ); |
1072 | mPisyncFinished = true; | 1073 | mPisyncFinished = true; |
1073 | return; | 1074 | return; |
1074 | } | 1075 | } |
1075 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); | 1076 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); |
1076 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); | 1077 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); |
1077 | commandSocket->readFile( syncFileName() ); | 1078 | commandSocket->readFile( syncFileName() ); |
1078 | } | 1079 | } |
1079 | 1080 | ||
1080 | void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) | 1081 | void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) |
1081 | { | 1082 | { |
1082 | //enum { success, errorW, errorR, quiet }; | 1083 | //enum { success, errorW, errorR, quiet }; |
1083 | 1084 | ||
1084 | 1085 | ||
1085 | 1086 | ||
1086 | if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW || | 1087 | if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW || |
1087 | state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) { | 1088 | state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) { |
1088 | if ( state == KCommandSocket::errorPW ) | 1089 | if ( state == KCommandSocket::errorPW ) |
1089 | mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") ); | 1090 | mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") ); |
1090 | else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ) | 1091 | else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ) |
1091 | mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") ); | 1092 | mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") ); |
1092 | else if ( state == KCommandSocket::errorCA ) | 1093 | else if ( state == KCommandSocket::errorCA ) |
1093 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") ); | 1094 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") ); |
1094 | else if ( state == KCommandSocket::errorFI ) | 1095 | else if ( state == KCommandSocket::errorFI ) |
1095 | mParent->topLevelWidget()->setCaption( i18n("File error on remote.") ); | 1096 | mParent->topLevelWidget()->setCaption( i18n("File error on remote.") ); |
1096 | else if ( state == KCommandSocket::errorED ) | 1097 | else if ( state == KCommandSocket::errorED ) |
1097 | mParent->topLevelWidget()->setCaption( i18n("Please close error dialog on remote.") ); | 1098 | mParent->topLevelWidget()->setCaption( i18n("Please close error dialog on remote.") ); |
1098 | else if ( state == KCommandSocket::errorUN ) | 1099 | else if ( state == KCommandSocket::errorUN ) |
1099 | mParent->topLevelWidget()->setCaption( i18n("Unknown error on remote.") ); | 1100 | mParent->topLevelWidget()->setCaption( i18n("Unknown error on remote.") ); |
1100 | delete s; | 1101 | delete s; |
1101 | if ( state == KCommandSocket::errorR ) { | 1102 | if ( state == KCommandSocket::errorR ) { |
1102 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget()); | 1103 | KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget()); |
1103 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); | 1104 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); |
1104 | commandSocket->sendStop(); | 1105 | commandSocket->sendStop(); |
1105 | } | 1106 | } |
1106 | mPisyncFinished = true; | 1107 | mPisyncFinished = true; |
1107 | return; | 1108 | return; |
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp index e57defe..b6d2feb 100644 --- a/microkde/kglobalsettings.cpp +++ b/microkde/kglobalsettings.cpp | |||
@@ -1,44 +1,50 @@ | |||
1 | #include "kglobalsettings.h" | 1 | #include "kglobalsettings.h" |
2 | #include "kconfig.h" | 2 | #include "kconfig.h" |
3 | #include "kglobal.h" | 3 | #include "kglobal.h" |
4 | #include "kconfigbase.h" | 4 | #include "kconfigbase.h" |
5 | 5 | ||
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | 7 | ||
8 | QFont KGlobalSettings::generalFont() | 8 | QFont KGlobalSettings::generalFont() |
9 | { | 9 | { |
10 | int size = 12; | 10 | int size = 12; |
11 | if (QApplication::desktop()->width() < 480 ) | 11 | if (QApplication::desktop()->width() < 480 ) { |
12 | size = 10; | 12 | size = 10; |
13 | } | ||
14 | #ifndef DESKTOP_VERSION | ||
15 | else | ||
16 | if (QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) | ||
17 | size = 18; | ||
18 | #endif | ||
13 | QFont f = QApplication::font(); | 19 | QFont f = QApplication::font(); |
14 | //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); | 20 | //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1()); |
15 | f.setPointSize( size ); | 21 | f.setPointSize( size ); |
16 | return f; | 22 | return f; |
17 | } | 23 | } |
18 | QFont KGlobalSettings::toolBarFont() | 24 | QFont KGlobalSettings::toolBarFont() |
19 | { | 25 | { |
20 | return QApplication::font(); | 26 | return QApplication::font(); |
21 | } | 27 | } |
22 | 28 | ||
23 | QColor KGlobalSettings::toolBarHighlightColor() | 29 | QColor KGlobalSettings::toolBarHighlightColor() |
24 | { | 30 | { |
25 | return QColor( "black" ); | 31 | return QColor( "black" ); |
26 | } | 32 | } |
27 | 33 | ||
28 | QRect KGlobalSettings::desktopGeometry( QWidget * ) | 34 | QRect KGlobalSettings::desktopGeometry( QWidget * ) |
29 | { | 35 | { |
30 | return QApplication::desktop()->rect(); | 36 | return QApplication::desktop()->rect(); |
31 | } | 37 | } |
32 | 38 | ||
33 | /** | 39 | /** |
34 | * Returns whether KDE runs in single (default) or double click | 40 | * Returns whether KDE runs in single (default) or double click |
35 | * mode. | 41 | * mode. |
36 | * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html | 42 | * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html |
37 | * @return true if single click mode, or false if double click mode. | 43 | * @return true if single click mode, or false if double click mode. |
38 | **/ | 44 | **/ |
39 | bool KGlobalSettings::singleClick() | 45 | bool KGlobalSettings::singleClick() |
40 | { | 46 | { |
41 | KConfig *c = KGlobal::config(); | 47 | KConfig *c = KGlobal::config(); |
42 | KConfigGroupSaver cgs( c, "KDE" ); | 48 | KConfigGroupSaver cgs( c, "KDE" ); |
43 | return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); | 49 | return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); |
44 | } | 50 | } |