-rw-r--r-- | bin/kdepim/WhatsNew.txt | 12 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 5 | ||||
-rw-r--r-- | kalarmd/alarmdialog.cpp | 48 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 18 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 17 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 1 |
7 files changed, 92 insertions, 11 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index d4ec863..4250fb3 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,114 +1,126 @@ | |||
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". | 7 | Changed default setting for new filter in KA/Pi to "exclude categories". |
8 | Changed the default font size for 640x480 display . | 8 | Changed the default font size for 640x480 display . |
9 | Changed popup menu behaviour in agenda and list view. | 9 | Changed popup menu behaviour in agenda and list view. |
10 | Fixed some layout problems of the date label size in the month view. | 10 | Fixed some layout problems of the date label size in the month view. |
11 | Made month view update faster. | 11 | Made month view update faster. |
12 | Made first datenavigator repainting faster. | 12 | Made first datenavigator repainting faster. |
13 | Changed the title of the event/todo edit dialogs. | 13 | Changed the title of the event/todo edit dialogs. |
14 | Timelabels in agenga changed from 22:00 to 22 oo. ( the oo higher, of course). | 14 | Timelabels in agenga changed from 22:00 to 22 oo. ( the oo higher, of course). |
15 | Many small usebility fixes in KO/Pi. | 15 | Many small usebility fixes in KO/Pi. |
16 | Pressing the "Calendar" button on the Z switches now to the next view in KO/Pi. | 16 | Pressing the "Calendar" button on the Z switches now to the next view in KO/Pi. |
17 | The set of possible "next views" are the views you have toolbar buttons for. | 17 | The set of possible "next views" are the views you have toolbar buttons for. |
18 | 18 | ||
19 | Made alarm sound working on Linux. | ||
20 | |||
21 | KO/Pi alarm applet changed: | ||
22 | Made buttons in alarm dialog much bigger. | ||
23 | Made setting of timer more user friendly by showing the actual timer fire time and making the buttons in the timer settings much bigger. | ||
24 | The goal was it to make it possible to use a finger tip ( and not the stylus ) on the touchscreen to adjust the settings. | ||
25 | |||
26 | And because this version is realeased at Easter, I added an Easter-egg: | ||
27 | With a new undocumented command you can get a message box about the next alarm. | ||
28 | Good luck to find it! | ||
29 | |||
30 | |||
19 | 31 | ||
20 | ********** VERSION 2.0.20 ************ | 32 | ********** VERSION 2.0.20 ************ |
21 | 33 | ||
22 | Two small fixes in OM/Pi. | 34 | Two small fixes in OM/Pi. |
23 | 35 | ||
24 | Better resizing of the new datenavigator in KO/Pi. | 36 | Better resizing of the new datenavigator in KO/Pi. |
25 | 37 | ||
26 | ********** VERSION 2.0.19 ************ | 38 | ********** VERSION 2.0.19 ************ |
27 | KO/Pi: | 39 | KO/Pi: |
28 | Enhancements and bugfixes in the new datenavigator. | 40 | Enhancements and bugfixes in the new datenavigator. |
29 | Bugfix in this changelog: | 41 | Bugfix in this changelog: |
30 | The datenavigator was changed in version 2.0.18, not the datepicker. | 42 | The datenavigator was changed in version 2.0.18, not the datepicker. |
31 | 43 | ||
32 | ********** VERSION 2.0.18 ************ | 44 | ********** VERSION 2.0.18 ************ |
33 | KO/Pi: | 45 | KO/Pi: |
34 | Fixed some minor problems. | 46 | Fixed some minor problems. |
35 | Cleaned up the KO/Pi config dialog. | 47 | Cleaned up the KO/Pi config dialog. |
36 | Fixed problem moving events in aganda view. | 48 | Fixed problem moving events in aganda view. |
37 | Made datepicker scaleable, i.e. if the datenavigator shows now a | 49 | Made datepicker scaleable, i.e. if the datenavigator shows now a |
38 | datenavigator matrix depending on its size. | 50 | datenavigator matrix depending on its size. |
39 | Birthdays are now displayed green in the datenavigator. | 51 | Birthdays are now displayed green in the datenavigator. |
40 | What'sThis Help in datenavigator shows all events of the day. | 52 | What'sThis Help in datenavigator shows all events of the day. |
41 | 53 | ||
42 | OM/Pi: | 54 | OM/Pi: |
43 | Updated the backend mail library to the latest version. | 55 | Updated the backend mail library to the latest version. |
44 | Please backup your mail before using this version. | 56 | Please backup your mail before using this version. |
45 | 57 | ||
46 | ********** VERSION 2.0.17 ************ | 58 | ********** VERSION 2.0.17 ************ |
47 | 59 | ||
48 | KO/Pi: | 60 | KO/Pi: |
49 | Tooltips in month view were not sorted. Fixed. | 61 | Tooltips in month view were not sorted. Fixed. |
50 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. | 62 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. |
51 | Conflict display dialog for syncing was not on top of other windows. Fixed. | 63 | Conflict display dialog for syncing was not on top of other windows. Fixed. |
52 | Fixed some minor problems. | 64 | Fixed some minor problems. |
53 | 65 | ||
54 | Fixed an endless loop when importing vcs file with RESOURCES entry. | 66 | Fixed an endless loop when importing vcs file with RESOURCES entry. |
55 | 67 | ||
56 | ********** VERSION 2.0.16 ************ | 68 | ********** VERSION 2.0.16 ************ |
57 | OM/Pi: | 69 | OM/Pi: |
58 | Fixed the SMTP account setting the option. | 70 | Fixed the SMTP account setting the option. |
59 | Fixed something in mail sending. | 71 | Fixed something in mail sending. |
60 | 72 | ||
61 | KO/Pi: | 73 | KO/Pi: |
62 | Added possibility to export selected events/todos as vcal file. | 74 | Added possibility to export selected events/todos as vcal file. |
63 | 75 | ||
64 | ********** VERSION 2.0.15 ************ | 76 | ********** VERSION 2.0.15 ************ |
65 | 77 | ||
66 | PwM/Pi: | 78 | PwM/Pi: |
67 | Added keyboard shorcuts for | 79 | Added keyboard shorcuts for |
68 | - toggling summary view (space bar) | 80 | - toggling summary view (space bar) |
69 | - delete item (delete + backspace key) | 81 | - delete item (delete + backspace key) |
70 | - add new item ( i + n key) | 82 | - add new item ( i + n key) |
71 | Fixed length of info in the title. | 83 | Fixed length of info in the title. |
72 | 84 | ||
73 | KO/Pi-KA/Pi: | 85 | KO/Pi-KA/Pi: |
74 | Changed "ME" menu bar entry to an icon. | 86 | Changed "ME" menu bar entry to an icon. |
75 | 87 | ||
76 | KO/Pi: | 88 | KO/Pi: |
77 | Fixed two minor bugs in displaying todos. | 89 | Fixed two minor bugs in displaying todos. |
78 | If in month view a cell is selected, the key shortcut "d" shows now that date. | 90 | If in month view a cell is selected, the key shortcut "d" shows now that date. |
79 | Added complete info for a todo in month view as an icon left of the text. | 91 | Added complete info for a todo in month view as an icon left of the text. |
80 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. | 92 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. |
81 | Fixed problem of search dialog size when switching displays. | 93 | Fixed problem of search dialog size when switching displays. |
82 | Cancel key now closes date picker. | 94 | Cancel key now closes date picker. |
83 | Rearranged KO/Pi file menu structure. | 95 | Rearranged KO/Pi file menu structure. |
84 | 96 | ||
85 | OM/Pi: | 97 | OM/Pi: |
86 | Added to the SMTP account setting the option | 98 | Added to the SMTP account setting the option |
87 | "No secure connection". | 99 | "No secure connection". |
88 | You have to configure your SMTP accounts again, sorry. | 100 | You have to configure your SMTP accounts again, sorry. |
89 | 101 | ||
90 | KA/Pi: | 102 | KA/Pi: |
91 | Added support for importing quoted-printable. | 103 | Added support for importing quoted-printable. |
92 | Support was added by Peter P.. Thanks, Peter! | 104 | Support was added by Peter P.. Thanks, Peter! |
93 | 105 | ||
94 | 106 | ||
95 | ********** VERSION 2.0.14 ************ | 107 | ********** VERSION 2.0.14 ************ |
96 | 108 | ||
97 | Made Passwordmanager PwM/Pi more userfriendly: | 109 | Made Passwordmanager PwM/Pi more userfriendly: |
98 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 110 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
99 | Fixed bug in KO/Pi todo printing. | 111 | Fixed bug in KO/Pi todo printing. |
100 | Made Qtopia calendar import possible on desktop . | 112 | Made Qtopia calendar import possible on desktop . |
101 | 113 | ||
102 | ********** VERSION 2.0.13 ************ | 114 | ********** VERSION 2.0.13 ************ |
103 | 115 | ||
104 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. | 116 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. |
105 | 117 | ||
106 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". | 118 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". |
107 | 119 | ||
108 | OM/Pi: | 120 | OM/Pi: |
109 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. | 121 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. |
110 | Added missing German translation. | 122 | Added missing German translation. |
111 | Added warning if path is specified in local folder settings of account config. | 123 | Added warning if path is specified in local folder settings of account config. |
112 | 124 | ||
113 | ********** VERSION 2.0.12 ************ | 125 | ********** VERSION 2.0.12 ************ |
114 | 126 | ||
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index b6293b5..ce55780 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1211,103 +1211,106 @@ | |||
1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, | 1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, |
1212 | { " and "," und " }, | 1212 | { " and "," und " }, |
1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, | 1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, |
1214 | { "Mail to selected","Mail an Ausgewählte" }, | 1214 | { "Mail to selected","Mail an Ausgewählte" }, |
1215 | { "Mail to all","Mail an Alle" }, | 1215 | { "Mail to all","Mail an Alle" }, |
1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, | 1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, |
1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1218 | { " on"," am" }, | 1218 | { " on"," am" }, |
1219 | { " completed on "," erledigt am " }, | 1219 | { " completed on "," erledigt am " }, |
1220 | { "Save as Event template","Speichere als Vorlage" }, | 1220 | { "Save as Event template","Speichere als Vorlage" }, |
1221 | { "Load Event template","Lade Termin Vorlage" }, | 1221 | { "Load Event template","Lade Termin Vorlage" }, |
1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, | 1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, |
1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, | 1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, |
1224 | { "Sub todos:<br>","Unter Todos:<br>" }, | 1224 | { "Sub todos:<br>","Unter Todos:<br>" }, |
1225 | { "Parent todo:<br>","Über Todo:<br>" }, | 1225 | { "Parent todo:<br>","Über Todo:<br>" }, |
1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, | 1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, |
1227 | { " completed"," erledigt" }, | 1227 | { " completed"," erledigt" }, |
1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, | 1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, |
1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, | 1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, |
1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
1234 | { "Error","Fehler" }, | 1234 | { "Error","Fehler" }, |
1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
1237 | { "Warning","Warnung" }, | 1237 | { "Warning","Warnung" }, |
1238 | { "Select week number","Wähle Wochen Nummer" }, | 1238 | { "Select week number","Wähle Wochen Nummer" }, |
1239 | { "Februar","Februar" }, | 1239 | { "Februar","Februar" }, |
1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, | 1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, |
1241 | { "W","W" }, | 1241 | { "W","W" }, |
1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, | 1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, |
1243 | { "T: %1","T: %1" }, | 1243 | { "T: %1","T: %1" }, |
1244 | { "Start: ","Start: " }, | 1244 | { "Start: ","Start: " }, |
1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
1247 | { "Remote IP address:","Ferne IP Adresse:" }, | 1247 | { "Remote IP address:","Ferne IP Adresse:" }, |
1248 | { "Remote port number:","Ferne Port Nummer:" }, | 1248 | { "Remote port number:","Ferne Port Nummer:" }, |
1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
1250 | { "Remote from: ","Fern von: " }, | 1250 | { "Remote from: ","Fern von: " }, |
1251 | { "Local from: ","Lokal von: " }, | 1251 | { "Local from: ","Lokal von: " }, |
1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, | 1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, |
1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
1254 | { "Write back","Schreibe zurück" }, | 1254 | { "Write back","Schreibe zurück" }, |
1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, | 1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, |
1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
1257 | { "Received sync request","Sync Anfrage erhalten" }, | 1257 | { "Received sync request","Sync Anfrage erhalten" }, |
1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, | 1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, |
1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
1261 | { "Sending file...","Sende Datei..." }, | 1261 | { "Sending file...","Sende Datei..." }, |
1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
1264 | { "Received %1 bytes","%1 Bytes erhalten" }, | 1264 | { "Received %1 bytes","%1 Bytes erhalten" }, |
1265 | { "Writing file to disk...","Speichere Datei..." }, | 1265 | { "Writing file to disk...","Speichere Datei..." }, |
1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
1268 | { "Synchronize!","Synchronisiere!" }, | 1268 | { "Synchronize!","Synchronisiere!" }, |
1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, | 1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, |
1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, | 1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, |
1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, | 1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, |
1274 | { "List week view","Listenwochenansicht" }, | 1274 | { "List week view","Listenwochenansicht" }, |
1275 | { "List week","Listenwochenansicht" }, | 1275 | { "List week","Listenwochenansicht" }, |
1276 | { "Next Week","Nächste Woche" }, | 1276 | { "Next Week","Nächste Woche" }, |
1277 | { "Previous Week","Vorherige Woche" }, | 1277 | { "Previous Week","Vorherige Woche" }, |
1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, | 1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, |
1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, | 1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, |
1280 | { "Details","Details" }, | 1280 | { "Details","Details" }, |
1281 | { "Created time","Erstellt Zeit" }, | 1281 | { "Created time","Erstellt Zeit" }, |
1282 | { "Last modified time","Geändert Zeit" }, | 1282 | { "Last modified time","Geändert Zeit" }, |
1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, | 1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, |
1284 | { "View Options","Anzeige Optionen" }, | 1284 | { "View Options","Anzeige Optionen" }, |
1285 | { "<b>Created: ","<b>Erstellt am: " }, | 1285 | { "<b>Created: ","<b>Erstellt am: " }, |
1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, | 1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, |
1287 | { "Journal: ","Journal: " }, | 1287 | { "Journal: ","Journal: " }, |
1288 | { "yearly","jährlich" }, | 1288 | { "yearly","jährlich" }, |
1289 | { "(%1) ","%1-" }, | 1289 | { "(%1) ","%1-" }, |
1290 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, | 1290 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, |
1291 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, | 1291 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, |
1292 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, | 1292 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, |
1293 | { "Summary/Loc.","Titel/Ort" }, | 1293 | { "Summary/Loc.","Titel/Ort" }, |
1294 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, | 1294 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, |
1295 | { "Week Number","Wochennummer" }, | 1295 | { "Week Number","Wochennummer" }, |
1296 | { "Import","Importiere" }, | 1296 | { "Import","Importiere" }, |
1297 | { "Export","Exportiere" }, | 1297 | { "Export","Exportiere" }, |
1298 | { "Beam","Beame" }, | 1298 | { "Beam","Beame" }, |
1299 | { "Export selected","Exportiere Selektierte" }, | 1299 | { "Export selected","Exportiere Selektierte" }, |
1300 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, | 1300 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, |
1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, | 1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, |
1302 | { "Journal/Details...","Journale/Details..." }, | 1302 | { "Journal/Details...","Journale/Details..." }, |
1303 | { "Agenda View","Agenda Ansicht" }, | 1303 | { "Agenda View","Agenda Ansicht" }, |
1304 | { "Show current time","Zeige aktuelle Zeit" }, | 1304 | { "Show current time","Zeige aktuelle Zeit" }, |
1305 | { "Edit new item","Bearbeite neuen Eintrag" }, | 1305 | { "Edit new item","Bearbeite neuen Eintrag" }, |
1306 | { "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, | 1306 | { "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, |
1307 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, | ||
1308 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, | ||
1309 | { "The next alarm is on:\n%1\nat: %2\n\n%3\n(%4)","Der nächste Alarm in am:\n%1\num: %2\n\n%3\n(%4)" }, | ||
1307 | { "","" }, | 1310 | { "","" }, |
1308 | { "","" }, | 1311 | { "","" }, |
1309 | { "","" }, | 1312 | { "","" }, |
1310 | { "","" }, | 1313 | { "","" }, |
1311 | { "","" }, | 1314 | { "","" }, |
1312 | { "","" }, | 1315 | { "","" }, |
1313 | { "","" }, | 1316 | \ No newline at end of file |
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index c939ae0..7ead3b9 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp | |||
@@ -1,280 +1,312 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the KDE alarm daemon. | 2 | This file is part of the KDE alarm daemon. |
3 | Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | // $Id$ | 24 | // $Id$ |
25 | 25 | ||
26 | #include <qhbox.h> | 26 | #include <qhbox.h> |
27 | #include <qvbox.h> | 27 | #include <qvbox.h> |
28 | #include <qapp.h> | 28 | #include <qapp.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qlayout.h> | 30 | #include <qlayout.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qsound.h> | 33 | #include <qsound.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #define protected public | 35 | #define protected public |
36 | #include <qspinbox.h> | 36 | #include <qspinbox.h> |
37 | #undef protected | 37 | #undef protected |
38 | #include <stdlib.h> | 38 | #include <stdlib.h> |
39 | #ifndef _WIN32_ | 39 | #ifndef _WIN32_ |
40 | #include <unistd.h> | 40 | #include <unistd.h> |
41 | #include <sys/ioctl.h> | 41 | #include <sys/ioctl.h> |
42 | #endif | 42 | #endif |
43 | #include <stdio.h> | 43 | #include <stdio.h> |
44 | #include <fcntl.h> | 44 | #include <fcntl.h> |
45 | 45 | ||
46 | #ifndef DESKTOP_VERSION | 46 | #ifndef DESKTOP_VERSION |
47 | #include <qtopia/alarmserver.h> | 47 | #include <qtopia/alarmserver.h> |
48 | #include <qpe/resource.h> | 48 | #include <qpe/resource.h> |
49 | #include <qtopia/sound.h> | 49 | #include <qtopia/sound.h> |
50 | |||
50 | #endif | 51 | #endif |
51 | 52 | ||
52 | #include "alarmdialog.h" | 53 | #include "alarmdialog.h" |
53 | 54 | ||
54 | 55 | ||
55 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) | 56 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) |
56 | : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) | 57 | : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) |
57 | { | 58 | { |
58 | setCaption( "KO/Pi Alarm!" ); | 59 | setCaption( "KO/Pi Alarm!" ); |
59 | QVBoxLayout* layout = new QVBoxLayout( this); | 60 | QVBoxLayout* layout = new QVBoxLayout( this); |
60 | QLabel* l = new QLabel("The following event triggered alarm:",this); | 61 | QLabel* l = new QLabel("The following event triggered alarm:",this); |
61 | layout->addWidget ( l ); | 62 | layout->addWidget ( l ); |
62 | l->setAlignment( AlignCenter); | 63 | l->setAlignment( AlignCenter); |
63 | mMessage = new QLabel ( " ", this ); | 64 | mMessage = new QLabel ( " ", this ); |
64 | int fs = 18; | 65 | int fs = 18; |
65 | int fs2 = 12; | 66 | int fs2 = 12; |
66 | if ( QApplication::desktop()->width() < 480 ) { | 67 | if ( QApplication::desktop()->width() < 480 ) { |
67 | setMaximumSize(220, 260); | 68 | setMaximumSize(220, 260); |
68 | fs2 = 10; | 69 | fs2 = 10; |
69 | } | 70 | } |
70 | else { | 71 | else { |
71 | setMaximumSize(440, 440); | 72 | setMaximumSize(440, 440); |
72 | } | 73 | } |
73 | layout->setSpacing( 3 ); | 74 | layout->setSpacing( 3 ); |
74 | layout->setMargin( 3 ); | 75 | layout->setMargin( 3 ); |
75 | QFont fo = QApplication::font(); | 76 | QFont fo = QApplication::font(); |
76 | fo.setBold( true ); | 77 | fo.setBold( true ); |
77 | fo.setPointSize( fs2 ); | 78 | fo.setPointSize( fs2 ); |
78 | l->setFont( fo ); | 79 | l->setFont( fo ); |
79 | fo.setPointSize( fs ); | 80 | fo.setPointSize( fs ); |
80 | mMessage->setFont(fo ); | 81 | mMessage->setFont(fo ); |
81 | mMessage->setAlignment( AlignCenter); | 82 | mMessage->setAlignment( AlignCenter); |
82 | layout->addWidget ( mMessage ); | 83 | layout->addWidget ( mMessage ); |
83 | mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); | 84 | mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); |
84 | mMissedAlarms->setAlignment( AlignCenter); | 85 | mMissedAlarms->setAlignment( AlignCenter); |
85 | 86 | ||
86 | playSoundTimer = new QTimer( this ); | 87 | playSoundTimer = new QTimer( this ); |
87 | connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); | 88 | connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); |
88 | 89 | ||
89 | playSoundTimer->stop(); | 90 | playSoundTimer->stop(); |
90 | 91 | ||
91 | layout->addWidget ( mMissedAlarms ); | 92 | layout->addWidget ( mMissedAlarms ); |
92 | mMissedAlarmsCombo = new QComboBox ( this ); | 93 | mMissedAlarmsCombo = new QComboBox ( this ); |
93 | layout->addWidget ( mMissedAlarmsCombo ); | 94 | layout->addWidget ( mMissedAlarmsCombo ); |
94 | QVBox *suspendBox = new QVBox( this ); | 95 | |
95 | suspendBox->setSpacing(3); | 96 | QLabel* labb = new QLabel("Suspend duration (minutes):",this); |
96 | layout->addWidget ( suspendBox ); | ||
97 | QLabel* labb = new QLabel("Suspend duration (minutes):",suspendBox); | ||
98 | labb->setAlignment(AlignCenter); | 97 | labb->setAlignment(AlignCenter); |
98 | layout->addWidget ( labb ); | ||
99 | fo = font(); | 99 | fo = font(); |
100 | fo.setPointSize( 36 ); | 100 | int pointSize = 36; |
101 | mSuspendSpin = new QSpinBox(1,1440,1,suspendBox); | 101 | if ( QApplication::desktop()->width() <= 320 ) |
102 | pointSize = 24; | ||
103 | fo.setPointSize( pointSize ); | ||
104 | mSuspendSpin = new QSpinBox(1,1440,1,this); | ||
102 | mSuspendSpin->setFont( fo ); | 105 | mSuspendSpin->setFont( fo ); |
103 | mSuspendSpin->setValue(7); // default suspend duration | 106 | mSuspendSpin->setValue(7); // default suspend duration |
104 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); | 107 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); |
105 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); | 108 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); |
106 | #if QT_VERSION < 0x030000 | 109 | #if QT_VERSION < 0x030000 |
107 | mSuspendSpin->upButton ()->setFixedSize( QSize( 48, 30 )); | 110 | mSuspendSpin->upButton ()->setFixedSize( QSize( 48, 30 )); |
108 | mSuspendSpin->downButton ()->setFixedSize( QSize( 48, 30 )); | 111 | mSuspendSpin->downButton ()->setFixedSize( QSize( 48, 30 )); |
109 | #endif | 112 | #endif |
110 | mSuspendSpin->setFixedSize( 100,62 ); | 113 | mSuspendSpin->setFixedSize( 100,62 ); |
111 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); | 114 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); |
115 | QHBoxLayout* layoutSpin = new QHBoxLayout( layout ); | ||
116 | layoutSpin->addStretch (); | ||
117 | layoutSpin->addWidget ( mSuspendSpin ); | ||
118 | layoutSpin->addStretch (); | ||
112 | 119 | ||
113 | QVBox * bbox = new QVBox ( this ); | 120 | QVBox * bbox = new QVBox ( this ); |
114 | layout->addWidget ( bbox ); | 121 | layout->addWidget ( bbox ); |
115 | bbox->layout()->setSpacing( 2 ); | 122 | bbox->layout()->setSpacing( 2 ); |
123 | labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox); | ||
124 | labb->setAlignment(AlignCenter); | ||
116 | mSuspendButton = new QPushButton( "Suspend", bbox); | 125 | mSuspendButton = new QPushButton( "Suspend", bbox); |
117 | QPushButton* silen = new QPushButton( " Stop sound ", bbox); | 126 | QPushButton* silen = new QPushButton( " Stop sound ", bbox); |
118 | QPushButton* okbut = new QPushButton( "Ok", bbox); | 127 | QPushButton* okbut = new QPushButton( "Ok", bbox); |
119 | mSuspendButton->setFont( fo ); | 128 | mSuspendButton->setFont( fo ); |
120 | silen->setFont( fo ); | 129 | silen->setFont( fo ); |
121 | okbut->setFont( fo ); | 130 | okbut->setFont( fo ); |
122 | okbut->setDefault( true ); | 131 | okbut->setDefault( true ); |
123 | connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); | 132 | connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); |
124 | connect (mSuspendButton, SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); | 133 | connect (mSuspendButton, SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); |
125 | connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); | 134 | connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); |
126 | #ifndef _WIN32_ | 135 | #ifndef _WIN32_ |
127 | if ( QFile::exists ( "/dev/sharp_led" ) ) | 136 | if ( QFile::exists ( "/dev/sharp_led" ) ) |
128 | fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); | 137 | fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); |
129 | else | 138 | else |
130 | #endif | 139 | #endif |
131 | fd_led = 0; | 140 | fd_led = 0; |
132 | statusLED.which = SHARP_LED_SALARM; | 141 | statusLED.which = SHARP_LED_SALARM; |
133 | mSilent = false; | 142 | mSilent = false; |
134 | mSuspendCounter = 0; | 143 | mSuspendCounter = 0; |
135 | setServerNotification( true ); | 144 | setServerNotification( true ); |
136 | } | 145 | } |
137 | void AlarmDialog::reject () | 146 | void AlarmDialog::reject () |
138 | { | 147 | { |
139 | QTimer::singleShot ( 3000, this, SLOT (suspend()) ); | 148 | QTimer::singleShot ( 3000, this, SLOT (suspend()) ); |
140 | slotSuspend(); | 149 | slotSuspend(); |
141 | } | 150 | } |
142 | AlarmDialog::~AlarmDialog() | 151 | AlarmDialog::~AlarmDialog() |
143 | { | 152 | { |
144 | } | 153 | } |
145 | void AlarmDialog::silent () | 154 | void AlarmDialog::silent () |
146 | { | 155 | { |
147 | mSilent = true; | 156 | mSilent = true; |
148 | } | 157 | } |
149 | void AlarmDialog::accept() | 158 | void AlarmDialog::accept() |
150 | { | 159 | { |
151 | slotOk(); | 160 | slotOk(); |
152 | } | 161 | } |
153 | 162 | ||
154 | void AlarmDialog::suspend() | 163 | void AlarmDialog::suspend() |
155 | { | 164 | { |
156 | #ifdef DESKTOP_VERSION | 165 | #ifdef DESKTOP_VERSION |
157 | 166 | ||
158 | #else | 167 | #else |
159 | Sound::soundAlarm (); | 168 | Sound::soundAlarm (); |
160 | #endif | 169 | #endif |
161 | } | 170 | } |
162 | void AlarmDialog::slotOk() | 171 | void AlarmDialog::slotOk() |
163 | { | 172 | { |
164 | mStopAlarm = true; | 173 | mStopAlarm = true; |
165 | mMissedAlarms->setText("(No missed Alarms)"); | 174 | mMissedAlarms->setText("(No missed Alarms)"); |
166 | mMessage->setText(""); | 175 | mMessage->setText(""); |
167 | mMissedAlarmsCombo->clear(); | 176 | mMissedAlarmsCombo->clear(); |
168 | #ifndef _WIN32_ | 177 | #ifndef _WIN32_ |
169 | if ( fd_led > 0 ) { | 178 | if ( fd_led > 0 ) { |
170 | statusLED.status = LED_SALARM_OFF ; | 179 | statusLED.status = LED_SALARM_OFF ; |
171 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); | 180 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); |
172 | } | 181 | } |
173 | #endif | 182 | #endif |
174 | QDialog::accept(); | 183 | QDialog::accept(); |
175 | } | 184 | } |
176 | 185 | ||
177 | void AlarmDialog::slotSuspend() | 186 | void AlarmDialog::slotSuspend() |
178 | { | 187 | { |
179 | //qDebug("AlarmDialog::suspend() "); // emit suspendSignal(mSuspendSpin->value()); | 188 | //qDebug("AlarmDialog::suspend() "); // emit suspendSignal(mSuspendSpin->value()); |
180 | mStopAlarm = true; | 189 | mStopAlarm = true; |
181 | QDateTime nextA = QDateTime::currentDateTime().addSecs( mSuspendSpin->value() * 60 ); | 190 | QDateTime nextA = QDateTime::currentDateTime().addSecs( mSuspendSpin->value() * 60 ); |
182 | QString mess = "suspend_alarm" +mFileName+"+++" ; | 191 | QString mess = "suspend_alarm" +mFileName+"+++" ; |
183 | if ( mMessage->text().left( 10 ) !="Suspended:" ) | 192 | if ( mMessage->text().left( 10 ) !="Suspended:" ) |
184 | mess += "Suspended:\n"; | 193 | mess += "Suspended:\n"; |
185 | mess +=mMessage->text(); | 194 | mess +=mMessage->text(); |
186 | #ifndef DESKTOP_VERSION | 195 | #ifndef DESKTOP_VERSION |
187 | if ( mServerNotification ) | 196 | if ( mServerNotification ) |
188 | AlarmServer::addAlarm ( nextA,"koalarm",mess.latin1()); | 197 | AlarmServer::addAlarm ( nextA,"koalarm",mess.latin1()); |
189 | #endif | 198 | #endif |
190 | emit addAlarm( nextA , mess ); | 199 | emit addAlarm( nextA , mess ); |
191 | slotOk(); | 200 | slotOk(); |
192 | } | 201 | } |
193 | 202 | ||
194 | void AlarmDialog::setServerNotification( bool b ) | 203 | void AlarmDialog::setServerNotification( bool b ) |
195 | { | 204 | { |
196 | mServerNotification = b; | 205 | mServerNotification = b; |
197 | } | 206 | } |
198 | int AlarmDialog::getSuspendTime( ) | 207 | int AlarmDialog::getSuspendTime( ) |
199 | { | 208 | { |
200 | return mSuspendSpin->value(); | 209 | return mSuspendSpin->value(); |
201 | 210 | ||
202 | } | 211 | } |
203 | void AlarmDialog::setSuspendTime( int val ) | 212 | void AlarmDialog::setSuspendTime( int val ) |
204 | { | 213 | { |
205 | mSuspendSpin->setValue( val ); | 214 | mSuspendSpin->setValue( val ); |
206 | } | 215 | } |
207 | bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, bool playwav, int pause , int suspendtimes) | 216 | bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, bool playwav, int pause , int suspendtimes) |
208 | { | 217 | { |
209 | if ( mess.left( 9) != "Suspended" ) | 218 | if ( mess.left( 9) != "Suspended" ) |
210 | mSuspendCounter = suspendtimes; | 219 | mSuspendCounter = suspendtimes; |
211 | mPauseCount = pause; | 220 | mPauseCount = pause; |
212 | mFileName = fn; | 221 | mFileName = fn; |
213 | mPlayWav = playwav; | 222 | mPlayWav = playwav; |
214 | if ( !QFile::exists( fn ) ) | 223 | if ( !QFile::exists( fn ) ) |
215 | mFileName = ""; | 224 | mFileName = ""; |
216 | alarmCounter = 0 ; | 225 | alarmCounter = 0 ; |
217 | maxAlarmReplay = replay ; | 226 | maxAlarmReplay = replay ; |
218 | mStopAlarm = false; | 227 | mStopAlarm = false; |
219 | mSilent = false; | 228 | mSilent = false; |
220 | if ( !mMessage->text().stripWhiteSpace().isEmpty() ) { | 229 | if ( !mMessage->text().stripWhiteSpace().isEmpty() ) { |
221 | mMissedAlarmsCombo->show(); | 230 | mMissedAlarmsCombo->show(); |
222 | mMissedAlarmsCombo->insertItem( mMessage->text().stripWhiteSpace() ); | 231 | mMissedAlarmsCombo->insertItem( mMessage->text().stripWhiteSpace() ); |
223 | mMissedAlarms->setText( "Missed alarms:"); | 232 | mMissedAlarms->setText( "Missed alarms:"); |
224 | } else | 233 | } else |
225 | mMissedAlarmsCombo->hide(); | 234 | mMissedAlarmsCombo->hide(); |
226 | mMessage->setText(mess); | 235 | mMessage->setText(mess); |
227 | int w =sizeHint().width() ; | 236 | int w =sizeHint().width() ; |
228 | int h = sizeHint().height() ; | 237 | int h = sizeHint().height() ; |
229 | int dw = QApplication::desktop()->width(); | 238 | int dw = QApplication::desktop()->width(); |
230 | int dh = QApplication::desktop()->height(); | 239 | int dh = QApplication::desktop()->height(); |
231 | setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 240 | setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
232 | show(); | 241 | show(); |
233 | raise(); | 242 | raise(); |
234 | qApp->processEvents(); | 243 | qApp->processEvents(); |
235 | repaint(); | 244 | repaint(); |
236 | qApp->processEvents(); | 245 | qApp->processEvents(); |
237 | 246 | ||
238 | #ifndef _WIN32_ | 247 | #ifndef _WIN32_ |
239 | if ( fd_led > 0 ) { | 248 | if ( fd_led > 0 ) { |
240 | statusLED.status = LED_SALARM_ON ; | 249 | statusLED.status = LED_SALARM_ON ; |
241 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); | 250 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); |
242 | } | 251 | } |
243 | #endif | 252 | #endif |
244 | playSoundTimer->start( 1000, true ); | 253 | playSoundTimer->start( 1000, true ); |
245 | return true; | 254 | return true; |
246 | 255 | ||
247 | } | 256 | } |
248 | 257 | ||
249 | 258 | ||
250 | void AlarmDialog::playSound () | 259 | void AlarmDialog::playSound () |
251 | { | 260 | { |
252 | if (mStopAlarm ) | 261 | if (mStopAlarm ) |
253 | return; | 262 | return; |
254 | showNormal(); | 263 | showNormal(); |
255 | setActiveWindow(); | 264 | setActiveWindow(); |
256 | mSuspendSpin->setFocus(); | 265 | mSuspendSpin->setFocus(); |
257 | raise(); | 266 | raise(); |
258 | 267 | ||
259 | qApp->processEvents(); | 268 | qApp->processEvents(); |
260 | if ( alarmCounter < maxAlarmReplay && ! mSilent) { | 269 | if ( alarmCounter < maxAlarmReplay && ! mSilent) { |
261 | ++alarmCounter; | 270 | ++alarmCounter; |
271 | #ifdef DESKTOP_VERSION | ||
272 | mPlayWav = true; | ||
273 | #endif | ||
262 | if ( !mPlayWav || mFileName.length() < 2 ) { | 274 | if ( !mPlayWav || mFileName.length() < 2 ) { |
263 | 275 | ||
264 | #ifndef DESKTOP_VERSION | 276 | #ifdef DESKTOP_VERSION |
277 | qDebug("Sound play not possible - file not found"); | ||
278 | #else | ||
265 | Sound::soundAlarm (); | 279 | Sound::soundAlarm (); |
266 | #endif | 280 | #endif |
267 | } else { | 281 | } else |
282 | |||
283 | { | ||
284 | #ifdef DESKTOP_VERSION | ||
285 | #ifdef _WIN32_ | ||
268 | QSound::play ( mFileName ); | 286 | QSound::play ( mFileName ); |
287 | #else | ||
288 | |||
289 | QString command = "playwave -r 22050 " + mFileName; | ||
290 | qDebug("KO: Playing file %s with 22kHz",mFileName.latin1() ); | ||
291 | int ret = system ( command.latin1() ); | ||
292 | if ( ret != 0 ) { | ||
293 | qDebug("Sound play command failed: %s ",command.latin1() ); | ||
294 | } | ||
295 | |||
296 | #endif | ||
297 | |||
298 | #else | ||
299 | QSound::play ( mFileName ); | ||
300 | #endif | ||
269 | //qDebug("BEEP!"); | 301 | //qDebug("BEEP!"); |
270 | } | 302 | } |
271 | } else { | 303 | } else { |
272 | if ( ! mSilent && mSuspendCounter > 0 ) { | 304 | if ( ! mSilent && mSuspendCounter > 0 ) { |
273 | --mSuspendCounter; | 305 | --mSuspendCounter; |
274 | reject (); | 306 | reject (); |
275 | hide(); | 307 | hide(); |
276 | return; | 308 | return; |
277 | } | 309 | } |
278 | } | 310 | } |
279 | playSoundTimer->start( mPauseCount * 1000, true ); | 311 | playSoundTimer->start( mPauseCount * 1000, true ); |
280 | } | 312 | } |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 3a16fe6..73aa733 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -142,193 +142,193 @@ extern int globalFlagBlockStartup; | |||
142 | class KOBeamPrefs : public QDialog | 142 | class KOBeamPrefs : public QDialog |
143 | { | 143 | { |
144 | public: | 144 | public: |
145 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : | 145 | KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : |
146 | QDialog( parent, name, true ) | 146 | QDialog( parent, name, true ) |
147 | { | 147 | { |
148 | setCaption( i18n("Beam Options") ); | 148 | setCaption( i18n("Beam Options") ); |
149 | QVBoxLayout* lay = new QVBoxLayout( this ); | 149 | QVBoxLayout* lay = new QVBoxLayout( this ); |
150 | lay->setSpacing( 3 ); | 150 | lay->setSpacing( 3 ); |
151 | lay->setMargin( 3 ); | 151 | lay->setMargin( 3 ); |
152 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); | 152 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); |
153 | lay->addWidget( format ); | 153 | lay->addWidget( format ); |
154 | format->setExclusive ( true ) ; | 154 | format->setExclusive ( true ) ; |
155 | QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); | 155 | QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); |
156 | lay->addWidget( time ); time->setExclusive ( true ) ; | 156 | lay->addWidget( time ); time->setExclusive ( true ) ; |
157 | vcal = new QRadioButton(" vCalendar ", format ); | 157 | vcal = new QRadioButton(" vCalendar ", format ); |
158 | ical = new QRadioButton(" iCalendar ", format ); | 158 | ical = new QRadioButton(" iCalendar ", format ); |
159 | vcal->setChecked( true ); | 159 | vcal->setChecked( true ); |
160 | tz = new QRadioButton(i18n(" With timezone "), time ); | 160 | tz = new QRadioButton(i18n(" With timezone "), time ); |
161 | local = new QRadioButton(i18n(" Local time "), time ); | 161 | local = new QRadioButton(i18n(" Local time "), time ); |
162 | tz->setChecked( true ); | 162 | tz->setChecked( true ); |
163 | QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); | 163 | QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); |
164 | lay->addWidget( ok ); | 164 | lay->addWidget( ok ); |
165 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 165 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
166 | lay->addWidget( cancel ); | 166 | lay->addWidget( cancel ); |
167 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 167 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
168 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 168 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
169 | resize( 200, 200 ); | 169 | resize( 200, 200 ); |
170 | } | 170 | } |
171 | 171 | ||
172 | bool beamVcal() { return vcal->isChecked(); } | 172 | bool beamVcal() { return vcal->isChecked(); } |
173 | bool beamLocal() { return local->isChecked(); } | 173 | bool beamLocal() { return local->isChecked(); } |
174 | private: | 174 | private: |
175 | QRadioButton* vcal, *ical, *local, *tz; | 175 | QRadioButton* vcal, *ical, *local, *tz; |
176 | }; | 176 | }; |
177 | class KOCatPrefs : public QDialog | 177 | class KOCatPrefs : public QDialog |
178 | { | 178 | { |
179 | public: | 179 | public: |
180 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : | 180 | KOCatPrefs( QWidget *parent=0, const char *name=0 ) : |
181 | QDialog( parent, name, true ) | 181 | QDialog( parent, name, true ) |
182 | { | 182 | { |
183 | setCaption( i18n("Manage new Categories") ); | 183 | setCaption( i18n("Manage new Categories") ); |
184 | QVBoxLayout* lay = new QVBoxLayout( this ); | 184 | QVBoxLayout* lay = new QVBoxLayout( this ); |
185 | lay->setSpacing( 3 ); | 185 | lay->setSpacing( 3 ); |
186 | lay->setMargin( 3 ); | 186 | lay->setMargin( 3 ); |
187 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); | 187 | QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); |
188 | lay->addWidget( lab ); | 188 | lay->addWidget( lab ); |
189 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); | 189 | QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); |
190 | lay->addWidget( format ); | 190 | lay->addWidget( format ); |
191 | format->setExclusive ( true ) ; | 191 | format->setExclusive ( true ) ; |
192 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); | 192 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); |
193 | new QRadioButton(i18n("Remove from Events/Todos"), format ); | 193 | new QRadioButton(i18n("Remove from Events/Todos"), format ); |
194 | addCatBut->setChecked( true ); | 194 | addCatBut->setChecked( true ); |
195 | QPushButton * ok = new QPushButton( i18n("OK"), this ); | 195 | QPushButton * ok = new QPushButton( i18n("OK"), this ); |
196 | lay->addWidget( ok ); | 196 | lay->addWidget( ok ); |
197 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 197 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
198 | lay->addWidget( cancel ); | 198 | lay->addWidget( cancel ); |
199 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 199 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
200 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 200 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
201 | resize( 200, 200 ); | 201 | resize( 200, 200 ); |
202 | } | 202 | } |
203 | 203 | ||
204 | bool addCat() { return addCatBut->isChecked(); } | 204 | bool addCat() { return addCatBut->isChecked(); } |
205 | private: | 205 | private: |
206 | QRadioButton* addCatBut; | 206 | QRadioButton* addCatBut; |
207 | }; | 207 | }; |
208 | 208 | ||
209 | 209 | ||
210 | 210 | ||
211 | CalendarView::CalendarView( CalendarResources *calendar, | 211 | CalendarView::CalendarView( CalendarResources *calendar, |
212 | QWidget *parent, const char *name ) | 212 | QWidget *parent, const char *name ) |
213 | : CalendarViewBase( parent, name ), | 213 | : CalendarViewBase( parent, name ), |
214 | mCalendar( calendar ), | 214 | mCalendar( calendar ), |
215 | mResourceManager( calendar->resourceManager() ) | 215 | mResourceManager( calendar->resourceManager() ) |
216 | { | 216 | { |
217 | 217 | ||
218 | mEventEditor = 0; | 218 | mEventEditor = 0; |
219 | mTodoEditor = 0; | 219 | mTodoEditor = 0; |
220 | 220 | ||
221 | init(); | 221 | init(); |
222 | } | 222 | } |
223 | 223 | ||
224 | CalendarView::CalendarView( Calendar *calendar, | 224 | CalendarView::CalendarView( Calendar *calendar, |
225 | QWidget *parent, const char *name ) | 225 | QWidget *parent, const char *name ) |
226 | : CalendarViewBase( parent, name ), | 226 | : CalendarViewBase( parent, name ), |
227 | mCalendar( calendar ), | 227 | mCalendar( calendar ), |
228 | mResourceManager( 0 ) | 228 | mResourceManager( 0 ) |
229 | { | 229 | { |
230 | 230 | ||
231 | mEventEditor = 0; | 231 | mEventEditor = 0; |
232 | mTodoEditor = 0; | 232 | mTodoEditor = 0; |
233 | init(); | 233 | init(); |
234 | } | 234 | } |
235 | 235 | ||
236 | void CalendarView::init() | 236 | void CalendarView::init() |
237 | { | 237 | { |
238 | 238 | mNextAlarmDateTime = QDateTime::currentDateTime(); | |
239 | setFocusPolicy ( WheelFocus ); | 239 | setFocusPolicy ( WheelFocus ); |
240 | mViewerCallerIsSearchDialog = false; | 240 | mViewerCallerIsSearchDialog = false; |
241 | mBlockShowDates = false; | 241 | mBlockShowDates = false; |
242 | beamDialog = new KOBeamPrefs(); | 242 | beamDialog = new KOBeamPrefs(); |
243 | mDatePickerMode = 0; | 243 | mDatePickerMode = 0; |
244 | mCurrentSyncDevice = ""; | 244 | mCurrentSyncDevice = ""; |
245 | writeLocale(); | 245 | writeLocale(); |
246 | mViewManager = new KOViewManager( this ); | 246 | mViewManager = new KOViewManager( this ); |
247 | mDialogManager = new KODialogManager( this ); | 247 | mDialogManager = new KODialogManager( this ); |
248 | mEventViewerDialog = 0; | 248 | mEventViewerDialog = 0; |
249 | mModified = false; | 249 | mModified = false; |
250 | mReadOnly = false; | 250 | mReadOnly = false; |
251 | mSelectedIncidence = 0; | 251 | mSelectedIncidence = 0; |
252 | mCalPrinter = 0; | 252 | mCalPrinter = 0; |
253 | mFilters.setAutoDelete(true); | 253 | mFilters.setAutoDelete(true); |
254 | 254 | ||
255 | mCalendar->registerObserver( this ); | 255 | mCalendar->registerObserver( this ); |
256 | // TODO: Make sure that view is updated, when calendar is changed. | 256 | // TODO: Make sure that view is updated, when calendar is changed. |
257 | 257 | ||
258 | mStorage = new FileStorage( mCalendar ); | 258 | mStorage = new FileStorage( mCalendar ); |
259 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); | 259 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); |
260 | 260 | ||
261 | QBoxLayout *topLayout = (QBoxLayout*)layout(); | 261 | QBoxLayout *topLayout = (QBoxLayout*)layout(); |
262 | #ifndef KORG_NOSPLITTER | 262 | #ifndef KORG_NOSPLITTER |
263 | // create the main layout frames. | 263 | // create the main layout frames. |
264 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); | 264 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); |
265 | topLayout->addWidget(mPanner); | 265 | topLayout->addWidget(mPanner); |
266 | 266 | ||
267 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, | 267 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, |
268 | "CalendarView::LeftFrame"); | 268 | "CalendarView::LeftFrame"); |
269 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); | 269 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); |
270 | 270 | ||
271 | mDateNavigator = new DateNavigatorContainer( mLeftSplitter, | 271 | mDateNavigator = new DateNavigatorContainer( mLeftSplitter, |
272 | "CalendarView::DateNavigator" ); | 272 | "CalendarView::DateNavigator" ); |
273 | 273 | ||
274 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); | 274 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); |
275 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); | 275 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); |
276 | mTodoList->setNavigator( mNavigator ); | 276 | mTodoList->setNavigator( mNavigator ); |
277 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); | 277 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); |
278 | 278 | ||
279 | #ifdef KORG_NORESOURCEVIEW | 279 | #ifdef KORG_NORESOURCEVIEW |
280 | mResourceView = 0; | 280 | mResourceView = 0; |
281 | #else | 281 | #else |
282 | if ( mResourceManager ) { | 282 | if ( mResourceManager ) { |
283 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); | 283 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); |
284 | mResourceView->updateView(); | 284 | mResourceView->updateView(); |
285 | connect( mResourceView, SIGNAL( resourcesChanged() ), | 285 | connect( mResourceView, SIGNAL( resourcesChanged() ), |
286 | SLOT( updateView() ) ); | 286 | SLOT( updateView() ) ); |
287 | } else { | 287 | } else { |
288 | mResourceView = 0; | 288 | mResourceView = 0; |
289 | } | 289 | } |
290 | #endif | 290 | #endif |
291 | QWidget *rightBox = new QWidget( mPanner ); | 291 | QWidget *rightBox = new QWidget( mPanner ); |
292 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 292 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
293 | 293 | ||
294 | mRightFrame = new QWidgetStack( rightBox ); | 294 | mRightFrame = new QWidgetStack( rightBox ); |
295 | rightLayout->addWidget( mRightFrame, 1 ); | 295 | rightLayout->addWidget( mRightFrame, 1 ); |
296 | 296 | ||
297 | mLeftFrame = mLeftSplitter; | 297 | mLeftFrame = mLeftSplitter; |
298 | #else | 298 | #else |
299 | //QWidget *mainBox = new QWidget( this ); | 299 | //QWidget *mainBox = new QWidget( this ); |
300 | //QWidget *leftFrame = new QWidget( mainBox ); | 300 | //QWidget *leftFrame = new QWidget( mainBox ); |
301 | //QBoxLayout * mainBoxLayout; | 301 | //QBoxLayout * mainBoxLayout; |
302 | if ( KOPrefs::instance()->mVerticalScreen ) { | 302 | if ( KOPrefs::instance()->mVerticalScreen ) { |
303 | //mainBoxLayout = new QVBoxLayout(mainBox); | 303 | //mainBoxLayout = new QVBoxLayout(mainBox); |
304 | //leftFrameLayout = new QHBoxLayout(leftFrame ); | 304 | //leftFrameLayout = new QHBoxLayout(leftFrame ); |
305 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); | 305 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); |
306 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 306 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
307 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; | 307 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; |
308 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 308 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
309 | } else { | 309 | } else { |
310 | //mainBoxLayout = new QHBoxLayout(mainBox); | 310 | //mainBoxLayout = new QHBoxLayout(mainBox); |
311 | //leftFrameLayout = new QVBoxLayout(leftFrame ); | 311 | //leftFrameLayout = new QVBoxLayout(leftFrame ); |
312 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 312 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
313 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); | 313 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); |
314 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); | 314 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); |
315 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 315 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
316 | } | 316 | } |
317 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); | 317 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); |
318 | //QBoxLayout * leftFrameLayout; | 318 | //QBoxLayout * leftFrameLayout; |
319 | topLayout->addWidget( mMainFrame ); | 319 | topLayout->addWidget( mMainFrame ); |
320 | //mainBoxLayout->addWidget (mLeftFrame); | 320 | //mainBoxLayout->addWidget (mLeftFrame); |
321 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, | 321 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, |
322 | "CalendarView::DateNavigator" ); | 322 | "CalendarView::DateNavigator" ); |
323 | #if 0 | 323 | #if 0 |
324 | // FIXME | 324 | // FIXME |
325 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, | 325 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, |
326 | "CalendarView::DateNavigator", QDate::currentDate()); | 326 | "CalendarView::DateNavigator", QDate::currentDate()); |
327 | #endif | 327 | #endif |
328 | // mDateNavigator->blockSignals( true ); | 328 | // mDateNavigator->blockSignals( true ); |
329 | //leftFrameLayout->addWidget( mDateNavigator ); | 329 | //leftFrameLayout->addWidget( mDateNavigator ); |
330 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); | 330 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); |
331 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); | 331 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); |
332 | mTodoList->setNavigator( mNavigator ); | 332 | mTodoList->setNavigator( mNavigator ); |
333 | #if 0 | 333 | #if 0 |
334 | if ( QApplication::desktop()->width() < 480 ) { | 334 | if ( QApplication::desktop()->width() < 480 ) { |
@@ -549,192 +549,193 @@ void CalendarView::computeAlarm( QString msg ) | |||
549 | filename += "koalarm.wav"; | 549 | filename += "koalarm.wav"; |
550 | QString tempfilename; | 550 | QString tempfilename; |
551 | if ( mess.left( 13 ) == "suspend_alarm") { | 551 | if ( mess.left( 13 ) == "suspend_alarm") { |
552 | bool error = false; | 552 | bool error = false; |
553 | int len = mess.mid( 13 ).find("+++"); | 553 | int len = mess.mid( 13 ).find("+++"); |
554 | if ( len < 2 ) | 554 | if ( len < 2 ) |
555 | error = true; | 555 | error = true; |
556 | else { | 556 | else { |
557 | tempfilename = mess.mid( 13, len ); | 557 | tempfilename = mess.mid( 13, len ); |
558 | if ( !QFile::exists( tempfilename ) ) | 558 | if ( !QFile::exists( tempfilename ) ) |
559 | error = true; | 559 | error = true; |
560 | } | 560 | } |
561 | if ( ! error ) { | 561 | if ( ! error ) { |
562 | filename = tempfilename; | 562 | filename = tempfilename; |
563 | } | 563 | } |
564 | mAlarmMessage = mess.mid( 13+len+3 ); | 564 | mAlarmMessage = mess.mid( 13+len+3 ); |
565 | //qDebug("suspend file %s ",tempfilename.latin1() ); | 565 | //qDebug("suspend file %s ",tempfilename.latin1() ); |
566 | startAlarm( mAlarmMessage, filename); | 566 | startAlarm( mAlarmMessage, filename); |
567 | return; | 567 | return; |
568 | } | 568 | } |
569 | if ( mess.left( 11 ) == "timer_alarm") { | 569 | if ( mess.left( 11 ) == "timer_alarm") { |
570 | //mTimerTime = 0; | 570 | //mTimerTime = 0; |
571 | startAlarm( mess.mid( 11 ), filename ); | 571 | startAlarm( mess.mid( 11 ), filename ); |
572 | return; | 572 | return; |
573 | } | 573 | } |
574 | if ( mess.left( 10 ) == "proc_alarm") { | 574 | if ( mess.left( 10 ) == "proc_alarm") { |
575 | bool error = false; | 575 | bool error = false; |
576 | int len = mess.mid( 10 ).find("+++"); | 576 | int len = mess.mid( 10 ).find("+++"); |
577 | if ( len < 2 ) | 577 | if ( len < 2 ) |
578 | error = true; | 578 | error = true; |
579 | else { | 579 | else { |
580 | tempfilename = mess.mid( 10, len ); | 580 | tempfilename = mess.mid( 10, len ); |
581 | if ( !QFile::exists( tempfilename ) ) | 581 | if ( !QFile::exists( tempfilename ) ) |
582 | error = true; | 582 | error = true; |
583 | } | 583 | } |
584 | if ( error ) { | 584 | if ( error ) { |
585 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; | 585 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; |
586 | mAlarmMessage += mess.mid( 10+len+3+9 ); | 586 | mAlarmMessage += mess.mid( 10+len+3+9 ); |
587 | } else { | 587 | } else { |
588 | //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 588 | //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
589 | //qDebug("-----system command %s ",tempfilename.latin1() ); | 589 | //qDebug("-----system command %s ",tempfilename.latin1() ); |
590 | #ifndef _WIN32_ | 590 | #ifndef _WIN32_ |
591 | if ( vfork () == 0 ) { | 591 | if ( vfork () == 0 ) { |
592 | execl ( tempfilename.latin1(), 0 ); | 592 | execl ( tempfilename.latin1(), 0 ); |
593 | return; | 593 | return; |
594 | } | 594 | } |
595 | #else | 595 | #else |
596 | QProcess* p = new QProcess(); | 596 | QProcess* p = new QProcess(); |
597 | p->addArgument( tempfilename.latin1() ); | 597 | p->addArgument( tempfilename.latin1() ); |
598 | p->start(); | 598 | p->start(); |
599 | return; | 599 | return; |
600 | #endif | 600 | #endif |
601 | 601 | ||
602 | return; | 602 | return; |
603 | } | 603 | } |
604 | 604 | ||
605 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); | 605 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); |
606 | } | 606 | } |
607 | if ( mess.left( 11 ) == "audio_alarm") { | 607 | if ( mess.left( 11 ) == "audio_alarm") { |
608 | bool error = false; | 608 | bool error = false; |
609 | int len = mess.mid( 11 ).find("+++"); | 609 | int len = mess.mid( 11 ).find("+++"); |
610 | if ( len < 2 ) | 610 | if ( len < 2 ) |
611 | error = true; | 611 | error = true; |
612 | else { | 612 | else { |
613 | tempfilename = mess.mid( 11, len ); | 613 | tempfilename = mess.mid( 11, len ); |
614 | if ( !QFile::exists( tempfilename ) ) | 614 | if ( !QFile::exists( tempfilename ) ) |
615 | error = true; | 615 | error = true; |
616 | } | 616 | } |
617 | if ( ! error ) { | 617 | if ( ! error ) { |
618 | filename = tempfilename; | 618 | filename = tempfilename; |
619 | } | 619 | } |
620 | mAlarmMessage = mess.mid( 11+len+3+9 ); | 620 | mAlarmMessage = mess.mid( 11+len+3+9 ); |
621 | //qDebug("audio file command %s ",tempfilename.latin1() ); | 621 | //qDebug("audio file command %s ",tempfilename.latin1() ); |
622 | } | 622 | } |
623 | if ( mess.left( 9 ) == "cal_alarm") { | 623 | if ( mess.left( 9 ) == "cal_alarm") { |
624 | mAlarmMessage = mess.mid( 9 ) ; | 624 | mAlarmMessage = mess.mid( 9 ) ; |
625 | } | 625 | } |
626 | 626 | ||
627 | startAlarm( mAlarmMessage, filename ); | 627 | startAlarm( mAlarmMessage, filename ); |
628 | 628 | ||
629 | 629 | ||
630 | } | 630 | } |
631 | 631 | ||
632 | void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) | 632 | void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) |
633 | { | 633 | { |
634 | //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 634 | //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
635 | 635 | ||
636 | mSuspendAlarmNotification = noti; | 636 | mSuspendAlarmNotification = noti; |
637 | int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; | 637 | int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; |
638 | //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); | 638 | //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); |
639 | mSuspendTimer->start( ms , true ); | 639 | mSuspendTimer->start( ms , true ); |
640 | 640 | ||
641 | } | 641 | } |
642 | 642 | ||
643 | void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) | 643 | void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) |
644 | { | 644 | { |
645 | mNextAlarmDateTime = qdt; | ||
645 | //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 646 | //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
646 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 647 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
647 | #ifndef DESKTOP_VERSION | 648 | #ifndef DESKTOP_VERSION |
648 | AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() ); | 649 | AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() ); |
649 | #endif | 650 | #endif |
650 | return; | 651 | return; |
651 | } | 652 | } |
652 | int maxSec; | 653 | int maxSec; |
653 | //maxSec = 5; //testing only | 654 | //maxSec = 5; //testing only |
654 | maxSec = 86400+3600; // one day+1hour | 655 | maxSec = 86400+3600; // one day+1hour |
655 | mAlarmNotification = noti; | 656 | mAlarmNotification = noti; |
656 | int sec = QDateTime::currentDateTime().secsTo( qdt ); | 657 | int sec = QDateTime::currentDateTime().secsTo( qdt ); |
657 | if ( sec > maxSec ) { | 658 | if ( sec > maxSec ) { |
658 | mRecheckAlarmTimer->start( maxSec * 1000 ); | 659 | mRecheckAlarmTimer->start( maxSec * 1000 ); |
659 | // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); | 660 | // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); |
660 | return; | 661 | return; |
661 | } else { | 662 | } else { |
662 | mRecheckAlarmTimer->stop(); | 663 | mRecheckAlarmTimer->stop(); |
663 | } | 664 | } |
664 | //qDebug("Alarm timer started with secs: %d ", sec); | 665 | //qDebug("Alarm timer started with secs: %d ", sec); |
665 | mAlarmTimer->start( sec *1000 , true ); | 666 | mAlarmTimer->start( sec *1000 , true ); |
666 | 667 | ||
667 | } | 668 | } |
668 | // called by mRecheckAlarmTimer to get next alarm | 669 | // called by mRecheckAlarmTimer to get next alarm |
669 | // we need this, because a QTimer has only a max range of 25 days | 670 | // we need this, because a QTimer has only a max range of 25 days |
670 | void CalendarView::recheckTimerAlarm() | 671 | void CalendarView::recheckTimerAlarm() |
671 | { | 672 | { |
672 | mAlarmTimer->stop(); | 673 | mAlarmTimer->stop(); |
673 | mRecheckAlarmTimer->stop(); | 674 | mRecheckAlarmTimer->stop(); |
674 | mCalendar->checkAlarmForIncidence( 0, true ); | 675 | mCalendar->checkAlarmForIncidence( 0, true ); |
675 | } | 676 | } |
676 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) | 677 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) |
677 | { | 678 | { |
678 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 679 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
679 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 680 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
680 | #ifndef DESKTOP_VERSION | 681 | #ifndef DESKTOP_VERSION |
681 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); | 682 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); |
682 | #endif | 683 | #endif |
683 | return; | 684 | return; |
684 | } | 685 | } |
685 | mAlarmTimer->stop(); | 686 | mAlarmTimer->stop(); |
686 | } | 687 | } |
687 | void CalendarView::selectWeekNum ( int num ) | 688 | void CalendarView::selectWeekNum ( int num ) |
688 | { | 689 | { |
689 | dateNavigator()->blockSignals( true ); | 690 | dateNavigator()->blockSignals( true ); |
690 | dateNavigator()->selectWeek( num ); | 691 | dateNavigator()->selectWeek( num ); |
691 | dateNavigator()->blockSignals( false ); | 692 | dateNavigator()->blockSignals( false ); |
692 | mViewManager->showWeekView(); | 693 | mViewManager->showWeekView(); |
693 | } | 694 | } |
694 | KOViewManager *CalendarView::viewManager() | 695 | KOViewManager *CalendarView::viewManager() |
695 | { | 696 | { |
696 | return mViewManager; | 697 | return mViewManager; |
697 | } | 698 | } |
698 | 699 | ||
699 | KODialogManager *CalendarView::dialogManager() | 700 | KODialogManager *CalendarView::dialogManager() |
700 | { | 701 | { |
701 | return mDialogManager; | 702 | return mDialogManager; |
702 | } | 703 | } |
703 | 704 | ||
704 | QDate CalendarView::startDate() | 705 | QDate CalendarView::startDate() |
705 | { | 706 | { |
706 | DateList dates = mNavigator->selectedDates(); | 707 | DateList dates = mNavigator->selectedDates(); |
707 | 708 | ||
708 | return dates.first(); | 709 | return dates.first(); |
709 | } | 710 | } |
710 | 711 | ||
711 | QDate CalendarView::endDate() | 712 | QDate CalendarView::endDate() |
712 | { | 713 | { |
713 | DateList dates = mNavigator->selectedDates(); | 714 | DateList dates = mNavigator->selectedDates(); |
714 | 715 | ||
715 | return dates.last(); | 716 | return dates.last(); |
716 | } | 717 | } |
717 | 718 | ||
718 | 719 | ||
719 | void CalendarView::createPrinter() | 720 | void CalendarView::createPrinter() |
720 | { | 721 | { |
721 | #ifndef KORG_NOPRINTER | 722 | #ifndef KORG_NOPRINTER |
722 | if (!mCalPrinter) { | 723 | if (!mCalPrinter) { |
723 | mCalPrinter = new CalPrinter(this, mCalendar); | 724 | mCalPrinter = new CalPrinter(this, mCalendar); |
724 | connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); | 725 | connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); |
725 | } | 726 | } |
726 | #endif | 727 | #endif |
727 | } | 728 | } |
728 | 729 | ||
729 | 730 | ||
730 | //KOPrefs::instance()->mWriteBackFile | 731 | //KOPrefs::instance()->mWriteBackFile |
731 | //KOPrefs::instance()->mWriteBackExistingOnly | 732 | //KOPrefs::instance()->mWriteBackExistingOnly |
732 | 733 | ||
733 | // 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 734 | // 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
734 | // 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 735 | // 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
735 | // 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | 736 | // 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); |
736 | // 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | 737 | // 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); |
737 | // 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); | 738 | // 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); |
738 | // 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | 739 | // 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); |
739 | 740 | ||
740 | int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) | 741 | int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) |
@@ -3971,96 +3972,111 @@ void CalendarView::purgeCompleted() | |||
3971 | } | 3972 | } |
3972 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { | 3973 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { |
3973 | removeCompletedSubTodos( aTodo ); | 3974 | removeCompletedSubTodos( aTodo ); |
3974 | } | 3975 | } |
3975 | 3976 | ||
3976 | updateView(); | 3977 | updateView(); |
3977 | } | 3978 | } |
3978 | } | 3979 | } |
3979 | 3980 | ||
3980 | void CalendarView::slotCalendarChanged() | 3981 | void CalendarView::slotCalendarChanged() |
3981 | { | 3982 | { |
3982 | ; | 3983 | ; |
3983 | } | 3984 | } |
3984 | 3985 | ||
3985 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 3986 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
3986 | { | 3987 | { |
3987 | //qDebug(" alendarView::keyPressEvent "); | 3988 | //qDebug(" alendarView::keyPressEvent "); |
3988 | e->ignore(); | 3989 | e->ignore(); |
3989 | } | 3990 | } |
3990 | 3991 | ||
3991 | 3992 | ||
3992 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 3993 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
3993 | { | 3994 | { |
3994 | // mSyncManager = manager; | 3995 | // mSyncManager = manager; |
3995 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 3996 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
3996 | qDebug("KO: SyncKDE request detected!"); | 3997 | qDebug("KO: SyncKDE request detected!"); |
3997 | } | 3998 | } |
3998 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 3999 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
3999 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4000 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4000 | return syncCalendar( filename, mode ); | 4001 | return syncCalendar( filename, mode ); |
4001 | } | 4002 | } |
4002 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 4003 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
4003 | { | 4004 | { |
4004 | //mSyncManager = manager; | 4005 | //mSyncManager = manager; |
4005 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4006 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4006 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4007 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4007 | if ( resource == "sharp" ) | 4008 | if ( resource == "sharp" ) |
4008 | syncExternal( 0 ); | 4009 | syncExternal( 0 ); |
4009 | if ( resource == "phone" ) | 4010 | if ( resource == "phone" ) |
4010 | syncExternal( 1 ); | 4011 | syncExternal( 1 ); |
4011 | // pending setmodified | 4012 | // pending setmodified |
4012 | return true; | 4013 | return true; |
4013 | } | 4014 | } |
4014 | void CalendarView::setSyncManager(KSyncManager* manager) | 4015 | void CalendarView::setSyncManager(KSyncManager* manager) |
4015 | { | 4016 | { |
4016 | mSyncManager = manager; | 4017 | mSyncManager = manager; |
4017 | } | 4018 | } |
4018 | 4019 | ||
4019 | void CalendarView::removeSyncInfo( QString syncProfile) | 4020 | void CalendarView::removeSyncInfo( QString syncProfile) |
4020 | { | 4021 | { |
4021 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); | 4022 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); |
4022 | mCalendar->removeSyncInfo( syncProfile ); | 4023 | mCalendar->removeSyncInfo( syncProfile ); |
4023 | 4024 | ||
4024 | } | 4025 | } |
4025 | 4026 | ||
4026 | void CalendarView::undo_delete() | 4027 | void CalendarView::undo_delete() |
4027 | { | 4028 | { |
4028 | //qDebug("undo_delete() "); | 4029 | //qDebug("undo_delete() "); |
4029 | Incidence* undo = mCalendar->undoIncidence(); | 4030 | Incidence* undo = mCalendar->undoIncidence(); |
4030 | if ( !undo ) { | 4031 | if ( !undo ) { |
4031 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), | 4032 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), |
4032 | i18n("KO/Pi")); | 4033 | i18n("KO/Pi")); |
4033 | return; | 4034 | return; |
4034 | } | 4035 | } |
4035 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + | 4036 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + |
4036 | i18n("\nAre you sure you want\nto restore this?"), | 4037 | i18n("\nAre you sure you want\nto restore this?"), |
4037 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { | 4038 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { |
4038 | mCalendar->undoDeleteIncidence(); | 4039 | mCalendar->undoDeleteIncidence(); |
4039 | updateView(); | 4040 | updateView(); |
4040 | } | 4041 | } |
4041 | } | 4042 | } |
4042 | 4043 | ||
4043 | void CalendarView::slotViewerClosed() | 4044 | void CalendarView::slotViewerClosed() |
4044 | { | 4045 | { |
4045 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); | 4046 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); |
4046 | } | 4047 | } |
4047 | 4048 | ||
4048 | void CalendarView::resetFocus() | 4049 | void CalendarView::resetFocus() |
4049 | { | 4050 | { |
4050 | if ( mViewerCallerIsSearchDialog ) { | 4051 | if ( mViewerCallerIsSearchDialog ) { |
4051 | if ( mDialogManager->getSearchDialog()->isVisible() ){ | 4052 | if ( mDialogManager->getSearchDialog()->isVisible() ){ |
4052 | mDialogManager->getSearchDialog()->raise(); | 4053 | mDialogManager->getSearchDialog()->raise(); |
4053 | mDialogManager->getSearchDialog()->setActiveWindow(); | 4054 | mDialogManager->getSearchDialog()->setActiveWindow(); |
4054 | mDialogManager->getSearchDialog()->listview()->resetFocus(); | 4055 | mDialogManager->getSearchDialog()->listview()->resetFocus(); |
4055 | } else | 4056 | } else |
4056 | mViewerCallerIsSearchDialog = false; | 4057 | mViewerCallerIsSearchDialog = false; |
4057 | } | 4058 | } |
4058 | if ( !mViewerCallerIsSearchDialog ) { | 4059 | if ( !mViewerCallerIsSearchDialog ) { |
4059 | //mViewManager->currentView()->setFocus(); | 4060 | //mViewManager->currentView()->setFocus(); |
4060 | //qDebug("sssssssssssssssset focus "); | 4061 | //qDebug("sssssssssssssssset focus "); |
4061 | topLevelWidget()->raise(); | 4062 | topLevelWidget()->raise(); |
4062 | setActiveWindow(); | 4063 | setActiveWindow(); |
4063 | //setFocus(); | 4064 | //setFocus(); |
4064 | } | 4065 | } |
4065 | mViewerCallerIsSearchDialog = false; | 4066 | mViewerCallerIsSearchDialog = false; |
4066 | } | 4067 | } |
4068 | |||
4069 | void CalendarView::showNextAlarms() | ||
4070 | { | ||
4071 | QString message; | ||
4072 | if ( mNextAlarmDateTime > QDateTime::currentDateTime() ) { | ||
4073 | QString sum = mCalendar->nextSummary(); | ||
4074 | QDateTime nextA = mNextAlarmDateTime; | ||
4075 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); | ||
4076 | message = i18n("The next alarm is on:\n%1\nat: %2\n\n%3\n(%4)").arg( KGlobal::locale()->formatDate(nextA.date() , false)).arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; | ||
4077 | } else { | ||
4078 | message = i18n("There is no next alarm."); | ||
4079 | |||
4080 | } | ||
4081 | KMessageBox::information( this, message); | ||
4082 | } | ||
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 16e671f..9782ffe 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -83,192 +83,193 @@ using namespace KCal; | |||
83 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface | 83 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface |
84 | { | 84 | { |
85 | Q_OBJECT | 85 | Q_OBJECT |
86 | public: | 86 | public: |
87 | /** | 87 | /** |
88 | Constructs a new calendar view widget. | 88 | Constructs a new calendar view widget. |
89 | 89 | ||
90 | @param calendar calendar document | 90 | @param calendar calendar document |
91 | @param parent parent window | 91 | @param parent parent window |
92 | @param name Qt internal widget object name | 92 | @param name Qt internal widget object name |
93 | */ | 93 | */ |
94 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, | 94 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, |
95 | const char *name = 0 ); | 95 | const char *name = 0 ); |
96 | CalendarView( Calendar *calendar, QWidget *parent = 0, | 96 | CalendarView( Calendar *calendar, QWidget *parent = 0, |
97 | const char *name = 0 ); | 97 | const char *name = 0 ); |
98 | virtual ~CalendarView(); | 98 | virtual ~CalendarView(); |
99 | 99 | ||
100 | Calendar *calendar() { return mCalendar; } | 100 | Calendar *calendar() { return mCalendar; } |
101 | 101 | ||
102 | KOViewManager *viewManager(); | 102 | KOViewManager *viewManager(); |
103 | KODialogManager *dialogManager(); | 103 | KODialogManager *dialogManager(); |
104 | 104 | ||
105 | QDate startDate(); | 105 | QDate startDate(); |
106 | QDate endDate(); | 106 | QDate endDate(); |
107 | 107 | ||
108 | QWidgetStack *viewStack(); | 108 | QWidgetStack *viewStack(); |
109 | QWidget *leftFrame(); | 109 | QWidget *leftFrame(); |
110 | 110 | ||
111 | DateNavigator *dateNavigator(); | 111 | DateNavigator *dateNavigator(); |
112 | KDateNavigator *dateNavigatorWidget(); | 112 | KDateNavigator *dateNavigatorWidget(); |
113 | 113 | ||
114 | void addView(KOrg::BaseView *); | 114 | void addView(KOrg::BaseView *); |
115 | void showView(KOrg::BaseView *); | 115 | void showView(KOrg::BaseView *); |
116 | KOEventViewerDialog* getEventViewerDialog(); | 116 | KOEventViewerDialog* getEventViewerDialog(); |
117 | Incidence *currentSelection(); | 117 | Incidence *currentSelection(); |
118 | 118 | ||
119 | signals: | 119 | signals: |
120 | void save (); | 120 | void save (); |
121 | void saveStopTimer (); | 121 | void saveStopTimer (); |
122 | void tempDisableBR(bool); | 122 | void tempDisableBR(bool); |
123 | /** This todo has been modified */ | 123 | /** This todo has been modified */ |
124 | void todoModified(Todo *, int); | 124 | void todoModified(Todo *, int); |
125 | 125 | ||
126 | /** when change is made to options dialog, the topwidget will catch this | 126 | /** when change is made to options dialog, the topwidget will catch this |
127 | * and emit this signal which notifies all widgets which have registered | 127 | * and emit this signal which notifies all widgets which have registered |
128 | * for notification to update their settings. */ | 128 | * for notification to update their settings. */ |
129 | void configChanged(); | 129 | void configChanged(); |
130 | /** emitted when the topwidget is closing down, so that any attached | 130 | /** emitted when the topwidget is closing down, so that any attached |
131 | child windows can also close. */ | 131 | child windows can also close. */ |
132 | void closingDown(); | 132 | void closingDown(); |
133 | /** emitted right before we die */ | 133 | /** emitted right before we die */ |
134 | void closed(QWidget *); | 134 | void closed(QWidget *); |
135 | 135 | ||
136 | /** Emitted when state of modified flag changes */ | 136 | /** Emitted when state of modified flag changes */ |
137 | void modifiedChanged(bool); | 137 | void modifiedChanged(bool); |
138 | void signalmodified(); | 138 | void signalmodified(); |
139 | 139 | ||
140 | /** Emitted when state of read-only flag changes */ | 140 | /** Emitted when state of read-only flag changes */ |
141 | void readOnlyChanged(bool); | 141 | void readOnlyChanged(bool); |
142 | 142 | ||
143 | /** Emitted when the unit of navigation changes */ | 143 | /** Emitted when the unit of navigation changes */ |
144 | void changeNavStringPrev(const QString &); | 144 | void changeNavStringPrev(const QString &); |
145 | void changeNavStringNext(const QString &); | 145 | void changeNavStringNext(const QString &); |
146 | 146 | ||
147 | /** Emitted when state of events selection has changed and user is organizer*/ | 147 | /** Emitted when state of events selection has changed and user is organizer*/ |
148 | void organizerEventsSelected(bool); | 148 | void organizerEventsSelected(bool); |
149 | /** Emitted when state of events selection has changed and user is attendee*/ | 149 | /** Emitted when state of events selection has changed and user is attendee*/ |
150 | void groupEventsSelected(bool); | 150 | void groupEventsSelected(bool); |
151 | /** | 151 | /** |
152 | Emitted when an incidence gets selected. If the selection is cleared the | 152 | Emitted when an incidence gets selected. If the selection is cleared the |
153 | signal is emitted with 0 as argument. | 153 | signal is emitted with 0 as argument. |
154 | */ | 154 | */ |
155 | void incidenceSelected( Incidence * ); | 155 | void incidenceSelected( Incidence * ); |
156 | /** Emitted, when a todoitem is selected or deselected. */ | 156 | /** Emitted, when a todoitem is selected or deselected. */ |
157 | void todoSelected( bool ); | 157 | void todoSelected( bool ); |
158 | 158 | ||
159 | /** | 159 | /** |
160 | Emitted, when clipboard content changes. Parameter indicates if paste | 160 | Emitted, when clipboard content changes. Parameter indicates if paste |
161 | is possible or not. | 161 | is possible or not. |
162 | */ | 162 | */ |
163 | void pasteEnabled(bool); | 163 | void pasteEnabled(bool); |
164 | 164 | ||
165 | /** Emitted, when the number of incoming messages has changed. */ | 165 | /** Emitted, when the number of incoming messages has changed. */ |
166 | void numIncomingChanged(int); | 166 | void numIncomingChanged(int); |
167 | 167 | ||
168 | /** Emitted, when the number of outgoing messages has changed. */ | 168 | /** Emitted, when the number of outgoing messages has changed. */ |
169 | void numOutgoingChanged(int); | 169 | void numOutgoingChanged(int); |
170 | 170 | ||
171 | /** Send status message, which can e.g. be displayed in the status bar. */ | 171 | /** Send status message, which can e.g. be displayed in the status bar. */ |
172 | void statusMessage(const QString &); | 172 | void statusMessage(const QString &); |
173 | 173 | ||
174 | void calendarViewExpanded( bool ); | 174 | void calendarViewExpanded( bool ); |
175 | void updateSearchDialog(); | 175 | void updateSearchDialog(); |
176 | 176 | ||
177 | 177 | ||
178 | public slots: | 178 | public slots: |
179 | void showNextAlarms(); | ||
179 | void showOpenError(); | 180 | void showOpenError(); |
180 | void watchSavedFile(); | 181 | void watchSavedFile(); |
181 | void recheckTimerAlarm(); | 182 | void recheckTimerAlarm(); |
182 | void checkNextTimerAlarm(); | 183 | void checkNextTimerAlarm(); |
183 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 184 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
184 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 185 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
185 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 186 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
186 | 187 | ||
187 | /** options dialog made a changed to the configuration. we catch this | 188 | /** options dialog made a changed to the configuration. we catch this |
188 | * and notify all widgets which need to update their configuration. */ | 189 | * and notify all widgets which need to update their configuration. */ |
189 | void updateConfig(); | 190 | void updateConfig(); |
190 | 191 | ||
191 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 192 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
192 | const QStringList& anniversaryList, const QStringList& realNameList, | 193 | const QStringList& anniversaryList, const QStringList& realNameList, |
193 | const QStringList& emailList, const QStringList& assembledNameList, | 194 | const QStringList& emailList, const QStringList& assembledNameList, |
194 | const QStringList& uidList); | 195 | const QStringList& uidList); |
195 | 196 | ||
196 | /** | 197 | /** |
197 | Load calendar from file \a filename. If \a merge is true, load | 198 | Load calendar from file \a filename. If \a merge is true, load |
198 | calendar into existing one, if it is false, clear calendar, before | 199 | calendar into existing one, if it is false, clear calendar, before |
199 | loading. Return true, if calendar could be successfully loaded. | 200 | loading. Return true, if calendar could be successfully loaded. |
200 | */ | 201 | */ |
201 | bool openCalendar(QString filename, bool merge=false); | 202 | bool openCalendar(QString filename, bool merge=false); |
202 | bool syncCalendar(QString filename,int mode = 0 ); | 203 | bool syncCalendar(QString filename,int mode = 0 ); |
203 | 204 | ||
204 | /** | 205 | /** |
205 | Save calendar data to file. Return true if calendar could be | 206 | Save calendar data to file. Return true if calendar could be |
206 | successfully saved. | 207 | successfully saved. |
207 | */ | 208 | */ |
208 | bool saveCalendar(QString filename); | 209 | bool saveCalendar(QString filename); |
209 | 210 | ||
210 | /** | 211 | /** |
211 | Close calendar. Clear calendar data and reset views to display an empty | 212 | Close calendar. Clear calendar data and reset views to display an empty |
212 | calendar. | 213 | calendar. |
213 | */ | 214 | */ |
214 | void closeCalendar(); | 215 | void closeCalendar(); |
215 | 216 | ||
216 | /** Archive old events of calendar */ | 217 | /** Archive old events of calendar */ |
217 | void archiveCalendar(); | 218 | void archiveCalendar(); |
218 | 219 | ||
219 | void showIncidence(); | 220 | void showIncidence(); |
220 | void editIncidence(); | 221 | void editIncidence(); |
221 | void editIncidenceDescription(); | 222 | void editIncidenceDescription(); |
222 | void deleteIncidence(); | 223 | void deleteIncidence(); |
223 | void cloneIncidence(); | 224 | void cloneIncidence(); |
224 | void moveIncidence(); | 225 | void moveIncidence(); |
225 | void beamIncidence(); | 226 | void beamIncidence(); |
226 | void toggleCancelIncidence(); | 227 | void toggleCancelIncidence(); |
227 | 228 | ||
228 | /** create an editeventwin with supplied date/time, and if bool is true, | 229 | /** create an editeventwin with supplied date/time, and if bool is true, |
229 | * make the event take all day. */ | 230 | * make the event take all day. */ |
230 | void newEvent(QDateTime, QDateTime, bool allDay ); | 231 | void newEvent(QDateTime, QDateTime, bool allDay ); |
231 | void newEvent(QDateTime, QDateTime); | 232 | void newEvent(QDateTime, QDateTime); |
232 | void newEvent(QDateTime fh); | 233 | void newEvent(QDateTime fh); |
233 | void newEvent(QDate dt); | 234 | void newEvent(QDate dt); |
234 | /** create new event without having a date hint. Takes current date as | 235 | /** create new event without having a date hint. Takes current date as |
235 | default hint. */ | 236 | default hint. */ |
236 | void newEvent(); | 237 | void newEvent(); |
237 | void newFloatingEvent(); | 238 | void newFloatingEvent(); |
238 | 239 | ||
239 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ | 240 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ |
240 | void showIncidence(Incidence *); | 241 | void showIncidence(Incidence *); |
241 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ | 242 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ |
242 | void editIncidence(Incidence *); | 243 | void editIncidence(Incidence *); |
243 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ | 244 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ |
244 | void deleteIncidence(Incidence *); | 245 | void deleteIncidence(Incidence *); |
245 | void cloneIncidence(Incidence *); | 246 | void cloneIncidence(Incidence *); |
246 | void cancelIncidence(Incidence *); | 247 | void cancelIncidence(Incidence *); |
247 | /** Create an editor for the supplied event. */ | 248 | /** Create an editor for the supplied event. */ |
248 | void editEvent(Event *); | 249 | void editEvent(Event *); |
249 | /** Delete the supplied event. */ | 250 | /** Delete the supplied event. */ |
250 | void deleteEvent(Event *); | 251 | void deleteEvent(Event *); |
251 | /** Delete the event with the given unique ID. Returns false, if event wasn't | 252 | /** Delete the event with the given unique ID. Returns false, if event wasn't |
252 | found. */ | 253 | found. */ |
253 | bool deleteEvent(const QString &uid); | 254 | bool deleteEvent(const QString &uid); |
254 | /** Create a read-only viewer dialog for the supplied event. */ | 255 | /** Create a read-only viewer dialog for the supplied event. */ |
255 | void showEvent(Event *); | 256 | void showEvent(Event *); |
256 | 257 | ||
257 | void editJournal(Journal *); | 258 | void editJournal(Journal *); |
258 | void showJournal(Journal *); | 259 | void showJournal(Journal *); |
259 | void deleteJournal(Journal *); | 260 | void deleteJournal(Journal *); |
260 | /** Create an editor dialog for a todo */ | 261 | /** Create an editor dialog for a todo */ |
261 | void editTodo(Todo *); | 262 | void editTodo(Todo *); |
262 | /** Create a read-only viewer dialog for the supplied todo */ | 263 | /** Create a read-only viewer dialog for the supplied todo */ |
263 | void showTodo(Todo *); | 264 | void showTodo(Todo *); |
264 | /** create new todo */ | 265 | /** create new todo */ |
265 | void newTodo(); | 266 | void newTodo(); |
266 | void newTodoDateTime(QDateTime, bool allday); | 267 | void newTodoDateTime(QDateTime, bool allday); |
267 | /** create new todo with a parent todo */ | 268 | /** create new todo with a parent todo */ |
268 | void newSubTodo(); | 269 | void newSubTodo(); |
269 | /** create new todo with a parent todo */ | 270 | /** create new todo with a parent todo */ |
270 | void newSubTodo(Todo *); | 271 | void newSubTodo(Todo *); |
271 | /** Delete todo */ | 272 | /** Delete todo */ |
272 | void deleteTodo(Todo *); | 273 | void deleteTodo(Todo *); |
273 | 274 | ||
274 | 275 | ||
@@ -406,192 +407,193 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
406 | 407 | ||
407 | /** Move the curdatepient view date to today */ | 408 | /** Move the curdatepient view date to today */ |
408 | void goToday(); | 409 | void goToday(); |
409 | 410 | ||
410 | /** Move to the next date(s) in the current view */ | 411 | /** Move to the next date(s) in the current view */ |
411 | void goNext(); | 412 | void goNext(); |
412 | 413 | ||
413 | /** Move to the previous date(s) in the current view */ | 414 | /** Move to the previous date(s) in the current view */ |
414 | void goPrevious(); | 415 | void goPrevious(); |
415 | /** Move to the next date(s) in the current view */ | 416 | /** Move to the next date(s) in the current view */ |
416 | void goNextMonth(); | 417 | void goNextMonth(); |
417 | 418 | ||
418 | /** Move to the previous date(s) in the current view */ | 419 | /** Move to the previous date(s) in the current view */ |
419 | void goPreviousMonth(); | 420 | void goPreviousMonth(); |
420 | 421 | ||
421 | void toggleExpand(); | 422 | void toggleExpand(); |
422 | void toggleDateNavigatorWidget(); | 423 | void toggleDateNavigatorWidget(); |
423 | void toggleAllDaySize(); | 424 | void toggleAllDaySize(); |
424 | void dialogClosing(Incidence *); | 425 | void dialogClosing(Incidence *); |
425 | 426 | ||
426 | /** Look for new messages in the inbox */ | 427 | /** Look for new messages in the inbox */ |
427 | void lookForIncomingMessages(); | 428 | void lookForIncomingMessages(); |
428 | /** Look for new messages in the outbox */ | 429 | /** Look for new messages in the outbox */ |
429 | void lookForOutgoingMessages(); | 430 | void lookForOutgoingMessages(); |
430 | 431 | ||
431 | void processMainViewSelection( Incidence * ); | 432 | void processMainViewSelection( Incidence * ); |
432 | void processTodoListSelection( Incidence * ); | 433 | void processTodoListSelection( Incidence * ); |
433 | 434 | ||
434 | void processIncidenceSelection( Incidence * ); | 435 | void processIncidenceSelection( Incidence * ); |
435 | 436 | ||
436 | void purgeCompleted(); | 437 | void purgeCompleted(); |
437 | bool removeCompletedSubTodos( Todo* ); | 438 | bool removeCompletedSubTodos( Todo* ); |
438 | void slotCalendarChanged(); | 439 | void slotCalendarChanged(); |
439 | bool importBday(); | 440 | bool importBday(); |
440 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); | 441 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); |
441 | bool importQtopia( const QString &categoriesFile, | 442 | bool importQtopia( const QString &categoriesFile, |
442 | const QString &datebookFile, | 443 | const QString &datebookFile, |
443 | const QString &tasklistFile ); | 444 | const QString &tasklistFile ); |
444 | void syncExternal( int mode ); | 445 | void syncExternal( int mode ); |
445 | void slotSelectPickerDate( QDate ) ; | 446 | void slotSelectPickerDate( QDate ) ; |
446 | void showDatePicker() ; | 447 | void showDatePicker() ; |
447 | void showDatePickerPopup() ; | 448 | void showDatePickerPopup() ; |
448 | void moveIncidence(Incidence *) ; | 449 | void moveIncidence(Incidence *) ; |
449 | void beamIncidence(Incidence *) ; | 450 | void beamIncidence(Incidence *) ; |
450 | void beamCalendar() ; | 451 | void beamCalendar() ; |
451 | void beamFilteredCalendar() ; | 452 | void beamFilteredCalendar() ; |
452 | void beamIncidenceList(QPtrList<Incidence>) ; | 453 | void beamIncidenceList(QPtrList<Incidence>) ; |
453 | void manageCategories(); | 454 | void manageCategories(); |
454 | int addCategories(); | 455 | int addCategories(); |
455 | void removeCategories(); | 456 | void removeCategories(); |
456 | void setSyncDevice( QString ); | 457 | void setSyncDevice( QString ); |
457 | void setSyncName( QString ); | 458 | void setSyncName( QString ); |
458 | void showDay( QDate ); | 459 | void showDay( QDate ); |
459 | void undo_delete(); | 460 | void undo_delete(); |
460 | protected slots: | 461 | protected slots: |
461 | void resetFocus(); | 462 | void resetFocus(); |
462 | void slotViewerClosed(); | 463 | void slotViewerClosed(); |
463 | void timerAlarm(); | 464 | void timerAlarm(); |
464 | void suspendAlarm(); | 465 | void suspendAlarm(); |
465 | void beamDone( Ir *ir ); | 466 | void beamDone( Ir *ir ); |
466 | /** Select a view or adapt the current view to display the specified dates. */ | 467 | /** Select a view or adapt the current view to display the specified dates. */ |
467 | void showDates( const KCal::DateList & ); | 468 | void showDates( const KCal::DateList & ); |
468 | void selectWeekNum ( int ); | 469 | void selectWeekNum ( int ); |
469 | 470 | ||
470 | public: | 471 | public: |
471 | // show a standard warning | 472 | // show a standard warning |
472 | // returns KMsgBox::yesNoCancel() | 473 | // returns KMsgBox::yesNoCancel() |
473 | int msgCalModified(); | 474 | int msgCalModified(); |
474 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 475 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
475 | 476 | ||
476 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 477 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
477 | virtual void removeSyncInfo( QString syncProfile); | 478 | virtual void removeSyncInfo( QString syncProfile); |
478 | void setSyncManager(KSyncManager* manager); | 479 | void setSyncManager(KSyncManager* manager); |
479 | void setLoadedFileVersion(QDateTime); | 480 | void setLoadedFileVersion(QDateTime); |
480 | bool checkFileVersion(QString fn); | 481 | bool checkFileVersion(QString fn); |
481 | bool checkFileChanged(QString fn); | 482 | bool checkFileChanged(QString fn); |
482 | Event* getLastSyncEvent(); | 483 | Event* getLastSyncEvent(); |
483 | /** Adapt navigation units correpsonding to step size of navigation of the | 484 | /** Adapt navigation units correpsonding to step size of navigation of the |
484 | * current view. | 485 | * current view. |
485 | */ | 486 | */ |
486 | void adaptNavigationUnits(); | 487 | void adaptNavigationUnits(); |
487 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); | 488 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); |
488 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); | 489 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); |
489 | //Attendee* getYourAttendee(Event *event); | 490 | //Attendee* getYourAttendee(Event *event); |
490 | void setBlockShowDates( bool b ) { mBlockShowDates = b ;} | 491 | void setBlockShowDates( bool b ) { mBlockShowDates = b ;} |
491 | protected: | 492 | protected: |
492 | void schedule(Scheduler::Method, Incidence *incidence = 0); | 493 | void schedule(Scheduler::Method, Incidence *incidence = 0); |
493 | 494 | ||
494 | // returns KMsgBox::OKCandel() | 495 | // returns KMsgBox::OKCandel() |
495 | int msgItemDelete(const QString name); | 496 | int msgItemDelete(const QString name); |
496 | void showEventEditor(); | 497 | void showEventEditor(); |
497 | void showTodoEditor(); | 498 | void showTodoEditor(); |
498 | void writeLocale(); | 499 | void writeLocale(); |
499 | Todo *selectedTodo(); | 500 | Todo *selectedTodo(); |
500 | 501 | ||
501 | private: | 502 | private: |
503 | QDateTime mNextAlarmDateTime; | ||
502 | bool mViewerCallerIsSearchDialog; | 504 | bool mViewerCallerIsSearchDialog; |
503 | bool mBlockShowDates; | 505 | bool mBlockShowDates; |
504 | KSyncManager* mSyncManager; | 506 | KSyncManager* mSyncManager; |
505 | AlarmDialog * mAlarmDialog; | 507 | AlarmDialog * mAlarmDialog; |
506 | QString mAlarmNotification; | 508 | QString mAlarmNotification; |
507 | QString mSuspendAlarmNotification; | 509 | QString mSuspendAlarmNotification; |
508 | QTimer* mSuspendTimer; | 510 | QTimer* mSuspendTimer; |
509 | QTimer* mAlarmTimer; | 511 | QTimer* mAlarmTimer; |
510 | QTimer* mRecheckAlarmTimer; | 512 | QTimer* mRecheckAlarmTimer; |
511 | void computeAlarm( QString ); | 513 | void computeAlarm( QString ); |
512 | void startAlarm( QString, QString ); | 514 | void startAlarm( QString, QString ); |
513 | void setSyncEventsReadOnly(); | 515 | void setSyncEventsReadOnly(); |
514 | 516 | ||
515 | QDateTime loadedFileVersion; | 517 | QDateTime loadedFileVersion; |
516 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); | 518 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); |
517 | void checkExternalId( Incidence * inc ); | 519 | void checkExternalId( Incidence * inc ); |
518 | int mGlobalSyncMode; | 520 | int mGlobalSyncMode; |
519 | QString mCurrentSyncDevice; | 521 | QString mCurrentSyncDevice; |
520 | QString mCurrentSyncName; | 522 | QString mCurrentSyncName; |
521 | KOBeamPrefs* beamDialog; | 523 | KOBeamPrefs* beamDialog; |
522 | void init(); | 524 | void init(); |
523 | int mDatePickerMode; | 525 | int mDatePickerMode; |
524 | bool mFlagEditDescription; | 526 | bool mFlagEditDescription; |
525 | QDateTime mLastCalendarSync; | 527 | QDateTime mLastCalendarSync; |
526 | void createPrinter(); | 528 | void createPrinter(); |
527 | 529 | ||
528 | void calendarModified( bool, Calendar * ); | 530 | void calendarModified( bool, Calendar * ); |
529 | 531 | ||
530 | CalPrinter *mCalPrinter; | 532 | CalPrinter *mCalPrinter; |
531 | 533 | ||
532 | QSplitter *mPanner; | 534 | QSplitter *mPanner; |
533 | QSplitter *mLeftSplitter; | 535 | QSplitter *mLeftSplitter; |
534 | KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; | 536 | KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; |
535 | QWidgetStack *mRightFrame; | 537 | QWidgetStack *mRightFrame; |
536 | 538 | ||
537 | KDatePicker* mDatePicker; | 539 | KDatePicker* mDatePicker; |
538 | QVBox* mDateFrame; | 540 | QVBox* mDateFrame; |
539 | 541 | ||
540 | DateNavigatorContainer *mDateNavigator; // widget showing small month view. | 542 | DateNavigatorContainer *mDateNavigator; // widget showing small month view. |
541 | 543 | ||
542 | KOFilterView *mFilterView; | 544 | KOFilterView *mFilterView; |
543 | 545 | ||
544 | ResourceView *mResourceView; | 546 | ResourceView *mResourceView; |
545 | 547 | ||
546 | // calendar object for this viewing instance | 548 | // calendar object for this viewing instance |
547 | Calendar *mCalendar; | 549 | Calendar *mCalendar; |
548 | 550 | ||
549 | CalendarResourceManager *mResourceManager; | 551 | CalendarResourceManager *mResourceManager; |
550 | 552 | ||
551 | FileStorage *mStorage; | 553 | FileStorage *mStorage; |
552 | 554 | ||
553 | DateNavigator *mNavigator; | 555 | DateNavigator *mNavigator; |
554 | 556 | ||
555 | KOViewManager *mViewManager; | 557 | KOViewManager *mViewManager; |
556 | KODialogManager *mDialogManager; | 558 | KODialogManager *mDialogManager; |
557 | 559 | ||
558 | // Calendar filters | 560 | // Calendar filters |
559 | QPtrList<CalFilter> mFilters; | 561 | QPtrList<CalFilter> mFilters; |
560 | 562 | ||
561 | // various housekeeping variables. | 563 | // various housekeeping variables. |
562 | bool mModified; // flag indicating if calendar is modified | 564 | bool mModified; // flag indicating if calendar is modified |
563 | bool mReadOnly; // flag indicating if calendar is read-only | 565 | bool mReadOnly; // flag indicating if calendar is read-only |
564 | QDate mSaveSingleDate; | 566 | QDate mSaveSingleDate; |
565 | 567 | ||
566 | Incidence *mSelectedIncidence; | 568 | Incidence *mSelectedIncidence; |
567 | Incidence *mMoveIncidence; | 569 | Incidence *mMoveIncidence; |
568 | QDate mMoveIncidenceOldDate; | 570 | QDate mMoveIncidenceOldDate; |
569 | KOTodoView *mTodoList; | 571 | KOTodoView *mTodoList; |
570 | KOEventEditor * mEventEditor; | 572 | KOEventEditor * mEventEditor; |
571 | KOTodoEditor * mTodoEditor; | 573 | KOTodoEditor * mTodoEditor; |
572 | KOEventViewerDialog * mEventViewerDialog; | 574 | KOEventViewerDialog * mEventViewerDialog; |
573 | void keyPressEvent ( QKeyEvent *e) ; | 575 | void keyPressEvent ( QKeyEvent *e) ; |
574 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; | 576 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; |
575 | }; | 577 | }; |
576 | 578 | ||
577 | 579 | ||
578 | class CalendarViewVisitor : public Incidence::Visitor | 580 | class CalendarViewVisitor : public Incidence::Visitor |
579 | { | 581 | { |
580 | public: | 582 | public: |
581 | CalendarViewVisitor() : mView( 0 ) {} | 583 | CalendarViewVisitor() : mView( 0 ) {} |
582 | 584 | ||
583 | bool act( Incidence *incidence, CalendarView *view ) | 585 | bool act( Incidence *incidence, CalendarView *view ) |
584 | { | 586 | { |
585 | mView = view; | 587 | mView = view; |
586 | return incidence->accept( *this ); | 588 | return incidence->accept( *this ); |
587 | } | 589 | } |
588 | 590 | ||
589 | protected: | 591 | protected: |
590 | CalendarView *mView; | 592 | CalendarView *mView; |
591 | }; | 593 | }; |
592 | 594 | ||
593 | class ShowIncidenceVisitor : public CalendarViewVisitor | 595 | class ShowIncidenceVisitor : public CalendarViewVisitor |
594 | { | 596 | { |
595 | protected: | 597 | protected: |
596 | bool visit( Event *event ) { mView->showEvent( event ); return true; } | 598 | bool visit( Event *event ) { mView->showEvent( event ); return true; } |
597 | bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } | 599 | bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 95b836c..7a4275b 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -497,193 +497,193 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
497 | 497 | ||
498 | } | 498 | } |
499 | 499 | ||
500 | showMaximized(); | 500 | showMaximized(); |
501 | raise(); | 501 | raise(); |
502 | } | 502 | } |
503 | 503 | ||
504 | QPixmap MainWindow::loadPixmap( QString name ) | 504 | QPixmap MainWindow::loadPixmap( QString name ) |
505 | { | 505 | { |
506 | return SmallIcon( name ); | 506 | return SmallIcon( name ); |
507 | 507 | ||
508 | } | 508 | } |
509 | void MainWindow::initActions() | 509 | void MainWindow::initActions() |
510 | { | 510 | { |
511 | //KOPrefs::instance()->mShowFullMenu | 511 | //KOPrefs::instance()->mShowFullMenu |
512 | iconToolBar->clear(); | 512 | iconToolBar->clear(); |
513 | KOPrefs *p = KOPrefs::instance(); | 513 | KOPrefs *p = KOPrefs::instance(); |
514 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 514 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
515 | 515 | ||
516 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 516 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
517 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 517 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
518 | QPopupMenu *importMenu = new QPopupMenu( this ); | 518 | QPopupMenu *importMenu = new QPopupMenu( this ); |
519 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 519 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
520 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 520 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
521 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 521 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
522 | selectFilterMenu = new QPopupMenu( this ); | 522 | selectFilterMenu = new QPopupMenu( this ); |
523 | selectFilterMenu->setCheckable( true ); | 523 | selectFilterMenu->setCheckable( true ); |
524 | syncMenu = new QPopupMenu( this ); | 524 | syncMenu = new QPopupMenu( this ); |
525 | configureAgendaMenu = new QPopupMenu( this ); | 525 | configureAgendaMenu = new QPopupMenu( this ); |
526 | configureToolBarMenu = new QPopupMenu( this ); | 526 | configureToolBarMenu = new QPopupMenu( this ); |
527 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 527 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
528 | QIconSet icon; | 528 | QIconSet icon; |
529 | int pixWid = 22, pixHei = 22; | 529 | int pixWid = 22, pixHei = 22; |
530 | QString pathString = ""; | 530 | QString pathString = ""; |
531 | if ( !p->mToolBarMiniIcons ) { | 531 | if ( !p->mToolBarMiniIcons ) { |
532 | if ( QApplication::desktop()->width() < 480 ) { | 532 | if ( QApplication::desktop()->width() < 480 ) { |
533 | pathString += "icons16/"; | 533 | pathString += "icons16/"; |
534 | pixWid = 18; pixHei = 16; | 534 | pixWid = 18; pixHei = 16; |
535 | } | 535 | } |
536 | } else { | 536 | } else { |
537 | pathString += "iconsmini/"; | 537 | pathString += "iconsmini/"; |
538 | pixWid = 18; pixHei = 16; | 538 | pixWid = 18; pixHei = 16; |
539 | } | 539 | } |
540 | if ( KOPrefs::instance()->mShowFullMenu ) { | 540 | if ( KOPrefs::instance()->mShowFullMenu ) { |
541 | QMenuBar *menuBar1; | 541 | QMenuBar *menuBar1; |
542 | menuBar1 = menuBar(); | 542 | menuBar1 = menuBar(); |
543 | menuBar1->insertItem( i18n("File"), importMenu ); | 543 | menuBar1->insertItem( i18n("File"), importMenu ); |
544 | menuBar1->insertItem( i18n("View"), viewMenu ); | 544 | menuBar1->insertItem( i18n("View"), viewMenu ); |
545 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 545 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
546 | #ifdef DESKTOP_VERSION | 546 | #ifdef DESKTOP_VERSION |
547 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 547 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
548 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 548 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
549 | #else | 549 | #else |
550 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 550 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
551 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 551 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
552 | #endif | 552 | #endif |
553 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 553 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
554 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 554 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
555 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 555 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
556 | } else { | 556 | } else { |
557 | QPEMenuBar *menuBar1; | 557 | QPEMenuBar *menuBar1; |
558 | menuBar1 = new QPEMenuBar( iconToolBar ); | 558 | menuBar1 = new QPEMenuBar( iconToolBar ); |
559 | QPopupMenu *menuBar = new QPopupMenu( this ); | 559 | QPopupMenu *menuBar = new QPopupMenu( this ); |
560 | icon = loadPixmap( pathString + "z_menu" ); | 560 | icon = loadPixmap( pathString + "z_menu" ); |
561 | menuBar1->insertItem( icon.pixmap(), menuBar); | 561 | menuBar1->insertItem( icon.pixmap(), menuBar); |
562 | //menuBar1->insertItem( i18n("ME"), menuBar); | 562 | //menuBar1->insertItem( i18n("ME"), menuBar); |
563 | menuBar->insertItem( i18n("File"), importMenu ); | 563 | menuBar->insertItem( i18n("File"), importMenu ); |
564 | menuBar->insertItem( i18n("View"), viewMenu ); | 564 | menuBar->insertItem( i18n("View"), viewMenu ); |
565 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 565 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
566 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 566 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
567 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 567 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
568 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 568 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
569 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 569 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
570 | menuBar->insertItem( i18n("Help"), helpMenu ); | 570 | menuBar->insertItem( i18n("Help"), helpMenu ); |
571 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 571 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
572 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 572 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
573 | } | 573 | } |
574 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 574 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
575 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 575 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
576 | mWeekBgColor = iconToolBar->backgroundColor(); | 576 | mWeekBgColor = iconToolBar->backgroundColor(); |
577 | mWeekPixmap.resize( pixWid , pixHei ); | 577 | mWeekPixmap.resize( pixWid , pixHei ); |
578 | mWeekPixmap.fill( mWeekBgColor ); | 578 | mWeekPixmap.fill( mWeekBgColor ); |
579 | icon = mWeekPixmap; | 579 | icon = mWeekPixmap; |
580 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 580 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
581 | if ( p-> mShowIconWeekNum ) | 581 | if ( p-> mShowIconWeekNum ) |
582 | mWeekAction->addTo( iconToolBar ); | 582 | mWeekAction->addTo( iconToolBar ); |
583 | mWeekFont = font(); | 583 | mWeekFont = font(); |
584 | 584 | ||
585 | int fontPoint = mWeekFont.pointSize(); | 585 | int fontPoint = mWeekFont.pointSize(); |
586 | QFontMetrics f( mWeekFont ); | 586 | QFontMetrics f( mWeekFont ); |
587 | int fontWid = f.width( "30" ); | 587 | int fontWid = f.width( "30" ); |
588 | while ( fontWid > pixWid ) { | 588 | while ( fontWid > pixWid ) { |
589 | --fontPoint; | 589 | --fontPoint; |
590 | mWeekFont.setPointSize( fontPoint ); | 590 | mWeekFont.setPointSize( fontPoint ); |
591 | QFontMetrics f( mWeekFont ); | 591 | QFontMetrics f( mWeekFont ); |
592 | fontWid = f.width( "30" ); | 592 | fontWid = f.width( "30" ); |
593 | qDebug("dec-- "); | 593 | //qDebug("dec-- "); |
594 | } | 594 | } |
595 | 595 | ||
596 | connect( mWeekAction, SIGNAL( activated() ), | 596 | connect( mWeekAction, SIGNAL( activated() ), |
597 | this, SLOT( weekAction() ) ); | 597 | this, SLOT( weekAction() ) ); |
598 | 598 | ||
599 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 599 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
600 | 600 | ||
601 | //#endif | 601 | //#endif |
602 | // ****************** | 602 | // ****************** |
603 | QAction *action; | 603 | QAction *action; |
604 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 604 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
605 | configureToolBarMenu->setCheckable( true ); | 605 | configureToolBarMenu->setCheckable( true ); |
606 | 606 | ||
607 | 607 | ||
608 | configureAgendaMenu->setCheckable( true ); | 608 | configureAgendaMenu->setCheckable( true ); |
609 | int iii ; | 609 | int iii ; |
610 | for ( iii = 1;iii<= 10 ;++iii ){ | 610 | for ( iii = 1;iii<= 10 ;++iii ){ |
611 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 611 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
612 | } | 612 | } |
613 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 613 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
614 | 614 | ||
615 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 615 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
616 | this, SLOT( showConfigureAgenda( ) ) ); | 616 | this, SLOT( showConfigureAgenda( ) ) ); |
617 | 617 | ||
618 | icon = loadPixmap( pathString + "configure" ); | 618 | icon = loadPixmap( pathString + "configure" ); |
619 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 619 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
620 | action->addTo( actionMenu ); | 620 | action->addTo( actionMenu ); |
621 | connect( action, SIGNAL( activated() ), | 621 | connect( action, SIGNAL( activated() ), |
622 | mView, SLOT( edit_options() ) ); | 622 | mView, SLOT( edit_options() ) ); |
623 | actionMenu->insertSeparator(); | 623 | actionMenu->insertSeparator(); |
624 | 624 | ||
625 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 625 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
626 | action->addTo( actionMenu ); | 626 | action->addTo( actionMenu ); |
627 | connect( action, SIGNAL( activated() ), | 627 | connect( action, SIGNAL( activated() ), |
628 | mView, SLOT( undo_delete() ) ); | 628 | mView, SLOT( undo_delete() ) ); |
629 | actionMenu->insertSeparator(); | 629 | actionMenu->insertSeparator(); |
630 | 630 | ||
631 | icon = loadPixmap( pathString + "newevent" ); | 631 | icon = loadPixmap( pathString + "newevent" ); |
632 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 632 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
633 | configureToolBarMenu->insertSeparator(); | 633 | configureToolBarMenu->insertSeparator(); |
634 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 634 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
635 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 635 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
636 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 636 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
637 | ne_action->addTo( actionMenu ); | 637 | ne_action->addTo( actionMenu ); |
638 | connect( ne_action, SIGNAL( activated() ), | 638 | connect( ne_action, SIGNAL( activated() ), |
639 | mView, SLOT( newEvent() ) ); | 639 | mView, SLOT( newEvent() ) ); |
640 | icon = loadPixmap( pathString + "newtodo" ); | 640 | icon = loadPixmap( pathString + "newtodo" ); |
641 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 641 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
642 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 642 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
643 | nt_action->addTo( actionMenu ); | 643 | nt_action->addTo( actionMenu ); |
644 | connect( nt_action, SIGNAL( activated() ), | 644 | connect( nt_action, SIGNAL( activated() ), |
645 | mView, SLOT( newTodo() ) ); | 645 | mView, SLOT( newTodo() ) ); |
646 | 646 | ||
647 | icon = loadPixmap( pathString + "today" ); | 647 | icon = loadPixmap( pathString + "today" ); |
648 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 648 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
649 | today_action->addTo( viewMenu ); | 649 | today_action->addTo( viewMenu ); |
650 | connect( today_action, SIGNAL( activated() ), | 650 | connect( today_action, SIGNAL( activated() ), |
651 | mView, SLOT( goToday() ) ); | 651 | mView, SLOT( goToday() ) ); |
652 | viewMenu->insertSeparator(); | 652 | viewMenu->insertSeparator(); |
653 | 653 | ||
654 | icon = loadPixmap( pathString + "navi" ); | 654 | icon = loadPixmap( pathString + "navi" ); |
655 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 655 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
656 | action->addTo( viewMenu ); | 656 | action->addTo( viewMenu ); |
657 | connect( action, SIGNAL( activated() ), | 657 | connect( action, SIGNAL( activated() ), |
658 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 658 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
659 | mToggleNav = action ; | 659 | mToggleNav = action ; |
660 | icon = loadPixmap( pathString + "filter" ); | 660 | icon = loadPixmap( pathString + "filter" ); |
661 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 661 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
662 | action->addTo( viewMenu ); | 662 | action->addTo( viewMenu ); |
663 | connect( action, SIGNAL( activated() ), | 663 | connect( action, SIGNAL( activated() ), |
664 | mView, SLOT( toggleFilter() ) ); | 664 | mView, SLOT( toggleFilter() ) ); |
665 | mToggleFilter = action; | 665 | mToggleFilter = action; |
666 | icon = loadPixmap( pathString + "allday" ); | 666 | icon = loadPixmap( pathString + "allday" ); |
667 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 667 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
668 | action->addTo( viewMenu ); | 668 | action->addTo( viewMenu ); |
669 | connect( action, SIGNAL( activated() ), | 669 | connect( action, SIGNAL( activated() ), |
670 | mView, SLOT( toggleAllDaySize() ) ); | 670 | mView, SLOT( toggleAllDaySize() ) ); |
671 | mToggleAllday = action; | 671 | mToggleAllday = action; |
672 | 672 | ||
673 | 673 | ||
674 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 674 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
675 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 675 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
676 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 676 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
677 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 677 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
678 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 678 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
679 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 679 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
680 | 680 | ||
681 | viewMenu->insertSeparator(); | 681 | viewMenu->insertSeparator(); |
682 | icon = loadPixmap( pathString + "picker" ); | 682 | icon = loadPixmap( pathString + "picker" ); |
683 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 683 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
684 | action->addTo( viewMenu ); | 684 | action->addTo( viewMenu ); |
685 | connect( action, SIGNAL( activated() ), | 685 | connect( action, SIGNAL( activated() ), |
686 | mView, SLOT( showDatePicker() ) ); | 686 | mView, SLOT( showDatePicker() ) ); |
687 | action->addTo( iconToolBar ); | 687 | action->addTo( iconToolBar ); |
688 | viewMenu->insertSeparator(); | 688 | viewMenu->insertSeparator(); |
689 | 689 | ||
@@ -1655,192 +1655,195 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
1655 | case Qt::Key_Down: | 1655 | case Qt::Key_Down: |
1656 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 1656 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1657 | break; | 1657 | break; |
1658 | case Qt::Key_Up: | 1658 | case Qt::Key_Up: |
1659 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1659 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1660 | break; | 1660 | break; |
1661 | case Qt::Key_K: | 1661 | case Qt::Key_K: |
1662 | mView->viewManager()->showMonthViewWeek(); | 1662 | mView->viewManager()->showMonthViewWeek(); |
1663 | break; | 1663 | break; |
1664 | case Qt::Key_I: | 1664 | case Qt::Key_I: |
1665 | mView->showIncidence(); | 1665 | mView->showIncidence(); |
1666 | break; | 1666 | break; |
1667 | case Qt::Key_Delete: | 1667 | case Qt::Key_Delete: |
1668 | case Qt::Key_Backspace: | 1668 | case Qt::Key_Backspace: |
1669 | mView->deleteIncidence(); | 1669 | mView->deleteIncidence(); |
1670 | break; | 1670 | break; |
1671 | case Qt::Key_D: | 1671 | case Qt::Key_D: |
1672 | mView->viewManager()->showDayView(); | 1672 | mView->viewManager()->showDayView(); |
1673 | showSelectedDates = true; | 1673 | showSelectedDates = true; |
1674 | break; | 1674 | break; |
1675 | case Qt::Key_O: | 1675 | case Qt::Key_O: |
1676 | mView->toggleFilerEnabled( ); | 1676 | mView->toggleFilerEnabled( ); |
1677 | break; | 1677 | break; |
1678 | case Qt::Key_0: | 1678 | case Qt::Key_0: |
1679 | case Qt::Key_1: | 1679 | case Qt::Key_1: |
1680 | case Qt::Key_2: | 1680 | case Qt::Key_2: |
1681 | case Qt::Key_3: | 1681 | case Qt::Key_3: |
1682 | case Qt::Key_4: | 1682 | case Qt::Key_4: |
1683 | case Qt::Key_5: | 1683 | case Qt::Key_5: |
1684 | case Qt::Key_6: | 1684 | case Qt::Key_6: |
1685 | case Qt::Key_7: | 1685 | case Qt::Key_7: |
1686 | case Qt::Key_8: | 1686 | case Qt::Key_8: |
1687 | case Qt::Key_9: | 1687 | case Qt::Key_9: |
1688 | pro = e->key()-48; | 1688 | pro = e->key()-48; |
1689 | if ( pro == 0 ) | 1689 | if ( pro == 0 ) |
1690 | pro = 10; | 1690 | pro = 10; |
1691 | if ( e->state() == Qt::ControlButton) | 1691 | if ( e->state() == Qt::ControlButton) |
1692 | pro += 10; | 1692 | pro += 10; |
1693 | break; | 1693 | break; |
1694 | case Qt::Key_M: | 1694 | case Qt::Key_M: |
1695 | mView->viewManager()->showMonthView(); | 1695 | mView->viewManager()->showMonthView(); |
1696 | showSelectedDates = true; | 1696 | showSelectedDates = true; |
1697 | break; | 1697 | break; |
1698 | case Qt::Key_Insert: | 1698 | case Qt::Key_Insert: |
1699 | mView->newEvent(); | 1699 | mView->newEvent(); |
1700 | break; | 1700 | break; |
1701 | case Qt::Key_S : | 1701 | case Qt::Key_S : |
1702 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1702 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1703 | mView->newSubTodo(); | 1703 | mView->newSubTodo(); |
1704 | else | 1704 | else |
1705 | mView->dialogManager()->showSearchDialog(); | 1705 | mView->dialogManager()->showSearchDialog(); |
1706 | break; | 1706 | break; |
1707 | case Qt::Key_Y : | 1707 | case Qt::Key_Y : |
1708 | case Qt::Key_Z : | 1708 | case Qt::Key_Z : |
1709 | mView->viewManager()->showWorkWeekView(); | 1709 | mView->viewManager()->showWorkWeekView(); |
1710 | showSelectedDates = true; | 1710 | showSelectedDates = true; |
1711 | break; | 1711 | break; |
1712 | case Qt::Key_U : | 1712 | case Qt::Key_U : |
1713 | mView->viewManager()->showWeekView(); | 1713 | mView->viewManager()->showWeekView(); |
1714 | showSelectedDates = true; | 1714 | showSelectedDates = true; |
1715 | break; | 1715 | break; |
1716 | case Qt::Key_H : | 1716 | case Qt::Key_H : |
1717 | keyBindings(); | 1717 | keyBindings(); |
1718 | break; | 1718 | break; |
1719 | case Qt::Key_W: | 1719 | case Qt::Key_W: |
1720 | mView->viewManager()->showWhatsNextView(); | 1720 | mView->viewManager()->showWhatsNextView(); |
1721 | break; | 1721 | break; |
1722 | case Qt::Key_L: | 1722 | case Qt::Key_L: |
1723 | mView->viewManager()->showListView(); | 1723 | mView->viewManager()->showListView(); |
1724 | break; | 1724 | break; |
1725 | case Qt::Key_N: | 1725 | case Qt::Key_N: |
1726 | mView->viewManager()->showNextXView(); | 1726 | mView->viewManager()->showNextXView(); |
1727 | showSelectedDates = true; | 1727 | showSelectedDates = true; |
1728 | break; | 1728 | break; |
1729 | case Qt::Key_V: | 1729 | case Qt::Key_V: |
1730 | mView->viewManager()->showTodoView(); | 1730 | mView->viewManager()->showTodoView(); |
1731 | break; | 1731 | break; |
1732 | case Qt::Key_C: | 1732 | case Qt::Key_C: |
1733 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1733 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1734 | break; | 1734 | break; |
1735 | case Qt::Key_P: | 1735 | case Qt::Key_P: |
1736 | mView->showDatePicker( ); | 1736 | mView->showDatePicker( ); |
1737 | break; | 1737 | break; |
1738 | case Qt::Key_F: | 1738 | case Qt::Key_F: |
1739 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1739 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1740 | mView->editFilters(); | 1740 | mView->editFilters(); |
1741 | else | 1741 | else |
1742 | mView->toggleFilter(); | 1742 | mView->toggleFilter(); |
1743 | break; | 1743 | break; |
1744 | case Qt::Key_X: | 1744 | case Qt::Key_X: |
1745 | mView->toggleDateNavigatorWidget(); | 1745 | mView->toggleDateNavigatorWidget(); |
1746 | break; | 1746 | break; |
1747 | case Qt::Key_Space: | 1747 | case Qt::Key_Space: |
1748 | mView->toggleExpand(); | 1748 | mView->toggleExpand(); |
1749 | break; | 1749 | break; |
1750 | case Qt::Key_A: | 1750 | case Qt::Key_A: |
1751 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) | ||
1752 | mView->showNextAlarms(); | ||
1753 | else | ||
1751 | mView->toggleAllDaySize(); | 1754 | mView->toggleAllDaySize(); |
1752 | break; | 1755 | break; |
1753 | case Qt::Key_T: | 1756 | case Qt::Key_T: |
1754 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1757 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1755 | mView->newTodo(); | 1758 | mView->newTodo(); |
1756 | else { | 1759 | else { |
1757 | mView->goToday(); | 1760 | mView->goToday(); |
1758 | showSelectedDates = true; | 1761 | showSelectedDates = true; |
1759 | } | 1762 | } |
1760 | break; | 1763 | break; |
1761 | case Qt::Key_J: | 1764 | case Qt::Key_J: |
1762 | mView->viewManager()->showJournalView(); | 1765 | mView->viewManager()->showJournalView(); |
1763 | break; | 1766 | break; |
1764 | case Qt::Key_B: | 1767 | case Qt::Key_B: |
1765 | mView->editIncidenceDescription();; | 1768 | mView->editIncidenceDescription();; |
1766 | break; | 1769 | break; |
1767 | // case Qt::Key_Return: | 1770 | // case Qt::Key_Return: |
1768 | case Qt::Key_E: | 1771 | case Qt::Key_E: |
1769 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1772 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1770 | mView->newEvent(); | 1773 | mView->newEvent(); |
1771 | else | 1774 | else |
1772 | mView->editIncidence(); | 1775 | mView->editIncidence(); |
1773 | break; | 1776 | break; |
1774 | case Qt::Key_Plus: | 1777 | case Qt::Key_Plus: |
1775 | size = p->mHourSize +2; | 1778 | size = p->mHourSize +2; |
1776 | if ( size <= 22 ) | 1779 | if ( size <= 22 ) |
1777 | configureAgenda( size ); | 1780 | configureAgenda( size ); |
1778 | break; | 1781 | break; |
1779 | case Qt::Key_Minus: | 1782 | case Qt::Key_Minus: |
1780 | size = p->mHourSize - 2; | 1783 | size = p->mHourSize - 2; |
1781 | if ( size >= 4 ) | 1784 | if ( size >= 4 ) |
1782 | configureAgenda( size ); | 1785 | configureAgenda( size ); |
1783 | break; | 1786 | break; |
1784 | 1787 | ||
1785 | 1788 | ||
1786 | default: | 1789 | default: |
1787 | e->ignore(); | 1790 | e->ignore(); |
1788 | } | 1791 | } |
1789 | if ( pro > 0 ) { | 1792 | if ( pro > 0 ) { |
1790 | mView->selectFilter( pro-1 ); | 1793 | mView->selectFilter( pro-1 ); |
1791 | } | 1794 | } |
1792 | if ( showSelectedDates ) { | 1795 | if ( showSelectedDates ) { |
1793 | ;// setCaptionToDates(); | 1796 | ;// setCaptionToDates(); |
1794 | } | 1797 | } |
1795 | 1798 | ||
1796 | } | 1799 | } |
1797 | 1800 | ||
1798 | void MainWindow::fillFilterMenu() | 1801 | void MainWindow::fillFilterMenu() |
1799 | { | 1802 | { |
1800 | selectFilterMenu->clear(); | 1803 | selectFilterMenu->clear(); |
1801 | bool disable = false; | 1804 | bool disable = false; |
1802 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 1805 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
1803 | selectFilterMenu->insertSeparator(); | 1806 | selectFilterMenu->insertSeparator(); |
1804 | if ( mView->filterView()->filtersEnabled() ) { | 1807 | if ( mView->filterView()->filtersEnabled() ) { |
1805 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); | 1808 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); |
1806 | } | 1809 | } |
1807 | else { | 1810 | else { |
1808 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); | 1811 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); |
1809 | disable = true; | 1812 | disable = true; |
1810 | } | 1813 | } |
1811 | selectFilterMenu->insertSeparator(); | 1814 | selectFilterMenu->insertSeparator(); |
1812 | QPtrList<CalFilter> fili = mView->filters(); | 1815 | QPtrList<CalFilter> fili = mView->filters(); |
1813 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1816 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
1814 | CalFilter *filter = fili.first(); | 1817 | CalFilter *filter = fili.first(); |
1815 | int iii = 2; | 1818 | int iii = 2; |
1816 | while(filter) { | 1819 | while(filter) { |
1817 | selectFilterMenu->insertItem( filter->name(), iii ); | 1820 | selectFilterMenu->insertItem( filter->name(), iii ); |
1818 | if ( filter == curfilter) | 1821 | if ( filter == curfilter) |
1819 | selectFilterMenu->setItemChecked( iii, true ); | 1822 | selectFilterMenu->setItemChecked( iii, true ); |
1820 | if ( disable ) | 1823 | if ( disable ) |
1821 | selectFilterMenu->setItemEnabled( iii, false ); | 1824 | selectFilterMenu->setItemEnabled( iii, false ); |
1822 | filter = fili.next(); | 1825 | filter = fili.next(); |
1823 | ++iii; | 1826 | ++iii; |
1824 | } | 1827 | } |
1825 | } | 1828 | } |
1826 | void MainWindow::selectFilter( int fil ) | 1829 | void MainWindow::selectFilter( int fil ) |
1827 | { | 1830 | { |
1828 | if ( fil == 0 ) { | 1831 | if ( fil == 0 ) { |
1829 | mView->editFilters( ); | 1832 | mView->editFilters( ); |
1830 | } else if ( fil == 1 ){ | 1833 | } else if ( fil == 1 ){ |
1831 | mView->toggleFilerEnabled( ); | 1834 | mView->toggleFilerEnabled( ); |
1832 | } else { | 1835 | } else { |
1833 | mView->selectFilter( fil-2 ); | 1836 | mView->selectFilter( fil-2 ); |
1834 | } | 1837 | } |
1835 | } | 1838 | } |
1836 | void MainWindow::configureToolBar( int item ) | 1839 | void MainWindow::configureToolBar( int item ) |
1837 | { | 1840 | { |
1838 | 1841 | ||
1839 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 1842 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
1840 | KOPrefs *p = KOPrefs::instance(); | 1843 | KOPrefs *p = KOPrefs::instance(); |
1841 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 1844 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
1842 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 1845 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
1843 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 1846 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
1844 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 1847 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
1845 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 1848 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
1846 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 1849 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
@@ -2040,96 +2043,108 @@ void MainWindow::exportVCalendar() | |||
2040 | if ( createbup ) { | 2043 | if ( createbup ) { |
2041 | if ( mView->exportVCalendar( fn ) ) { | 2044 | if ( mView->exportVCalendar( fn ) ) { |
2042 | KOPrefs::instance()->mLastVcalFile = fn; | 2045 | KOPrefs::instance()->mLastVcalFile = fn; |
2043 | if ( fn.length() > 20 ) | 2046 | if ( fn.length() > 20 ) |
2044 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 2047 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
2045 | else | 2048 | else |
2046 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 2049 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
2047 | setCaption(mes); | 2050 | setCaption(mes); |
2048 | } | 2051 | } |
2049 | } | 2052 | } |
2050 | 2053 | ||
2051 | } | 2054 | } |
2052 | QString MainWindow::sentSyncFile() | 2055 | QString MainWindow::sentSyncFile() |
2053 | { | 2056 | { |
2054 | #ifdef DESKTOP_VERSION | 2057 | #ifdef DESKTOP_VERSION |
2055 | return locateLocal( "tmp", "copysynccal.ics" ); | 2058 | return locateLocal( "tmp", "copysynccal.ics" ); |
2056 | #else | 2059 | #else |
2057 | return QString( "/tmp/copysynccal.ics" ); | 2060 | return QString( "/tmp/copysynccal.ics" ); |
2058 | #endif | 2061 | #endif |
2059 | } | 2062 | } |
2060 | 2063 | ||
2061 | void MainWindow::syncFileRequest() | 2064 | void MainWindow::syncFileRequest() |
2062 | { | 2065 | { |
2063 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2066 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2064 | mSyncManager->slotSyncMenu( 999 ); | 2067 | mSyncManager->slotSyncMenu( 999 ); |
2065 | } | 2068 | } |
2066 | 2069 | ||
2067 | setCaption(i18n("Saving Data to temp file ..." )); | 2070 | setCaption(i18n("Saving Data to temp file ..." )); |
2068 | mView->saveCalendar( sentSyncFile() ); | 2071 | mView->saveCalendar( sentSyncFile() ); |
2069 | setCaption(i18n("Data saved to temp file!" )); | 2072 | setCaption(i18n("Data saved to temp file!" )); |
2070 | 2073 | ||
2071 | } | 2074 | } |
2072 | void MainWindow::getFile( bool success ) | 2075 | void MainWindow::getFile( bool success ) |
2073 | { | 2076 | { |
2074 | if ( ! success ) { | 2077 | if ( ! success ) { |
2075 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2078 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2076 | return; | 2079 | return; |
2077 | } | 2080 | } |
2078 | mView->openCalendar( sentSyncFile() ); | 2081 | mView->openCalendar( sentSyncFile() ); |
2079 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2082 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2080 | mSyncManager->slotSyncMenu( 999 ); | 2083 | mSyncManager->slotSyncMenu( 999 ); |
2081 | } | 2084 | } |
2082 | setCaption( i18n("Pi-Sync successful!") ); | 2085 | setCaption( i18n("Pi-Sync successful!") ); |
2083 | } | 2086 | } |
2084 | 2087 | ||
2085 | void MainWindow::printSel( ) | 2088 | void MainWindow::printSel( ) |
2086 | { | 2089 | { |
2087 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 2090 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
2088 | } | 2091 | } |
2089 | 2092 | ||
2090 | void MainWindow::printCal() | 2093 | void MainWindow::printCal() |
2091 | { | 2094 | { |
2092 | mView->print();//mCp->showDialog(); | 2095 | mView->print();//mCp->showDialog(); |
2093 | } | 2096 | } |
2094 | 2097 | ||
2095 | 2098 | ||
2096 | #include "libkdepim/kdatepicker.h" | 2099 | #include "libkdepim/kdatepicker.h" |
2097 | #include <kdatetbl.h> | 2100 | #include <kdatetbl.h> |
2098 | void MainWindow::weekAction() | 2101 | void MainWindow::weekAction() |
2099 | { | 2102 | { |
2100 | int month; | 2103 | int month; |
2101 | KPopupFrame* popup = new KPopupFrame(this); | 2104 | KPopupFrame* popup = new KPopupFrame(this); |
2102 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); | 2105 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); |
2103 | // ----- | 2106 | // ----- |
2104 | picker->resize(picker->sizeHint()); | 2107 | picker->resize(picker->sizeHint()); |
2105 | popup->setMainWidget(picker); | 2108 | popup->setMainWidget(picker); |
2106 | picker->setFocus(); | 2109 | picker->setFocus(); |
2107 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); | 2110 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); |
2108 | int x = 0; | 2111 | int x = 0; |
2109 | int y = iconToolBar->height(); | 2112 | int y = iconToolBar->height(); |
2110 | int dX = 0; | 2113 | int dX = 0; |
2111 | int dY = 0; | 2114 | int dY = 0; |
2112 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 2115 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
2113 | if ( iconToolBar->y() > height()/2 ) { | 2116 | if ( iconToolBar->y() > height()/2 ) { |
2114 | dY = picker->sizeHint().height()+8; | 2117 | dY = picker->sizeHint().height()+8; |
2115 | y = 0; | 2118 | y = 0; |
2116 | } | 2119 | } |
2117 | } else { | 2120 | } else { |
2118 | if ( iconToolBar->x() > width()/2 ) { // right side | 2121 | if ( iconToolBar->x() > width()/2 ) { // right side |
2119 | x=0; | 2122 | x=0; |
2120 | dX= picker->sizeHint().width()+8; | 2123 | dX= picker->sizeHint().width()+8; |
2121 | y = 0; | 2124 | y = 0; |
2122 | } else { | 2125 | } else { |
2123 | x= iconToolBar->width(); | 2126 | x= iconToolBar->width(); |
2124 | y = 0; | 2127 | y = 0; |
2125 | } | 2128 | } |
2126 | } | 2129 | } |
2127 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); | 2130 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); |
2128 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) | 2131 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) |
2129 | { | 2132 | { |
2130 | month = picker->getResult(); | 2133 | month = picker->getResult(); |
2131 | emit selectWeek ( month ); | 2134 | emit selectWeek ( month ); |
2132 | //qDebug("weekSelected %d ", month); | 2135 | //qDebug("weekSelected %d ", month); |
2133 | } | 2136 | } |
2134 | delete popup; | 2137 | delete popup; |
2135 | } | 2138 | } |
2139 | |||
2140 | void MainWindow::hideEvent ( QHideEvent * ) | ||
2141 | { | ||
2142 | QString message; | ||
2143 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); | ||
2144 | if ( nextA.isValid() ) { | ||
2145 | QString sum = mCalendar->nextSummary(); | ||
2146 | |||
2147 | message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); | ||
2148 | setCaption( message ); | ||
2149 | } | ||
2150 | } | ||
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h index 7604529..b3041dc 100644 --- a/korganizer/mainwindow.h +++ b/korganizer/mainwindow.h | |||
@@ -11,150 +11,151 @@ | |||
11 | 11 | ||
12 | #include <libkcal/incidence.h> | 12 | #include <libkcal/incidence.h> |
13 | #include "simplealarmclient.h" | 13 | #include "simplealarmclient.h" |
14 | #include <ksyncmanager.h> | 14 | #include <ksyncmanager.h> |
15 | #ifndef DESKTOP_VERSION | 15 | #ifndef DESKTOP_VERSION |
16 | #include <qcopchannel_qws.h> | 16 | #include <qcopchannel_qws.h> |
17 | #endif | 17 | #endif |
18 | class QAction; | 18 | class QAction; |
19 | class CalendarView; | 19 | class CalendarView; |
20 | class KSyncProfile; | 20 | class KSyncProfile; |
21 | #ifdef DESKTOP_VERSION | 21 | #ifdef DESKTOP_VERSION |
22 | 22 | ||
23 | #define QPEToolBar QToolBar | 23 | #define QPEToolBar QToolBar |
24 | #define QPEMenuBar QMenuBar | 24 | #define QPEMenuBar QMenuBar |
25 | #endif | 25 | #endif |
26 | class QPEToolBar; | 26 | class QPEToolBar; |
27 | 27 | ||
28 | 28 | ||
29 | namespace KCal { | 29 | namespace KCal { |
30 | class CalendarLocal; | 30 | class CalendarLocal; |
31 | } | 31 | } |
32 | 32 | ||
33 | class KOMenuBar : public QMenuBar | 33 | class KOMenuBar : public QMenuBar |
34 | { | 34 | { |
35 | public: | 35 | public: |
36 | KOMenuBar( QWidget *parent=0 ): QMenuBar (parent ) {;} | 36 | KOMenuBar( QWidget *parent=0 ): QMenuBar (parent ) {;} |
37 | QSize sizeHint () const{ qDebug("sizejint ");return QSize ( 40,25 );} | 37 | QSize sizeHint () const{ qDebug("sizejint ");return QSize ( 40,25 );} |
38 | }; | 38 | }; |
39 | 39 | ||
40 | using namespace KCal; | 40 | using namespace KCal; |
41 | 41 | ||
42 | class MainWindow : public QMainWindow | 42 | class MainWindow : public QMainWindow |
43 | { | 43 | { |
44 | Q_OBJECT | 44 | Q_OBJECT |
45 | public: | 45 | public: |
46 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); | 46 | MainWindow( QWidget *parent = 0, const char *name = 0, QString command = ""); |
47 | ~MainWindow(); | 47 | ~MainWindow(); |
48 | bool beamReceiveEnabled(); | 48 | bool beamReceiveEnabled(); |
49 | static QString defaultFileName(); | 49 | static QString defaultFileName(); |
50 | static QString syncFileName(); | 50 | static QString syncFileName(); |
51 | static QString resourcePath(); | 51 | static QString resourcePath(); |
52 | public slots: | 52 | public slots: |
53 | void setCaption ( const QString & ); | 53 | void setCaption ( const QString & ); |
54 | void updateWeekNum(const KCal::DateList &); | 54 | void updateWeekNum(const KCal::DateList &); |
55 | void updateWeek(QDate); | 55 | void updateWeek(QDate); |
56 | virtual void showMaximized (); | 56 | virtual void showMaximized (); |
57 | void configureAgenda( int ); | 57 | void configureAgenda( int ); |
58 | void recieve( const QCString& msg, const QByteArray& data ); | 58 | void recieve( const QCString& msg, const QByteArray& data ); |
59 | protected slots: | 59 | protected slots: |
60 | void setCaptionToDates(); | 60 | void setCaptionToDates(); |
61 | void weekAction(); | 61 | void weekAction(); |
62 | void about(); | 62 | void about(); |
63 | void licence(); | 63 | void licence(); |
64 | void faq(); | 64 | void faq(); |
65 | void usertrans(); | 65 | void usertrans(); |
66 | void features(); | 66 | void features(); |
67 | void synchowto(); | 67 | void synchowto(); |
68 | void kdesynchowto(); | 68 | void kdesynchowto(); |
69 | void multisynchowto(); | 69 | void multisynchowto(); |
70 | void whatsNew(); | 70 | void whatsNew(); |
71 | void keyBindings(); | 71 | void keyBindings(); |
72 | void aboutAutoSaving();; | 72 | void aboutAutoSaving();; |
73 | void aboutKnownBugs(); | 73 | void aboutKnownBugs(); |
74 | 74 | ||
75 | void processIncidenceSelection( Incidence * ); | 75 | void processIncidenceSelection( Incidence * ); |
76 | 76 | ||
77 | void importQtopia(); | 77 | void importQtopia(); |
78 | void importBday(); | 78 | void importBday(); |
79 | void importOL(); | 79 | void importOL(); |
80 | void importIcal(); | 80 | void importIcal(); |
81 | void importFile( QString, bool ); | 81 | void importFile( QString, bool ); |
82 | void quickImportIcal(); | 82 | void quickImportIcal(); |
83 | 83 | ||
84 | void slotModifiedChanged( bool ); | 84 | void slotModifiedChanged( bool ); |
85 | 85 | ||
86 | void save(); | 86 | void save(); |
87 | void saveStopTimer(); | 87 | void saveStopTimer(); |
88 | void configureToolBar( int ); | 88 | void configureToolBar( int ); |
89 | void printSel(); | 89 | void printSel(); |
90 | void printCal(); | 90 | void printCal(); |
91 | void saveCalendar(); | 91 | void saveCalendar(); |
92 | void loadCalendar(); | 92 | void loadCalendar(); |
93 | void exportVCalendar(); | 93 | void exportVCalendar(); |
94 | void fillFilterMenu(); | 94 | void fillFilterMenu(); |
95 | void selectFilter( int ); | 95 | void selectFilter( int ); |
96 | void exportToPhone( int ); | 96 | void exportToPhone( int ); |
97 | void toggleBeamReceive(); | 97 | void toggleBeamReceive(); |
98 | void disableBR(bool); | 98 | void disableBR(bool); |
99 | signals: | 99 | signals: |
100 | void selectWeek ( int ); | 100 | void selectWeek ( int ); |
101 | private slots: | 101 | private slots: |
102 | void showConfigureAgenda(); | 102 | void showConfigureAgenda(); |
103 | void getFile( bool ); | 103 | void getFile( bool ); |
104 | void syncFileRequest(); | 104 | void syncFileRequest(); |
105 | 105 | ||
106 | protected: | 106 | protected: |
107 | void hideEvent ( QHideEvent * ); | ||
107 | QString sentSyncFile(); | 108 | QString sentSyncFile(); |
108 | void displayText( QString, QString); | 109 | void displayText( QString, QString); |
109 | void enableIncidenceActions( bool ); | 110 | void enableIncidenceActions( bool ); |
110 | 111 | ||
111 | private: | 112 | private: |
112 | bool mBRdisabled; | 113 | bool mBRdisabled; |
113 | #ifndef DESKTOP_VERSION | 114 | #ifndef DESKTOP_VERSION |
114 | QCopChannel* infrared; | 115 | QCopChannel* infrared; |
115 | #endif | 116 | #endif |
116 | QAction* brAction; | 117 | QAction* brAction; |
117 | KSyncManager* mSyncManager; | 118 | KSyncManager* mSyncManager; |
118 | bool mClosed; | 119 | bool mClosed; |
119 | void saveOnClose(); | 120 | void saveOnClose(); |
120 | bool mFlagKeyPressed; | 121 | bool mFlagKeyPressed; |
121 | bool mBlockAtStartup; | 122 | bool mBlockAtStartup; |
122 | QPEToolBar *iconToolBar; | 123 | QPEToolBar *iconToolBar; |
123 | void initActions(); | 124 | void initActions(); |
124 | void setDefaultPreferences(); | 125 | void setDefaultPreferences(); |
125 | void keyPressEvent ( QKeyEvent * ) ; | 126 | void keyPressEvent ( QKeyEvent * ) ; |
126 | void keyReleaseEvent ( QKeyEvent * ) ; | 127 | void keyReleaseEvent ( QKeyEvent * ) ; |
127 | QPopupMenu *configureToolBarMenu; | 128 | QPopupMenu *configureToolBarMenu; |
128 | QPopupMenu *selectFilterMenu; | 129 | QPopupMenu *selectFilterMenu; |
129 | QPopupMenu *configureAgendaMenu, *syncMenu; | 130 | QPopupMenu *configureAgendaMenu, *syncMenu; |
130 | CalendarLocal *mCalendar; | 131 | CalendarLocal *mCalendar; |
131 | CalendarView *mView; | 132 | CalendarView *mView; |
132 | QAction *mNewSubTodoAction; | 133 | QAction *mNewSubTodoAction; |
133 | QAction *mWeekAction; | 134 | QAction *mWeekAction; |
134 | QFont mWeekFont; | 135 | QFont mWeekFont; |
135 | QPixmap mWeekPixmap; | 136 | QPixmap mWeekPixmap; |
136 | QColor mWeekBgColor; | 137 | QColor mWeekBgColor; |
137 | 138 | ||
138 | QAction *mShowAction; | 139 | QAction *mShowAction; |
139 | QAction *mEditAction; | 140 | QAction *mEditAction; |
140 | QAction *mDeleteAction; | 141 | QAction *mDeleteAction; |
141 | QAction *mCloneAction; | 142 | QAction *mCloneAction; |
142 | QAction *mMoveAction; | 143 | QAction *mMoveAction; |
143 | QAction *mBeamAction; | 144 | QAction *mBeamAction; |
144 | QAction *mCancelAction; | 145 | QAction *mCancelAction; |
145 | 146 | ||
146 | QAction *mToggleNav; | 147 | QAction *mToggleNav; |
147 | QAction *mToggleFilter; | 148 | QAction *mToggleFilter; |
148 | QAction *mToggleAllday; | 149 | QAction *mToggleAllday; |
149 | 150 | ||
150 | 151 | ||
151 | void closeEvent( QCloseEvent* ce ); | 152 | void closeEvent( QCloseEvent* ce ); |
152 | SimpleAlarmClient mAlarmClient; | 153 | SimpleAlarmClient mAlarmClient; |
153 | QTimer mSaveTimer; | 154 | QTimer mSaveTimer; |
154 | //bool mBlockSaveFlag; | 155 | //bool mBlockSaveFlag; |
155 | bool mCalendarModifiedFlag; | 156 | bool mCalendarModifiedFlag; |
156 | QPixmap loadPixmap( QString ); | 157 | QPixmap loadPixmap( QString ); |
157 | }; | 158 | }; |
158 | 159 | ||
159 | 160 | ||
160 | #endif | 161 | #endif |