-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 32 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 34 |
3 files changed, 32 insertions, 36 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index c6cd0ae..a8035d4 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1011,193 +1011,193 @@ | |||
1011 | { "<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n","<p><b>shift+P</b>: Mache Todo zum neuen <b>P</b>arent Todo für das Todo, welches mit shift+Sselektiert wurde.</p>\n" }, | 1011 | { "<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n","<p><b>shift+P</b>: Mache Todo zum neuen <b>P</b>arent Todo für das Todo, welches mit shift+Sselektiert wurde.</p>\n" }, |
1012 | { "<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n","<p><b>shift+S</b>: Mache Todo zum <b>S</b>ubtodo</p>\n" }, | 1012 | { "<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n","<p><b>shift+S</b>: Mache Todo zum <b>S</b>ubtodo</p>\n" }, |
1013 | { "<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n","<p><b>shift+U</b>: <b>U</b>nparent Todo (Mache Sub-Todo zum Toplevel Todo)</p>\n" }, | 1013 | { "<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n","<p><b>shift+U</b>: <b>U</b>nparent Todo (Mache Sub-Todo zum Toplevel Todo)</p>\n" }, |
1014 | { "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, | 1014 | { "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, |
1015 | { "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, | 1015 | { "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, |
1016 | { "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, | 1016 | { "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, |
1017 | { "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, | 1017 | { "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, |
1018 | { "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, | 1018 | { "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, |
1019 | { "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" }, | 1019 | { "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" }, |
1020 | { "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" }, | 1020 | { "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" }, |
1021 | { "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, | 1021 | { "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, |
1022 | { "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, | 1022 | { "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, |
1023 | { "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" }, | 1023 | { "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" }, |
1024 | { "<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X</b>: Zeige/verstecke Datumsnavigator</p>\n" }, | 1024 | { "<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X</b>: Zeige/verstecke Datumsnavigator</p>\n" }, |
1025 | { "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" }, | 1025 | { "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" }, |
1026 | { "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" }, | 1026 | { "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" }, |
1027 | { "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monatsansicht</p>\n" }, | 1027 | { "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monatsansicht</p>\n" }, |
1028 | { "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochenansicht | <b>U</b>: Wochenansicht</p>\n" }, | 1028 | { "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochenansicht | <b>U</b>: Wochenansicht</p>\n" }, |
1029 | { "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" }, | 1029 | { "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" }, |
1030 | { "<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ","<p><b>N</b>: Nächste-Tage Ansicht | <b>W</b>: What's Next Ansicht\n " }, | 1030 | { "<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ","<p><b>N</b>: Nächste-Tage Ansicht | <b>W</b>: What's Next Ansicht\n " }, |
1031 | { "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" }, | 1031 | { "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" }, |
1032 | { "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" }, | 1032 | { "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" }, |
1033 | { "<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n","<p><b>F</b>: Zeige/verstecke Filter Ansicht |<b>F+ctrl</b>: Editiere Filter </p>\n" }, | 1033 | { "<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n","<p><b>F</b>: Zeige/verstecke Filter Ansicht |<b>F+ctrl</b>: Editiere Filter </p>\n" }, |
1034 | { "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" }, | 1034 | { "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" }, |
1035 | { "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" }, | 1035 | { "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" }, |
1036 | { "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" }, | 1036 | { "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" }, |
1037 | { "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, | 1037 | { "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, |
1038 | { "After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" }, | 1038 | { "After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" }, |
1039 | { "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, | 1039 | { "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, |
1040 | { "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, | 1040 | { "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, |
1041 | { "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, | 1041 | { "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, |
1042 | { "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" }, | 1042 | { "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" }, |
1043 | { "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" }, | 1043 | { "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" }, |
1044 | { "1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" }, | 1044 | { "1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" }, |
1045 | { "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, | 1045 | { "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, |
1046 | { "KO/Pi FAQ","KO/Pi FAQ" }, | 1046 | { "KO/Pi FAQ","KO/Pi FAQ" }, |
1047 | { "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, | 1047 | { "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, |
1048 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, | 1048 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, |
1049 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, | 1049 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, |
1050 | { "From: ","Von: " }, | 1050 | { "From: ","Von: " }, |
1051 | { "Remove sync info","Entferne Sync Info" }, | 1051 | { "Remove sync info","Entferne Sync Info" }, |
1052 | { "For all profiles","Für alle Profile" }, | 1052 | { "For all profiles","Für alle Profile" }, |
1053 | { "Hide not Running","Verstecke nicht Laufende" }, | 1053 | { "Hide not Running","Verstecke nicht Laufende" }, |
1054 | { "ME","ME" }, | 1054 | { "ME","ME" }, |
1055 | { "Toolbar","Toolbar" }, | 1055 | { "Toolbar","Toolbar" }, |
1056 | { "Undo Delete...","Löschen rückgängig machen..." }, | 1056 | { "Undo Delete...","Löschen rückgängig machen..." }, |
1057 | { "Undo Delete","Löschen rückgängig machen" }, | 1057 | { "Undo Delete","Löschen rückgängig machen" }, |
1058 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, | 1058 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, |
1059 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, | 1059 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, |
1060 | { "Januar","Januar" }, | 1060 | { "Januar","Januar" }, |
1061 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, | 1061 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, |
1062 | { "No Filter","Kein Filter" }, | 1062 | { "No Filter","Kein Filter" }, |
1063 | { "Multiple Sync options","Multi Sync Optionen" }, | 1063 | { "Multiple Sync options","Multi Sync Optionen" }, |
1064 | { "Sync algo options","Sync Ablauf Optionen" }, | 1064 | { "Sync algo options","Sync Ablauf Optionen" }, |
1065 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, | 1065 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, |
1066 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, | 1066 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, |
1067 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, | 1067 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, |
1068 | { "Write back options","Optionen zum Zurückschreiben" }, | 1068 | { "Write back options","Optionen zum Zurückschreiben" }, |
1069 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, | 1069 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, |
1070 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, | 1070 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, |
1071 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, | 1071 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, |
1072 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, | 1072 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, |
1073 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, | 1073 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, |
1074 | { "Time period","Zeitspanne" }, | 1074 | { "Time period","Zeitspanne" }, |
1075 | { "From ","Von " }, | 1075 | { "From ","Von " }, |
1076 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, | 1076 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, |
1077 | { " weeks in the future "," Wochen in der Zukunft " }, | 1077 | { " weeks in the future "," Wochen in der Zukunft " }, |
1078 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, | 1078 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, |
1079 | { "Local temp file:","Lokale temp Datei:" }, | 1079 | { "Local temp file:","Lokale temp Datei:" }, |
1080 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, | 1080 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, |
1081 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, | 1081 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, |
1082 | { "Language","Sprache" }, | 1082 | { "Language","Sprache" }, |
1083 | { "Time Format","Zeit Format" }, | 1083 | { "Time Format","Zeit Format" }, |
1084 | { "Time Zone","Zeit Zone" }, | 1084 | { "Time Zone","Zeit Zone" }, |
1085 | { "%1 groups subscribed","%1 Guppen abboniert" }, | 1085 | { "%1 groups subscribed","%1 Guppen abboniert" }, |
1086 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, | 1086 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, |
1087 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, | 1087 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, |
1088 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, | 1088 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, |
1089 | { "Save settings","Speichere Einstellungen" }, | 1089 | { "Save settings","Speichere Einstellungen" }, |
1090 | { "Save standard","Speichere Standard" }, | 1090 | { "Save standard","Speichere Standard" }, |
1091 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, | 1091 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, |
1092 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, | 1092 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, |
1093 | { "Data storage path","Daten Speicherpfad" }, | 1093 | { "Data storage path","Daten Speicherpfad" }, |
1094 | { "Language","Sprache" }, | 1094 | { "Language","Sprache" }, |
1095 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, | 1095 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, |
1096 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, | 1096 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, |
1097 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, | 1097 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, |
1098 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, | 1098 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, |
1099 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, | 1099 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, |
1100 | { "KO/Pi","KO/Pi" }, | 1100 | { "KO/Pi","KO/Pi" }, |
1101 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, | 1101 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, |
1102 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, | 1102 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, |
1103 | { "Sound.Al.: ","Sound.Al.: " }, | 1103 | { "Sound.Al.: ","Sound.Al.: " }, |
1104 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, | 1104 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, |
1105 | { "Restore","Wiederherstellen" }, | 1105 | { "Restore","Wiederherstellen" }, |
1106 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, | 1106 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, |
1107 | { "% completed","% komplett" }, | 1107 | { "% completed","% erledigt" }, |
1108 | { "%d item(s) found.","%d Item(s) gefunden." }, | 1108 | { "%d item(s) found.","%d Item(s) gefunden." }, |
1109 | { "Set complete","Setze auf erledigt" }, | 1109 | { "Set complete","Setze auf erledigt" }, |
1110 | { "(cancelled)","(gecancelt)" }, | 1110 | { "(cancelled)","(gecancelt)" }, |
1111 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, | 1111 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, |
1112 | { " Local time "," Locale Zeit " }, | 1112 | { " Local time "," Locale Zeit " }, |
1113 | { "Form2","Form2" }, | 1113 | { "Form2","Form2" }, |
1114 | { "Filter enabled","Filter angeschaltet" }, | 1114 | { "Filter enabled","Filter angeschaltet" }, |
1115 | { "Edit Filters","Ändere Filter" }, | 1115 | { "Edit Filters","Ändere Filter" }, |
1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, | 1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, |
1117 | { "Agenda","Agenda" }, | 1117 | { "Agenda","Agenda" }, |
1118 | { " ("," (" }, | 1118 | { " ("," (" }, |
1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, | 1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, |
1120 | { "Print","Print" }, | 1120 | { "Print","Print" }, |
1121 | { "&Setup Printer...","Drucker &Setup..." }, | 1121 | { "&Setup Printer...","Drucker &Setup..." }, |
1122 | { "View Type","Zeige Typ" }, | 1122 | { "View Type","Zeige Typ" }, |
1123 | { "Page &orientation:","Seiten Ausrichtung:" }, | 1123 | { "Page &orientation:","Seiten Ausrichtung:" }, |
1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, | 1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, |
1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, | 1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, |
1126 | { "Portrait","Portrait" }, | 1126 | { "Portrait","Portrait" }, |
1127 | { "Landscape","Landschaft" }, | 1127 | { "Landscape","Landschaft" }, |
1128 | { "Print day","Drucke Tag" }, | 1128 | { "Print day","Drucke Tag" }, |
1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, | 1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, |
1130 | { "Date && Time Range","Datum && Zeitspanne" }, | 1130 | { "Date && Time Range","Datum && Zeitspanne" }, |
1131 | { "&End date:","&Enddatum:" }, | 1131 | { "&End date:","&Enddatum:" }, |
1132 | { "&Start date:","&Startdatum:" }, | 1132 | { "&Start date:","&Startdatum:" }, |
1133 | { "Start &time:","Startzeit:" }, | 1133 | { "Start &time:","Startzeit:" }, |
1134 | { "End ti&me:","Endzeit:" }, | 1134 | { "End ti&me:","Endzeit:" }, |
1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, | 1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, |
1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, | 1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, |
1137 | { "Alt+D","Alt+D" }, | 1137 | { "Alt+D","Alt+D" }, |
1138 | { "&Use colors","Nutze Farben" }, | 1138 | { "&Use colors","Nutze Farben" }, |
1139 | { "Alt+U","Alt+U" }, | 1139 | { "Alt+U","Alt+U" }, |
1140 | { "Print week","Drucke Woche" }, | 1140 | { "Print week","Drucke Woche" }, |
1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, | 1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, |
1142 | { "Use &colors","Nutze Farben" }, | 1142 | { "Use &colors","Nutze Farben" }, |
1143 | { "Type of View","Typ der Ansicht" }, | 1143 | { "Type of View","Typ der Ansicht" }, |
1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, | 1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, |
1145 | { "Alt+F","Alt+F" }, | 1145 | { "Alt+F","Alt+F" }, |
1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, | 1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, |
1147 | { "Alt+T","Alt+T" }, | 1147 | { "Alt+T","Alt+T" }, |
1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, | 1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, |
1149 | { "Print month","Drucke Monat" }, | 1149 | { "Print month","Drucke Monat" }, |
1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, | 1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, |
1151 | { "&Start month:","&Startmonat:" }, | 1151 | { "&Start month:","&Startmonat:" }, |
1152 | { "&End month:","&Endmonat:" }, | 1152 | { "&End month:","&Endmonat:" }, |
1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, | 1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, |
1154 | { "Print todos","Drucke Todos" }, | 1154 | { "Print todos","Drucke Todos" }, |
1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, | 1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, |
1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, | 1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, |
1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, | 1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, |
1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, | 1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, |
1159 | { "Items to Print","Zu druckende Items" }, | 1159 | { "Items to Print","Zu druckende Items" }, |
1160 | { "&From:","Von:" }, | 1160 | { "&From:","Von:" }, |
1161 | { "&To:","Bis:" }, | 1161 | { "&To:","Bis:" }, |
1162 | { "Print &all todo items","Drucke alle Todo Items" }, | 1162 | { "Print &all todo items","Drucke alle Todo Items" }, |
1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, | 1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, |
1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, | 1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, |
1165 | { "Todo List","Todo Liste" }, | 1165 | { "Todo List","Todo Liste" }, |
1166 | { "&Title:","&Titel:" }, | 1166 | { "&Title:","&Titel:" }, |
1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, | 1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, |
1168 | { "Todo list","Todo Liste" }, | 1168 | { "Todo list","Todo Liste" }, |
1169 | { "&Print...","Drucke..." }, | 1169 | { "&Print...","Drucke..." }, |
1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1171 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1171 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1172 | { "OK","OK" }, | 1172 | { "OK","OK" }, |
1173 | { "FilterEditor","FilterEditor" }, | 1173 | { "FilterEditor","FilterEditor" }, |
1174 | { "Include","Inclusive" }, | 1174 | { "Include","Inclusive" }, |
1175 | { "Exclude","Exclusive" }, | 1175 | { "Exclude","Exclusive" }, |
1176 | { "Edit Selection...","Editiere Auswahl" }, | 1176 | { "Edit Selection...","Editiere Auswahl" }, |
1177 | { "recurring events","wiederholende Termine" }, | 1177 | { "recurring events","wiederholende Termine" }, |
1178 | { "recurr. events","wiederh.Termine" }, | 1178 | { "recurr. events","wiederh.Termine" }, |
1179 | { "completed to-dos","erledigte Todos" }, | 1179 | { "completed to-dos","erledigte Todos" }, |
1180 | { "events","Termine" }, | 1180 | { "events","Termine" }, |
1181 | { "todos","Todos" }, | 1181 | { "todos","Todos" }, |
1182 | { "journals","Journale" }, | 1182 | { "journals","Journale" }, |
1183 | { "public","öffentl." }, | 1183 | { "public","öffentl." }, |
1184 | { "private","privat" }, | 1184 | { "private","privat" }, |
1185 | { "confidential","vertraul." }, | 1185 | { "confidential","vertraul." }, |
1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, | 1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, |
1187 | { "Yesterday","Gestern" }, | 1187 | { "Yesterday","Gestern" }, |
1188 | { "Day after tomorrow","Übermorgen" }, | 1188 | { "Day after tomorrow","Übermorgen" }, |
1189 | { "Tomorrow","Morgen" }, | 1189 | { "Tomorrow","Morgen" }, |
1190 | { "Day before yesterday","Vorgestern" }, | 1190 | { "Day before yesterday","Vorgestern" }, |
1191 | { "Size %1","Größe %1" }, | 1191 | { "Size %1","Größe %1" }, |
1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1193 | { " (%1 y.)"," (%1 J.)" }, | 1193 | { " (%1 y.)"," (%1 J.)" }, |
1194 | { "Allday:","Ganztägig:" }, | 1194 | { "Allday:","Ganztägig:" }, |
1195 | { "compl.todos","erled.Todos" }, | 1195 | { "compl.todos","erled.Todos" }, |
1196 | { "Day view","Tagesansicht" }, | 1196 | { "Day view","Tagesansicht" }, |
1197 | { "Next days","Nächste Tage" }, | 1197 | { "Next days","Nächste Tage" }, |
1198 | { "Next week","Nächste Woche" }, | 1198 | { "Next week","Nächste Woche" }, |
1199 | { "Next two weeks","Nächste zwei Wochen" }, | 1199 | { "Next two weeks","Nächste zwei Wochen" }, |
1200 | { "Next month","Nächster Monat" }, | 1200 | { "Next month","Nächster Monat" }, |
1201 | { "Journal view","Journal" }, | 1201 | { "Journal view","Journal" }, |
1202 | { "Display all opened","Zeige alle geöffnet" }, | 1202 | { "Display all opened","Zeige alle geöffnet" }, |
1203 | { "Display all closed","Zeige alle geschlossen" }, | 1203 | { "Display all closed","Zeige alle geschlossen" }, |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 5508210..f287216 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -34,217 +34,229 @@ | |||
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | #include <qtooltip.h> | 35 | #include <qtooltip.h> |
36 | #include <qpainter.h> | 36 | #include <qpainter.h> |
37 | #include <qpushbutton.h> | 37 | #include <qpushbutton.h> |
38 | #include <qapplication.h> | 38 | #include <qapplication.h> |
39 | 39 | ||
40 | #include <kapplication.h> | 40 | #include <kapplication.h> |
41 | #include <KDGanttMinimizeSplitter.h> | 41 | #include <KDGanttMinimizeSplitter.h> |
42 | #include <kdebug.h> | 42 | #include <kdebug.h> |
43 | #include <kstandarddirs.h> | 43 | #include <kstandarddirs.h> |
44 | #include <kiconloader.h> | 44 | #include <kiconloader.h> |
45 | #include <klocale.h> | 45 | #include <klocale.h> |
46 | #include <kconfig.h> | 46 | #include <kconfig.h> |
47 | #include <kglobal.h> | 47 | #include <kglobal.h> |
48 | #include "calendarview.h" | 48 | #include "calendarview.h" |
49 | #include "koviewmanager.h" | 49 | #include "koviewmanager.h" |
50 | 50 | ||
51 | #include <libkcal/calendar.h> | 51 | #include <libkcal/calendar.h> |
52 | #include <libkcal/icaldrag.h> | 52 | #include <libkcal/icaldrag.h> |
53 | #include <libkcal/dndfactory.h> | 53 | #include <libkcal/dndfactory.h> |
54 | 54 | ||
55 | #include <kcalendarsystem.h> | 55 | #include <kcalendarsystem.h> |
56 | 56 | ||
57 | #include "koglobals.h" | 57 | #include "koglobals.h" |
58 | #ifndef KORG_NOPLUGINS | 58 | #ifndef KORG_NOPLUGINS |
59 | #include "kocore.h" | 59 | #include "kocore.h" |
60 | #endif | 60 | #endif |
61 | #include "koprefs.h" | 61 | #include "koprefs.h" |
62 | #include "koagenda.h" | 62 | #include "koagenda.h" |
63 | #include "koagendaitem.h" | 63 | #include "koagendaitem.h" |
64 | #ifndef KORG_NOPRINTER | 64 | #ifndef KORG_NOPRINTER |
65 | #include "calprinter.h" | 65 | #include "calprinter.h" |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #include "koagendaview.h" | 68 | #include "koagendaview.h" |
69 | //#include "koagendaview.moc" | 69 | //#include "koagendaview.moc" |
70 | 70 | ||
71 | //extern bool globalFlagBlockPainting; | 71 | //extern bool globalFlagBlockPainting; |
72 | extern int globalFlagBlockAgenda; | 72 | extern int globalFlagBlockAgenda; |
73 | extern int globalFlagBlockStartup; | 73 | extern int globalFlagBlockStartup; |
74 | extern int globalFlagBlockAgendaItemPaint; | 74 | extern int globalFlagBlockAgendaItemPaint; |
75 | extern int globalFlagBlockAgendaItemUpdate; | 75 | extern int globalFlagBlockAgendaItemUpdate; |
76 | extern int globalFlagBlockLabel; | 76 | extern int globalFlagBlockLabel; |
77 | using namespace KOrg; | 77 | using namespace KOrg; |
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
81 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : | 81 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : |
82 | QScrollView(parent,name,f) | 82 | QScrollView(parent,name,f) |
83 | { | 83 | { |
84 | mRows = rows; | 84 | mRows = rows; |
85 | 85 | ||
86 | setMinimumHeight( 20 ); | 86 | setMinimumHeight( 20 ); |
87 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 87 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
88 | 88 | ||
89 | enableClipper(true); | 89 | enableClipper(true); |
90 | 90 | ||
91 | setHScrollBarMode(AlwaysOff); | 91 | setHScrollBarMode(AlwaysOff); |
92 | setVScrollBarMode(AlwaysOff); | 92 | setVScrollBarMode(AlwaysOff); |
93 | 93 | ||
94 | resizeContents(50,mRows * mCellHeight); | 94 | resizeContents(50,mRows * mCellHeight); |
95 | 95 | ||
96 | viewport()->setBackgroundMode( PaletteBackground ); | 96 | viewport()->setBackgroundMode( PaletteBackground ); |
97 | } | 97 | } |
98 | 98 | ||
99 | void TimeLabels::setCellHeight(int height) | 99 | void TimeLabels::setCellHeight(int height) |
100 | { | 100 | { |
101 | mCellHeight = height; | 101 | mCellHeight = height; |
102 | } | 102 | } |
103 | 103 | ||
104 | /* | 104 | /* |
105 | Optimization so that only the "dirty" portion of the scroll view | 105 | Optimization so that only the "dirty" portion of the scroll view |
106 | is redrawn. Unfortunately, this is not called by default paintEvent() method. | 106 | is redrawn. Unfortunately, this is not called by default paintEvent() method. |
107 | */ | 107 | */ |
108 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | 108 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) |
109 | { | 109 | { |
110 | 110 | ||
111 | // if ( globalFlagBlockAgenda ) | 111 | // if ( globalFlagBlockAgenda ) |
112 | // return; | 112 | // return; |
113 | // bug: the parameters cx, cy, cw, ch are the areas that need to be | 113 | // bug: the parameters cx, cy, cw, ch are the areas that need to be |
114 | // redrawn, not the area of the widget. unfortunately, this | 114 | // redrawn, not the area of the widget. unfortunately, this |
115 | // code assumes the latter... | 115 | // code assumes the latter... |
116 | 116 | ||
117 | // now, for a workaround... | 117 | // now, for a workaround... |
118 | // these two assignments fix the weird redraw bug | 118 | // these two assignments fix the weird redraw bug |
119 | cx = contentsX() + 2; | 119 | cx = contentsX() + 2; |
120 | cw = contentsWidth() - 2; | 120 | cw = contentsWidth() - 2; |
121 | // end of workaround | 121 | // end of workaround |
122 | 122 | ||
123 | int cell = ((int)(cy/mCellHeight)); | 123 | int cell = ((int)(cy/mCellHeight)); |
124 | int y = cell * mCellHeight; | 124 | int y = cell * mCellHeight; |
125 | QFontMetrics fm = fontMetrics(); | 125 | QFontMetrics fm = fontMetrics(); |
126 | QString hour; | 126 | QString hour; |
127 | QString suffix; | 127 | QString suffix; |
128 | QString fullTime; | 128 | QString fullTime; |
129 | int tW = fm.width("24:00i"); | 129 | int tW = fm.width("24:00i"); |
130 | int timeHeight = fm.height(); | ||
131 | if ( timeHeight > mCellHeight ) | ||
132 | timeHeight = mCellHeight-1; | ||
133 | int borderWidth = 5; | ||
134 | QFont nFont = p->font(); | ||
135 | QFont sFont = nFont; | ||
136 | sFont.setPointSize( sFont.pointSize()/2+2 ); | ||
137 | if (!KGlobal::locale()->use12Clock()) | ||
138 | suffix = "00"; | ||
139 | QFontMetrics fmS( sFont ); | ||
140 | int sHei = fmS.height(); | ||
130 | 141 | ||
131 | while (y < cy + ch) { | 142 | while (y < cy + ch) { |
132 | p->drawLine(cx,y,cx+tW,y); | 143 | p->drawLine(cx,y,cx+tW,y); |
133 | hour.setNum(cell); | 144 | hour.setNum(cell); |
134 | suffix = "am"; | ||
135 | 145 | ||
136 | // handle 24h and am/pm time formats | 146 | // handle 24h and am/pm time formats |
137 | if (KGlobal::locale()->use12Clock()) { | 147 | if (KGlobal::locale()->use12Clock()) { |
138 | if (cell > 11) suffix = "pm"; | 148 | if (cell > 11) suffix = "pm"; |
149 | else | ||
150 | suffix = "am"; | ||
139 | if (cell == 0) hour.setNum(12); | 151 | if (cell == 0) hour.setNum(12); |
140 | if (cell > 12) hour.setNum(cell - 12); | 152 | if (cell > 12) hour.setNum(cell - 12); |
141 | } else { | ||
142 | suffix = ":00"; | ||
143 | } | 153 | } |
144 | 154 | ||
145 | // create string in format of "XX:XX" or "XXpm/am" | 155 | // create string in format of "XX:XX" or "XXpm/am" |
146 | fullTime = hour + suffix; | 156 | fullTime = hour;// + suffix; |
147 | 157 | ||
148 | // center and draw the time label | 158 | // center and draw the time label |
149 | int timeWidth = fm.width(fullTime+"i"); | 159 | int timeWidth = fm.width(fullTime+"i"); |
150 | int offset = this->width() - timeWidth; | 160 | int tw2 = fm.width(suffix); |
151 | int borderWidth = 5; | 161 | int offset = this->width() - timeWidth - tw2; |
152 | int timeHeight = fm.height(); | 162 | p->setFont( nFont ); |
153 | timeHeight = timeHeight + 2 - ( timeHeight / 4 ); | 163 | p->drawText(cx - borderWidth + offset, y+ timeHeight, fullTime); |
154 | p->drawText(cx -borderWidth + offset, y+ timeHeight, fullTime); | 164 | p->setFont( sFont ); |
165 | offset += timeWidth; | ||
166 | p->drawText(cx - borderWidth + offset, y+ sHei, suffix); | ||
155 | 167 | ||
156 | // increment indices | 168 | // increment indices |
157 | y += mCellHeight; | 169 | y += mCellHeight; |
158 | cell++; | 170 | cell++; |
159 | } | 171 | } |
160 | } | 172 | } |
161 | 173 | ||
162 | /** | 174 | /** |
163 | Calculates the minimum width. | 175 | Calculates the minimum width. |
164 | */ | 176 | */ |
165 | int TimeLabels::minimumWidth() const | 177 | int TimeLabels::minimumWidth() const |
166 | { | 178 | { |
167 | QFontMetrics fm = fontMetrics(); | 179 | QFontMetrics fm = fontMetrics(); |
168 | 180 | ||
169 | //TODO: calculate this value | 181 | //TODO: calculate this value |
170 | int borderWidth = 4; | 182 | int borderWidth = 4; |
171 | 183 | ||
172 | // the maximum width possible | 184 | // the maximum width possible |
173 | int width = fm.width("88:88x") + borderWidth; | 185 | int width = fm.width("88:88x") + borderWidth; |
174 | 186 | ||
175 | return width; | 187 | return width; |
176 | } | 188 | } |
177 | 189 | ||
178 | /** updates widget's internal state */ | 190 | /** updates widget's internal state */ |
179 | void TimeLabels::updateConfig() | 191 | void TimeLabels::updateConfig() |
180 | { | 192 | { |
181 | // set the font | 193 | // set the font |
182 | // config->setGroup("Fonts"); | 194 | // config->setGroup("Fonts"); |
183 | // QFont font = config->readFontEntry("TimeBar Font"); | 195 | // QFont font = config->readFontEntry("TimeBar Font"); |
184 | setFont(KOPrefs::instance()->mTimeBarFont); | 196 | setFont(KOPrefs::instance()->mTimeBarFont); |
185 | 197 | ||
186 | // update geometry restrictions based on new settings | 198 | // update geometry restrictions based on new settings |
187 | setFixedWidth(minimumWidth()); | 199 | setFixedWidth(minimumWidth()); |
188 | 200 | ||
189 | // update HourSize | 201 | // update HourSize |
190 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 202 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
191 | resizeContents(50,mRows * mCellHeight); | 203 | resizeContents(50,mRows * mCellHeight); |
192 | } | 204 | } |
193 | 205 | ||
194 | /** update time label positions */ | 206 | /** update time label positions */ |
195 | void TimeLabels::positionChanged() | 207 | void TimeLabels::positionChanged() |
196 | { | 208 | { |
197 | int adjustment = mAgenda->contentsY(); | 209 | int adjustment = mAgenda->contentsY(); |
198 | setContentsPos(0, adjustment); | 210 | setContentsPos(0, adjustment); |
199 | } | 211 | } |
200 | 212 | ||
201 | /** */ | 213 | /** */ |
202 | void TimeLabels::setAgenda(KOAgenda* agenda) | 214 | void TimeLabels::setAgenda(KOAgenda* agenda) |
203 | { | 215 | { |
204 | mAgenda = agenda; | 216 | mAgenda = agenda; |
205 | } | 217 | } |
206 | 218 | ||
207 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) | 219 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) |
208 | { | 220 | { |
209 | mMouseDownY = e->pos().y(); | 221 | mMouseDownY = e->pos().y(); |
210 | mOrgCap = topLevelWidget()->caption(); | 222 | mOrgCap = topLevelWidget()->caption(); |
211 | } | 223 | } |
212 | 224 | ||
213 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) | 225 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) |
214 | { | 226 | { |
215 | int diff = mMouseDownY - e->pos().y(); | 227 | int diff = mMouseDownY - e->pos().y(); |
216 | if ( diff < 10 && diff > -10 ) | 228 | if ( diff < 10 && diff > -10 ) |
217 | return; | 229 | return; |
218 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; | 230 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; |
219 | if ( tSize < 4 ) | 231 | if ( tSize < 4 ) |
220 | tSize = 4; | 232 | tSize = 4; |
221 | if ( tSize > 22 ) | 233 | if ( tSize > 22 ) |
222 | tSize = 22; | 234 | tSize = 22; |
223 | tSize = (tSize-2)/2; | 235 | tSize = (tSize-2)/2; |
224 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); | 236 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); |
225 | 237 | ||
226 | } | 238 | } |
227 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) | 239 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) |
228 | { | 240 | { |
229 | topLevelWidget()->setCaption( mOrgCap ); | 241 | topLevelWidget()->setCaption( mOrgCap ); |
230 | int diff = mMouseDownY - e->pos().y(); | 242 | int diff = mMouseDownY - e->pos().y(); |
231 | if ( diff < 10 && diff > -10 ) | 243 | if ( diff < 10 && diff > -10 ) |
232 | return; | 244 | return; |
233 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); | 245 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); |
234 | if ( tSize < 4 ) | 246 | if ( tSize < 4 ) |
235 | tSize = 4; | 247 | tSize = 4; |
236 | if ( tSize > 22 ) | 248 | if ( tSize > 22 ) |
237 | tSize = 22; | 249 | tSize = 22; |
238 | tSize = (tSize/2)*2; | 250 | tSize = (tSize/2)*2; |
239 | if ( tSize == KOPrefs::instance()->mHourSize ) | 251 | if ( tSize == KOPrefs::instance()->mHourSize ) |
240 | return; | 252 | return; |
241 | KOPrefs::instance()->mHourSize = tSize; | 253 | KOPrefs::instance()->mHourSize = tSize; |
242 | emit scaleChanged(); | 254 | emit scaleChanged(); |
243 | } | 255 | } |
244 | 256 | ||
245 | /** This is called in response to repaint() */ | 257 | /** This is called in response to repaint() */ |
246 | void TimeLabels::paintEvent(QPaintEvent*) | 258 | void TimeLabels::paintEvent(QPaintEvent*) |
247 | { | 259 | { |
248 | 260 | ||
249 | // kdDebug() << "paintevent..." << endl; | 261 | // kdDebug() << "paintevent..." << endl; |
250 | // this is another hack! | 262 | // this is another hack! |
@@ -787,194 +799,192 @@ void KOAgendaView::createDayLabels() | |||
787 | #endif | 799 | #endif |
788 | } | 800 | } |
789 | if ( ! appendLabels ) { | 801 | if ( ! appendLabels ) { |
790 | dayLabel = mDayLabelsList.next(); | 802 | dayLabel = mDayLabelsList.next(); |
791 | if ( !dayLabel ) | 803 | if ( !dayLabel ) |
792 | appendLabels = true; | 804 | appendLabels = true; |
793 | } | 805 | } |
794 | if ( appendLabels ) { | 806 | if ( appendLabels ) { |
795 | dayLabel = getNewDaylabel(); | 807 | dayLabel = getNewDaylabel(); |
796 | } | 808 | } |
797 | //dayLabel->hide();//test only | 809 | //dayLabel->hide();//test only |
798 | 810 | ||
799 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; | 811 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; |
800 | if ( offset < 0 ) offset = 0; | 812 | if ( offset < 0 ) offset = 0; |
801 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); | 813 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); |
802 | dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); | 814 | dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); |
803 | dayLabel->setFont( dlf ); | 815 | dayLabel->setFont( dlf ); |
804 | dayLabel->show(); | 816 | dayLabel->show(); |
805 | dayLabel->setNum( -2 ); | 817 | dayLabel->setNum( -2 ); |
806 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); | 818 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); |
807 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); | 819 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); |
808 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); | 820 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); |
809 | if ( !appendLabels ) { | 821 | if ( !appendLabels ) { |
810 | dayLabel = mDayLabelsList.next(); | 822 | dayLabel = mDayLabelsList.next(); |
811 | while ( dayLabel ) { | 823 | while ( dayLabel ) { |
812 | //qDebug("!dayLabel %d",dayLabel ); | 824 | //qDebug("!dayLabel %d",dayLabel ); |
813 | dayLabel->hide(); | 825 | dayLabel->hide(); |
814 | dayLabel = mDayLabelsList.next(); | 826 | dayLabel = mDayLabelsList.next(); |
815 | } | 827 | } |
816 | } | 828 | } |
817 | //mDayLabelsFrame->show(); | 829 | //mDayLabelsFrame->show(); |
818 | //mDayLabels->show(); | 830 | //mDayLabels->show(); |
819 | //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight); | 831 | //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight); |
820 | //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight ); | 832 | //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight ); |
821 | mDayLabelsFrame->setFixedHeight( newHight ); | 833 | mDayLabelsFrame->setFixedHeight( newHight ); |
822 | } | 834 | } |
823 | 835 | ||
824 | int KOAgendaView::maxDatesHint() | 836 | int KOAgendaView::maxDatesHint() |
825 | { | 837 | { |
826 | // Not sure about the max number of events, so return 0 for now. | 838 | // Not sure about the max number of events, so return 0 for now. |
827 | return 0; | 839 | return 0; |
828 | } | 840 | } |
829 | 841 | ||
830 | int KOAgendaView::currentDateCount() | 842 | int KOAgendaView::currentDateCount() |
831 | { | 843 | { |
832 | return mSelectedDates.count(); | 844 | return mSelectedDates.count(); |
833 | } | 845 | } |
834 | 846 | ||
835 | QPtrList<Incidence> KOAgendaView::selectedIncidences() | 847 | QPtrList<Incidence> KOAgendaView::selectedIncidences() |
836 | { | 848 | { |
837 | QPtrList<Incidence> selected; | 849 | QPtrList<Incidence> selected; |
838 | Incidence *incidence; | 850 | Incidence *incidence; |
839 | 851 | ||
840 | incidence = mAgenda->selectedIncidence(); | 852 | incidence = mAgenda->selectedIncidence(); |
841 | if (incidence) selected.append(incidence); | 853 | if (incidence) selected.append(incidence); |
842 | 854 | ||
843 | incidence = mAllDayAgenda->selectedIncidence(); | 855 | incidence = mAllDayAgenda->selectedIncidence(); |
844 | if (incidence) selected.append(incidence); | 856 | if (incidence) selected.append(incidence); |
845 | 857 | ||
846 | return selected; | 858 | return selected; |
847 | } | 859 | } |
848 | 860 | ||
849 | DateList KOAgendaView::selectedDates() | 861 | DateList KOAgendaView::selectedDates() |
850 | { | 862 | { |
851 | DateList selected; | 863 | DateList selected; |
852 | QDate qd; | 864 | QDate qd; |
853 | 865 | ||
854 | qd = mAgenda->selectedIncidenceDate(); | 866 | qd = mAgenda->selectedIncidenceDate(); |
855 | if (qd.isValid()) selected.append(qd); | 867 | if (qd.isValid()) selected.append(qd); |
856 | 868 | ||
857 | qd = mAllDayAgenda->selectedIncidenceDate(); | 869 | qd = mAllDayAgenda->selectedIncidenceDate(); |
858 | if (qd.isValid()) selected.append(qd); | 870 | if (qd.isValid()) selected.append(qd); |
859 | 871 | ||
860 | return selected; | 872 | return selected; |
861 | } | 873 | } |
862 | 874 | ||
863 | 875 | ||
864 | void KOAgendaView::updateView() | 876 | void KOAgendaView::updateView() |
865 | { | 877 | { |
866 | if ( mBlockUpdating ) | 878 | if ( mBlockUpdating ) |
867 | return; | 879 | return; |
868 | // kdDebug() << "KOAgendaView::updateView()" << endl; | 880 | // kdDebug() << "KOAgendaView::updateView()" << endl; |
869 | fillAgenda(); | 881 | fillAgenda(); |
870 | 882 | ||
871 | } | 883 | } |
872 | 884 | ||
873 | 885 | ||
874 | /* | 886 | /* |
875 | Update configuration settings for the agenda view. This method is not | 887 | Update configuration settings for the agenda view. This method is not |
876 | complete. | 888 | complete. |
877 | */ | 889 | */ |
878 | void KOAgendaView::updateConfig() | 890 | void KOAgendaView::updateConfig() |
879 | { | 891 | { |
880 | if ( mBlockUpdating ) | 892 | if ( mBlockUpdating ) |
881 | return; | 893 | return; |
882 | 894 | ||
883 | |||
884 | |||
885 | // update config for children | 895 | // update config for children |
886 | mTimeLabels->updateConfig(); | 896 | mTimeLabels->updateConfig(); |
887 | mAgenda->storePosition(); | 897 | mAgenda->storePosition(); |
888 | mAgenda->updateConfig(); | 898 | mAgenda->updateConfig(); |
889 | mAllDayAgenda->updateConfig(); | 899 | mAllDayAgenda->updateConfig(); |
890 | // widget synchronization | 900 | // widget synchronization |
891 | //TODO: find a better way, maybe signal/slot | 901 | //TODO: find a better way, maybe signal/slot |
892 | mTimeLabels->positionChanged(); | 902 | mTimeLabels->positionChanged(); |
893 | 903 | ||
894 | // for some reason, this needs to be called explicitly | 904 | // for some reason, this needs to be called explicitly |
895 | mTimeLabels->repaint(); | 905 | mTimeLabels->repaint(); |
896 | 906 | ||
897 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 907 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
898 | 908 | ||
899 | // ToolTips displaying summary of events | 909 | // ToolTips displaying summary of events |
900 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() | 910 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() |
901 | ->mEnableToolTips); | 911 | ->mEnableToolTips); |
902 | 912 | ||
903 | //setHolidayMasks(); | 913 | //setHolidayMasks(); |
904 | 914 | ||
905 | //createDayLabels(); called by via updateView(); | 915 | //createDayLabels(); called by via updateView(); |
906 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); | 916 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); |
907 | updateView(); | 917 | updateView(); |
908 | mAgenda->restorePosition(); | 918 | mAgenda->restorePosition(); |
909 | } | 919 | } |
910 | 920 | ||
911 | 921 | ||
912 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) | 922 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) |
913 | { | 923 | { |
914 | // kdDebug() << "KOAgendaView::updateEventDates(): " << item->text() << endl; | 924 | // kdDebug() << "KOAgendaView::updateEventDates(): " << item->text() << endl; |
915 | //qDebug("KOAgendaView::updateEventDates "); | 925 | //qDebug("KOAgendaView::updateEventDates "); |
916 | QDateTime startDt,endDt; | 926 | QDateTime startDt,endDt; |
917 | QDate startDate; | 927 | QDate startDate; |
918 | int lenInSecs; | 928 | int lenInSecs; |
919 | // if ( type == KOAgenda::RESIZETOP ) | 929 | // if ( type == KOAgenda::RESIZETOP ) |
920 | // qDebug("RESIZETOP "); | 930 | // qDebug("RESIZETOP "); |
921 | // if ( type == KOAgenda::RESIZEBOTTOM ) | 931 | // if ( type == KOAgenda::RESIZEBOTTOM ) |
922 | // qDebug("RESIZEBOTTOM "); | 932 | // qDebug("RESIZEBOTTOM "); |
923 | // if ( type == KOAgenda::MOVE ) | 933 | // if ( type == KOAgenda::MOVE ) |
924 | // qDebug("MOVE "); | 934 | // qDebug("MOVE "); |
925 | if ( item->incidence()->type() == "Event" ) { | 935 | if ( item->incidence()->type() == "Event" ) { |
926 | startDt =item->incidence()->dtStart(); | 936 | startDt =item->incidence()->dtStart(); |
927 | endDt = item->incidence()->dtEnd(); | 937 | endDt = item->incidence()->dtEnd(); |
928 | lenInSecs = startDt.secsTo( endDt ); | 938 | lenInSecs = startDt.secsTo( endDt ); |
929 | } | 939 | } |
930 | 940 | ||
931 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); | 941 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); |
932 | 942 | ||
933 | if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { | 943 | if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { |
934 | startDate = mSelectedDates[item->mLastMoveXPos]; | 944 | startDate = mSelectedDates[item->mLastMoveXPos]; |
935 | } else { | 945 | } else { |
936 | if (item->cellX() < 0) { | 946 | if (item->cellX() < 0) { |
937 | startDate = (mSelectedDates.first()).addDays(item->cellX()); | 947 | startDate = (mSelectedDates.first()).addDays(item->cellX()); |
938 | } else { | 948 | } else { |
939 | startDate = mSelectedDates[item->cellX()]; | 949 | startDate = mSelectedDates[item->cellX()]; |
940 | } | 950 | } |
941 | } | 951 | } |
942 | startDt.setDate(startDate); | 952 | startDt.setDate(startDate); |
943 | 953 | ||
944 | if (item->incidence()->doesFloat()) { | 954 | if (item->incidence()->doesFloat()) { |
945 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); | 955 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); |
946 | } else { | 956 | } else { |
947 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) | 957 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) |
948 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); | 958 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); |
949 | if ( item->incidence()->type() == "Event" ) { | 959 | if ( item->incidence()->type() == "Event" ) { |
950 | if ( type == KOAgenda::MOVE ) { | 960 | if ( type == KOAgenda::MOVE ) { |
951 | endDt = startDt.addSecs(lenInSecs); | 961 | endDt = startDt.addSecs(lenInSecs); |
952 | 962 | ||
953 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { | 963 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { |
954 | if (item->lastMultiItem()) { | 964 | if (item->lastMultiItem()) { |
955 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 965 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
956 | endDt.setDate(startDate. | 966 | endDt.setDate(startDate. |
957 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 967 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
958 | } else { | 968 | } else { |
959 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 969 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
960 | endDt.setDate(startDate); | 970 | endDt.setDate(startDate); |
961 | } | 971 | } |
962 | } | 972 | } |
963 | } else { | 973 | } else { |
964 | // todo | 974 | // todo |
965 | if (item->lastMultiItem()) { | 975 | if (item->lastMultiItem()) { |
966 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 976 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
967 | endDt.setDate(startDate. | 977 | endDt.setDate(startDate. |
968 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 978 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
969 | } else { | 979 | } else { |
970 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); | 980 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); |
971 | if ( item->cellYBottom() > 0 ) | 981 | if ( item->cellYBottom() > 0 ) |
972 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 982 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
973 | else | 983 | else |
974 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); | 984 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); |
975 | endDt.setDate(startDate); | 985 | endDt.setDate(startDate); |
976 | } | 986 | } |
977 | } | 987 | } |
978 | } | 988 | } |
979 | if ( item->incidence()->type() == "Event" ) { | 989 | if ( item->incidence()->type() == "Event" ) { |
980 | item->incidence()->setDtStart(startDt); | 990 | item->incidence()->setDtStart(startDt); |
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 4ee5292..cf0d4ae 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -135,365 +135,351 @@ void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) | |||
135 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); | 135 | connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); |
136 | categoriesLayout->addWidget(mCategoriesButton); | 136 | categoriesLayout->addWidget(mCategoriesButton); |
137 | 137 | ||
138 | mCategoriesLabel = new QLabel(parent); | 138 | mCategoriesLabel = new QLabel(parent); |
139 | mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); | 139 | mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); |
140 | categoriesLayout->addWidget(mCategoriesLabel,1); | 140 | categoriesLayout->addWidget(mCategoriesLabel,1); |
141 | } | 141 | } |
142 | 142 | ||
143 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) | 143 | void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) |
144 | { | 144 | { |
145 | QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); | 145 | QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); |
146 | 146 | ||
147 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); | 147 | QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); |
148 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); | 148 | mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); |
149 | secrecyLayout->addWidget(mCancelBox); | 149 | secrecyLayout->addWidget(mCancelBox); |
150 | secrecyLayout->addWidget(secrecyLabel); | 150 | secrecyLayout->addWidget(secrecyLabel); |
151 | 151 | ||
152 | mSecrecyCombo = new QComboBox(parent); | 152 | mSecrecyCombo = new QComboBox(parent); |
153 | mSecrecyCombo->insertStringList(Incidence::secrecyList()); | 153 | mSecrecyCombo->insertStringList(Incidence::secrecyList()); |
154 | secrecyLayout->addWidget(mSecrecyCombo); | 154 | secrecyLayout->addWidget(mSecrecyCombo); |
155 | } | 155 | } |
156 | 156 | ||
157 | void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) | 157 | void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) |
158 | { | 158 | { |
159 | mDescriptionEdit = new KTextEdit(parent); | 159 | mDescriptionEdit = new KTextEdit(parent); |
160 | mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); | 160 | mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); |
161 | mDescriptionEdit->append(""); | 161 | mDescriptionEdit->append(""); |
162 | mDescriptionEdit->setReadOnly(false); | 162 | mDescriptionEdit->setReadOnly(false); |
163 | mDescriptionEdit->setOverwriteMode(false); | 163 | mDescriptionEdit->setOverwriteMode(false); |
164 | mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); | 164 | mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); |
165 | topLayout->addWidget(mDescriptionEdit); | 165 | topLayout->addWidget(mDescriptionEdit); |
166 | #ifndef DESKTOP_VERSION | 166 | #ifndef DESKTOP_VERSION |
167 | QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); | 167 | QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); |
168 | #endif | 168 | #endif |
169 | 169 | ||
170 | } | 170 | } |
171 | 171 | ||
172 | void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) | 172 | void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) |
173 | { | 173 | { |
174 | QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); | 174 | QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); |
175 | 175 | ||
176 | //mAlarmBell = new QLabel(parent); | 176 | //mAlarmBell = new QLabel(parent); |
177 | //mAlarmBell->setPixmap(SmallIcon("bell")); | 177 | //mAlarmBell->setPixmap(SmallIcon("bell")); |
178 | //alarmLayout->addWidget(mAlarmBell); | 178 | //alarmLayout->addWidget(mAlarmBell); |
179 | if ( QApplication::desktop()->width() < 320 ) | 179 | if ( QApplication::desktop()->width() < 320 ) |
180 | mAlarmButton = new QCheckBox(i18n("Rem."),parent); | 180 | mAlarmButton = new QCheckBox(i18n("Rem."),parent); |
181 | else | 181 | else |
182 | mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); | 182 | mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); |
183 | 183 | ||
184 | connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); | 184 | connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); |
185 | alarmLayout->addWidget(mAlarmButton); | 185 | alarmLayout->addWidget(mAlarmButton); |
186 | 186 | ||
187 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; | 187 | mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; |
188 | alarmLayout->addWidget(mAlarmTimeEdit); | 188 | alarmLayout->addWidget(mAlarmTimeEdit); |
189 | mAlarmIncrCombo = new QComboBox(false, parent); | 189 | mAlarmIncrCombo = new QComboBox(false, parent); |
190 | if ( QApplication::desktop()->width() < 320 ) { | 190 | if ( QApplication::desktop()->width() < 320 ) { |
191 | mAlarmIncrCombo->insertItem(i18n("min")); | 191 | mAlarmIncrCombo->insertItem(i18n("min")); |
192 | mAlarmIncrCombo->insertItem(i18n("hou")); | 192 | mAlarmIncrCombo->insertItem(i18n("hou")); |
193 | mAlarmIncrCombo->insertItem(i18n("day")); | 193 | mAlarmIncrCombo->insertItem(i18n("day")); |
194 | mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); | 194 | mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); |
195 | mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); | 195 | mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); |
196 | } else { | 196 | } else { |
197 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); | 197 | mAlarmIncrCombo->insertItem(i18n("minute(s)")); |
198 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); | 198 | mAlarmIncrCombo->insertItem(i18n("hour(s)")); |
199 | mAlarmIncrCombo->insertItem(i18n("day(s)")); | 199 | mAlarmIncrCombo->insertItem(i18n("day(s)")); |
200 | } | 200 | } |
201 | 201 | ||
202 | // mAlarmIncrCombo->setMinimumHeight(20); | 202 | // mAlarmIncrCombo->setMinimumHeight(20); |
203 | alarmLayout->addWidget(mAlarmIncrCombo); | 203 | alarmLayout->addWidget(mAlarmIncrCombo); |
204 | mAlarmSoundButton = new QPushButton(parent); | 204 | mAlarmSoundButton = new QPushButton(parent); |
205 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); | 205 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); |
206 | mAlarmSoundButton->setToggleButton(true); | 206 | mAlarmSoundButton->setToggleButton(true); |
207 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); | 207 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); |
208 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); | 208 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); |
209 | alarmLayout->addWidget(mAlarmSoundButton); | 209 | alarmLayout->addWidget(mAlarmSoundButton); |
210 | 210 | ||
211 | mAlarmProgramButton = new QPushButton(parent); | 211 | mAlarmProgramButton = new QPushButton(parent); |
212 | mAlarmProgramButton->setPixmap(SmallIcon("run")); | 212 | mAlarmProgramButton->setPixmap(SmallIcon("run")); |
213 | mAlarmProgramButton->setToggleButton(true); | 213 | mAlarmProgramButton->setToggleButton(true); |
214 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); | 214 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); |
215 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); | 215 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); |
216 | alarmLayout->addWidget(mAlarmProgramButton); | 216 | alarmLayout->addWidget(mAlarmProgramButton); |
217 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); | 217 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); |
218 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); | 218 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); |
219 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 219 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
220 | // mAlarmSoundButton->hide(); | 220 | // mAlarmSoundButton->hide(); |
221 | // mAlarmProgramButton->hide(); | 221 | // mAlarmProgramButton->hide(); |
222 | // } | 222 | // } |
223 | } | 223 | } |
224 | 224 | ||
225 | void KOEditorGeneral::pickAlarmSound() | 225 | void KOEditorGeneral::pickAlarmSound() |
226 | { | 226 | { |
227 | 227 | ||
228 | qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); | 228 | qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); |
229 | //QString prefix = mAlarmSound; | 229 | //QString prefix = mAlarmSound; |
230 | if (!mAlarmSoundButton->isOn()) { | 230 | if (!mAlarmSoundButton->isOn()) { |
231 | //mAlarmSound = ""; | 231 | mAlarmSoundButton->setOn(true); |
232 | QToolTip::remove(mAlarmSoundButton); | 232 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
233 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); | ||
234 | mAlarmProgramButton->setOn(true); | ||
235 | mAlarmSoundButton->setOn(false); | ||
236 | pickAlarmProgram(); | ||
237 | } else { | 233 | } else { |
238 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, | 234 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, |
239 | i18n("*.wav|Wav Files"), 0)); | 235 | i18n("*.wav|Wav Files"), 0)); |
240 | if (!fileName.isEmpty()) { | 236 | if (!fileName.isEmpty()) { |
241 | mAlarmSound = fileName; | 237 | mAlarmSound = fileName; |
242 | QToolTip::remove(mAlarmSoundButton); | 238 | QToolTip::remove(mAlarmSoundButton); |
243 | QString dispStr = i18n("Playing '%1'").arg(fileName); | 239 | QString dispStr = i18n("Playing '%1'").arg(fileName); |
244 | QToolTip::add(mAlarmSoundButton, dispStr); | 240 | QToolTip::add(mAlarmSoundButton, dispStr); |
245 | mAlarmProgramButton->setOn(false); | 241 | mAlarmProgramButton->setOn(false); |
246 | mAlarmSoundButton->setOn(true); | 242 | mAlarmSoundButton->setOn(true); |
247 | } else { | 243 | } else { |
248 | mAlarmProgramButton->setOn(true); | 244 | mAlarmProgramButton->setOn(true); |
249 | mAlarmSoundButton->setOn(false); | 245 | mAlarmSoundButton->setOn(false); |
250 | 246 | ||
251 | } | 247 | } |
252 | } | 248 | } |
253 | 249 | #if 0 | |
254 | if (mAlarmProgramButton->isOn()) | 250 | if (mAlarmProgramButton->isOn()) |
255 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 251 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
256 | if ( mAlarmSoundButton->isOn()) | 252 | if ( mAlarmSoundButton->isOn()) |
257 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | 253 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
254 | #endif | ||
258 | } | 255 | } |
259 | 256 | ||
260 | void KOEditorGeneral::pickAlarmProgram() | 257 | void KOEditorGeneral::pickAlarmProgram() |
261 | { | 258 | { |
262 | if (!mAlarmProgramButton->isOn()) { | 259 | if (!mAlarmProgramButton->isOn()) { |
263 | //mAlarmProgram = ""; | 260 | mAlarmProgramButton->setOn(true); |
264 | QToolTip::remove(mAlarmProgramButton); | 261 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
265 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); | ||
266 | mAlarmProgramButton->setOn(false); | ||
267 | mAlarmSoundButton->setOn(true); | ||
268 | pickAlarmSound(); | ||
269 | } else { | 262 | } else { |
270 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); | 263 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); |
271 | if (!fileName.isEmpty()) { | 264 | if (!fileName.isEmpty()) { |
272 | mAlarmProgram = fileName; | 265 | mAlarmProgram = fileName; |
273 | QToolTip::remove(mAlarmProgramButton); | 266 | QToolTip::remove(mAlarmProgramButton); |
274 | QString dispStr = i18n("Running '%1'").arg(fileName); | 267 | QString dispStr = i18n("Running '%1'").arg(fileName); |
275 | QToolTip::add(mAlarmProgramButton, dispStr); | 268 | QToolTip::add(mAlarmProgramButton, dispStr); |
276 | mAlarmSoundButton->setOn(false); | 269 | mAlarmSoundButton->setOn(false); |
277 | mAlarmProgramButton->setOn(true); | 270 | mAlarmProgramButton->setOn(true); |
278 | } else { | 271 | } else { |
279 | mAlarmProgramButton->setOn(false); | 272 | mAlarmProgramButton->setOn(false); |
280 | mAlarmSoundButton->setOn(true); | 273 | mAlarmSoundButton->setOn(true); |
281 | } | 274 | } |
282 | } | 275 | } |
276 | #if 0 | ||
283 | if (mAlarmProgramButton->isOn()) | 277 | if (mAlarmProgramButton->isOn()) |
284 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 278 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
285 | if ( mAlarmSoundButton->isOn()) | 279 | if ( mAlarmSoundButton->isOn()) |
286 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | 280 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
281 | #endif | ||
287 | } | 282 | } |
288 | 283 | ||
289 | 284 | ||
290 | QString KOEditorGeneral::getFittingPath( const QString s ) | 285 | QString KOEditorGeneral::getFittingPath( const QString s ) |
291 | { | 286 | { |
292 | int maxlen = 50; | 287 | int maxlen = 50; |
293 | if ( QApplication::desktop()->width() < 640 ) { | 288 | if ( QApplication::desktop()->width() < 640 ) { |
294 | if ( QApplication::desktop()->width() < 320 ) | 289 | if ( QApplication::desktop()->width() < 320 ) |
295 | maxlen = 22; | 290 | maxlen = 22; |
296 | else | 291 | else |
297 | maxlen = 35; | 292 | maxlen = 35; |
298 | } | 293 | } |
299 | if ( s.length() > maxlen ) { | 294 | if ( s.length() > maxlen ) { |
300 | return "..."+s.right(maxlen -3); | 295 | return "..."+s.right(maxlen -3); |
301 | } | 296 | } |
302 | return s; | 297 | return s; |
303 | } | 298 | } |
304 | 299 | ||
305 | void KOEditorGeneral::enableAlarmEdit(bool enable) | 300 | void KOEditorGeneral::enableAlarmEdit(bool enable) |
306 | { | 301 | { |
307 | if ( enable ) { | 302 | if ( enable ) { |
308 | if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { | 303 | if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { |
309 | mAlarmSoundButton->setOn( true ); | 304 | mAlarmSoundButton->setOn( true ); |
310 | if ( mAlarmSound.isEmpty() ) | 305 | if ( mAlarmSound.isEmpty() ) |
311 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 306 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
312 | else { | 307 | else { |
313 | if ( ! QFile::exists( mAlarmSound ) ) | 308 | if ( ! QFile::exists( mAlarmSound ) ) |
314 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 309 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
315 | } | 310 | } |
316 | } | 311 | } |
317 | if (mAlarmProgramButton->isOn()) | ||
318 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | ||
319 | if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) | ||
320 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | ||
321 | } | ||
322 | else { | ||
323 | ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage); | ||
324 | //((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Edit item: ") + mSummaryEdit->currentText()); | ||
325 | |||
326 | |||
327 | } | 312 | } |
313 | ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage); | ||
328 | mAlarmTimeEdit->setEnabled(enable); | 314 | mAlarmTimeEdit->setEnabled(enable); |
329 | mAlarmSoundButton->setEnabled(enable); | 315 | mAlarmSoundButton->setEnabled(enable); |
330 | mAlarmProgramButton->setEnabled(enable); | 316 | mAlarmProgramButton->setEnabled(enable); |
331 | mAlarmIncrCombo->setEnabled(enable); | 317 | mAlarmIncrCombo->setEnabled(enable); |
332 | } | 318 | } |
333 | 319 | ||
334 | void KOEditorGeneral::disableAlarmEdit(bool disable) | 320 | void KOEditorGeneral::disableAlarmEdit(bool disable) |
335 | { | 321 | { |
336 | enableAlarmEdit( !disable ); | 322 | enableAlarmEdit( !disable ); |
337 | } | 323 | } |
338 | 324 | ||
339 | void KOEditorGeneral::enableAlarm( bool enable ) | 325 | void KOEditorGeneral::enableAlarm( bool enable ) |
340 | { | 326 | { |
341 | enableAlarmEdit( enable ); | 327 | enableAlarmEdit( enable ); |
342 | } | 328 | } |
343 | 329 | ||
344 | void KOEditorGeneral::alarmDisable(bool disable) | 330 | void KOEditorGeneral::alarmDisable(bool disable) |
345 | { | 331 | { |
346 | if (!disable) { | 332 | if (!disable) { |
347 | //mAlarmBell->setEnabled(true); | 333 | //mAlarmBell->setEnabled(true); |
348 | mAlarmButton->setEnabled(true); | 334 | mAlarmButton->setEnabled(true); |
349 | } else { | 335 | } else { |
350 | //mAlarmBell->setEnabled(false); | 336 | //mAlarmBell->setEnabled(false); |
351 | mAlarmButton->setEnabled(false); | 337 | mAlarmButton->setEnabled(false); |
352 | mAlarmButton->setChecked(false); | 338 | mAlarmButton->setChecked(false); |
353 | mAlarmTimeEdit->setEnabled(false); | 339 | mAlarmTimeEdit->setEnabled(false); |
354 | mAlarmSoundButton->setEnabled(false); | 340 | mAlarmSoundButton->setEnabled(false); |
355 | mAlarmProgramButton->setEnabled(false); | 341 | mAlarmProgramButton->setEnabled(false); |
356 | mAlarmIncrCombo->setEnabled(false); | 342 | mAlarmIncrCombo->setEnabled(false); |
357 | } | 343 | } |
358 | } | 344 | } |
359 | 345 | ||
360 | void KOEditorGeneral::setCategories(const QString &str) | 346 | void KOEditorGeneral::setCategories(const QString &str) |
361 | { | 347 | { |
362 | mCategoriesLabel->setText(str); | 348 | mCategoriesLabel->setText(str); |
363 | } | 349 | } |
364 | 350 | ||
365 | void KOEditorGeneral::setDefaults(bool allDay) | 351 | void KOEditorGeneral::setDefaults(bool allDay) |
366 | { | 352 | { |
367 | #if 0 | 353 | #if 0 |
368 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); | 354 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); |
369 | #endif | 355 | #endif |
370 | 356 | ||
371 | mAlarmMessage = i18n("Edit new item"); | 357 | mAlarmMessage = i18n("Edit new item"); |
372 | enableAlarmEdit( !allDay ); | 358 | enableAlarmEdit( !allDay ); |
373 | 359 | ||
374 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 360 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
375 | int alarmTime; | 361 | int alarmTime; |
376 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 362 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
377 | int index = KOPrefs::instance()->mAlarmTime; | 363 | int index = KOPrefs::instance()->mAlarmTime; |
378 | if (index < 0 || index > 7) { | 364 | if (index < 0 || index > 7) { |
379 | alarmTime = 15; | 365 | alarmTime = 15; |
380 | } else { | 366 | } else { |
381 | alarmTime = a[index]; | 367 | alarmTime = a[index]; |
382 | } | 368 | } |
383 | mAlarmButton ->setChecked( false ); | 369 | mAlarmButton ->setChecked( false ); |
384 | mAlarmTimeEdit->setValue(alarmTime); | 370 | mAlarmTimeEdit->setValue(alarmTime); |
385 | mAlarmIncrCombo->setCurrentItem(0); | 371 | mAlarmIncrCombo->setCurrentItem(0); |
386 | enableAlarmEdit( false ); | 372 | enableAlarmEdit( false ); |
387 | //alarmDisable (false); | 373 | //alarmDisable (false); |
388 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); | 374 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); |
389 | mCancelBox->setChecked( false ); | 375 | mCancelBox->setChecked( false ); |
390 | mSummaryEdit->setEditText(""); | 376 | mSummaryEdit->setEditText(""); |
391 | mLocationEdit->setEditText(""); | 377 | mLocationEdit->setEditText(""); |
392 | mDescriptionEdit->setText(""); | 378 | mDescriptionEdit->setText(""); |
393 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 379 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
394 | setCategories(""); | 380 | setCategories(""); |
395 | } | 381 | } |
396 | void KOEditorGeneral::setSecrecy( int num ) | 382 | void KOEditorGeneral::setSecrecy( int num ) |
397 | { | 383 | { |
398 | mSecrecyCombo->setCurrentItem(num); | 384 | mSecrecyCombo->setCurrentItem(num); |
399 | } | 385 | } |
400 | void KOEditorGeneral::readIncidence(Incidence *event) | 386 | void KOEditorGeneral::readIncidence(Incidence *event) |
401 | { | 387 | { |
402 | 388 | ||
403 | mAlarmMessage = i18n("Edit") +" "+event->summary(); | 389 | mAlarmMessage = event->summary(); |
404 | mAlarmIncrCombo->setCurrentItem(0); | 390 | mAlarmIncrCombo->setCurrentItem(0); |
405 | mSummaryEdit->setEditText(event->summary()); | 391 | mSummaryEdit->setEditText(event->summary()); |
406 | mLocationEdit->setEditText(event->location()); | 392 | mLocationEdit->setEditText(event->location()); |
407 | mDescriptionEdit->setText(event->description()); | 393 | mDescriptionEdit->setText(event->description()); |
408 | 394 | ||
409 | #if 0 | 395 | #if 0 |
410 | // organizer information | 396 | // organizer information |
411 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); | 397 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); |
412 | #endif | 398 | #endif |
413 | 399 | ||
414 | enableAlarmEdit( event->isAlarmEnabled() ); | 400 | enableAlarmEdit( event->isAlarmEnabled() ); |
415 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); | 401 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); |
416 | if(!event->isAlarmEnabled()) { | 402 | if(!event->isAlarmEnabled()) { |
417 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 403 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
418 | int alarmTime; | 404 | int alarmTime; |
419 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 405 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
420 | int index = KOPrefs::instance()->mAlarmTime; | 406 | int index = KOPrefs::instance()->mAlarmTime; |
421 | if (index < 0 || index > 7) { | 407 | if (index < 0 || index > 7) { |
422 | alarmTime = 15; | 408 | alarmTime = 15; |
423 | } else { | 409 | } else { |
424 | alarmTime = a[index]; | 410 | alarmTime = a[index]; |
425 | } | 411 | } |
426 | mAlarmTimeEdit->setValue(alarmTime); | 412 | mAlarmTimeEdit->setValue(alarmTime); |
427 | } | 413 | } |
428 | mAlarmButton->setChecked( event->isAlarmEnabled() ); | 414 | mAlarmButton->setChecked( event->isAlarmEnabled() ); |
429 | mSecrecyCombo->setCurrentItem(event->secrecy()); | 415 | mSecrecyCombo->setCurrentItem(event->secrecy()); |
430 | mCancelBox->setChecked( event->cancelled() ); | 416 | mCancelBox->setChecked( event->cancelled() ); |
431 | mAlarmProgramButton->setOn(false); | 417 | mAlarmProgramButton->setOn(false); |
432 | mAlarmSoundButton->setOn(false); | 418 | mAlarmSoundButton->setOn(false); |
433 | 419 | ||
434 | // set up alarm stuff | 420 | // set up alarm stuff |
435 | QPtrList<Alarm> alarms = event->alarms(); | 421 | QPtrList<Alarm> alarms = event->alarms(); |
436 | Alarm* alarm; | 422 | Alarm* alarm; |
437 | mAlarmIncrCombo->setCurrentItem(0); | 423 | mAlarmIncrCombo->setCurrentItem(0); |
438 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 424 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
439 | int offset; | 425 | int offset; |
440 | if ( alarm->hasTime() ) { | 426 | if ( alarm->hasTime() ) { |
441 | QDateTime t = alarm->time(); | 427 | QDateTime t = alarm->time(); |
442 | offset = event->dtStart().secsTo( t ); | 428 | offset = event->dtStart().secsTo( t ); |
443 | } else { | 429 | } else { |
444 | offset = alarm->startOffset().asSeconds(); | 430 | offset = alarm->startOffset().asSeconds(); |
445 | } | 431 | } |
446 | if ( offset != 0 ) { | 432 | if ( offset != 0 ) { |
447 | offset = offset / -60; // make minutes | 433 | offset = offset / -60; // make minutes |
448 | if (offset % 60 == 0) { // divides evenly into hours? | 434 | if (offset % 60 == 0) { // divides evenly into hours? |
449 | offset = offset / 60; | 435 | offset = offset / 60; |
450 | mAlarmIncrCombo->setCurrentItem(1); | 436 | mAlarmIncrCombo->setCurrentItem(1); |
451 | if (offset % 24 == 0) { // divides evenly into days? | 437 | if (offset % 24 == 0) { // divides evenly into days? |
452 | offset = offset / 24; | 438 | offset = offset / 24; |
453 | mAlarmIncrCombo->setCurrentItem(2); | 439 | mAlarmIncrCombo->setCurrentItem(2); |
454 | } | 440 | } |
455 | } | 441 | } |
456 | } | 442 | } |
457 | mAlarmTimeEdit->setValue( offset ); | 443 | mAlarmTimeEdit->setValue( offset ); |
458 | if (alarm->type() == Alarm::Procedure) { | 444 | if (alarm->type() == Alarm::Procedure) { |
459 | 445 | ||
460 | mAlarmProgram = alarm->programFile(); | 446 | mAlarmProgram = alarm->programFile(); |
461 | mAlarmProgramButton->setOn(true); | 447 | mAlarmProgramButton->setOn(true); |
462 | QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); | 448 | QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); |
463 | QToolTip::add(mAlarmProgramButton, dispStr); | 449 | QToolTip::add(mAlarmProgramButton, dispStr); |
464 | } | 450 | } |
465 | else if (alarm->type() == Alarm::Audio) { | 451 | else if (alarm->type() == Alarm::Audio) { |
466 | mAlarmSound = alarm->audioFile(); | 452 | mAlarmSound = alarm->audioFile(); |
467 | if ( ! QFile::exists( mAlarmSound ) ) | 453 | if ( ! QFile::exists( mAlarmSound ) ) |
468 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 454 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
469 | mAlarmSoundButton->setOn(true); | 455 | mAlarmSoundButton->setOn(true); |
470 | QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); | 456 | QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); |
471 | QToolTip::add(mAlarmSoundButton, dispStr); | 457 | QToolTip::add(mAlarmSoundButton, dispStr); |
472 | } | 458 | } |
473 | mAlarmButton->setChecked(alarm->enabled()); | 459 | mAlarmButton->setChecked(alarm->enabled()); |
474 | enableAlarmEdit( alarm->enabled() ); | 460 | enableAlarmEdit( alarm->enabled() ); |
475 | //qDebug("nableAlarmEdit( alarm->enabled() )********* "); | 461 | //qDebug("nableAlarmEdit( alarm->enabled() )********* "); |
476 | // TODO: Deal with multiple alarms | 462 | // TODO: Deal with multiple alarms |
477 | break; // For now, stop after the first alarm | 463 | break; // For now, stop after the first alarm |
478 | } | 464 | } |
479 | 465 | ||
480 | setCategories(event->categoriesStr()); | 466 | setCategories(event->categoriesStr()); |
481 | } | 467 | } |
482 | 468 | ||
483 | void KOEditorGeneral::writeIncidence(Incidence *event) | 469 | void KOEditorGeneral::writeIncidence(Incidence *event) |
484 | { | 470 | { |
485 | // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; | 471 | // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; |
486 | mLocationEdit->save(KOLocationBox::LOCATION); | 472 | mLocationEdit->save(KOLocationBox::LOCATION); |
487 | event->setSummary(mSummaryEdit->currentText()); | 473 | event->setSummary(mSummaryEdit->currentText()); |
488 | event->setLocation(mLocationEdit->currentText()); | 474 | event->setLocation(mLocationEdit->currentText()); |
489 | event->setDescription(mDescriptionEdit->text()); | 475 | event->setDescription(mDescriptionEdit->text()); |
490 | event->setCategories(mCategoriesLabel->text()); | 476 | event->setCategories(mCategoriesLabel->text()); |
491 | event->setSecrecy(mSecrecyCombo->currentItem()); | 477 | event->setSecrecy(mSecrecyCombo->currentItem()); |
492 | event->setCancelled(mCancelBox->isChecked() );; | 478 | event->setCancelled(mCancelBox->isChecked() );; |
493 | // alarm stuff | 479 | // alarm stuff |
494 | if (mAlarmButton->isChecked()) { | 480 | if (mAlarmButton->isChecked()) { |
495 | if (event->alarms().count() == 0) | 481 | if (event->alarms().count() == 0) |
496 | event->newAlarm(); | 482 | event->newAlarm(); |
497 | QPtrList<Alarm> alarms = event->alarms(); | 483 | QPtrList<Alarm> alarms = event->alarms(); |
498 | Alarm *alarm; | 484 | Alarm *alarm; |
499 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 485 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { |