-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 8 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 59 | ||||
-rw-r--r-- | korganizer/koagenda.h | 1 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 3 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 1 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 50 | ||||
-rw-r--r-- | korganizer/koviewmanager.h | 1 |
8 files changed, 93 insertions, 31 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 6a20868..8572bf9 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1005,197 +1005,201 @@ | |||
1005 | { "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, | 1005 | { "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, |
1006 | { "<p><b>I</b>: Show info of current item+one step down.</p>\n","<p><b>I</b>: Zeige Detail-Ansicht vom sel.Eintrag+Cursor einen Eintrag runter.</p>\n" }, | 1006 | { "<p><b>I</b>: Show info of current item+one step down.</p>\n","<p><b>I</b>: Zeige Detail-Ansicht vom sel.Eintrag+Cursor einen Eintrag runter.</p>\n" }, |
1007 | { "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, | 1007 | { "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, |
1008 | { "<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n","<p><b>return+shift</b>: Markiere Todo als nicht erledigt+Cursor einen Eintrag runter</p>\n" }, | 1008 | { "<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n","<p><b>return+shift</b>: Markiere Todo als nicht erledigt+Cursor einen Eintrag runter</p>\n" }, |
1009 | { "<p><b>return</b>: Mark item as completed+one step down.</p>\n","<p><b>return</b>: Markiere Todo als erledigt+Cursor einen Eintrag runter.</p>\n" }, | 1009 | { "<p><b>return</b>: Mark item as completed+one step down.</p>\n","<p><b>return</b>: Markiere Todo als erledigt+Cursor einen Eintrag runter.</p>\n" }, |
1010 | { "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" }, | 1010 | { "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</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" }, | 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 Datenavigator</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 Datenavigator</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>: Monats Ansicht</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>: Monats Ansicht</p>\n" }, |
1028 | { "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochen Ansicht | <b>U</b>: Wochen Ansicht</p>\n" }, | 1028 | { "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochen Ansicht | <b>U</b>: Wochen 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" }, | 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 days view| <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 days view| <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.net\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.net\n" }, | 1042 | { "\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.net\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 | { "(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n","(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi basiert auf KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.korganizer.org\nwww.pi-sync.net\n" }, | 1047 | { "(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi is based on KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi is licensed\nunder the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.korganizer.org\nwww.pi-sync.net\n","(c) 2004 Lutz Rogowski\nEmail:lutz@pi-sync.net\nKO/Pi basiert auf KOrganizer\n(c) 2002,2003 Cornelius Schumacher\nEmail: schumacher@kde.org\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.korganizer.org\nwww.pi-sync.net\n" }, |
1048 | { "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n","PDA-Edition\nfür: Zaurus 5x00 / 7x0 / 8x0\n" }, | 1048 | { "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n","PDA-Edition\nfür: Zaurus 5x00 / 7x0 / 8x0\n" }, |
1049 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, | 1049 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, |
1050 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, | 1050 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, |
1051 | { "From: ","Von: " }, | 1051 | { "From: ","Von: " }, |
1052 | { "Remove sync info","Entferne Sync Info" }, | 1052 | { "Remove sync info","Entferne Sync Info" }, |
1053 | { "For all profiles","Für alle Profile" }, | 1053 | { "For all profiles","Für alle Profile" }, |
1054 | { "Hide not Running","Verstecke nicht Laufende" }, | 1054 | { "Hide not Running","Verstecke nicht Laufende" }, |
1055 | { "ME","ME" }, | 1055 | { "ME","ME" }, |
1056 | { "Toolbar","Toolbar" }, | 1056 | { "Toolbar","Toolbar" }, |
1057 | { "Undo Delete...","Löschen rückgängig machen..." }, | 1057 | { "Undo Delete...","Löschen rückgängig machen..." }, |
1058 | { "Undo Delete","Löschen rückgängig machen" }, | 1058 | { "Undo Delete","Löschen rückgängig machen" }, |
1059 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, | 1059 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, |
1060 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, | 1060 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, |
1061 | { "Januar","Januar" }, | 1061 | { "Januar","Januar" }, |
1062 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, | 1062 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, |
1063 | { "No Filter","Kein Filter" }, | 1063 | { "No Filter","Kein Filter" }, |
1064 | { "Multiple Sync options","Multi Sync Optionen" }, | 1064 | { "Multiple Sync options","Multi Sync Optionen" }, |
1065 | { "Sync algo options","Sync Ablauf Optionen" }, | 1065 | { "Sync algo options","Sync Ablauf Optionen" }, |
1066 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, | 1066 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, |
1067 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, | 1067 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, |
1068 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, | 1068 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, |
1069 | { "Write back options","Optionen zum Zurückschreiben" }, | 1069 | { "Write back options","Optionen zum Zurückschreiben" }, |
1070 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, | 1070 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, |
1071 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, | 1071 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, |
1072 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, | 1072 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, |
1073 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, | 1073 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, |
1074 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, | 1074 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, |
1075 | { "Time period","Zeitspanne" }, | 1075 | { "Time period","Zeitspanne" }, |
1076 | { "From ","Von " }, | 1076 | { "From ","Von " }, |
1077 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, | 1077 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, |
1078 | { " weeks in the future "," Wochen in der Zukunft " }, | 1078 | { " weeks in the future "," Wochen in der Zukunft " }, |
1079 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, | 1079 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, |
1080 | { "Local temp file:","Lokale temp Datei:" }, | 1080 | { "Local temp file:","Lokale temp Datei:" }, |
1081 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, | 1081 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, |
1082 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, | 1082 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, |
1083 | { "Language","Sprache" }, | 1083 | { "Language","Sprache" }, |
1084 | { "Time Format","Zeit Format" }, | 1084 | { "Time Format","Zeit Format" }, |
1085 | { "Time Zone","Zeit Zone" }, | 1085 | { "Time Zone","Zeit Zone" }, |
1086 | { "%1 groups subscribed","%1 Guppen abboniert" }, | 1086 | { "%1 groups subscribed","%1 Guppen abboniert" }, |
1087 | { "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 | { "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" }, |
1088 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, | 1088 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, |
1089 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, | 1089 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, |
1090 | { "Save settings","Speichere Einstellungen" }, | 1090 | { "Save settings","Speichere Einstellungen" }, |
1091 | { "Save standard","Speichere Standard" }, | 1091 | { "Save standard","Speichere Standard" }, |
1092 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, | 1092 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, |
1093 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, | 1093 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, |
1094 | { "Data storage path","Daten Speicherpfad" }, | 1094 | { "Data storage path","Daten Speicherpfad" }, |
1095 | { "Language","Sprache" }, | 1095 | { "Language","Sprache" }, |
1096 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, | 1096 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, |
1097 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, | 1097 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, |
1098 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, | 1098 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, |
1099 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, | 1099 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, |
1100 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, | 1100 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, |
1101 | { "KO/Pi","KO/Pi" }, | 1101 | { "KO/Pi","KO/Pi" }, |
1102 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, | 1102 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, |
1103 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, | 1103 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, |
1104 | { "Sound.Al.: ","Sound.Al.: " }, | 1104 | { "Sound.Al.: ","Sound.Al.: " }, |
1105 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, | 1105 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, |
1106 | { "Restore","Wiederherstellen" }, | 1106 | { "Restore","Wiederherstellen" }, |
1107 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, | 1107 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, |
1108 | { "% completed","% komplett" }, | 1108 | { "% completed","% komplett" }, |
1109 | { "%d item(s) found.","%d Item(s) gefunden." }, | 1109 | { "%d item(s) found.","%d Item(s) gefunden." }, |
1110 | { "Set complete","Setze auf erledigt" }, | 1110 | { "Set complete","Setze auf erledigt" }, |
1111 | { "(cancelled)","(gecancelt)" }, | 1111 | { "(cancelled)","(gecancelt)" }, |
1112 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, | 1112 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, |
1113 | { " Local time "," Locale Zeit " }, | 1113 | { " Local time "," Locale Zeit " }, |
1114 | { "Form2","Form2" }, | 1114 | { "Form2","Form2" }, |
1115 | { "Filter enabled","Filter angeschaltet" }, | 1115 | { "Filter enabled","Filter angeschaltet" }, |
1116 | { "Edit Filters","Ändere Filter" }, | 1116 | { "Edit Filters","Ändere Filter" }, |
1117 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, | 1117 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, |
1118 | { "Agenda","Agenda" }, | 1118 | { "Agenda","Agenda" }, |
1119 | { " ("," (" }, | 1119 | { " ("," (" }, |
1120 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, | 1120 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, |
1121 | { "Print","Print" }, | 1121 | { "Print","Print" }, |
1122 | { "&Setup Printer...","Drucker &Setup..." }, | 1122 | { "&Setup Printer...","Drucker &Setup..." }, |
1123 | { "View Type","Zeige Typ" }, | 1123 | { "View Type","Zeige Typ" }, |
1124 | { "Page &orientation:","Seiten Ausrichtung:" }, | 1124 | { "Page &orientation:","Seiten Ausrichtung:" }, |
1125 | { "Use Default of Selected Style","Default des selektierten Stils" }, | 1125 | { "Use Default of Selected Style","Default des selektierten Stils" }, |
1126 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, | 1126 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, |
1127 | { "Portrait","Portrait" }, | 1127 | { "Portrait","Portrait" }, |
1128 | { "Landscape","Landschaft" }, | 1128 | { "Landscape","Landschaft" }, |
1129 | { "Print day","Drucke Tag" }, | 1129 | { "Print day","Drucke Tag" }, |
1130 | { "CalPrintDay_Base","CalPrintDay_Base" }, | 1130 | { "CalPrintDay_Base","CalPrintDay_Base" }, |
1131 | { "Date && Time Range","Datum && Zeitspanne" }, | 1131 | { "Date && Time Range","Datum && Zeitspanne" }, |
1132 | { "&End date:","&Enddatum:" }, | 1132 | { "&End date:","&Enddatum:" }, |
1133 | { "&Start date:","&Startdatum:" }, | 1133 | { "&Start date:","&Startdatum:" }, |
1134 | { "Start &time:","Startzeit:" }, | 1134 | { "Start &time:","Startzeit:" }, |
1135 | { "End ti&me:","Endzeit:" }, | 1135 | { "End ti&me:","Endzeit:" }, |
1136 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, | 1136 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, |
1137 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, | 1137 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, |
1138 | { "Alt+D","Alt+D" }, | 1138 | { "Alt+D","Alt+D" }, |
1139 | { "&Use colors","Nutze Farben" }, | 1139 | { "&Use colors","Nutze Farben" }, |
1140 | { "Alt+U","Alt+U" }, | 1140 | { "Alt+U","Alt+U" }, |
1141 | { "Print week","Drucke Woche" }, | 1141 | { "Print week","Drucke Woche" }, |
1142 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, | 1142 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, |
1143 | { "Use &colors","Nutze Farben" }, | 1143 | { "Use &colors","Nutze Farben" }, |
1144 | { "Type of View","Typ der Ansicht" }, | 1144 | { "Type of View","Typ der Ansicht" }, |
1145 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, | 1145 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, |
1146 | { "Alt+F","Alt+F" }, | 1146 | { "Alt+F","Alt+F" }, |
1147 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, | 1147 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, |
1148 | { "Alt+T","Alt+T" }, | 1148 | { "Alt+T","Alt+T" }, |
1149 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, | 1149 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, |
1150 | { "Print month","Drucke Monat" }, | 1150 | { "Print month","Drucke Monat" }, |
1151 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, | 1151 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, |
1152 | { "&Start month:","&Startmonat:" }, | 1152 | { "&Start month:","&Startmonat:" }, |
1153 | { "&End month:","&Endmonat:" }, | 1153 | { "&End month:","&Endmonat:" }, |
1154 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, | 1154 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, |
1155 | { "Print todos","Drucke Todos" }, | 1155 | { "Print todos","Drucke Todos" }, |
1156 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, | 1156 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, |
1157 | { "Include &description of the item","Inclusive Itembeschreibung" }, | 1157 | { "Include &description of the item","Inclusive Itembeschreibung" }, |
1158 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, | 1158 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, |
1159 | { "Include &priority of the item","Inclusive Priorität des Items" }, | 1159 | { "Include &priority of the item","Inclusive Priorität des Items" }, |
1160 | { "Items to Print","Zu druckende Items" }, | 1160 | { "Items to Print","Zu druckende Items" }, |
1161 | { "&From:","Von:" }, | 1161 | { "&From:","Von:" }, |
1162 | { "&To:","Bis:" }, | 1162 | { "&To:","Bis:" }, |
1163 | { "Print &all todo items","Drucke alle Todo Items" }, | 1163 | { "Print &all todo items","Drucke alle Todo Items" }, |
1164 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, | 1164 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, |
1165 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, | 1165 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, |
1166 | { "Todo List","Todo Liste" }, | 1166 | { "Todo List","Todo Liste" }, |
1167 | { "&Title:","&Titel:" }, | 1167 | { "&Title:","&Titel:" }, |
1168 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, | 1168 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, |
1169 | { "Todo list","Todo Liste" }, | 1169 | { "Todo list","Todo Liste" }, |
1170 | { "&Print...","Drucke..." }, | 1170 | { "&Print...","Drucke..." }, |
1171 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1171 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1172 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1172 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1173 | { "OK","OK" }, | 1173 | { "OK","OK" }, |
1174 | { "FilterEditor","FilterEditor" }, | 1174 | { "FilterEditor","FilterEditor" }, |
1175 | { "Include","Inclusive" }, | 1175 | { "Include","Inclusive" }, |
1176 | { "Exclude","Exclusive" }, | 1176 | { "Exclude","Exclusive" }, |
1177 | { "Edit Selection...","Editiere Auswahl" }, | 1177 | { "Edit Selection...","Editiere Auswahl" }, |
1178 | { "recurring events","wiederholende Termine" }, | 1178 | { "recurring events","wiederholende Termine" }, |
1179 | { "recurr. events","wiederh.Termine" }, | 1179 | { "recurr. events","wiederh.Termine" }, |
1180 | { "completed to-dos","erledigte Todos" }, | 1180 | { "completed to-dos","erledigte Todos" }, |
1181 | { "events","Termine" }, | 1181 | { "events","Termine" }, |
1182 | { "todos","Todos" }, | 1182 | { "todos","Todos" }, |
1183 | { "journals","Journale" }, | 1183 | { "journals","Journale" }, |
1184 | { "public","öffentl." }, | 1184 | { "public","öffentl." }, |
1185 | { "private","privat" }, | 1185 | { "private","privat" }, |
1186 | { "confidential","vertraul." }, | 1186 | { "confidential","vertraul." }, |
1187 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, | 1187 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, |
1188 | { "Yesterday","Gestern" }, | 1188 | { "Yesterday","Gestern" }, |
1189 | { "Day after tomorrow","Übermorgen" }, | 1189 | { "Day after tomorrow","Übermorgen" }, |
1190 | { "Tomorrow","Morgen" }, | 1190 | { "Tomorrow","Morgen" }, |
1191 | { "Day before yesterday","Vorgestern" }, | 1191 | { "Day before yesterday","Vorgestern" }, |
1192 | { "Size %1","Größe %1" }, | 1192 | { "Size %1","Größe %1" }, |
1193 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1193 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1194 | { " (%1 y.)"," (%1 J.)" }, | 1194 | { " (%1 y.)"," (%1 J.)" }, |
1195 | { "Allday:","Ganztägig:" }, | 1195 | { "Allday:","Ganztägig:" }, |
1196 | { "compl.todos","erled.Todos" }, | 1196 | { "compl.todos","erled.Todos" }, |
1197 | { "","" }, | 1197 | { "Day view","Tagesansicht" }, |
1198 | { "","" }, | 1198 | { "Next days","Nächste Tage" }, |
1199 | { "Next week","Nächste Woche" }, | ||
1200 | { "Next two weeks","Nächste zwei Wochen" }, | ||
1201 | { "Next month","Nächster Monat" }, | ||
1202 | { "Journal view","Journal" }, | ||
1199 | { "","" }, | 1203 | { "","" }, |
1200 | { "","" }, | 1204 | { "","" }, |
1201 | { "","" }, | 1205 | { "","" }, |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 035d630..e7b6755 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2500,385 +2500,384 @@ void CalendarView::showDatePicker( ) | |||
2500 | int dw = QApplication::desktop()->width(); | 2500 | int dw = QApplication::desktop()->width(); |
2501 | int dh = QApplication::desktop()->height(); | 2501 | int dh = QApplication::desktop()->height(); |
2502 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2502 | mDateFrame->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2503 | mDateFrame->show(); | 2503 | mDateFrame->show(); |
2504 | } | 2504 | } |
2505 | mDatePickerMode = 1; | 2505 | mDatePickerMode = 1; |
2506 | mDatePicker->setDate( mNavigator->selectedDates().first() ); | 2506 | mDatePicker->setDate( mNavigator->selectedDates().first() ); |
2507 | } | 2507 | } |
2508 | 2508 | ||
2509 | void CalendarView::showEventEditor() | 2509 | void CalendarView::showEventEditor() |
2510 | { | 2510 | { |
2511 | #ifdef DESKTOP_VERSION | 2511 | #ifdef DESKTOP_VERSION |
2512 | mEventEditor->show(); | 2512 | mEventEditor->show(); |
2513 | #else | 2513 | #else |
2514 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { | 2514 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { |
2515 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2515 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2516 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); | 2516 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); |
2517 | qApp->processEvents(); | 2517 | qApp->processEvents(); |
2518 | delete mEventEditor; | 2518 | delete mEventEditor; |
2519 | mEventEditor = mDialogManager->getEventEditor(); | 2519 | mEventEditor = mDialogManager->getEventEditor(); |
2520 | topLevelWidget()->setCaption( i18n("") ); | 2520 | topLevelWidget()->setCaption( i18n("") ); |
2521 | } | 2521 | } |
2522 | mEventEditor->showMaximized(); | 2522 | mEventEditor->showMaximized(); |
2523 | #endif | 2523 | #endif |
2524 | } | 2524 | } |
2525 | void CalendarView::showTodoEditor() | 2525 | void CalendarView::showTodoEditor() |
2526 | { | 2526 | { |
2527 | #ifdef DESKTOP_VERSION | 2527 | #ifdef DESKTOP_VERSION |
2528 | mTodoEditor->show(); | 2528 | mTodoEditor->show(); |
2529 | #else | 2529 | #else |
2530 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { | 2530 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { |
2531 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2531 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2532 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); | 2532 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); |
2533 | qApp->processEvents(); | 2533 | qApp->processEvents(); |
2534 | delete mTodoEditor; | 2534 | delete mTodoEditor; |
2535 | mTodoEditor = mDialogManager->getTodoEditor(); | 2535 | mTodoEditor = mDialogManager->getTodoEditor(); |
2536 | topLevelWidget()->setCaption( i18n("") ); | 2536 | topLevelWidget()->setCaption( i18n("") ); |
2537 | } | 2537 | } |
2538 | mTodoEditor->showMaximized(); | 2538 | mTodoEditor->showMaximized(); |
2539 | #endif | 2539 | #endif |
2540 | } | 2540 | } |
2541 | 2541 | ||
2542 | void CalendarView::cloneIncidence() | 2542 | void CalendarView::cloneIncidence() |
2543 | { | 2543 | { |
2544 | Incidence *incidence = currentSelection(); | 2544 | Incidence *incidence = currentSelection(); |
2545 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2545 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2546 | if ( incidence ) { | 2546 | if ( incidence ) { |
2547 | cloneIncidence(incidence); | 2547 | cloneIncidence(incidence); |
2548 | } | 2548 | } |
2549 | } | 2549 | } |
2550 | void CalendarView::moveIncidence() | 2550 | void CalendarView::moveIncidence() |
2551 | { | 2551 | { |
2552 | Incidence *incidence = currentSelection(); | 2552 | Incidence *incidence = currentSelection(); |
2553 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2553 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2554 | if ( incidence ) { | 2554 | if ( incidence ) { |
2555 | moveIncidence(incidence); | 2555 | moveIncidence(incidence); |
2556 | } | 2556 | } |
2557 | } | 2557 | } |
2558 | void CalendarView::beamIncidence() | 2558 | void CalendarView::beamIncidence() |
2559 | { | 2559 | { |
2560 | Incidence *incidence = currentSelection(); | 2560 | Incidence *incidence = currentSelection(); |
2561 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2561 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2562 | if ( incidence ) { | 2562 | if ( incidence ) { |
2563 | beamIncidence(incidence); | 2563 | beamIncidence(incidence); |
2564 | } | 2564 | } |
2565 | } | 2565 | } |
2566 | void CalendarView::toggleCancelIncidence() | 2566 | void CalendarView::toggleCancelIncidence() |
2567 | { | 2567 | { |
2568 | Incidence *incidence = currentSelection(); | 2568 | Incidence *incidence = currentSelection(); |
2569 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2569 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2570 | if ( incidence ) { | 2570 | if ( incidence ) { |
2571 | cancelIncidence(incidence); | 2571 | cancelIncidence(incidence); |
2572 | } | 2572 | } |
2573 | } | 2573 | } |
2574 | 2574 | ||
2575 | 2575 | ||
2576 | void CalendarView::cancelIncidence(Incidence * inc ) | 2576 | void CalendarView::cancelIncidence(Incidence * inc ) |
2577 | { | 2577 | { |
2578 | inc->setCancelled( ! inc->cancelled() ); | 2578 | inc->setCancelled( ! inc->cancelled() ); |
2579 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); | 2579 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); |
2580 | updateView(); | 2580 | updateView(); |
2581 | } | 2581 | } |
2582 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 2582 | void CalendarView::cloneIncidence(Incidence * orgInc ) |
2583 | { | 2583 | { |
2584 | Incidence * newInc = orgInc->clone(); | 2584 | Incidence * newInc = orgInc->clone(); |
2585 | newInc->recreate(); | 2585 | newInc->recreate(); |
2586 | 2586 | ||
2587 | if ( newInc->type() == "Todo" ) { | 2587 | if ( newInc->type() == "Todo" ) { |
2588 | Todo* t = (Todo*) newInc; | 2588 | Todo* t = (Todo*) newInc; |
2589 | showTodoEditor(); | 2589 | showTodoEditor(); |
2590 | mTodoEditor->editTodo( t ); | 2590 | mTodoEditor->editTodo( t ); |
2591 | if ( mTodoEditor->exec() ) { | 2591 | if ( mTodoEditor->exec() ) { |
2592 | mCalendar->addTodo( t ); | 2592 | mCalendar->addTodo( t ); |
2593 | updateView(); | 2593 | updateView(); |
2594 | } else { | 2594 | } else { |
2595 | delete t; | 2595 | delete t; |
2596 | } | 2596 | } |
2597 | } | 2597 | } |
2598 | else { | 2598 | else { |
2599 | Event* e = (Event*) newInc; | 2599 | Event* e = (Event*) newInc; |
2600 | showEventEditor(); | 2600 | showEventEditor(); |
2601 | mEventEditor->editEvent( e ); | 2601 | mEventEditor->editEvent( e ); |
2602 | if ( mEventEditor->exec() ) { | 2602 | if ( mEventEditor->exec() ) { |
2603 | mCalendar->addEvent( e ); | 2603 | mCalendar->addEvent( e ); |
2604 | updateView(); | 2604 | updateView(); |
2605 | } else { | 2605 | } else { |
2606 | delete e; | 2606 | delete e; |
2607 | } | 2607 | } |
2608 | } | 2608 | } |
2609 | } | 2609 | } |
2610 | 2610 | ||
2611 | void CalendarView::newEvent() | 2611 | void CalendarView::newEvent() |
2612 | { | 2612 | { |
2613 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. | 2613 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. |
2614 | KOAgendaView *aView = mViewManager->agendaView(); | 2614 | KOAgendaView *aView = mViewManager->agendaView(); |
2615 | if (aView) { | 2615 | if (aView) { |
2616 | if (aView->selectionStart().isValid()) { | 2616 | if (aView->selectionStart().isValid()) { |
2617 | if (aView->selectedIsAllDay()) { | 2617 | if (aView->selectedIsAllDay()) { |
2618 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); | 2618 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); |
2619 | } else { | 2619 | } else { |
2620 | newEvent(aView->selectionStart(),aView->selectionEnd()); | 2620 | newEvent(aView->selectionStart(),aView->selectionEnd()); |
2621 | } | 2621 | } |
2622 | return; | 2622 | return; |
2623 | } | 2623 | } |
2624 | } | 2624 | } |
2625 | 2625 | ||
2626 | QDate date = mNavigator->selectedDates().first(); | 2626 | QDate date = mNavigator->selectedDates().first(); |
2627 | QDateTime current = QDateTime::currentDateTime(); | 2627 | QDateTime current = QDateTime::currentDateTime(); |
2628 | if ( date <= current.date() ) { | 2628 | if ( date <= current.date() ) { |
2629 | int hour = current.time().hour() +1; | 2629 | int hour = current.time().hour() +1; |
2630 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), | 2630 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), |
2631 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 2631 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
2632 | } else | 2632 | } else |
2633 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), | 2633 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), |
2634 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + | 2634 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + |
2635 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 2635 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
2636 | } | 2636 | } |
2637 | 2637 | ||
2638 | void CalendarView::newEvent(QDateTime fh) | 2638 | void CalendarView::newEvent(QDateTime fh) |
2639 | { | 2639 | { |
2640 | newEvent(fh, | 2640 | newEvent(fh, |
2641 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); | 2641 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); |
2642 | } | 2642 | } |
2643 | 2643 | ||
2644 | void CalendarView::newEvent(QDate dt) | 2644 | void CalendarView::newEvent(QDate dt) |
2645 | { | 2645 | { |
2646 | newEvent(QDateTime(dt, QTime(0,0,0)), | 2646 | newEvent(QDateTime(dt, QTime(0,0,0)), |
2647 | QDateTime(dt, QTime(0,0,0)), true); | 2647 | QDateTime(dt, QTime(0,0,0)), true); |
2648 | } | 2648 | } |
2649 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) | 2649 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) |
2650 | { | 2650 | { |
2651 | newEvent(fromHint, toHint, false); | 2651 | newEvent(fromHint, toHint, false); |
2652 | } | 2652 | } |
2653 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) | 2653 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) |
2654 | { | 2654 | { |
2655 | 2655 | ||
2656 | showEventEditor(); | 2656 | showEventEditor(); |
2657 | mEventEditor->newEvent(fromHint,toHint,allDay); | 2657 | mEventEditor->newEvent(fromHint,toHint,allDay); |
2658 | if ( mFilterView->filtersEnabled() ) { | 2658 | if ( mFilterView->filtersEnabled() ) { |
2659 | CalFilter *filter = mFilterView->selectedFilter(); | 2659 | CalFilter *filter = mFilterView->selectedFilter(); |
2660 | if (filter && filter->showCategories()) { | 2660 | if (filter && filter->showCategories()) { |
2661 | mEventEditor->setCategories(filter->categoryList().join(",") ); | 2661 | mEventEditor->setCategories(filter->categoryList().join(",") ); |
2662 | } | 2662 | } |
2663 | if ( filter ) | 2663 | if ( filter ) |
2664 | mEventEditor->setSecrecy( filter->getSecrecy() ); | 2664 | mEventEditor->setSecrecy( filter->getSecrecy() ); |
2665 | } | 2665 | } |
2666 | } | 2666 | } |
2667 | void CalendarView::todoAdded(Todo * t) | 2667 | void CalendarView::todoAdded(Todo * t) |
2668 | { | 2668 | { |
2669 | 2669 | ||
2670 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); | 2670 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); |
2671 | updateTodoViews(); | 2671 | updateTodoViews(); |
2672 | } | 2672 | } |
2673 | void CalendarView::todoChanged(Todo * t) | 2673 | void CalendarView::todoChanged(Todo * t) |
2674 | { | 2674 | { |
2675 | emit todoModified( t, 4 ); | 2675 | emit todoModified( t, 4 ); |
2676 | // updateTodoViews(); | 2676 | // updateTodoViews(); |
2677 | } | 2677 | } |
2678 | void CalendarView::todoToBeDeleted(Todo *) | 2678 | void CalendarView::todoToBeDeleted(Todo *) |
2679 | { | 2679 | { |
2680 | //qDebug("todoToBeDeleted(Todo *) "); | 2680 | //qDebug("todoToBeDeleted(Todo *) "); |
2681 | updateTodoViews(); | 2681 | updateTodoViews(); |
2682 | } | 2682 | } |
2683 | void CalendarView::todoDeleted() | 2683 | void CalendarView::todoDeleted() |
2684 | { | 2684 | { |
2685 | //qDebug(" todoDeleted()"); | 2685 | //qDebug(" todoDeleted()"); |
2686 | updateTodoViews(); | 2686 | updateTodoViews(); |
2687 | } | 2687 | } |
2688 | 2688 | ||
2689 | 2689 | ||
2690 | void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) | 2690 | void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) |
2691 | { | 2691 | { |
2692 | qDebug("datetime "); | ||
2693 | showTodoEditor(); | 2692 | showTodoEditor(); |
2694 | mTodoEditor->newTodo(dt,0,allday); | 2693 | mTodoEditor->newTodo(dt,0,allday); |
2695 | if ( mFilterView->filtersEnabled() ) { | 2694 | if ( mFilterView->filtersEnabled() ) { |
2696 | CalFilter *filter = mFilterView->selectedFilter(); | 2695 | CalFilter *filter = mFilterView->selectedFilter(); |
2697 | if (filter && filter->showCategories()) { | 2696 | if (filter && filter->showCategories()) { |
2698 | mTodoEditor->setCategories(filter->categoryList().join(",") ); | 2697 | mTodoEditor->setCategories(filter->categoryList().join(",") ); |
2699 | } | 2698 | } |
2700 | if ( filter ) | 2699 | if ( filter ) |
2701 | mTodoEditor->setSecrecy( filter->getSecrecy() ); | 2700 | mTodoEditor->setSecrecy( filter->getSecrecy() ); |
2702 | } | 2701 | } |
2703 | } | 2702 | } |
2704 | 2703 | ||
2705 | void CalendarView::newTodo() | 2704 | void CalendarView::newTodo() |
2706 | { | 2705 | { |
2707 | newTodoDateTime( QDateTime(),true ); | 2706 | newTodoDateTime( QDateTime(),true ); |
2708 | } | 2707 | } |
2709 | 2708 | ||
2710 | void CalendarView::newSubTodo() | 2709 | void CalendarView::newSubTodo() |
2711 | { | 2710 | { |
2712 | Todo *todo = selectedTodo(); | 2711 | Todo *todo = selectedTodo(); |
2713 | if ( todo ) newSubTodo( todo ); | 2712 | if ( todo ) newSubTodo( todo ); |
2714 | } | 2713 | } |
2715 | 2714 | ||
2716 | void CalendarView::newSubTodo(Todo *parentEvent) | 2715 | void CalendarView::newSubTodo(Todo *parentEvent) |
2717 | { | 2716 | { |
2718 | 2717 | ||
2719 | showTodoEditor(); | 2718 | showTodoEditor(); |
2720 | mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); | 2719 | mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); |
2721 | } | 2720 | } |
2722 | 2721 | ||
2723 | void CalendarView::newFloatingEvent() | 2722 | void CalendarView::newFloatingEvent() |
2724 | { | 2723 | { |
2725 | DateList tmpList = mNavigator->selectedDates(); | 2724 | DateList tmpList = mNavigator->selectedDates(); |
2726 | QDate date = tmpList.first(); | 2725 | QDate date = tmpList.first(); |
2727 | 2726 | ||
2728 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), | 2727 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), |
2729 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); | 2728 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); |
2730 | } | 2729 | } |
2731 | 2730 | ||
2732 | 2731 | ||
2733 | void CalendarView::editEvent( Event *event ) | 2732 | void CalendarView::editEvent( Event *event ) |
2734 | { | 2733 | { |
2735 | 2734 | ||
2736 | if ( !event ) return; | 2735 | if ( !event ) return; |
2737 | if ( event->isReadOnly() ) { | 2736 | if ( event->isReadOnly() ) { |
2738 | showEvent( event ); | 2737 | showEvent( event ); |
2739 | return; | 2738 | return; |
2740 | } | 2739 | } |
2741 | showEventEditor(); | 2740 | showEventEditor(); |
2742 | mEventEditor->editEvent( event , mFlagEditDescription); | 2741 | mEventEditor->editEvent( event , mFlagEditDescription); |
2743 | } | 2742 | } |
2744 | void CalendarView::editJournal( Journal *jour ) | 2743 | void CalendarView::editJournal( Journal *jour ) |
2745 | { | 2744 | { |
2746 | if ( !jour ) return; | 2745 | if ( !jour ) return; |
2747 | mDialogManager->hideSearchDialog(); | 2746 | mDialogManager->hideSearchDialog(); |
2748 | mViewManager->showJournalView(); | 2747 | mViewManager->showJournalView(); |
2749 | mNavigator->slotDaySelect( jour->dtStart().date() ); | 2748 | mNavigator->slotDaySelect( jour->dtStart().date() ); |
2750 | } | 2749 | } |
2751 | void CalendarView::editTodo( Todo *todo ) | 2750 | void CalendarView::editTodo( Todo *todo ) |
2752 | { | 2751 | { |
2753 | if ( !todo ) return; | 2752 | if ( !todo ) return; |
2754 | 2753 | ||
2755 | if ( todo->isReadOnly() ) { | 2754 | if ( todo->isReadOnly() ) { |
2756 | showTodo( todo ); | 2755 | showTodo( todo ); |
2757 | return; | 2756 | return; |
2758 | } | 2757 | } |
2759 | showTodoEditor(); | 2758 | showTodoEditor(); |
2760 | mTodoEditor->editTodo( todo ,mFlagEditDescription); | 2759 | mTodoEditor->editTodo( todo ,mFlagEditDescription); |
2761 | 2760 | ||
2762 | } | 2761 | } |
2763 | 2762 | ||
2764 | KOEventViewerDialog* CalendarView::getEventViewerDialog() | 2763 | KOEventViewerDialog* CalendarView::getEventViewerDialog() |
2765 | { | 2764 | { |
2766 | if ( !mEventViewerDialog ) { | 2765 | if ( !mEventViewerDialog ) { |
2767 | mEventViewerDialog = new KOEventViewerDialog(this); | 2766 | mEventViewerDialog = new KOEventViewerDialog(this); |
2768 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); | 2767 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); |
2769 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); | 2768 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); |
2770 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), | 2769 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), |
2771 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 2770 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
2772 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), | 2771 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), |
2773 | viewManager(), SLOT( showAgendaView( bool ) ) ); | 2772 | viewManager(), SLOT( showAgendaView( bool ) ) ); |
2774 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), | 2773 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), |
2775 | this, SLOT( todoChanged(Todo *) ) ); | 2774 | this, SLOT( todoChanged(Todo *) ) ); |
2776 | mEventViewerDialog->resize( 640, 480 ); | 2775 | mEventViewerDialog->resize( 640, 480 ); |
2777 | 2776 | ||
2778 | } | 2777 | } |
2779 | return mEventViewerDialog; | 2778 | return mEventViewerDialog; |
2780 | } | 2779 | } |
2781 | void CalendarView::showEvent(Event *event) | 2780 | void CalendarView::showEvent(Event *event) |
2782 | { | 2781 | { |
2783 | getEventViewerDialog()->setEvent(event); | 2782 | getEventViewerDialog()->setEvent(event); |
2784 | getEventViewerDialog()->showMe(); | 2783 | getEventViewerDialog()->showMe(); |
2785 | } | 2784 | } |
2786 | 2785 | ||
2787 | void CalendarView::showTodo(Todo *event) | 2786 | void CalendarView::showTodo(Todo *event) |
2788 | { | 2787 | { |
2789 | getEventViewerDialog()->setTodo(event); | 2788 | getEventViewerDialog()->setTodo(event); |
2790 | getEventViewerDialog()->showMe(); | 2789 | getEventViewerDialog()->showMe(); |
2791 | } | 2790 | } |
2792 | void CalendarView::showJournal( Journal *jour ) | 2791 | void CalendarView::showJournal( Journal *jour ) |
2793 | { | 2792 | { |
2794 | getEventViewerDialog()->setJournal(jour); | 2793 | getEventViewerDialog()->setJournal(jour); |
2795 | getEventViewerDialog()->showMe(); | 2794 | getEventViewerDialog()->showMe(); |
2796 | 2795 | ||
2797 | } | 2796 | } |
2798 | // void CalendarView::todoModified (Todo *event, int changed) | 2797 | // void CalendarView::todoModified (Todo *event, int changed) |
2799 | // { | 2798 | // { |
2800 | // // if (mDialogList.find (event) != mDialogList.end ()) { | 2799 | // // if (mDialogList.find (event) != mDialogList.end ()) { |
2801 | // // kdDebug() << "Todo modified and open" << endl; | 2800 | // // kdDebug() << "Todo modified and open" << endl; |
2802 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; | 2801 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; |
2803 | // // temp->modified (changed); | 2802 | // // temp->modified (changed); |
2804 | 2803 | ||
2805 | // // } | 2804 | // // } |
2806 | 2805 | ||
2807 | // mViewManager->updateView(); | 2806 | // mViewManager->updateView(); |
2808 | // } | 2807 | // } |
2809 | 2808 | ||
2810 | void CalendarView::appointment_show() | 2809 | void CalendarView::appointment_show() |
2811 | { | 2810 | { |
2812 | Event *anEvent = 0; | 2811 | Event *anEvent = 0; |
2813 | 2812 | ||
2814 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2813 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2815 | 2814 | ||
2816 | if (mViewManager->currentView()->isEventView()) { | 2815 | if (mViewManager->currentView()->isEventView()) { |
2817 | if ( incidence && incidence->type() == "Event" ) { | 2816 | if ( incidence && incidence->type() == "Event" ) { |
2818 | anEvent = static_cast<Event *>(incidence); | 2817 | anEvent = static_cast<Event *>(incidence); |
2819 | } | 2818 | } |
2820 | } | 2819 | } |
2821 | 2820 | ||
2822 | if (!anEvent) { | 2821 | if (!anEvent) { |
2823 | KNotifyClient::beep(); | 2822 | KNotifyClient::beep(); |
2824 | return; | 2823 | return; |
2825 | } | 2824 | } |
2826 | 2825 | ||
2827 | showEvent(anEvent); | 2826 | showEvent(anEvent); |
2828 | } | 2827 | } |
2829 | 2828 | ||
2830 | void CalendarView::appointment_edit() | 2829 | void CalendarView::appointment_edit() |
2831 | { | 2830 | { |
2832 | Event *anEvent = 0; | 2831 | Event *anEvent = 0; |
2833 | 2832 | ||
2834 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2833 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2835 | 2834 | ||
2836 | if (mViewManager->currentView()->isEventView()) { | 2835 | if (mViewManager->currentView()->isEventView()) { |
2837 | if ( incidence && incidence->type() == "Event" ) { | 2836 | if ( incidence && incidence->type() == "Event" ) { |
2838 | anEvent = static_cast<Event *>(incidence); | 2837 | anEvent = static_cast<Event *>(incidence); |
2839 | } | 2838 | } |
2840 | } | 2839 | } |
2841 | 2840 | ||
2842 | if (!anEvent) { | 2841 | if (!anEvent) { |
2843 | KNotifyClient::beep(); | 2842 | KNotifyClient::beep(); |
2844 | return; | 2843 | return; |
2845 | } | 2844 | } |
2846 | 2845 | ||
2847 | editEvent(anEvent); | 2846 | editEvent(anEvent); |
2848 | } | 2847 | } |
2849 | 2848 | ||
2850 | void CalendarView::appointment_delete() | 2849 | void CalendarView::appointment_delete() |
2851 | { | 2850 | { |
2852 | Event *anEvent = 0; | 2851 | Event *anEvent = 0; |
2853 | 2852 | ||
2854 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2853 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2855 | 2854 | ||
2856 | if (mViewManager->currentView()->isEventView()) { | 2855 | if (mViewManager->currentView()->isEventView()) { |
2857 | if ( incidence && incidence->type() == "Event" ) { | 2856 | if ( incidence && incidence->type() == "Event" ) { |
2858 | anEvent = static_cast<Event *>(incidence); | 2857 | anEvent = static_cast<Event *>(incidence); |
2859 | } | 2858 | } |
2860 | } | 2859 | } |
2861 | 2860 | ||
2862 | if (!anEvent) { | 2861 | if (!anEvent) { |
2863 | KNotifyClient::beep(); | 2862 | KNotifyClient::beep(); |
2864 | return; | 2863 | return; |
2865 | } | 2864 | } |
2866 | 2865 | ||
2867 | deleteEvent(anEvent); | 2866 | deleteEvent(anEvent); |
2868 | } | 2867 | } |
2869 | 2868 | ||
2870 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) | 2869 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) |
2871 | { | 2870 | { |
2872 | if (!sub) return; | 2871 | if (!sub) return; |
2873 | if (!parent) return; | 2872 | if (!parent) return; |
2874 | if ( sub->relatedTo() ) | 2873 | if ( sub->relatedTo() ) |
2875 | sub->relatedTo()->removeRelation(sub); | 2874 | sub->relatedTo()->removeRelation(sub); |
2876 | sub->setRelatedTo(parent); | 2875 | sub->setRelatedTo(parent); |
2877 | sub->setRelatedToUid(parent->uid()); | 2876 | sub->setRelatedToUid(parent->uid()); |
2878 | parent->addRelation(sub); | 2877 | parent->addRelation(sub); |
2879 | sub->updated(); | 2878 | sub->updated(); |
2880 | parent->updated(); | 2879 | parent->updated(); |
2881 | setModified(true); | 2880 | setModified(true); |
2882 | updateView(); | 2881 | updateView(); |
2883 | } | 2882 | } |
2884 | void CalendarView::todo_unsub(Todo *anTodo ) | 2883 | void CalendarView::todo_unsub(Todo *anTodo ) |
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 73ee5cb..0eeacb3 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -1,763 +1,768 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | Marcus Bains line. | 5 | Marcus Bains line. |
6 | Copyright (c) 2001 Ali Rahimi | 6 | Copyright (c) 2001 Ali Rahimi |
7 | 7 | ||
8 | This program is free software; you can redistribute it and/or modify | 8 | This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; either version 2 of the License, or | 10 | the Free Software Foundation; either version 2 of the License, or |
11 | (at your option) any later version. | 11 | (at your option) any later version. |
12 | 12 | ||
13 | This program is distributed in the hope that it will be useful, | 13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. | 16 | GNU General Public License for more details. |
17 | 17 | ||
18 | You should have received a copy of the GNU General Public License | 18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software | 19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 | 21 | ||
22 | As a special exception, permission is given to link this program | 22 | As a special exception, permission is given to link this program |
23 | with any edition of Qt, and distribute the resulting executable, | 23 | with any edition of Qt, and distribute the resulting executable, |
24 | without including the source code for Qt in the source distribution. | 24 | without including the source code for Qt in the source distribution. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #ifndef _WIN32_ | 27 | #ifndef _WIN32_ |
28 | #define protected public | 28 | #define protected public |
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | #undef protected | 30 | #undef protected |
31 | #endif | 31 | #endif |
32 | #include <qintdict.h> | 32 | #include <qintdict.h> |
33 | #include <qdatetime.h> | 33 | #include <qdatetime.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | #include <qpopupmenu.h> | 35 | #include <qpopupmenu.h> |
36 | #include <qcursor.h> | 36 | #include <qcursor.h> |
37 | #include <qpainter.h> | 37 | #include <qpainter.h> |
38 | 38 | ||
39 | #include <kdebug.h> | 39 | #include <kdebug.h> |
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <kiconloader.h> | 41 | #include <kiconloader.h> |
42 | #include <kglobal.h> | 42 | #include <kglobal.h> |
43 | 43 | ||
44 | #include "koagendaitem.h" | 44 | #include "koagendaitem.h" |
45 | #include "koprefs.h" | 45 | #include "koprefs.h" |
46 | #include "koglobals.h" | 46 | #include "koglobals.h" |
47 | 47 | ||
48 | #include "koagenda.h" | 48 | #include "koagenda.h" |
49 | 49 | ||
50 | #include <libkcal/event.h> | 50 | #include <libkcal/event.h> |
51 | #include <libkcal/todo.h> | 51 | #include <libkcal/todo.h> |
52 | 52 | ||
53 | #ifndef DESKTOP_VERSION | 53 | #ifndef DESKTOP_VERSION |
54 | #include <qpe/qpeapplication.h> | 54 | #include <qpe/qpeapplication.h> |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | //extern bool globalFlagBlockPainting; | 57 | //extern bool globalFlagBlockPainting; |
58 | extern int globalFlagBlockAgenda; | 58 | extern int globalFlagBlockAgenda; |
59 | extern int globalFlagBlockAgendaItemPaint; | 59 | extern int globalFlagBlockAgendaItemPaint; |
60 | extern int globalFlagBlockAgendaItemUpdate; | 60 | extern int globalFlagBlockAgendaItemUpdate; |
61 | extern int globalFlagBlockStartup; | 61 | extern int globalFlagBlockStartup; |
62 | 62 | ||
63 | //////////////////////////////////////////////////////////////////////////// | 63 | //////////////////////////////////////////////////////////////////////////// |
64 | MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) | 64 | MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) |
65 | : QFrame(_agenda->viewport(),name), agenda(_agenda) | 65 | : QFrame(_agenda->viewport(),name), agenda(_agenda) |
66 | { | 66 | { |
67 | setLineWidth(0); | 67 | setLineWidth(0); |
68 | setMargin(0); | 68 | setMargin(0); |
69 | setBackgroundColor(Qt::red); | 69 | setBackgroundColor(Qt::red); |
70 | minutes = new QTimer(this); | 70 | minutes = new QTimer(this); |
71 | connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); | 71 | connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); |
72 | minutes->start(0, true); | 72 | minutes->start(0, true); |
73 | 73 | ||
74 | mTimeBox = new QLabel(this); | 74 | mTimeBox = new QLabel(this); |
75 | mTimeBox->setAlignment(Qt::AlignRight | Qt::AlignBottom); | 75 | mTimeBox->setAlignment(Qt::AlignRight | Qt::AlignBottom); |
76 | QPalette pal = mTimeBox->palette(); | 76 | QPalette pal = mTimeBox->palette(); |
77 | pal.setColor(QColorGroup::Foreground, Qt::red); | 77 | pal.setColor(QColorGroup::Foreground, Qt::red); |
78 | mTimeBox->setPalette(pal); | 78 | mTimeBox->setPalette(pal); |
79 | //mTimeBox->setAutoMask(true); | 79 | //mTimeBox->setAutoMask(true); |
80 | 80 | ||
81 | agenda->addChild(mTimeBox); | 81 | agenda->addChild(mTimeBox); |
82 | 82 | ||
83 | oldToday = -1; | 83 | oldToday = -1; |
84 | } | 84 | } |
85 | 85 | ||
86 | MarcusBains::~MarcusBains() | 86 | MarcusBains::~MarcusBains() |
87 | { | 87 | { |
88 | delete minutes; | 88 | delete minutes; |
89 | } | 89 | } |
90 | 90 | ||
91 | int MarcusBains::todayColumn() | 91 | int MarcusBains::todayColumn() |
92 | { | 92 | { |
93 | QDate currentDate = QDate::currentDate(); | 93 | QDate currentDate = QDate::currentDate(); |
94 | 94 | ||
95 | DateList dateList = agenda->dateList(); | 95 | DateList dateList = agenda->dateList(); |
96 | DateList::ConstIterator it; | 96 | DateList::ConstIterator it; |
97 | int col = 0; | 97 | int col = 0; |
98 | for(it = dateList.begin(); it != dateList.end(); ++it) { | 98 | for(it = dateList.begin(); it != dateList.end(); ++it) { |
99 | if((*it) == currentDate) | 99 | if((*it) == currentDate) |
100 | return KOGlobals::self()->reverseLayout() ? | 100 | return KOGlobals::self()->reverseLayout() ? |
101 | agenda->columns() - 1 - col : col; | 101 | agenda->columns() - 1 - col : col; |
102 | ++col; | 102 | ++col; |
103 | } | 103 | } |
104 | 104 | ||
105 | return -1; | 105 | return -1; |
106 | } | 106 | } |
107 | void MarcusBains::updateLoc() | 107 | void MarcusBains::updateLoc() |
108 | { | 108 | { |
109 | updateLocation(); | 109 | updateLocation(); |
110 | } | 110 | } |
111 | void MarcusBains::updateLocation(bool recalculate) | 111 | void MarcusBains::updateLocation(bool recalculate) |
112 | { | 112 | { |
113 | 113 | ||
114 | QTime tim = QTime::currentTime(); | 114 | QTime tim = QTime::currentTime(); |
115 | //qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1()); | 115 | //qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1()); |
116 | if((tim.hour() == 0) && (oldTime.hour()==23)) | 116 | if((tim.hour() == 0) && (oldTime.hour()==23)) |
117 | recalculate = true; | 117 | recalculate = true; |
118 | 118 | ||
119 | int mins = tim.hour()*60 + tim.minute(); | 119 | int mins = tim.hour()*60 + tim.minute(); |
120 | int minutesPerCell = 24 * 60 / agenda->rows(); | 120 | int minutesPerCell = 24 * 60 / agenda->rows(); |
121 | int y = mins*agenda->gridSpacingY()/minutesPerCell; | 121 | int y = mins*agenda->gridSpacingY()/minutesPerCell; |
122 | int today = recalculate ? todayColumn() : oldToday; | 122 | int today = recalculate ? todayColumn() : oldToday; |
123 | int x = agenda->gridSpacingX()*today; | 123 | int x = agenda->gridSpacingX()*today; |
124 | bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled); | 124 | bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled); |
125 | 125 | ||
126 | oldTime = tim; | 126 | oldTime = tim; |
127 | oldToday = today; | 127 | oldToday = today; |
128 | 128 | ||
129 | if(disabled || (today<0)) { | 129 | if(disabled || (today<0)) { |
130 | hide(); mTimeBox->hide(); | 130 | hide(); mTimeBox->hide(); |
131 | return; | 131 | return; |
132 | } else { | 132 | } else { |
133 | show(); mTimeBox->show(); | 133 | show(); mTimeBox->show(); |
134 | } | 134 | } |
135 | 135 | ||
136 | if(recalculate) | 136 | if(recalculate) |
137 | setFixedSize(agenda->gridSpacingX(),1); | 137 | setFixedSize(agenda->gridSpacingX(),1); |
138 | agenda->moveChild(this, x, y); | 138 | agenda->moveChild(this, x, y); |
139 | raise(); | 139 | raise(); |
140 | 140 | ||
141 | if(recalculate) | 141 | if(recalculate) |
142 | //mTimeBox->setFont(QFont("helvetica",10)); | 142 | //mTimeBox->setFont(QFont("helvetica",10)); |
143 | mTimeBox->setFont(KOPrefs::instance()->mMarcusBainsFont); | 143 | mTimeBox->setFont(KOPrefs::instance()->mMarcusBainsFont); |
144 | 144 | ||
145 | mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds)); | 145 | mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds)); |
146 | mTimeBox->adjustSize(); | 146 | mTimeBox->adjustSize(); |
147 | // the -2 below is there because there is a bug in this program | 147 | // the -2 below is there because there is a bug in this program |
148 | // somewhere, where the last column of this widget is a few pixels | 148 | // somewhere, where the last column of this widget is a few pixels |
149 | // narrower than the other columns. | 149 | // narrower than the other columns. |
150 | int offs = (today==agenda->columns()-1) ? -4 : 0; | 150 | int offs = (today==agenda->columns()-1) ? -4 : 0; |
151 | agenda->moveChild(mTimeBox, | 151 | agenda->moveChild(mTimeBox, |
152 | x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, | 152 | x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, |
153 | y-mTimeBox->height()); | 153 | y-mTimeBox->height()); |
154 | 154 | ||
155 | mTimeBox->raise(); | 155 | mTimeBox->raise(); |
156 | //mTimeBox->setAutoMask(true); | 156 | //mTimeBox->setAutoMask(true); |
157 | minutes->start(5000,true); | 157 | minutes->start(5000,true); |
158 | } | 158 | } |
159 | 159 | ||
160 | 160 | ||
161 | //////////////////////////////////////////////////////////////////////////// | 161 | //////////////////////////////////////////////////////////////////////////// |
162 | 162 | ||
163 | 163 | ||
164 | /* | 164 | /* |
165 | Create an agenda widget with rows rows and columns columns. | 165 | Create an agenda widget with rows rows and columns columns. |
166 | */ | 166 | */ |
167 | KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, | 167 | KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, |
168 | const char *name,WFlags f) : | 168 | const char *name,WFlags f) : |
169 | QScrollView(parent,name,f) | 169 | QScrollView(parent,name,f) |
170 | { | 170 | { |
171 | mNewItemPopup = new QPopupMenu( this ); | 171 | |
172 | connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); | ||
173 | QString pathString = ""; | ||
174 | if ( !KOPrefs::instance()->mToolBarMiniIcons ) { | ||
175 | if ( QApplication::desktop()->width() < 480 ) | ||
176 | pathString += "icons16/"; | ||
177 | } else | ||
178 | pathString += "iconsmini/"; | ||
179 | |||
180 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); | ||
181 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); | ||
182 | 172 | ||
183 | mColumns = columns; | 173 | mColumns = columns; |
184 | mRows = rows; | 174 | mRows = rows; |
185 | mGridSpacingY = rowSize; | 175 | mGridSpacingY = rowSize; |
186 | mAllDayMode = false; | 176 | mAllDayMode = false; |
187 | #ifndef DESKTOP_VERSION | 177 | #ifndef DESKTOP_VERSION |
188 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); | 178 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); |
189 | #endif | 179 | #endif |
190 | mHolidayMask = 0; | 180 | mHolidayMask = 0; |
191 | init(); | 181 | init(); |
192 | } | 182 | } |
193 | 183 | ||
194 | /* | 184 | /* |
195 | Create an agenda widget with columns columns and one row. This is used for | 185 | Create an agenda widget with columns columns and one row. This is used for |
196 | all-day events. | 186 | all-day events. |
197 | */ | 187 | */ |
198 | KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : | 188 | KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : |
199 | QScrollView(parent,name,f) | 189 | QScrollView(parent,name,f) |
200 | { | 190 | { |
201 | mNewItemPopup = new QPopupMenu( this ); | ||
202 | connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); | ||
203 | QString pathString = ""; | ||
204 | if ( !KOPrefs::instance()->mToolBarMiniIcons ) { | ||
205 | if ( QApplication::desktop()->width() < 480 ) | ||
206 | pathString += "icons16/"; | ||
207 | } else | ||
208 | pathString += "iconsmini/"; | ||
209 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."),1 ); | ||
210 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); | ||
211 | blockResize = false; | 191 | blockResize = false; |
212 | mColumns = columns; | 192 | mColumns = columns; |
213 | mRows = 1; | 193 | mRows = 1; |
214 | //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); | 194 | //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); |
215 | mGridSpacingY = KOPrefs::instance()->mAllDaySize; | 195 | mGridSpacingY = KOPrefs::instance()->mAllDaySize; |
216 | mAllDayMode = true; | 196 | mAllDayMode = true; |
217 | #ifndef DESKTOP_VERSION | 197 | #ifndef DESKTOP_VERSION |
218 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); | 198 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); |
219 | #endif | 199 | #endif |
220 | mHolidayMask = 0; | 200 | mHolidayMask = 0; |
221 | init(); | 201 | init(); |
222 | } | 202 | } |
223 | 203 | ||
224 | 204 | ||
225 | KOAgenda::~KOAgenda() | 205 | KOAgenda::~KOAgenda() |
226 | { | 206 | { |
227 | if(mMarcusBains) delete mMarcusBains; | 207 | if(mMarcusBains) delete mMarcusBains; |
228 | 208 | ||
229 | } | 209 | } |
230 | 210 | ||
231 | Incidence *KOAgenda::selectedIncidence() const | 211 | Incidence *KOAgenda::selectedIncidence() const |
232 | { | 212 | { |
233 | return (mSelectedItem ? mSelectedItem->incidence() : 0); | 213 | return (mSelectedItem ? mSelectedItem->incidence() : 0); |
234 | } | 214 | } |
235 | 215 | ||
236 | 216 | ||
237 | QDate KOAgenda::selectedIncidenceDate() const | 217 | QDate KOAgenda::selectedIncidenceDate() const |
238 | { | 218 | { |
239 | return (mSelectedItem ? mSelectedItem->itemDate() : QDate()); | 219 | return (mSelectedItem ? mSelectedItem->itemDate() : QDate()); |
240 | } | 220 | } |
241 | 221 | ||
242 | 222 | ||
243 | void KOAgenda::init() | 223 | void KOAgenda::init() |
244 | { | 224 | { |
225 | mNewItemPopup = new QPopupMenu( this ); | ||
226 | connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); | ||
227 | QString pathString = ""; | ||
228 | if ( !KOPrefs::instance()->mToolBarMiniIcons ) { | ||
229 | if ( QApplication::desktop()->width() < 480 ) | ||
230 | pathString += "icons16/"; | ||
231 | } else | ||
232 | pathString += "iconsmini/"; | ||
233 | |||
234 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); | ||
235 | mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); | ||
236 | mNewItemPopup->insertSeparator ( ); | ||
237 | mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); | ||
238 | mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); | ||
239 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 ); | ||
240 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); | ||
241 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next month"),6 ); | ||
242 | mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); | ||
245 | #ifndef _WIN32_ | 243 | #ifndef _WIN32_ |
246 | int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase | 244 | int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase |
247 | viewport()->setWFlags ( wflags); | 245 | viewport()->setWFlags ( wflags); |
248 | #endif | 246 | #endif |
249 | mGridSpacingX = 80; | 247 | mGridSpacingX = 80; |
250 | mResizeBorderWidth = 8; | 248 | mResizeBorderWidth = 8; |
251 | mScrollBorderWidth = 8; | 249 | mScrollBorderWidth = 8; |
252 | mScrollDelay = 30; | 250 | mScrollDelay = 30; |
253 | mScrollOffset = 10; | 251 | mScrollOffset = 10; |
254 | mPaintPixmap.resize( 20,20); | 252 | mPaintPixmap.resize( 20,20); |
255 | //enableClipper(true); | 253 | //enableClipper(true); |
256 | 254 | ||
257 | // Grab key strokes for keyboard navigation of agenda. Seems to have no | 255 | // Grab key strokes for keyboard navigation of agenda. Seems to have no |
258 | // effect. Has to be fixed. | 256 | // effect. Has to be fixed. |
259 | setFocusPolicy(WheelFocus); | 257 | setFocusPolicy(WheelFocus); |
260 | 258 | ||
261 | connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); | 259 | connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); |
262 | connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); | 260 | connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); |
263 | connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); | 261 | connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); |
264 | 262 | ||
265 | mStartCellX = 0; | 263 | mStartCellX = 0; |
266 | mStartCellY = 0; | 264 | mStartCellY = 0; |
267 | mCurrentCellX = 0; | 265 | mCurrentCellX = 0; |
268 | mCurrentCellY = 0; | 266 | mCurrentCellY = 0; |
269 | 267 | ||
270 | mSelectionCellX = 0; | 268 | mSelectionCellX = 0; |
271 | mSelectionYTop = 0; | 269 | mSelectionYTop = 0; |
272 | mSelectionHeight = 0; | 270 | mSelectionHeight = 0; |
273 | 271 | ||
274 | mOldLowerScrollValue = -1; | 272 | mOldLowerScrollValue = -1; |
275 | mOldUpperScrollValue = -1; | 273 | mOldUpperScrollValue = -1; |
276 | 274 | ||
277 | mClickedItem = 0; | 275 | mClickedItem = 0; |
278 | 276 | ||
279 | mActionItem = 0; | 277 | mActionItem = 0; |
280 | mActionType = NOP; | 278 | mActionType = NOP; |
281 | mItemMoved = false; | 279 | mItemMoved = false; |
282 | 280 | ||
283 | mSelectedItem = 0; | 281 | mSelectedItem = 0; |
284 | 282 | ||
285 | // mItems.setAutoDelete(true); | 283 | // mItems.setAutoDelete(true); |
286 | 284 | ||
287 | resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 ); | 285 | resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 ); |
288 | 286 | ||
289 | viewport()->update(); | 287 | viewport()->update(); |
290 | 288 | ||
291 | setMinimumSize(30, 1); | 289 | setMinimumSize(30, 1); |
292 | // setMaximumHeight(mGridSpacingY * mRows + 5); | 290 | // setMaximumHeight(mGridSpacingY * mRows + 5); |
293 | 291 | ||
294 | // Disable horizontal scrollbar. This is a hack. The geometry should be | 292 | // Disable horizontal scrollbar. This is a hack. The geometry should be |
295 | // controlled in a way that the contents horizontally always fits. Then it is | 293 | // controlled in a way that the contents horizontally always fits. Then it is |
296 | // not necessary to turn off the scrollbar. | 294 | // not necessary to turn off the scrollbar. |
297 | setHScrollBarMode(AlwaysOff); | 295 | setHScrollBarMode(AlwaysOff); |
298 | if ( ! mAllDayMode ) | 296 | if ( ! mAllDayMode ) |
299 | setVScrollBarMode(AlwaysOn); | 297 | setVScrollBarMode(AlwaysOn); |
300 | else | 298 | else |
301 | setVScrollBarMode(AlwaysOff); | 299 | setVScrollBarMode(AlwaysOff); |
302 | 300 | ||
303 | setStartHour(KOPrefs::instance()->mDayBegins); | 301 | setStartHour(KOPrefs::instance()->mDayBegins); |
304 | 302 | ||
305 | calculateWorkingHours(); | 303 | calculateWorkingHours(); |
306 | 304 | ||
307 | connect(verticalScrollBar(),SIGNAL(valueChanged(int)), | 305 | connect(verticalScrollBar(),SIGNAL(valueChanged(int)), |
308 | SLOT(checkScrollBoundaries(int))); | 306 | SLOT(checkScrollBoundaries(int))); |
309 | 307 | ||
310 | // Create the Marcus Bains line. | 308 | // Create the Marcus Bains line. |
311 | if(mAllDayMode) | 309 | if(mAllDayMode) |
312 | mMarcusBains = 0; | 310 | mMarcusBains = 0; |
313 | else { | 311 | else { |
314 | mMarcusBains = new MarcusBains(this); | 312 | mMarcusBains = new MarcusBains(this); |
315 | addChild(mMarcusBains); | 313 | addChild(mMarcusBains); |
316 | } | 314 | } |
317 | } | 315 | } |
318 | 316 | ||
319 | void KOAgenda::clear() | 317 | void KOAgenda::clear() |
320 | { | 318 | { |
321 | KOAgendaItem *item; | 319 | KOAgendaItem *item; |
322 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { | 320 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { |
323 | mUnusedItems.append( item ); | 321 | mUnusedItems.append( item ); |
324 | //item->hide(); | 322 | //item->hide(); |
325 | } | 323 | } |
326 | mItems.clear(); | 324 | mItems.clear(); |
327 | mSelectedItem = 0; | 325 | mSelectedItem = 0; |
328 | clearSelection(); | 326 | clearSelection(); |
329 | } | 327 | } |
330 | 328 | ||
331 | void KOAgenda::clearSelection() | 329 | void KOAgenda::clearSelection() |
332 | { | 330 | { |
333 | mSelectionCellX = 0; | 331 | mSelectionCellX = 0; |
334 | mSelectionYTop = 0; | 332 | mSelectionYTop = 0; |
335 | mSelectionHeight = 0; | 333 | mSelectionHeight = 0; |
336 | } | 334 | } |
337 | 335 | ||
338 | void KOAgenda::marcus_bains() | 336 | void KOAgenda::marcus_bains() |
339 | { | 337 | { |
340 | if(mMarcusBains) mMarcusBains->updateLocation(true); | 338 | if(mMarcusBains) mMarcusBains->updateLocation(true); |
341 | } | 339 | } |
342 | 340 | ||
343 | 341 | ||
344 | void KOAgenda::changeColumns(int columns) | 342 | void KOAgenda::changeColumns(int columns) |
345 | { | 343 | { |
346 | if (columns == 0) { | 344 | if (columns == 0) { |
347 | kdDebug() << "KOAgenda::changeColumns() called with argument 0" << endl; | 345 | kdDebug() << "KOAgenda::changeColumns() called with argument 0" << endl; |
348 | return; | 346 | return; |
349 | } | 347 | } |
350 | 348 | ||
351 | clear(); | 349 | clear(); |
352 | 350 | ||
353 | mColumns = columns; | 351 | mColumns = columns; |
354 | // setMinimumSize(mColumns * 10, mGridSpacingY + 1); | 352 | // setMinimumSize(mColumns * 10, mGridSpacingY + 1); |
355 | // init(); | 353 | // init(); |
356 | // update(); | 354 | // update(); |
357 | //qDebug("KOAgenda::changeColumns "); | 355 | //qDebug("KOAgenda::changeColumns "); |
358 | computeSizes(); | 356 | computeSizes(); |
359 | // QResizeEvent event( size(), size() ); | 357 | // QResizeEvent event( size(), size() ); |
360 | 358 | ||
361 | //QApplication::sendEvent( this, &event ); | 359 | //QApplication::sendEvent( this, &event ); |
362 | } | 360 | } |
363 | 361 | ||
364 | /* | 362 | /* |
365 | This is the eventFilter function, which gets all events from the KOAgendaItems | 363 | This is the eventFilter function, which gets all events from the KOAgendaItems |
366 | contained in the agenda. It has to handle moving and resizing for all items. | 364 | contained in the agenda. It has to handle moving and resizing for all items. |
367 | */ | 365 | */ |
368 | bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) | 366 | bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) |
369 | { | 367 | { |
370 | // kdDebug() << "KOAgenda::eventFilter" << endl; | 368 | // kdDebug() << "KOAgenda::eventFilter" << endl; |
371 | switch(event->type()) { | 369 | switch(event->type()) { |
372 | case QEvent::MouseButtonPress: | 370 | case QEvent::MouseButtonPress: |
373 | case QEvent::MouseButtonDblClick: | 371 | case QEvent::MouseButtonDblClick: |
374 | case QEvent::MouseButtonRelease: | 372 | case QEvent::MouseButtonRelease: |
375 | case QEvent::MouseMove: | 373 | case QEvent::MouseMove: |
376 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); | 374 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); |
377 | 375 | ||
378 | case (QEvent::Leave): | 376 | case (QEvent::Leave): |
379 | if (!mActionItem) | 377 | if (!mActionItem) |
380 | setCursor(arrowCursor); | 378 | setCursor(arrowCursor); |
381 | return true; | 379 | return true; |
382 | 380 | ||
383 | default: | 381 | default: |
384 | return QScrollView::eventFilter(object,event); | 382 | return QScrollView::eventFilter(object,event); |
385 | } | 383 | } |
386 | } | 384 | } |
387 | 385 | ||
388 | 386 | ||
389 | bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | 387 | bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) |
390 | { | 388 | { |
391 | //qDebug("KOAgenda::eventFilter_mous "); | 389 | //qDebug("KOAgenda::eventFilter_mous "); |
392 | QPoint viewportPos; | 390 | QPoint viewportPos; |
393 | if (object != viewport()) { | 391 | if (object != viewport()) { |
394 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); | 392 | viewportPos = ((QWidget *)object)->mapToParent(me->pos()); |
395 | } else { | 393 | } else { |
396 | viewportPos = me->pos(); | 394 | viewportPos = me->pos(); |
397 | } | 395 | } |
398 | static int startX = 0; | 396 | static int startX = 0; |
399 | static int startY = 0; | 397 | static int startY = 0; |
400 | static bool block = true; | 398 | static bool block = true; |
401 | switch (me->type()) { | 399 | switch (me->type()) { |
402 | case QEvent::MouseButtonPress: | 400 | case QEvent::MouseButtonPress: |
403 | //qDebug("QEvent::MouseButtonPress: "); | 401 | //qDebug("QEvent::MouseButtonPress: "); |
404 | // kdDebug() << "koagenda: filtered button press" << endl; | 402 | // kdDebug() << "koagenda: filtered button press" << endl; |
405 | if (object != viewport()) { | 403 | if (object != viewport()) { |
406 | if (me->button() == RightButton) { | 404 | if (me->button() == RightButton) { |
407 | 405 | ||
408 | mClickedItem = (KOAgendaItem *)object; | 406 | mClickedItem = (KOAgendaItem *)object; |
409 | if (mClickedItem) { | 407 | if (mClickedItem) { |
410 | selectItem(mClickedItem); | 408 | selectItem(mClickedItem); |
411 | // emit showIncidencePopupSignal(mClickedItem->incidence()); | 409 | // emit showIncidencePopupSignal(mClickedItem->incidence()); |
412 | } | 410 | } |
413 | //mItemPopup->popup(QCursor::pos()); | 411 | //mItemPopup->popup(QCursor::pos()); |
414 | } else { | 412 | } else { |
415 | mActionItem = (KOAgendaItem *)object; | 413 | mActionItem = (KOAgendaItem *)object; |
416 | if (mActionItem) { | 414 | if (mActionItem) { |
417 | if ( mSelectionHeight > 0 ) { | 415 | if ( mSelectionHeight > 0 ) { |
418 | int selectionCellX = mSelectionCellX * mGridSpacingX; | 416 | int selectionCellX = mSelectionCellX * mGridSpacingX; |
419 | int selectionYTop = mSelectionYTop; | 417 | int selectionYTop = mSelectionYTop; |
420 | int gridSpacingX = mGridSpacingX; | 418 | int gridSpacingX = mGridSpacingX; |
421 | int selectionHeight = mSelectionHeight; | 419 | int selectionHeight = mSelectionHeight; |
422 | clearSelection(); | 420 | clearSelection(); |
423 | repaintContents( selectionCellX, selectionYTop, | 421 | repaintContents( selectionCellX, selectionYTop, |
424 | gridSpacingX, selectionHeight,false ); | 422 | gridSpacingX, selectionHeight,false ); |
425 | } | 423 | } |
426 | selectItem(mActionItem); | 424 | selectItem(mActionItem); |
427 | Incidence *incidence = mActionItem->incidence(); | 425 | Incidence *incidence = mActionItem->incidence(); |
428 | if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { | 426 | if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { |
429 | mActionItem = 0; | 427 | mActionItem = 0; |
430 | } else { | 428 | } else { |
431 | startItemAction(viewportPos); | 429 | startItemAction(viewportPos); |
432 | startX = viewportPos.x(); | 430 | startX = viewportPos.x(); |
433 | startY = viewportPos.y(); | 431 | startY = viewportPos.y(); |
434 | block = true; | 432 | block = true; |
435 | } | 433 | } |
436 | } | 434 | } |
437 | } | 435 | } |
438 | } else { | 436 | } else { |
439 | selectItem(0); | 437 | selectItem(0); |
440 | mActionItem = 0; | 438 | mActionItem = 0; |
441 | if (me->button() == RightButton ) { | 439 | if (me->button() == RightButton ) { |
442 | blockNewEvent = true; | 440 | blockNewEvent = true; |
443 | qDebug("right "); | 441 | qDebug("right "); |
444 | int x,y; | 442 | int x,y; |
445 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 443 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
446 | int gx,gy; | 444 | int gx,gy; |
447 | contentsToGrid(x,y,gx,gy); | 445 | contentsToGrid(x,y,gx,gy); |
448 | mStartCellX = gx; | 446 | mStartCellX = gx; |
449 | mStartCellY = gy; | 447 | mStartCellY = gy; |
450 | mCurrentCellX = gx; | 448 | mCurrentCellX = gx; |
451 | mCurrentCellY = gy; | 449 | mCurrentCellY = gy; |
452 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); | 450 | mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); |
453 | 451 | ||
454 | } else { | 452 | } else { |
455 | blockNewEvent = false; | 453 | blockNewEvent = false; |
456 | setCursor(arrowCursor); | 454 | setCursor(arrowCursor); |
457 | startSelectAction(viewportPos); | 455 | startSelectAction(viewportPos); |
458 | } | 456 | } |
459 | } | 457 | } |
460 | break; | 458 | break; |
461 | 459 | ||
462 | case QEvent::MouseButtonRelease: | 460 | case QEvent::MouseButtonRelease: |
463 | //qDebug("QEvent::MouseButtonRelease: "); | 461 | //qDebug("QEvent::MouseButtonRelease: "); |
464 | if (me->button() == RightButton && block ) { | 462 | if (me->button() == RightButton && block ) { |
465 | if (object != viewport()) { | 463 | if (object != viewport()) { |
466 | mClickedItem = (KOAgendaItem *)object; | 464 | mClickedItem = (KOAgendaItem *)object; |
467 | if (mActionItem ) { | 465 | if (mActionItem ) { |
468 | endItemAction(); | 466 | endItemAction(); |
469 | } | 467 | } |
470 | if (mClickedItem) { | 468 | if (mClickedItem) { |
471 | selectItem(mClickedItem); | 469 | selectItem(mClickedItem); |
472 | emit showIncidencePopupSignal(mClickedItem->incidence()); | 470 | emit showIncidencePopupSignal(mClickedItem->incidence()); |
473 | } | 471 | } |
474 | } | 472 | } |
475 | break; | 473 | break; |
476 | } | 474 | } |
477 | block = true; | 475 | block = true; |
478 | if (mActionItem) { | 476 | if (mActionItem) { |
479 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 477 | QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
480 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); | 478 | //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); |
481 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { | 479 | if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { |
482 | mScrollUpTimer.stop(); | 480 | mScrollUpTimer.stop(); |
483 | mScrollDownTimer.stop(); | 481 | mScrollDownTimer.stop(); |
484 | mActionItem->resetMove(); | 482 | mActionItem->resetMove(); |
485 | placeSubCells( mActionItem ); | 483 | placeSubCells( mActionItem ); |
486 | // emit startDragSignal( mActionItem->incidence() ); | 484 | // emit startDragSignal( mActionItem->incidence() ); |
487 | setCursor( arrowCursor ); | 485 | setCursor( arrowCursor ); |
488 | mActionItem = 0; | 486 | mActionItem = 0; |
489 | mActionType = NOP; | 487 | mActionType = NOP; |
490 | mItemMoved = 0; | 488 | mItemMoved = 0; |
491 | return true; | 489 | return true; |
492 | } | 490 | } |
493 | endItemAction(); | 491 | endItemAction(); |
494 | } else if ( mActionType == SELECT ) { | 492 | } else if ( mActionType == SELECT ) { |
495 | if (me->button() == RightButton ) { | 493 | if (me->button() == RightButton ) { |
496 | 494 | ||
497 | } else { | 495 | } else { |
498 | endSelectAction( !blockNewEvent ); | 496 | endSelectAction( !blockNewEvent ); |
499 | } | 497 | } |
500 | } | 498 | } |
501 | break; | 499 | break; |
502 | 500 | ||
503 | case QEvent::MouseMove: | 501 | case QEvent::MouseMove: |
504 | if (object != viewport()) { | 502 | if (object != viewport()) { |
505 | KOAgendaItem *moveItem = (KOAgendaItem *)object; | 503 | KOAgendaItem *moveItem = (KOAgendaItem *)object; |
506 | //qDebug("moveItem %d ",moveItem ); | 504 | //qDebug("moveItem %d ",moveItem ); |
507 | if (!moveItem->incidence()->isReadOnly() /*&& | 505 | if (!moveItem->incidence()->isReadOnly() /*&& |
508 | !moveItem->incidence()->recurrence()->doesRecur()*/ ) | 506 | !moveItem->incidence()->recurrence()->doesRecur()*/ ) |
509 | if (!mActionItem) | 507 | if (!mActionItem) |
510 | setNoActionCursor(moveItem,viewportPos); | 508 | setNoActionCursor(moveItem,viewportPos); |
511 | else { | 509 | else { |
512 | if ( block ) { | 510 | if ( block ) { |
513 | int dX, dY; | 511 | int dX, dY; |
514 | dX = startX - viewportPos.x(); | 512 | dX = startX - viewportPos.x(); |
515 | if ( dX < 0 ) | 513 | if ( dX < 0 ) |
516 | dX = -dX; | 514 | dX = -dX; |
517 | dY = viewportPos.y() - startY; | 515 | dY = viewportPos.y() - startY; |
518 | if ( dY < 0 ) | 516 | if ( dY < 0 ) |
519 | dY = -dY; | 517 | dY = -dY; |
520 | int diff = 30; | 518 | int diff = 30; |
521 | if ( QApplication::desktop()->width() < 480 ) | 519 | if ( QApplication::desktop()->width() < 480 ) |
522 | diff = 15; | 520 | diff = 15; |
523 | // qDebug(" %d %d ",dX, dY ); | 521 | // qDebug(" %d %d ",dX, dY ); |
524 | if ( dX > diff || dY > diff ) { | 522 | if ( dX > diff || dY > diff ) { |
525 | block = false; | 523 | block = false; |
526 | } | 524 | } |
527 | } | 525 | } |
528 | if ( !block ) | 526 | if ( !block ) |
529 | performItemAction(viewportPos); | 527 | performItemAction(viewportPos); |
530 | } | 528 | } |
531 | } else { | 529 | } else { |
532 | if ( mActionType == SELECT ) { | 530 | if ( mActionType == SELECT ) { |
533 | performSelectAction( viewportPos ); | 531 | performSelectAction( viewportPos ); |
534 | } | 532 | } |
535 | } | 533 | } |
536 | break; | 534 | break; |
537 | 535 | ||
538 | case QEvent::MouseButtonDblClick: | 536 | case QEvent::MouseButtonDblClick: |
539 | if (object == viewport()) { | 537 | if (object == viewport()) { |
540 | selectItem(0); | 538 | selectItem(0); |
541 | int x,y; | 539 | int x,y; |
542 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 540 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
543 | int gx,gy; | 541 | int gx,gy; |
544 | contentsToGrid(x,y,gx,gy); | 542 | contentsToGrid(x,y,gx,gy); |
545 | emit newEventSignal(gx,gy); | 543 | emit newEventSignal(gx,gy); |
546 | } else { | 544 | } else { |
547 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; | 545 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; |
548 | selectItem(doubleClickedItem); | 546 | selectItem(doubleClickedItem); |
549 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 547 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
550 | emit editIncidenceSignal(doubleClickedItem->incidence()); | 548 | emit editIncidenceSignal(doubleClickedItem->incidence()); |
551 | else | 549 | else |
552 | emit showIncidenceSignal(doubleClickedItem->incidence()); | 550 | emit showIncidenceSignal(doubleClickedItem->incidence()); |
553 | } | 551 | } |
554 | break; | 552 | break; |
555 | 553 | ||
556 | default: | 554 | default: |
557 | break; | 555 | break; |
558 | } | 556 | } |
559 | 557 | ||
560 | return true; | 558 | return true; |
561 | } | 559 | } |
562 | 560 | ||
563 | void KOAgenda::newItem( int item ) | 561 | void KOAgenda::newItem( int item ) |
564 | { | 562 | { |
565 | qDebug("new %d ", item); | ||
566 | if ( item == 1 ) { //new event | 563 | if ( item == 1 ) { //new event |
567 | newEventSignal(mStartCellX ,mStartCellY ); | 564 | newEventSignal(mStartCellX ,mStartCellY ); |
568 | } | 565 | } else |
569 | if ( item == 2 ) { //new event | 566 | if ( item == 2 ) { //new event |
570 | newTodoSignal(mStartCellX ,mStartCellY ); | 567 | newTodoSignal(mStartCellX ,mStartCellY ); |
571 | } | 568 | } else |
569 | { | ||
570 | QDate day = mSelectedDates[mStartCellX]; | ||
571 | emit showDateView( item, day ); | ||
572 | // 3Day view | ||
573 | // 4Week view | ||
574 | // 5Month view | ||
575 | // 6Journal view | ||
576 | } | ||
572 | } | 577 | } |
573 | void KOAgenda::startSelectAction(QPoint viewportPos) | 578 | void KOAgenda::startSelectAction(QPoint viewportPos) |
574 | { | 579 | { |
575 | //emit newStartSelectSignal(); | 580 | //emit newStartSelectSignal(); |
576 | 581 | ||
577 | mActionType = SELECT; | 582 | mActionType = SELECT; |
578 | 583 | ||
579 | int x,y; | 584 | int x,y; |
580 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 585 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
581 | int gx,gy; | 586 | int gx,gy; |
582 | contentsToGrid(x,y,gx,gy); | 587 | contentsToGrid(x,y,gx,gy); |
583 | 588 | ||
584 | mStartCellX = gx; | 589 | mStartCellX = gx; |
585 | mStartCellY = gy; | 590 | mStartCellY = gy; |
586 | mCurrentCellX = gx; | 591 | mCurrentCellX = gx; |
587 | mCurrentCellY = gy; | 592 | mCurrentCellY = gy; |
588 | 593 | ||
589 | // Store coordinates of old selection | 594 | // Store coordinates of old selection |
590 | int selectionX = mSelectionCellX * mGridSpacingX; | 595 | int selectionX = mSelectionCellX * mGridSpacingX; |
591 | int selectionYTop = mSelectionYTop; | 596 | int selectionYTop = mSelectionYTop; |
592 | int selectionHeight = mSelectionHeight; | 597 | int selectionHeight = mSelectionHeight; |
593 | 598 | ||
594 | // Store new selection | 599 | // Store new selection |
595 | mSelectionCellX = gx; | 600 | mSelectionCellX = gx; |
596 | mSelectionYTop = gy * mGridSpacingY; | 601 | mSelectionYTop = gy * mGridSpacingY; |
597 | mSelectionHeight = mGridSpacingY; | 602 | mSelectionHeight = mGridSpacingY; |
598 | 603 | ||
599 | // Clear old selection | 604 | // Clear old selection |
600 | repaintContents( selectionX, selectionYTop, | 605 | repaintContents( selectionX, selectionYTop, |
601 | mGridSpacingX, selectionHeight,false ); | 606 | mGridSpacingX, selectionHeight,false ); |
602 | 607 | ||
603 | // Paint new selection | 608 | // Paint new selection |
604 | // repaintContents( mSelectionCellX * mGridSpacingX, mSelectionYTop, | 609 | // repaintContents( mSelectionCellX * mGridSpacingX, mSelectionYTop, |
605 | // mGridSpacingX, mSelectionHeight ); | 610 | // mGridSpacingX, mSelectionHeight ); |
606 | } | 611 | } |
607 | 612 | ||
608 | void KOAgenda::performSelectAction(QPoint viewportPos) | 613 | void KOAgenda::performSelectAction(QPoint viewportPos) |
609 | { | 614 | { |
610 | int x,y; | 615 | int x,y; |
611 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 616 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
612 | int gx,gy; | 617 | int gx,gy; |
613 | contentsToGrid(x,y,gx,gy); | 618 | contentsToGrid(x,y,gx,gy); |
614 | 619 | ||
615 | QPoint clipperPos = clipper()-> | 620 | QPoint clipperPos = clipper()-> |
616 | mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 621 | mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
617 | 622 | ||
618 | // Scroll if cursor was moved to upper or lower end of agenda. | 623 | // Scroll if cursor was moved to upper or lower end of agenda. |
619 | if (clipperPos.y() < mScrollBorderWidth) { | 624 | if (clipperPos.y() < mScrollBorderWidth) { |
620 | mScrollUpTimer.start(mScrollDelay); | 625 | mScrollUpTimer.start(mScrollDelay); |
621 | } else if (visibleHeight() - clipperPos.y() < | 626 | } else if (visibleHeight() - clipperPos.y() < |
622 | mScrollBorderWidth) { | 627 | mScrollBorderWidth) { |
623 | mScrollDownTimer.start(mScrollDelay); | 628 | mScrollDownTimer.start(mScrollDelay); |
624 | } else { | 629 | } else { |
625 | mScrollUpTimer.stop(); | 630 | mScrollUpTimer.stop(); |
626 | mScrollDownTimer.stop(); | 631 | mScrollDownTimer.stop(); |
627 | } | 632 | } |
628 | 633 | ||
629 | if ( gy > mCurrentCellY ) { | 634 | if ( gy > mCurrentCellY ) { |
630 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; | 635 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; |
631 | 636 | ||
632 | #if 0 | 637 | #if 0 |
633 | // FIXME: Repaint only the newly selected region | 638 | // FIXME: Repaint only the newly selected region |
634 | repaintContents( mSelectionCellX * mGridSpacingX, | 639 | repaintContents( mSelectionCellX * mGridSpacingX, |
635 | mCurrentCellY + mGridSpacingY, | 640 | mCurrentCellY + mGridSpacingY, |
636 | mGridSpacingX, | 641 | mGridSpacingX, |
637 | mSelectionHeight - ( gy - mCurrentCellY - 1 ) * mGridSpacingY ); | 642 | mSelectionHeight - ( gy - mCurrentCellY - 1 ) * mGridSpacingY ); |
638 | #else | 643 | #else |
639 | repaintContents( (KOGlobals::self()->reverseLayout() ? | 644 | repaintContents( (KOGlobals::self()->reverseLayout() ? |
640 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * | 645 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * |
641 | mGridSpacingX, mSelectionYTop, | 646 | mGridSpacingX, mSelectionYTop, |
642 | mGridSpacingX, mSelectionHeight , false); | 647 | mGridSpacingX, mSelectionHeight , false); |
643 | #endif | 648 | #endif |
644 | 649 | ||
645 | mCurrentCellY = gy; | 650 | mCurrentCellY = gy; |
646 | } else if ( gy < mCurrentCellY ) { | 651 | } else if ( gy < mCurrentCellY ) { |
647 | if ( gy >= mStartCellY ) { | 652 | if ( gy >= mStartCellY ) { |
648 | int selectionHeight = mSelectionHeight; | 653 | int selectionHeight = mSelectionHeight; |
649 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; | 654 | mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; |
650 | 655 | ||
651 | repaintContents( (KOGlobals::self()->reverseLayout() ? | 656 | repaintContents( (KOGlobals::self()->reverseLayout() ? |
652 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * | 657 | mColumns - 1 - mSelectionCellX : mSelectionCellX) * |
653 | mGridSpacingX, mSelectionYTop, | 658 | mGridSpacingX, mSelectionYTop, |
654 | mGridSpacingX, selectionHeight,false ); | 659 | mGridSpacingX, selectionHeight,false ); |
655 | 660 | ||
656 | mCurrentCellY = gy; | 661 | mCurrentCellY = gy; |
657 | } else { | 662 | } else { |
658 | } | 663 | } |
659 | } | 664 | } |
660 | } | 665 | } |
661 | 666 | ||
662 | void KOAgenda::endSelectAction( bool emitNewEvent ) | 667 | void KOAgenda::endSelectAction( bool emitNewEvent ) |
663 | { | 668 | { |
664 | mActionType = NOP; | 669 | mActionType = NOP; |
665 | mScrollUpTimer.stop(); | 670 | mScrollUpTimer.stop(); |
666 | mScrollDownTimer.stop(); | 671 | mScrollDownTimer.stop(); |
667 | 672 | ||
668 | emit newTimeSpanSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); | 673 | emit newTimeSpanSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); |
669 | if ( emitNewEvent && mStartCellY < mCurrentCellY ) | 674 | if ( emitNewEvent && mStartCellY < mCurrentCellY ) |
670 | emit newEventSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); | 675 | emit newEventSignal(mStartCellX,mStartCellY,mCurrentCellX,mCurrentCellY); |
671 | } | 676 | } |
672 | 677 | ||
673 | void KOAgenda::startItemAction(QPoint viewportPos) | 678 | void KOAgenda::startItemAction(QPoint viewportPos) |
674 | { | 679 | { |
675 | int x,y; | 680 | int x,y; |
676 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 681 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
677 | int gx,gy; | 682 | int gx,gy; |
678 | contentsToGrid(x,y,gx,gy); | 683 | contentsToGrid(x,y,gx,gy); |
679 | 684 | ||
680 | mStartCellX = gx; | 685 | mStartCellX = gx; |
681 | mStartCellY = gy; | 686 | mStartCellY = gy; |
682 | mCurrentCellX = gx; | 687 | mCurrentCellX = gx; |
683 | mCurrentCellY = gy; | 688 | mCurrentCellY = gy; |
684 | 689 | ||
685 | if (mAllDayMode) { | 690 | if (mAllDayMode) { |
686 | int gridDistanceX = (x - gx * mGridSpacingX); | 691 | int gridDistanceX = (x - gx * mGridSpacingX); |
687 | if (gridDistanceX < mResizeBorderWidth && | 692 | if (gridDistanceX < mResizeBorderWidth && |
688 | mActionItem->cellX() == mCurrentCellX) { | 693 | mActionItem->cellX() == mCurrentCellX) { |
689 | mActionType = RESIZELEFT; | 694 | mActionType = RESIZELEFT; |
690 | setCursor(sizeHorCursor); | 695 | setCursor(sizeHorCursor); |
691 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && | 696 | } else if ((mGridSpacingX - gridDistanceX) < mResizeBorderWidth && |
692 | mActionItem->cellXWidth() == mCurrentCellX) { | 697 | mActionItem->cellXWidth() == mCurrentCellX) { |
693 | mActionType = RESIZERIGHT; | 698 | mActionType = RESIZERIGHT; |
694 | setCursor(sizeHorCursor); | 699 | setCursor(sizeHorCursor); |
695 | } else { | 700 | } else { |
696 | mActionType = MOVE; | 701 | mActionType = MOVE; |
697 | mActionItem->startMove(); | 702 | mActionItem->startMove(); |
698 | setCursor(sizeAllCursor); | 703 | setCursor(sizeAllCursor); |
699 | } | 704 | } |
700 | } else { | 705 | } else { |
701 | int gridDistanceY = (y - gy * mGridSpacingY); | 706 | int gridDistanceY = (y - gy * mGridSpacingY); |
702 | bool allowResize = ( mActionItem->incidence()->type() != "Todo" ); | 707 | bool allowResize = ( mActionItem->incidence()->type() != "Todo" ); |
703 | if (allowResize && gridDistanceY < mResizeBorderWidth && | 708 | if (allowResize && gridDistanceY < mResizeBorderWidth && |
704 | mActionItem->cellYTop() == mCurrentCellY && | 709 | mActionItem->cellYTop() == mCurrentCellY && |
705 | !mActionItem->firstMultiItem()) { | 710 | !mActionItem->firstMultiItem()) { |
706 | mActionType = RESIZETOP; | 711 | mActionType = RESIZETOP; |
707 | setCursor(sizeVerCursor); | 712 | setCursor(sizeVerCursor); |
708 | } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && | 713 | } else if (allowResize &&(mGridSpacingY - gridDistanceY) < mResizeBorderWidth && |
709 | mActionItem->cellYBottom() == mCurrentCellY && | 714 | mActionItem->cellYBottom() == mCurrentCellY && |
710 | !mActionItem->lastMultiItem()) { | 715 | !mActionItem->lastMultiItem()) { |
711 | mActionType = RESIZEBOTTOM; | 716 | mActionType = RESIZEBOTTOM; |
712 | setCursor(sizeVerCursor); | 717 | setCursor(sizeVerCursor); |
713 | } else { | 718 | } else { |
714 | mActionType = MOVE; | 719 | mActionType = MOVE; |
715 | mActionItem->startMove(); | 720 | mActionItem->startMove(); |
716 | setCursor(sizeAllCursor); | 721 | setCursor(sizeAllCursor); |
717 | } | 722 | } |
718 | } | 723 | } |
719 | } | 724 | } |
720 | 725 | ||
721 | void KOAgenda::performItemAction(QPoint viewportPos) | 726 | void KOAgenda::performItemAction(QPoint viewportPos) |
722 | { | 727 | { |
723 | // kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl; | 728 | // kdDebug() << "viewportPos: " << viewportPos.x() << "," << viewportPos.y() << endl; |
724 | // QPoint point = viewport()->mapToGlobal(viewportPos); | 729 | // QPoint point = viewport()->mapToGlobal(viewportPos); |
725 | // kdDebug() << "Global: " << point.x() << "," << point.y() << endl; | 730 | // kdDebug() << "Global: " << point.x() << "," << point.y() << endl; |
726 | // point = clipper()->mapFromGlobal(point); | 731 | // point = clipper()->mapFromGlobal(point); |
727 | // kdDebug() << "clipper: " << point.x() << "," << point.y() << endl; | 732 | // kdDebug() << "clipper: " << point.x() << "," << point.y() << endl; |
728 | // kdDebug() << "visible height: " << visibleHeight() << endl; | 733 | // kdDebug() << "visible height: " << visibleHeight() << endl; |
729 | int x,y; | 734 | int x,y; |
730 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 735 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
731 | // kdDebug() << "contents: " << x << "," << y << "\n" << endl; | 736 | // kdDebug() << "contents: " << x << "," << y << "\n" << endl; |
732 | int gx,gy; | 737 | int gx,gy; |
733 | contentsToGrid(x,y,gx,gy); | 738 | contentsToGrid(x,y,gx,gy); |
734 | QPoint clipperPos = clipper()-> | 739 | QPoint clipperPos = clipper()-> |
735 | mapFromGlobal(viewport()->mapToGlobal(viewportPos)); | 740 | mapFromGlobal(viewport()->mapToGlobal(viewportPos)); |
736 | 741 | ||
737 | // Cursor left active agenda area. | 742 | // Cursor left active agenda area. |
738 | // This starts a drag. | 743 | // This starts a drag. |
739 | if ( /*clipperPos.y() < 0 || clipperPos.y() > visibleHeight() ||*/ | 744 | if ( /*clipperPos.y() < 0 || clipperPos.y() > visibleHeight() ||*/ |
740 | clipperPos.x() < 0 || clipperPos.x() > visibleWidth() ) { | 745 | clipperPos.x() < 0 || clipperPos.x() > visibleWidth() ) { |
741 | if ( mActionType == MOVE ) { | 746 | if ( mActionType == MOVE ) { |
742 | mScrollUpTimer.stop(); | 747 | mScrollUpTimer.stop(); |
743 | mScrollDownTimer.stop(); | 748 | mScrollDownTimer.stop(); |
744 | mActionItem->resetMove(); | 749 | mActionItem->resetMove(); |
745 | placeSubCells( mActionItem ); | 750 | placeSubCells( mActionItem ); |
746 | // emit startDragSignal( mActionItem->incidence() ); | 751 | // emit startDragSignal( mActionItem->incidence() ); |
747 | setCursor( arrowCursor ); | 752 | setCursor( arrowCursor ); |
748 | mActionItem = 0; | 753 | mActionItem = 0; |
749 | mActionType = NOP; | 754 | mActionType = NOP; |
750 | mItemMoved = 0; | 755 | mItemMoved = 0; |
751 | return; | 756 | return; |
752 | } | 757 | } |
753 | } else { | 758 | } else { |
754 | switch ( mActionType ) { | 759 | switch ( mActionType ) { |
755 | case MOVE: | 760 | case MOVE: |
756 | setCursor( sizeAllCursor ); | 761 | setCursor( sizeAllCursor ); |
757 | break; | 762 | break; |
758 | case RESIZETOP: | 763 | case RESIZETOP: |
759 | case RESIZEBOTTOM: | 764 | case RESIZEBOTTOM: |
760 | setCursor( sizeVerCursor ); | 765 | setCursor( sizeVerCursor ); |
761 | break; | 766 | break; |
762 | case RESIZELEFT: | 767 | case RESIZELEFT: |
763 | case RESIZERIGHT: | 768 | case RESIZERIGHT: |
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 12943d7..2069b22 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h | |||
@@ -1,290 +1,291 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 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 | #ifndef KOAGENDA_H | 23 | #ifndef KOAGENDA_H |
24 | #define KOAGENDA_H | 24 | #define KOAGENDA_H |
25 | 25 | ||
26 | #include <qscrollview.h> | 26 | #include <qscrollview.h> |
27 | #include <qtimer.h> | 27 | #include <qtimer.h> |
28 | #include <qmemarray.h> | 28 | #include <qmemarray.h> |
29 | #include <qpainter.h> | 29 | #include <qpainter.h> |
30 | #include <qpixmap.h> | 30 | #include <qpixmap.h> |
31 | #include <qguardedptr.h> | 31 | #include <qguardedptr.h> |
32 | 32 | ||
33 | #include "koagendaitem.h" | 33 | #include "koagendaitem.h" |
34 | 34 | ||
35 | class QPopupMenu; | 35 | class QPopupMenu; |
36 | class QTime; | 36 | class QTime; |
37 | class KConfig; | 37 | class KConfig; |
38 | class QFrame; | 38 | class QFrame; |
39 | class KOAgenda; | 39 | class KOAgenda; |
40 | class KCal::Event; | 40 | class KCal::Event; |
41 | class KCal::Todo; | 41 | class KCal::Todo; |
42 | 42 | ||
43 | using namespace KCal; | 43 | using namespace KCal; |
44 | 44 | ||
45 | class MarcusBains : public QFrame { | 45 | class MarcusBains : public QFrame { |
46 | Q_OBJECT | 46 | Q_OBJECT |
47 | public: | 47 | public: |
48 | MarcusBains(KOAgenda *agenda=0,const char *name=0); | 48 | MarcusBains(KOAgenda *agenda=0,const char *name=0); |
49 | virtual ~MarcusBains(); | 49 | virtual ~MarcusBains(); |
50 | 50 | ||
51 | public slots: | 51 | public slots: |
52 | void updateLocation(bool recalculate=false); | 52 | void updateLocation(bool recalculate=false); |
53 | void updateLoc(); | 53 | void updateLoc(); |
54 | 54 | ||
55 | private: | 55 | private: |
56 | int todayColumn(); | 56 | int todayColumn(); |
57 | QTimer *minutes; | 57 | QTimer *minutes; |
58 | QLabel *mTimeBox; | 58 | QLabel *mTimeBox; |
59 | KOAgenda *agenda; | 59 | KOAgenda *agenda; |
60 | QTime oldTime; | 60 | QTime oldTime; |
61 | int oldToday; | 61 | int oldToday; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | 64 | ||
65 | class KOAgenda : public QScrollView | 65 | class KOAgenda : public QScrollView |
66 | { | 66 | { |
67 | Q_OBJECT | 67 | Q_OBJECT |
68 | public: | 68 | public: |
69 | enum MouseActionType { NOP, MOVE, SELECT, | 69 | enum MouseActionType { NOP, MOVE, SELECT, |
70 | RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; | 70 | RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; |
71 | 71 | ||
72 | KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, | 72 | KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, |
73 | const char * name=0, WFlags f=0 ); | 73 | const char * name=0, WFlags f=0 ); |
74 | KOAgenda ( int columns, QWidget * parent=0, | 74 | KOAgenda ( int columns, QWidget * parent=0, |
75 | const char * name=0, WFlags f=0 ); | 75 | const char * name=0, WFlags f=0 ); |
76 | virtual ~KOAgenda(); | 76 | virtual ~KOAgenda(); |
77 | 77 | ||
78 | Incidence *selectedIncidence() const; | 78 | Incidence *selectedIncidence() const; |
79 | QDate selectedIncidenceDate() const; | 79 | QDate selectedIncidenceDate() const; |
80 | 80 | ||
81 | virtual bool eventFilter ( QObject *, QEvent * ); | 81 | virtual bool eventFilter ( QObject *, QEvent * ); |
82 | 82 | ||
83 | void contentsToGrid (int x, int y, int& gx, int& gy); | 83 | void contentsToGrid (int x, int y, int& gx, int& gy); |
84 | void gridToContents (int gx, int gy, int& x, int& y); | 84 | void gridToContents (int gx, int gy, int& x, int& y); |
85 | 85 | ||
86 | int timeToY (const QTime &time); | 86 | int timeToY (const QTime &time); |
87 | QTime gyToTime (int y); | 87 | QTime gyToTime (int y); |
88 | 88 | ||
89 | void setStartHour(int startHour); | 89 | void setStartHour(int startHour); |
90 | 90 | ||
91 | KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom); | 91 | KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom); |
92 | KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd); | 92 | KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd); |
93 | void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, | 93 | void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, |
94 | int YTop,int YBottom); | 94 | int YTop,int YBottom); |
95 | 95 | ||
96 | void changeColumns(int columns); | 96 | void changeColumns(int columns); |
97 | 97 | ||
98 | int columns() { return mColumns; } | 98 | int columns() { return mColumns; } |
99 | int rows() { return mRows; } | 99 | int rows() { return mRows; } |
100 | 100 | ||
101 | int gridSpacingX() const { return mGridSpacingX; } | 101 | int gridSpacingX() const { return mGridSpacingX; } |
102 | int gridSpacingY() const { return mGridSpacingY; } | 102 | int gridSpacingY() const { return mGridSpacingY; } |
103 | 103 | ||
104 | // virtual QSizePolicy sizePolicy() const; | 104 | // virtual QSizePolicy sizePolicy() const; |
105 | 105 | ||
106 | void clear(); | 106 | void clear(); |
107 | 107 | ||
108 | void clearSelection(); | 108 | void clearSelection(); |
109 | void hideUnused(); | 109 | void hideUnused(); |
110 | 110 | ||
111 | /** Calculates the minimum width */ | 111 | /** Calculates the minimum width */ |
112 | virtual int minimumWidth() const; | 112 | virtual int minimumWidth() const; |
113 | /** Update configuration from preference settings */ | 113 | /** Update configuration from preference settings */ |
114 | void updateConfig(); | 114 | void updateConfig(); |
115 | 115 | ||
116 | void checkScrollBoundaries(); | 116 | void checkScrollBoundaries(); |
117 | 117 | ||
118 | void setHolidayMask(QMemArray<bool> *); | 118 | void setHolidayMask(QMemArray<bool> *); |
119 | void setDateList(const DateList &selectedDates); | 119 | void setDateList(const DateList &selectedDates); |
120 | DateList dateList() const; | 120 | DateList dateList() const; |
121 | void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); | 121 | void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); |
122 | void finishUpdate(); | 122 | void finishUpdate(); |
123 | void printSelection(); | 123 | void printSelection(); |
124 | void storePosition(); | 124 | void storePosition(); |
125 | void restorePosition(); | 125 | void restorePosition(); |
126 | 126 | ||
127 | 127 | ||
128 | public slots: | 128 | public slots: |
129 | void newItem( int ); | 129 | void newItem( int ); |
130 | void moveChild( QWidget *, int, int ); | 130 | void moveChild( QWidget *, int, int ); |
131 | void scrollUp(); | 131 | void scrollUp(); |
132 | void scrollDown(); | 132 | void scrollDown(); |
133 | void updateTodo( Todo * t, int , bool ); | 133 | void updateTodo( Todo * t, int , bool ); |
134 | void popupAlarm(); | 134 | void popupAlarm(); |
135 | 135 | ||
136 | void checkScrollBoundaries(int); | 136 | void checkScrollBoundaries(int); |
137 | 137 | ||
138 | /** Deselect selected items. This function does not emit any signals. */ | 138 | /** Deselect selected items. This function does not emit any signals. */ |
139 | void deselectItem(); | 139 | void deselectItem(); |
140 | /** Select item. If the argument is 0, the currently selected item gets | 140 | /** Select item. If the argument is 0, the currently selected item gets |
141 | deselected. This function emits the itemSelected(bool) signal to inform | 141 | deselected. This function emits the itemSelected(bool) signal to inform |
142 | about selection/deseelction of events. */ | 142 | about selection/deseelction of events. */ |
143 | void selectItem(KOAgendaItem *); | 143 | void selectItem(KOAgendaItem *); |
144 | void finishResize(); | 144 | void finishResize(); |
145 | 145 | ||
146 | signals: | 146 | signals: |
147 | void showDateView( int, QDate ); | ||
147 | void newEventSignal(); | 148 | void newEventSignal(); |
148 | void newEventSignal(int gx,int gy); | 149 | void newEventSignal(int gx,int gy); |
149 | void newTodoSignal(int gx,int gy); | 150 | void newTodoSignal(int gx,int gy); |
150 | void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); | 151 | void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); |
151 | void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); | 152 | void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); |
152 | void newStartSelectSignal(); | 153 | void newStartSelectSignal(); |
153 | void showIncidenceSignal(Incidence *); | 154 | void showIncidenceSignal(Incidence *); |
154 | void editIncidenceSignal(Incidence *); | 155 | void editIncidenceSignal(Incidence *); |
155 | void deleteIncidenceSignal(Incidence *); | 156 | void deleteIncidenceSignal(Incidence *); |
156 | void showIncidencePopupSignal(Incidence *); | 157 | void showIncidencePopupSignal(Incidence *); |
157 | 158 | ||
158 | void itemModified(KOAgendaItem *item, int ); | 159 | void itemModified(KOAgendaItem *item, int ); |
159 | void incidenceSelected(Incidence *); | 160 | void incidenceSelected(Incidence *); |
160 | 161 | ||
161 | void lowerYChanged(int); | 162 | void lowerYChanged(int); |
162 | void upperYChanged(int); | 163 | void upperYChanged(int); |
163 | 164 | ||
164 | void startDragSignal(Incidence *); | 165 | void startDragSignal(Incidence *); |
165 | void addToCalSignal(Incidence *, Incidence *); | 166 | void addToCalSignal(Incidence *, Incidence *); |
166 | void resizedSignal(); | 167 | void resizedSignal(); |
167 | 168 | ||
168 | protected: | 169 | protected: |
169 | QPainter mPixPainter; | 170 | QPainter mPixPainter; |
170 | QPixmap mPaintPixmap; | 171 | QPixmap mPaintPixmap; |
171 | QPixmap mHighlightPixmap; | 172 | QPixmap mHighlightPixmap; |
172 | void drawContents(QPainter *p,int cx, int cy, int cw, int ch); | 173 | void drawContents(QPainter *p,int cx, int cy, int cw, int ch); |
173 | virtual void resizeEvent ( QResizeEvent * ); | 174 | virtual void resizeEvent ( QResizeEvent * ); |
174 | 175 | ||
175 | /** Handles mouse events. Called from eventFilter */ | 176 | /** Handles mouse events. Called from eventFilter */ |
176 | virtual bool eventFilter_mouse ( QObject *, QMouseEvent * ); | 177 | virtual bool eventFilter_mouse ( QObject *, QMouseEvent * ); |
177 | 178 | ||
178 | /** Start selecting time span. */ | 179 | /** Start selecting time span. */ |
179 | void startSelectAction(QPoint viewportPos); | 180 | void startSelectAction(QPoint viewportPos); |
180 | 181 | ||
181 | /** Select time span. */ | 182 | /** Select time span. */ |
182 | void performSelectAction(QPoint viewportPos); | 183 | void performSelectAction(QPoint viewportPos); |
183 | 184 | ||
184 | /** Emd selecting time span. */ | 185 | /** Emd selecting time span. */ |
185 | void endSelectAction( bool emitNewEvent = false ); | 186 | void endSelectAction( bool emitNewEvent = false ); |
186 | 187 | ||
187 | /** Start moving/resizing agenda item */ | 188 | /** Start moving/resizing agenda item */ |
188 | void startItemAction(QPoint viewportPos); | 189 | void startItemAction(QPoint viewportPos); |
189 | 190 | ||
190 | /** Move/resize agenda item */ | 191 | /** Move/resize agenda item */ |
191 | void performItemAction(QPoint viewportPos); | 192 | void performItemAction(QPoint viewportPos); |
192 | 193 | ||
193 | /** End moving/resizing agenda item */ | 194 | /** End moving/resizing agenda item */ |
194 | void endItemAction(); | 195 | void endItemAction(); |
195 | 196 | ||
196 | /** Set cursor, when no item action is in progress */ | 197 | /** Set cursor, when no item action is in progress */ |
197 | void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos); | 198 | void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos); |
198 | 199 | ||
199 | /** Place agenda item in agenda and adjust other cells if necessary */ | 200 | /** Place agenda item in agenda and adjust other cells if necessary */ |
200 | void placeSubCells(KOAgendaItem *placeItem); | 201 | void placeSubCells(KOAgendaItem *placeItem); |
201 | 202 | ||
202 | /** Process the keyevent, including the ignored keyevents of eventwidgets. | 203 | /** Process the keyevent, including the ignored keyevents of eventwidgets. |
203 | * Implements pgup/pgdn and cursor key navigation in the view. | 204 | * Implements pgup/pgdn and cursor key navigation in the view. |
204 | */ | 205 | */ |
205 | void keyPressEvent( QKeyEvent * ); | 206 | void keyPressEvent( QKeyEvent * ); |
206 | 207 | ||
207 | void calculateWorkingHours(); | 208 | void calculateWorkingHours(); |
208 | 209 | ||
209 | virtual void contentsMousePressEvent ( QMouseEvent * ); | 210 | virtual void contentsMousePressEvent ( QMouseEvent * ); |
210 | 211 | ||
211 | private: | 212 | private: |
212 | bool blockNewEvent; | 213 | bool blockNewEvent; |
213 | void init(); | 214 | void init(); |
214 | void marcus_bains(); | 215 | void marcus_bains(); |
215 | bool mAllDayMode; | 216 | bool mAllDayMode; |
216 | bool blockResize; | 217 | bool blockResize; |
217 | QTimer mResizeTimer; | 218 | QTimer mResizeTimer; |
218 | double mContentPosition; | 219 | double mContentPosition; |
219 | 220 | ||
220 | // Width and height of agenda cells | 221 | // Width and height of agenda cells |
221 | int mGridSpacingX; | 222 | int mGridSpacingX; |
222 | int mGridSpacingY; | 223 | int mGridSpacingY; |
223 | 224 | ||
224 | // size of border, where mouse action will resize the KOAgendaItem | 225 | // size of border, where mouse action will resize the KOAgendaItem |
225 | int mResizeBorderWidth; | 226 | int mResizeBorderWidth; |
226 | 227 | ||
227 | // size of border, where mouse mve will cause a scroll of the agenda | 228 | // size of border, where mouse mve will cause a scroll of the agenda |
228 | int mScrollBorderWidth; | 229 | int mScrollBorderWidth; |
229 | int mScrollDelay; | 230 | int mScrollDelay; |
230 | int mScrollOffset; | 231 | int mScrollOffset; |
231 | 232 | ||
232 | QTimer mScrollUpTimer; | 233 | QTimer mScrollUpTimer; |
233 | QTimer mScrollDownTimer; | 234 | QTimer mScrollDownTimer; |
234 | 235 | ||
235 | // Number of Columns/Rows of agenda grid | 236 | // Number of Columns/Rows of agenda grid |
236 | int mColumns; | 237 | int mColumns; |
237 | int mRows; | 238 | int mRows; |
238 | 239 | ||
239 | // Cells to store Move and Resize coordiantes | 240 | // Cells to store Move and Resize coordiantes |
240 | int mStartCellX; | 241 | int mStartCellX; |
241 | int mStartCellY; | 242 | int mStartCellY; |
242 | int mCurrentCellX; | 243 | int mCurrentCellX; |
243 | int mCurrentCellY; | 244 | int mCurrentCellY; |
244 | 245 | ||
245 | // Working Hour coordiantes | 246 | // Working Hour coordiantes |
246 | bool mWorkingHoursEnable; | 247 | bool mWorkingHoursEnable; |
247 | int mWorkingHoursYTop; | 248 | int mWorkingHoursYTop; |
248 | int mWorkingHoursYBottom; | 249 | int mWorkingHoursYBottom; |
249 | 250 | ||
250 | // Selection | 251 | // Selection |
251 | int mSelectionCellX; | 252 | int mSelectionCellX; |
252 | int mSelectionYTop; | 253 | int mSelectionYTop; |
253 | int mSelectionHeight; | 254 | int mSelectionHeight; |
254 | 255 | ||
255 | // List of dates to be displayed | 256 | // List of dates to be displayed |
256 | DateList mSelectedDates; | 257 | DateList mSelectedDates; |
257 | 258 | ||
258 | // The KOAgendaItem, which has been right-clicked last | 259 | // The KOAgendaItem, which has been right-clicked last |
259 | KOAgendaItem *mClickedItem; | 260 | KOAgendaItem *mClickedItem; |
260 | 261 | ||
261 | // The KOAgendaItem, which is being moved/resized | 262 | // The KOAgendaItem, which is being moved/resized |
262 | QGuardedPtr<KOAgendaItem> mActionItem; | 263 | QGuardedPtr<KOAgendaItem> mActionItem; |
263 | 264 | ||
264 | // Currently selected item | 265 | // Currently selected item |
265 | QGuardedPtr<KOAgendaItem> mSelectedItem; | 266 | QGuardedPtr<KOAgendaItem> mSelectedItem; |
266 | 267 | ||
267 | // The Marcus Bains Line widget. | 268 | // The Marcus Bains Line widget. |
268 | MarcusBains *mMarcusBains; | 269 | MarcusBains *mMarcusBains; |
269 | void computeSizes(); | 270 | void computeSizes(); |
270 | 271 | ||
271 | MouseActionType mActionType; | 272 | MouseActionType mActionType; |
272 | 273 | ||
273 | bool mItemMoved; | 274 | bool mItemMoved; |
274 | 275 | ||
275 | // List of all Items contained in agenda | 276 | // List of all Items contained in agenda |
276 | QPtrList<KOAgendaItem> mItems; | 277 | QPtrList<KOAgendaItem> mItems; |
277 | QPtrList<KOAgendaItem> mUnusedItems; | 278 | QPtrList<KOAgendaItem> mUnusedItems; |
278 | KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport); | 279 | KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport); |
279 | QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems | 280 | QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems |
280 | QPopupMenu *mNewItemPopup; | 281 | QPopupMenu *mNewItemPopup; |
281 | 282 | ||
282 | int mOldLowerScrollValue; | 283 | int mOldLowerScrollValue; |
283 | int mOldUpperScrollValue; | 284 | int mOldUpperScrollValue; |
284 | KOAgendaItem * getItemForTodo ( Todo * todo ); | 285 | KOAgendaItem * getItemForTodo ( Todo * todo ); |
285 | QMemArray<bool> *mHolidayMask; | 286 | QMemArray<bool> *mHolidayMask; |
286 | int mCurPixWid; | 287 | int mCurPixWid; |
287 | int mCurPixHei; | 288 | int mCurPixHei; |
288 | }; | 289 | }; |
289 | 290 | ||
290 | #endif // KOAGENDA_H | 291 | #endif // KOAGENDA_H |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 60ae41f..e0a1a21 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -296,384 +296,387 @@ void EventIndicator::drawContents(QPainter *p) | |||
296 | } else { | 296 | } else { |
297 | han->repaint(); | 297 | han->repaint(); |
298 | //mPaintWidget->setBackgroundColor( red ); | 298 | //mPaintWidget->setBackgroundColor( red ); |
299 | 299 | ||
300 | QPainter pa( han ); | 300 | QPainter pa( han ); |
301 | int i; | 301 | int i; |
302 | bool setColor = false; | 302 | bool setColor = false; |
303 | for(i=0;i<mColumns;++i) { | 303 | for(i=0;i<mColumns;++i) { |
304 | if (mEnabled[i]) { | 304 | if (mEnabled[i]) { |
305 | setColor = true; | 305 | setColor = true; |
306 | 306 | ||
307 | int cellWidth = contentsRect().right()/mColumns; | 307 | int cellWidth = contentsRect().right()/mColumns; |
308 | int xOffset = KOGlobals::self()->reverseLayout() ? | 308 | int xOffset = KOGlobals::self()->reverseLayout() ? |
309 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : | 309 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : |
310 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; | 310 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; |
311 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); | 311 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); |
312 | //qDebug("222draw pix %d ",xOffset ); | 312 | //qDebug("222draw pix %d ",xOffset ); |
313 | 313 | ||
314 | } | 314 | } |
315 | 315 | ||
316 | } | 316 | } |
317 | pa.end(); | 317 | pa.end(); |
318 | 318 | ||
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | void EventIndicator::setXOffset( int x ) | 322 | void EventIndicator::setXOffset( int x ) |
323 | { | 323 | { |
324 | mXOffset = x; | 324 | mXOffset = x; |
325 | } | 325 | } |
326 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) | 326 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) |
327 | { | 327 | { |
328 | mPaintWidget = w; | 328 | mPaintWidget = w; |
329 | } | 329 | } |
330 | void EventIndicator::changeColumns(int columns) | 330 | void EventIndicator::changeColumns(int columns) |
331 | { | 331 | { |
332 | mColumns = columns; | 332 | mColumns = columns; |
333 | mEnabled.resize(mColumns); | 333 | mEnabled.resize(mColumns); |
334 | 334 | ||
335 | update(); | 335 | update(); |
336 | } | 336 | } |
337 | 337 | ||
338 | void EventIndicator::enableColumn(int column, bool enable) | 338 | void EventIndicator::enableColumn(int column, bool enable) |
339 | { | 339 | { |
340 | mEnabled[column] = enable; | 340 | mEnabled[column] = enable; |
341 | } | 341 | } |
342 | 342 | ||
343 | 343 | ||
344 | //////////////////////////////////////////////////////////////////////////// | 344 | //////////////////////////////////////////////////////////////////////////// |
345 | //////////////////////////////////////////////////////////////////////////// | 345 | //////////////////////////////////////////////////////////////////////////// |
346 | //////////////////////////////////////////////////////////////////////////// | 346 | //////////////////////////////////////////////////////////////////////////// |
347 | 347 | ||
348 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | 348 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : |
349 | KOEventView (cal,parent,name) | 349 | KOEventView (cal,parent,name) |
350 | { | 350 | { |
351 | mBlockUpdating = true; | 351 | mBlockUpdating = true; |
352 | mStartHour = 8; | 352 | mStartHour = 8; |
353 | mSelectedDates.append(QDate::currentDate()); | 353 | mSelectedDates.append(QDate::currentDate()); |
354 | 354 | ||
355 | mLayoutDayLabels = 0; | 355 | mLayoutDayLabels = 0; |
356 | mDayLabelsFrame = 0; | 356 | mDayLabelsFrame = 0; |
357 | mDayLabels = 0; | 357 | mDayLabels = 0; |
358 | bool isRTL = KOGlobals::self()->reverseLayout(); | 358 | bool isRTL = KOGlobals::self()->reverseLayout(); |
359 | 359 | ||
360 | if ( KOPrefs::instance()->mVerticalScreen ) { | 360 | if ( KOPrefs::instance()->mVerticalScreen ) { |
361 | mExpandedPixmap = SmallIcon( "1downarrow" ); | 361 | mExpandedPixmap = SmallIcon( "1downarrow" ); |
362 | mNotExpandedPixmap = SmallIcon( "1uparrow" ); | 362 | mNotExpandedPixmap = SmallIcon( "1uparrow" ); |
363 | } else { | 363 | } else { |
364 | mExpandedPixmap = SmallIcon( isRTL ? "1leftarrow" : "1rightarrow" ); | 364 | mExpandedPixmap = SmallIcon( isRTL ? "1leftarrow" : "1rightarrow" ); |
365 | mNotExpandedPixmap = SmallIcon( isRTL ? "1rightarrow" : "1leftarrow" ); | 365 | mNotExpandedPixmap = SmallIcon( isRTL ? "1rightarrow" : "1leftarrow" ); |
366 | } | 366 | } |
367 | 367 | ||
368 | QBoxLayout *topLayout = new QVBoxLayout(this); | 368 | QBoxLayout *topLayout = new QVBoxLayout(this); |
369 | 369 | ||
370 | // Create day name labels for agenda columns | 370 | // Create day name labels for agenda columns |
371 | mDayLabelsFrame = new QHBox(this); | 371 | mDayLabelsFrame = new QHBox(this); |
372 | topLayout->addWidget(mDayLabelsFrame); | 372 | topLayout->addWidget(mDayLabelsFrame); |
373 | mDayLabels = new QFrame (mDayLabelsFrame); | 373 | mDayLabels = new QFrame (mDayLabelsFrame); |
374 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); | 374 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); |
375 | // Create agenda splitter | 375 | // Create agenda splitter |
376 | #ifndef KORG_NOSPLITTER | 376 | #ifndef KORG_NOSPLITTER |
377 | mSplitterAgenda = new QSplitter(Vertical,this); | 377 | mSplitterAgenda = new QSplitter(Vertical,this); |
378 | topLayout->addWidget(mSplitterAgenda); | 378 | topLayout->addWidget(mSplitterAgenda); |
379 | mSplitterAgenda->setOpaqueResize(); | 379 | mSplitterAgenda->setOpaqueResize(); |
380 | 380 | ||
381 | mAllDayFrame = new QHBox(mSplitterAgenda); | 381 | mAllDayFrame = new QHBox(mSplitterAgenda); |
382 | 382 | ||
383 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); | 383 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); |
384 | #else | 384 | #else |
385 | #if 0 | 385 | #if 0 |
386 | QWidget *mainBox = new QWidget( this ); | 386 | QWidget *mainBox = new QWidget( this ); |
387 | topLayout->addWidget( mainBox ); | 387 | topLayout->addWidget( mainBox ); |
388 | QBoxLayout *mainLayout = new QVBoxLayout(mainBox); | 388 | QBoxLayout *mainLayout = new QVBoxLayout(mainBox); |
389 | mAllDayFrame = new QHBox(mainBox); | 389 | mAllDayFrame = new QHBox(mainBox); |
390 | mainLayout->addWidget(mAllDayFrame); | 390 | mainLayout->addWidget(mAllDayFrame); |
391 | mainLayout->setStretchFactor( mAllDayFrame, 0 ); | 391 | mainLayout->setStretchFactor( mAllDayFrame, 0 ); |
392 | mAllDayFrame->setFocusPolicy(NoFocus); | 392 | mAllDayFrame->setFocusPolicy(NoFocus); |
393 | QWidget *agendaFrame = new QWidget(mainBox); | 393 | QWidget *agendaFrame = new QWidget(mainBox); |
394 | mainLayout->addWidget(agendaFrame); | 394 | mainLayout->addWidget(agendaFrame); |
395 | mainLayout->setStretchFactor( agendaFrame, 10 ); | 395 | mainLayout->setStretchFactor( agendaFrame, 10 ); |
396 | 396 | ||
397 | agendaFrame->setFocusPolicy(NoFocus); | 397 | agendaFrame->setFocusPolicy(NoFocus); |
398 | #endif | 398 | #endif |
399 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 399 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
400 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 400 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
401 | topLayout->addWidget( mSplitterAgenda ); | 401 | topLayout->addWidget( mSplitterAgenda ); |
402 | mAllDayFrame = new QHBox(mSplitterAgenda); | 402 | mAllDayFrame = new QHBox(mSplitterAgenda); |
403 | mAllDayFrame->setFocusPolicy(NoFocus); | 403 | mAllDayFrame->setFocusPolicy(NoFocus); |
404 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); | 404 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); |
405 | agendaFrame->setFocusPolicy(NoFocus); | 405 | agendaFrame->setFocusPolicy(NoFocus); |
406 | 406 | ||
407 | #endif | 407 | #endif |
408 | 408 | ||
409 | // Create all-day agenda widget | 409 | // Create all-day agenda widget |
410 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); | 410 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); |
411 | 411 | ||
412 | mExpandButton = new QPushButton(mDummyAllDayLeft); | 412 | mExpandButton = new QPushButton(mDummyAllDayLeft); |
413 | mExpandButton->setPixmap( mNotExpandedPixmap ); | 413 | mExpandButton->setPixmap( mNotExpandedPixmap ); |
414 | int widebut = mExpandButton->sizeHint().width(); | 414 | int widebut = mExpandButton->sizeHint().width(); |
415 | if ( QApplication::desktop()->width() < 480 ) | 415 | if ( QApplication::desktop()->width() < 480 ) |
416 | widebut = widebut*2; | 416 | widebut = widebut*2; |
417 | else | 417 | else |
418 | widebut = (widebut*3) / 2; | 418 | widebut = (widebut*3) / 2; |
419 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, | 419 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, |
420 | // QSizePolicy::Fixed ) ); | 420 | // QSizePolicy::Fixed ) ); |
421 | mExpandButton->setFixedSize( widebut, widebut); | 421 | mExpandButton->setFixedSize( widebut, widebut); |
422 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); | 422 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); |
423 | mExpandButton->setFocusPolicy(NoFocus); | 423 | mExpandButton->setFocusPolicy(NoFocus); |
424 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); | 424 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); |
425 | mAllDayAgenda->setFocusPolicy(NoFocus); | 425 | mAllDayAgenda->setFocusPolicy(NoFocus); |
426 | QWidget *dummyAllDayRight = new QWidget(mAllDayFrame); | 426 | QWidget *dummyAllDayRight = new QWidget(mAllDayFrame); |
427 | 427 | ||
428 | // Create event context menu for all day agenda | 428 | // Create event context menu for all day agenda |
429 | mAllDayAgendaPopup = eventPopup(); | 429 | mAllDayAgendaPopup = eventPopup(); |
430 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 430 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
431 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 431 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
432 | 432 | ||
433 | // Create agenda frame | 433 | // Create agenda frame |
434 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); | 434 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); |
435 | // QHBox *agendaFrame = new QHBox(splitterAgenda); | 435 | // QHBox *agendaFrame = new QHBox(splitterAgenda); |
436 | 436 | ||
437 | // create event indicator bars | 437 | // create event indicator bars |
438 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); | 438 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); |
439 | agendaLayout->addWidget(mEventIndicatorTop,0,1); | 439 | agendaLayout->addWidget(mEventIndicatorTop,0,1); |
440 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); | 440 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); |
441 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, | 441 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, |
442 | agendaFrame); | 442 | agendaFrame); |
443 | agendaLayout->addWidget(mEventIndicatorBottom,2,1); | 443 | agendaLayout->addWidget(mEventIndicatorBottom,2,1); |
444 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); | 444 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); |
445 | agendaLayout->addWidget(dummyAgendaRight,0,2); | 445 | agendaLayout->addWidget(dummyAgendaRight,0,2); |
446 | 446 | ||
447 | // Create time labels | 447 | // Create time labels |
448 | mTimeLabels = new TimeLabels(24,agendaFrame); | 448 | mTimeLabels = new TimeLabels(24,agendaFrame); |
449 | agendaLayout->addWidget(mTimeLabels,1,0); | 449 | agendaLayout->addWidget(mTimeLabels,1,0); |
450 | connect(mTimeLabels,SIGNAL( scaleChanged()), | 450 | connect(mTimeLabels,SIGNAL( scaleChanged()), |
451 | this,SLOT(updateConfig())); | 451 | this,SLOT(updateConfig())); |
452 | 452 | ||
453 | // Create agenda | 453 | // Create agenda |
454 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); | 454 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); |
455 | agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); | 455 | agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); |
456 | agendaLayout->setColStretch(1,1); | 456 | agendaLayout->setColStretch(1,1); |
457 | mAgenda->setFocusPolicy(NoFocus); | 457 | mAgenda->setFocusPolicy(NoFocus); |
458 | // Create event context menu for agenda | 458 | // Create event context menu for agenda |
459 | mAgendaPopup = eventPopup(); | 459 | mAgendaPopup = eventPopup(); |
460 | 460 | ||
461 | mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), | 461 | mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), |
462 | i18n("Toggle Alarm"),mAgenda, | 462 | i18n("Toggle Alarm"),mAgenda, |
463 | SLOT(popupAlarm()),true); | 463 | SLOT(popupAlarm()),true); |
464 | 464 | ||
465 | 465 | ||
466 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 466 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
467 | mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 467 | mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
468 | 468 | ||
469 | // make connections between dependent widgets | 469 | // make connections between dependent widgets |
470 | mTimeLabels->setAgenda(mAgenda); | 470 | mTimeLabels->setAgenda(mAgenda); |
471 | 471 | ||
472 | // Update widgets to reflect user preferences | 472 | // Update widgets to reflect user preferences |
473 | // updateConfig(); | 473 | // updateConfig(); |
474 | 474 | ||
475 | // createDayLabels(); | 475 | // createDayLabels(); |
476 | 476 | ||
477 | // these blank widgets make the All Day Event box line up with the agenda | 477 | // these blank widgets make the All Day Event box line up with the agenda |
478 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 478 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
479 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 479 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
480 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 480 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
481 | 481 | ||
482 | // Scrolling | 482 | // Scrolling |
483 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), | 483 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), |
484 | mTimeLabels, SLOT(positionChanged())); | 484 | mTimeLabels, SLOT(positionChanged())); |
485 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), | 485 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), |
486 | SLOT(setContentsPos(int))); | 486 | SLOT(setContentsPos(int))); |
487 | 487 | ||
488 | connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); | ||
489 | connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); | ||
490 | |||
488 | // Create/Show/Edit/Delete Event | 491 | // Create/Show/Edit/Delete Event |
489 | connect(mAgenda,SIGNAL(newEventSignal(int,int)), | 492 | connect(mAgenda,SIGNAL(newEventSignal(int,int)), |
490 | SLOT(newEvent(int,int))); | 493 | SLOT(newEvent(int,int))); |
491 | connect(mAgenda,SIGNAL(newTodoSignal(int,int)), | 494 | connect(mAgenda,SIGNAL(newTodoSignal(int,int)), |
492 | SLOT(newTodo(int,int))); | 495 | SLOT(newTodo(int,int))); |
493 | connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), | 496 | connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), |
494 | SLOT(newEvent(int,int,int,int))); | 497 | SLOT(newEvent(int,int,int,int))); |
495 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), | 498 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), |
496 | SLOT(newEventAllDay(int,int))); | 499 | SLOT(newEventAllDay(int,int))); |
497 | connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), | 500 | connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), |
498 | SLOT(newTodoAllDay(int,int))); | 501 | SLOT(newTodoAllDay(int,int))); |
499 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), | 502 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), |
500 | SLOT(newEventAllDay(int,int))); | 503 | SLOT(newEventAllDay(int,int))); |
501 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 504 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
502 | SLOT(newTimeSpanSelected(int,int,int,int))); | 505 | SLOT(newTimeSpanSelected(int,int,int,int))); |
503 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 506 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
504 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); | 507 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); |
505 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 508 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
506 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 509 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
507 | 510 | ||
508 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 511 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
509 | SIGNAL(editIncidenceSignal(Incidence *))); | 512 | SIGNAL(editIncidenceSignal(Incidence *))); |
510 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 513 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
511 | SIGNAL(editIncidenceSignal(Incidence *))); | 514 | SIGNAL(editIncidenceSignal(Incidence *))); |
512 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 515 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
513 | SIGNAL(showIncidenceSignal(Incidence *))); | 516 | SIGNAL(showIncidenceSignal(Incidence *))); |
514 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 517 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
515 | SIGNAL(showIncidenceSignal(Incidence *))); | 518 | SIGNAL(showIncidenceSignal(Incidence *))); |
516 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 519 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
517 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 520 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
518 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 521 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
519 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 522 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
520 | 523 | ||
521 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 524 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
522 | SLOT(updateEventDates(KOAgendaItem *, int ))); | 525 | SLOT(updateEventDates(KOAgendaItem *, int ))); |
523 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 526 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
524 | SLOT(updateEventDates(KOAgendaItem *, int))); | 527 | SLOT(updateEventDates(KOAgendaItem *, int))); |
525 | 528 | ||
526 | // event indicator update | 529 | // event indicator update |
527 | connect(mAgenda,SIGNAL(lowerYChanged(int)), | 530 | connect(mAgenda,SIGNAL(lowerYChanged(int)), |
528 | SLOT(updateEventIndicatorTop(int))); | 531 | SLOT(updateEventIndicatorTop(int))); |
529 | connect(mAgenda,SIGNAL(upperYChanged(int)), | 532 | connect(mAgenda,SIGNAL(upperYChanged(int)), |
530 | SLOT(updateEventIndicatorBottom(int))); | 533 | SLOT(updateEventIndicatorBottom(int))); |
531 | // drag signals | 534 | // drag signals |
532 | /* | 535 | /* |
533 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), | 536 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), |
534 | SLOT(startDrag(Event *))); | 537 | SLOT(startDrag(Event *))); |
535 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), | 538 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), |
536 | SLOT(startDrag(Event *))); | 539 | SLOT(startDrag(Event *))); |
537 | */ | 540 | */ |
538 | // synchronize selections | 541 | // synchronize selections |
539 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 542 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
540 | mAllDayAgenda, SLOT( deselectItem() ) ); | 543 | mAllDayAgenda, SLOT( deselectItem() ) ); |
541 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 544 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
542 | mAgenda, SLOT( deselectItem() ) ); | 545 | mAgenda, SLOT( deselectItem() ) ); |
543 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 546 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
544 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 547 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
545 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 548 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
546 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 549 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
547 | connect( mAgenda, SIGNAL( resizedSignal() ), | 550 | connect( mAgenda, SIGNAL( resizedSignal() ), |
548 | SLOT( updateConfig( ) ) ); | 551 | SLOT( updateConfig( ) ) ); |
549 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), | 552 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), |
550 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); | 553 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); |
551 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), | 554 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), |
552 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); | 555 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); |
553 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 556 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
554 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 557 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
555 | 558 | ||
556 | 559 | ||
557 | } | 560 | } |
558 | 561 | ||
559 | void KOAgendaView::toggleAllDay() | 562 | void KOAgendaView::toggleAllDay() |
560 | { | 563 | { |
561 | if ( mSplitterAgenda->firstHandle() ) | 564 | if ( mSplitterAgenda->firstHandle() ) |
562 | mSplitterAgenda->firstHandle()->toggle(); | 565 | mSplitterAgenda->firstHandle()->toggle(); |
563 | } | 566 | } |
564 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) | 567 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) |
565 | { | 568 | { |
566 | calendar()->addIncidence( inc ); | 569 | calendar()->addIncidence( inc ); |
567 | 570 | ||
568 | if ( incOld ) { | 571 | if ( incOld ) { |
569 | if ( incOld->type() == "Todo" ) | 572 | if ( incOld->type() == "Todo" ) |
570 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); | 573 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); |
571 | else | 574 | else |
572 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); | 575 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); |
573 | } | 576 | } |
574 | 577 | ||
575 | } | 578 | } |
576 | 579 | ||
577 | KOAgendaView::~KOAgendaView() | 580 | KOAgendaView::~KOAgendaView() |
578 | { | 581 | { |
579 | delete mAgendaPopup; | 582 | delete mAgendaPopup; |
580 | delete mAllDayAgendaPopup; | 583 | delete mAllDayAgendaPopup; |
581 | delete KOAgendaItem::paintPix(); | 584 | delete KOAgendaItem::paintPix(); |
582 | delete KOAgendaItem::paintPixSel(); | 585 | delete KOAgendaItem::paintPixSel(); |
583 | } | 586 | } |
584 | void KOAgendaView::resizeEvent( QResizeEvent* e ) | 587 | void KOAgendaView::resizeEvent( QResizeEvent* e ) |
585 | { | 588 | { |
586 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); | 589 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); |
587 | bool uc = false; | 590 | bool uc = false; |
588 | int ow = e->oldSize().width(); | 591 | int ow = e->oldSize().width(); |
589 | int oh = e->oldSize().height(); | 592 | int oh = e->oldSize().height(); |
590 | int w = e->size().width(); | 593 | int w = e->size().width(); |
591 | int h = e->size().height(); | 594 | int h = e->size().height(); |
592 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { | 595 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { |
593 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) | 596 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) |
594 | uc = true; | 597 | uc = true; |
595 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); | 598 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); |
596 | } | 599 | } |
597 | mUpcomingWidth = e->size().width() ; | 600 | mUpcomingWidth = e->size().width() ; |
598 | if ( mBlockUpdating || uc ) { | 601 | if ( mBlockUpdating || uc ) { |
599 | mBlockUpdating = false; | 602 | mBlockUpdating = false; |
600 | //mAgenda->setMinimumSize(800 , 600 ); | 603 | //mAgenda->setMinimumSize(800 , 600 ); |
601 | //qDebug("mAgenda->resize+++++++++++++++ "); | 604 | //qDebug("mAgenda->resize+++++++++++++++ "); |
602 | updateConfig(); | 605 | updateConfig(); |
603 | //qDebug("KOAgendaView::Updating now possible "); | 606 | //qDebug("KOAgendaView::Updating now possible "); |
604 | } else | 607 | } else |
605 | createDayLabels(); | 608 | createDayLabels(); |
606 | //qDebug("resizeEvent end "); | 609 | //qDebug("resizeEvent end "); |
607 | 610 | ||
608 | } | 611 | } |
609 | void KOAgendaView::createDayLabels() | 612 | void KOAgendaView::createDayLabels() |
610 | { | 613 | { |
611 | 614 | ||
612 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { | 615 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { |
613 | // qDebug(" KOAgendaView::createDayLabels() blocked "); | 616 | // qDebug(" KOAgendaView::createDayLabels() blocked "); |
614 | return; | 617 | return; |
615 | 618 | ||
616 | } | 619 | } |
617 | int newHight; | 620 | int newHight; |
618 | 621 | ||
619 | // ### Before deleting and recreating we could check if mSelectedDates changed... | 622 | // ### Before deleting and recreating we could check if mSelectedDates changed... |
620 | // It would remove some flickering and gain speed (since this is called by | 623 | // It would remove some flickering and gain speed (since this is called by |
621 | // each updateView() call) | 624 | // each updateView() call) |
622 | 625 | ||
623 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2; | 626 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2; |
624 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); | 627 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); |
625 | if ( maxWid < 0 ) | 628 | if ( maxWid < 0 ) |
626 | maxWid = 20; | 629 | maxWid = 20; |
627 | 630 | ||
628 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; | 631 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; |
629 | QFontMetrics fm ( dlf ); | 632 | QFontMetrics fm ( dlf ); |
630 | int selCount = mSelectedDates.count(); | 633 | int selCount = mSelectedDates.count(); |
631 | QString dayTest = "Mon 20"; | 634 | QString dayTest = "Mon 20"; |
632 | int wid = fm.width( dayTest ); | 635 | int wid = fm.width( dayTest ); |
633 | maxWid -= ( selCount * 3 ); | 636 | maxWid -= ( selCount * 3 ); |
634 | if ( maxWid < 0 ) | 637 | if ( maxWid < 0 ) |
635 | maxWid = 20; | 638 | maxWid = 20; |
636 | int needWid = wid * selCount; | 639 | int needWid = wid * selCount; |
637 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); | 640 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); |
638 | //if ( needWid > maxWid ) | 641 | //if ( needWid > maxWid ) |
639 | // qDebug("DAYLABELS TOOOOOOO BIG "); | 642 | // qDebug("DAYLABELS TOOOOOOO BIG "); |
640 | while ( needWid > maxWid ) { | 643 | while ( needWid > maxWid ) { |
641 | dayTest = dayTest.left( dayTest.length() - 1 ); | 644 | dayTest = dayTest.left( dayTest.length() - 1 ); |
642 | wid = fm.width( dayTest ); | 645 | wid = fm.width( dayTest ); |
643 | needWid = wid * selCount; | 646 | needWid = wid * selCount; |
644 | } | 647 | } |
645 | int maxLen = dayTest.length(); | 648 | int maxLen = dayTest.length(); |
646 | int fontPoint = dlf.pointSize(); | 649 | int fontPoint = dlf.pointSize(); |
647 | if ( maxLen < 2 ) { | 650 | if ( maxLen < 2 ) { |
648 | int fontPoint = dlf.pointSize(); | 651 | int fontPoint = dlf.pointSize(); |
649 | while ( fontPoint > 4 ) { | 652 | while ( fontPoint > 4 ) { |
650 | --fontPoint; | 653 | --fontPoint; |
651 | dlf.setPointSize( fontPoint ); | 654 | dlf.setPointSize( fontPoint ); |
652 | QFontMetrics f( dlf ); | 655 | QFontMetrics f( dlf ); |
653 | wid = f.width( "20" ); | 656 | wid = f.width( "20" ); |
654 | needWid = wid * selCount; | 657 | needWid = wid * selCount; |
655 | if ( needWid < maxWid ) | 658 | if ( needWid < maxWid ) |
656 | break; | 659 | break; |
657 | } | 660 | } |
658 | maxLen = 2; | 661 | maxLen = 2; |
659 | } | 662 | } |
660 | //qDebug("Max len %d ", dayTest.length() ); | 663 | //qDebug("Max len %d ", dayTest.length() ); |
661 | 664 | ||
662 | QFontMetrics tempF( dlf ); | 665 | QFontMetrics tempF( dlf ); |
663 | newHight = tempF.height(); | 666 | newHight = tempF.height(); |
664 | mDayLabels->setFont( dlf ); | 667 | mDayLabels->setFont( dlf ); |
665 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; | 668 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; |
666 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); | 669 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); |
667 | //mLayoutDayLabels->addSpacing( 2 ); | 670 | //mLayoutDayLabels->addSpacing( 2 ); |
668 | // QFont lFont = dlf; | 671 | // QFont lFont = dlf; |
669 | bool appendLabels = false; | 672 | bool appendLabels = false; |
670 | QLabel *dayLabel; | 673 | QLabel *dayLabel; |
671 | dayLabel = mDayLabelsList.first(); | 674 | dayLabel = mDayLabelsList.first(); |
672 | if ( !dayLabel ) { | 675 | if ( !dayLabel ) { |
673 | appendLabels = true; | 676 | appendLabels = true; |
674 | dayLabel = new QLabel(mDayLabels); | 677 | dayLabel = new QLabel(mDayLabels); |
675 | mDayLabelsList.append( dayLabel ); | 678 | mDayLabelsList.append( dayLabel ); |
676 | mLayoutDayLabels->addWidget(dayLabel); | 679 | mLayoutDayLabels->addWidget(dayLabel); |
677 | } | 680 | } |
678 | dayLabel->setFixedWidth( mTimeLabels->width()+2 ); | 681 | dayLabel->setFixedWidth( mTimeLabels->width()+2 ); |
679 | dayLabel->setFont( dlf ); | 682 | dayLabel->setFont( dlf ); |
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 01d74a1..7774fbe 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h | |||
@@ -1,261 +1,262 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 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 | #ifndef KOAGENDAVIEW_H | 23 | #ifndef KOAGENDAVIEW_H |
24 | #define KOAGENDAVIEW_H | 24 | #define KOAGENDAVIEW_H |
25 | 25 | ||
26 | #include <qscrollview.h> | 26 | #include <qscrollview.h> |
27 | #include <qdatetime.h> | 27 | #include <qdatetime.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #ifndef DESKTOP_VERSION | 29 | #ifndef DESKTOP_VERSION |
30 | #include <qksplitter.h> | 30 | #include <qksplitter.h> |
31 | #else | 31 | #else |
32 | #include <qsplitter.h> | 32 | #include <qsplitter.h> |
33 | #endif | 33 | #endif |
34 | #include <qmemarray.h> | 34 | #include <qmemarray.h> |
35 | 35 | ||
36 | #include "koeventview.h" | 36 | #include "koeventview.h" |
37 | 37 | ||
38 | 38 | ||
39 | class QHBox; | 39 | class QHBox; |
40 | class QFrame; | 40 | class QFrame; |
41 | class QLabel; | 41 | class QLabel; |
42 | class QPushButton; | 42 | class QPushButton; |
43 | class CalendarView; | 43 | class CalendarView; |
44 | class KOAgenda; | 44 | class KOAgenda; |
45 | class KOAgendaItem; | 45 | class KOAgendaItem; |
46 | class KConfig; | 46 | class KConfig; |
47 | class KDGanttMinimizeSplitter; | 47 | class KDGanttMinimizeSplitter; |
48 | class TimeLabels : public QScrollView { | 48 | class TimeLabels : public QScrollView { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); | 51 | TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); |
52 | 52 | ||
53 | void setCellHeight(int height); | 53 | void setCellHeight(int height); |
54 | 54 | ||
55 | /** Calculates the minimum width */ | 55 | /** Calculates the minimum width */ |
56 | virtual int minimumWidth() const; | 56 | virtual int minimumWidth() const; |
57 | 57 | ||
58 | /** updates widget's internal state */ | 58 | /** updates widget's internal state */ |
59 | void updateConfig(); | 59 | void updateConfig(); |
60 | 60 | ||
61 | /** */ | 61 | /** */ |
62 | void setAgenda(KOAgenda* agenda); | 62 | void setAgenda(KOAgenda* agenda); |
63 | 63 | ||
64 | /** */ | 64 | /** */ |
65 | virtual void paintEvent(QPaintEvent* e); | 65 | virtual void paintEvent(QPaintEvent* e); |
66 | void contentsMousePressEvent ( QMouseEvent * ) ; | 66 | void contentsMousePressEvent ( QMouseEvent * ) ; |
67 | void contentsMouseReleaseEvent ( QMouseEvent * ); | 67 | void contentsMouseReleaseEvent ( QMouseEvent * ); |
68 | void contentsMouseMoveEvent ( QMouseEvent * ); | 68 | void contentsMouseMoveEvent ( QMouseEvent * ); |
69 | 69 | ||
70 | public slots: | 70 | public slots: |
71 | /** update time label positions */ | 71 | /** update time label positions */ |
72 | void positionChanged(); | 72 | void positionChanged(); |
73 | signals: | 73 | signals: |
74 | void scaleChanged(); | 74 | void scaleChanged(); |
75 | protected: | 75 | protected: |
76 | void drawContents(QPainter *p,int cx, int cy, int cw, int ch); | 76 | void drawContents(QPainter *p,int cx, int cy, int cw, int ch); |
77 | 77 | ||
78 | private: | 78 | private: |
79 | int mMouseDownY; | 79 | int mMouseDownY; |
80 | QString mOrgCap; | 80 | QString mOrgCap; |
81 | int mRows; | 81 | int mRows; |
82 | int mCellHeight; | 82 | int mCellHeight; |
83 | 83 | ||
84 | /** */ | 84 | /** */ |
85 | KOAgenda* mAgenda; | 85 | KOAgenda* mAgenda; |
86 | }; | 86 | }; |
87 | 87 | ||
88 | class EventIndicator : public QFrame { | 88 | class EventIndicator : public QFrame { |
89 | Q_OBJECT | 89 | Q_OBJECT |
90 | public: | 90 | public: |
91 | enum Location { Top, Bottom }; | 91 | enum Location { Top, Bottom }; |
92 | EventIndicator(Location loc=Top,QWidget *parent=0,const char *name=0); | 92 | EventIndicator(Location loc=Top,QWidget *parent=0,const char *name=0); |
93 | virtual ~EventIndicator(); | 93 | virtual ~EventIndicator(); |
94 | 94 | ||
95 | void changeColumns(int columns); | 95 | void changeColumns(int columns); |
96 | void setPaintWidget( KDGanttMinimizeSplitter* ); | 96 | void setPaintWidget( KDGanttMinimizeSplitter* ); |
97 | void setXOffset( int ); | 97 | void setXOffset( int ); |
98 | void enableColumn(int column, bool enable); | 98 | void enableColumn(int column, bool enable); |
99 | 99 | ||
100 | protected: | 100 | protected: |
101 | void drawContents(QPainter *); | 101 | void drawContents(QPainter *); |
102 | 102 | ||
103 | private: | 103 | private: |
104 | int mXOffset; | 104 | int mXOffset; |
105 | KDGanttMinimizeSplitter* mPaintWidget; | 105 | KDGanttMinimizeSplitter* mPaintWidget; |
106 | int mColumns; | 106 | int mColumns; |
107 | QHBox *mTopBox; | 107 | QHBox *mTopBox; |
108 | QBoxLayout *mTopLayout; | 108 | QBoxLayout *mTopLayout; |
109 | Location mLocation; | 109 | Location mLocation; |
110 | QPixmap mPixmap; | 110 | QPixmap mPixmap; |
111 | QMemArray<bool> mEnabled; | 111 | QMemArray<bool> mEnabled; |
112 | }; | 112 | }; |
113 | 113 | ||
114 | /** | 114 | /** |
115 | KOAgendaView is the agenda-like view used to display events in an one or | 115 | KOAgendaView is the agenda-like view used to display events in an one or |
116 | multi-day view. | 116 | multi-day view. |
117 | */ | 117 | */ |
118 | class KOAgendaView : public KOEventView { | 118 | class KOAgendaView : public KOEventView { |
119 | Q_OBJECT | 119 | Q_OBJECT |
120 | public: | 120 | public: |
121 | KOAgendaView(Calendar *cal,QWidget *parent = 0,const char *name = 0 ); | 121 | KOAgendaView(Calendar *cal,QWidget *parent = 0,const char *name = 0 ); |
122 | virtual ~KOAgendaView(); | 122 | virtual ~KOAgendaView(); |
123 | void setStartHour( int ); | 123 | void setStartHour( int ); |
124 | void toggleAllDay(); | 124 | void toggleAllDay(); |
125 | 125 | ||
126 | 126 | ||
127 | /** Returns maximum number of days supported by the koagendaview */ | 127 | /** Returns maximum number of days supported by the koagendaview */ |
128 | virtual int maxDatesHint(); | 128 | virtual int maxDatesHint(); |
129 | 129 | ||
130 | /** Returns number of currently shown dates. */ | 130 | /** Returns number of currently shown dates. */ |
131 | virtual int currentDateCount(); | 131 | virtual int currentDateCount(); |
132 | 132 | ||
133 | /** returns the currently selected events */ | 133 | /** returns the currently selected events */ |
134 | virtual QPtrList<Incidence> selectedIncidences(); | 134 | virtual QPtrList<Incidence> selectedIncidences(); |
135 | 135 | ||
136 | /** returns the currently selected events */ | 136 | /** returns the currently selected events */ |
137 | virtual DateList selectedDates(); | 137 | virtual DateList selectedDates(); |
138 | 138 | ||
139 | /** Remove all events from view */ | 139 | /** Remove all events from view */ |
140 | void clearView(); | 140 | void clearView(); |
141 | KOAgenda *agenda() { return mAgenda;} | 141 | KOAgenda *agenda() { return mAgenda;} |
142 | virtual void printPreview(CalPrinter *calPrinter, | 142 | virtual void printPreview(CalPrinter *calPrinter, |
143 | const QDate &, const QDate &); | 143 | const QDate &, const QDate &); |
144 | 144 | ||
145 | /** start-datetime of selection */ | 145 | /** start-datetime of selection */ |
146 | QDateTime selectionStart() {return mTimeSpanBegin;} | 146 | QDateTime selectionStart() {return mTimeSpanBegin;} |
147 | /** end-datetime of selection */ | 147 | /** end-datetime of selection */ |
148 | QDateTime selectionEnd() {return mTimeSpanEnd;} | 148 | QDateTime selectionEnd() {return mTimeSpanEnd;} |
149 | /** returns true if selection is for whole day */ | 149 | /** returns true if selection is for whole day */ |
150 | bool selectedIsAllDay() {return mTimeSpanInAllDay;} | 150 | bool selectedIsAllDay() {return mTimeSpanInAllDay;} |
151 | /** make selected start/end invalid */ | 151 | /** make selected start/end invalid */ |
152 | void deleteSelectedDateTime(); | 152 | void deleteSelectedDateTime(); |
153 | void repaintAgenda(); | 153 | void repaintAgenda(); |
154 | public slots: | 154 | public slots: |
155 | virtual void updateView(); | 155 | virtual void updateView(); |
156 | virtual void updateConfig(); | 156 | virtual void updateConfig(); |
157 | virtual void showDates(const QDate &start, const QDate &end); | 157 | virtual void showDates(const QDate &start, const QDate &end); |
158 | virtual void showEvents(QPtrList<Event> eventList); | 158 | virtual void showEvents(QPtrList<Event> eventList); |
159 | 159 | ||
160 | void updateTodo( Todo *, int ); | 160 | void updateTodo( Todo *, int ); |
161 | void changeEventDisplay(Event *, int); | 161 | void changeEventDisplay(Event *, int); |
162 | 162 | ||
163 | void clearSelection(); | 163 | void clearSelection(); |
164 | 164 | ||
165 | void newTodo(int gx,int gy); | 165 | void newTodo(int gx,int gy); |
166 | void newEvent(int gx,int gy); | 166 | void newEvent(int gx,int gy); |
167 | void newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd); | 167 | void newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd); |
168 | void newEventAllDay(int gx, int gy); | 168 | void newEventAllDay(int gx, int gy); |
169 | void newTodoAllDay(int gx, int gy); | 169 | void newTodoAllDay(int gx, int gy); |
170 | 170 | ||
171 | void startDrag(Event *); | 171 | void startDrag(Event *); |
172 | 172 | ||
173 | void readSettings(); | 173 | void readSettings(); |
174 | void readSettings(KConfig *); | 174 | void readSettings(KConfig *); |
175 | void writeSettings(KConfig *); | 175 | void writeSettings(KConfig *); |
176 | 176 | ||
177 | void setContentsPos(int y); | 177 | void setContentsPos(int y); |
178 | 178 | ||
179 | void setExpandedButton( bool expanded ); | 179 | void setExpandedButton( bool expanded ); |
180 | void scrollOneHourUp(); | 180 | void scrollOneHourUp(); |
181 | void scrollOneHourDown(); | 181 | void scrollOneHourDown(); |
182 | void addToCalSlot(Incidence *, Incidence *); | 182 | void addToCalSlot(Incidence *, Incidence *); |
183 | 183 | ||
184 | signals: | 184 | signals: |
185 | void showDateView( int, QDate ); | ||
185 | void newTodoSignal( QDateTime ,bool ); | 186 | void newTodoSignal( QDateTime ,bool ); |
186 | void toggleExpand(); | 187 | void toggleExpand(); |
187 | void todoMoved( Todo *, int ); | 188 | void todoMoved( Todo *, int ); |
188 | void incidenceChanged(Incidence * , int ); | 189 | void incidenceChanged(Incidence * , int ); |
189 | // void cloneIncidenceSignal(Incidence *); | 190 | // void cloneIncidenceSignal(Incidence *); |
190 | 191 | ||
191 | protected: | 192 | protected: |
192 | bool mBlockUpdating; | 193 | bool mBlockUpdating; |
193 | int mUpcomingWidth; | 194 | int mUpcomingWidth; |
194 | /** Fill agenda beginning with date startDate */ | 195 | /** Fill agenda beginning with date startDate */ |
195 | void fillAgenda(const QDate &startDate); | 196 | void fillAgenda(const QDate &startDate); |
196 | void resizeEvent( QResizeEvent* e ); | 197 | void resizeEvent( QResizeEvent* e ); |
197 | /** Fill agenda using the current set value for the start date */ | 198 | /** Fill agenda using the current set value for the start date */ |
198 | void fillAgenda(); | 199 | void fillAgenda(); |
199 | 200 | ||
200 | /** Create labels for the selected dates. */ | 201 | /** Create labels for the selected dates. */ |
201 | void createDayLabels(); | 202 | void createDayLabels(); |
202 | 203 | ||
203 | /** | 204 | /** |
204 | Set the masks on the agenda widgets indicating, which days are holidays. | 205 | Set the masks on the agenda widgets indicating, which days are holidays. |
205 | */ | 206 | */ |
206 | void setHolidayMasks(); | 207 | void setHolidayMasks(); |
207 | 208 | ||
208 | protected slots: | 209 | protected slots: |
209 | /** Update event belonging to agenda item */ | 210 | /** Update event belonging to agenda item */ |
210 | void updateEventDates(KOAgendaItem *item, int mode = -1); | 211 | void updateEventDates(KOAgendaItem *item, int mode = -1); |
211 | //void updateMovedTodo(); | 212 | //void updateMovedTodo(); |
212 | 213 | ||
213 | void updateEventIndicatorTop(int newY); | 214 | void updateEventIndicatorTop(int newY); |
214 | void updateEventIndicatorBottom(int newY); | 215 | void updateEventIndicatorBottom(int newY); |
215 | 216 | ||
216 | /** Updates data for selected timespan */ | 217 | /** Updates data for selected timespan */ |
217 | void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd); | 218 | void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd); |
218 | /** Updates data for selected timespan for all day event*/ | 219 | /** Updates data for selected timespan for all day event*/ |
219 | void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd); | 220 | void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd); |
220 | 221 | ||
221 | private: | 222 | private: |
222 | // view widgets | 223 | // view widgets |
223 | QFrame *mDayLabels; | 224 | QFrame *mDayLabels; |
224 | QHBox *mDayLabelsFrame; | 225 | QHBox *mDayLabelsFrame; |
225 | QBoxLayout *mLayoutDayLabels; | 226 | QBoxLayout *mLayoutDayLabels; |
226 | QFrame *mAllDayFrame; | 227 | QFrame *mAllDayFrame; |
227 | KOAgenda *mAllDayAgenda; | 228 | KOAgenda *mAllDayAgenda; |
228 | KOAgenda *mAgenda; | 229 | KOAgenda *mAgenda; |
229 | TimeLabels *mTimeLabels; | 230 | TimeLabels *mTimeLabels; |
230 | QWidget *mDummyAllDayLeft; | 231 | QWidget *mDummyAllDayLeft; |
231 | 232 | ||
232 | KDGanttMinimizeSplitter* mSplitterAgenda; | 233 | KDGanttMinimizeSplitter* mSplitterAgenda; |
233 | QPushButton *mExpandButton; | 234 | QPushButton *mExpandButton; |
234 | 235 | ||
235 | DateList mSelectedDates; // List of dates to be displayed | 236 | DateList mSelectedDates; // List of dates to be displayed |
236 | int mViewType; | 237 | int mViewType; |
237 | 238 | ||
238 | bool mWeekStartsMonday; | 239 | bool mWeekStartsMonday; |
239 | int mStartHour; | 240 | int mStartHour; |
240 | 241 | ||
241 | KOEventPopupMenu *mAgendaPopup; | 242 | KOEventPopupMenu *mAgendaPopup; |
242 | KOEventPopupMenu *mAllDayAgendaPopup; | 243 | KOEventPopupMenu *mAllDayAgendaPopup; |
243 | 244 | ||
244 | EventIndicator *mEventIndicatorTop; | 245 | EventIndicator *mEventIndicatorTop; |
245 | EventIndicator *mEventIndicatorBottom; | 246 | EventIndicator *mEventIndicatorBottom; |
246 | 247 | ||
247 | QMemArray<int> mMinY; | 248 | QMemArray<int> mMinY; |
248 | QMemArray<int> mMaxY; | 249 | QMemArray<int> mMaxY; |
249 | 250 | ||
250 | QMemArray<bool> mHolidayMask; | 251 | QMemArray<bool> mHolidayMask; |
251 | 252 | ||
252 | QPixmap mExpandedPixmap; | 253 | QPixmap mExpandedPixmap; |
253 | QPixmap mNotExpandedPixmap; | 254 | QPixmap mNotExpandedPixmap; |
254 | QPtrList<QLabel> mDayLabelsList; | 255 | QPtrList<QLabel> mDayLabelsList; |
255 | QDateTime mTimeSpanBegin; | 256 | QDateTime mTimeSpanBegin; |
256 | QDateTime mTimeSpanEnd; | 257 | QDateTime mTimeSpanEnd; |
257 | bool mTimeSpanInAllDay; | 258 | bool mTimeSpanInAllDay; |
258 | void keyPressEvent ( QKeyEvent * e ); | 259 | void keyPressEvent ( QKeyEvent * e ); |
259 | }; | 260 | }; |
260 | 261 | ||
261 | #endif // KOAGENDAVIEW_H | 262 | #endif // KOAGENDAVIEW_H |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index a88276e..6da4799 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -1,503 +1,551 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | 3 | ||
4 | Copyright (c) 2001 | 4 | Copyright (c) 2001 |
5 | Cornelius Schumacher <schumacher@kde.org> | 5 | Cornelius Schumacher <schumacher@kde.org> |
6 | 6 | ||
7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 2 of the License, or | 9 | the Free Software Foundation; either version 2 of the License, or |
10 | (at your option) any later version. | 10 | (at your option) any later version. |
11 | 11 | ||
12 | This program is distributed in the hope that it will be useful, | 12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software | 18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 19 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
20 | 20 | ||
21 | As a special exception, permission is given to link this program | 21 | As a special exception, permission is given to link this program |
22 | with any edition of Qt, and distribute the resulting executable, | 22 | with any edition of Qt, and distribute the resulting executable, |
23 | without including the source code for Qt in the source distribution. | 23 | without including the source code for Qt in the source distribution. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <qwidgetstack.h> | 26 | #include <qwidgetstack.h> |
27 | 27 | ||
28 | #include <kconfig.h> | 28 | #include <kconfig.h> |
29 | #include <kglobal.h> | 29 | #include <kglobal.h> |
30 | #ifndef DESKTOP_VERSION | 30 | #ifndef DESKTOP_VERSION |
31 | #include <qpe/qpeapplication.h> | 31 | #include <qpe/qpeapplication.h> |
32 | #else | 32 | #else |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #endif | 34 | #endif |
35 | #include <qdatetime.h> | 35 | #include <qdatetime.h> |
36 | #include "calendarview.h" | 36 | #include "calendarview.h" |
37 | #include "datenavigator.h" | 37 | #include "datenavigator.h" |
38 | #include "kotodoview.h" | 38 | #include "kotodoview.h" |
39 | #include "koagendaview.h" | 39 | #include "koagendaview.h" |
40 | #include "kodialogmanager.h" | 40 | #include "kodialogmanager.h" |
41 | #include "komonthview.h" | 41 | #include "komonthview.h" |
42 | #include "kolistview.h" | 42 | #include "kolistview.h" |
43 | #include "kowhatsnextview.h" | 43 | #include "kowhatsnextview.h" |
44 | #include "kojournalview.h" | 44 | #include "kojournalview.h" |
45 | #include "kotimespanview.h" | 45 | #include "kotimespanview.h" |
46 | #include "koprefs.h" | 46 | #include "koprefs.h" |
47 | #include "navigatorbar.h" | 47 | #include "navigatorbar.h" |
48 | #include "kdatenavigator.h" | 48 | #include "kdatenavigator.h" |
49 | 49 | ||
50 | #include "koviewmanager.h" | 50 | #include "koviewmanager.h" |
51 | //extern bool externFlagMonthviewBlockPainting; | 51 | //extern bool externFlagMonthviewBlockPainting; |
52 | 52 | ||
53 | //bool globalFlagBlockPainting = false; | 53 | //bool globalFlagBlockPainting = false; |
54 | int globalFlagBlockAgenda = 0; | 54 | int globalFlagBlockAgenda = 0; |
55 | int globalFlagBlockLabel = 0; | 55 | int globalFlagBlockLabel = 0; |
56 | int globalFlagBlockAgendaItemPaint = 1; | 56 | int globalFlagBlockAgendaItemPaint = 1; |
57 | int globalFlagBlockAgendaItemUpdate = 1; | 57 | int globalFlagBlockAgendaItemUpdate = 1; |
58 | 58 | ||
59 | 59 | ||
60 | KOViewManager::KOViewManager( CalendarView *mainView ) : | 60 | KOViewManager::KOViewManager( CalendarView *mainView ) : |
61 | QObject(), mMainView( mainView ) | 61 | QObject(), mMainView( mainView ) |
62 | { | 62 | { |
63 | mCurrentView = 0; | 63 | mCurrentView = 0; |
64 | 64 | ||
65 | mWhatsNextView = 0; | 65 | mWhatsNextView = 0; |
66 | mTodoView = 0; | 66 | mTodoView = 0; |
67 | mAgendaView = 0; | 67 | mAgendaView = 0; |
68 | mMonthView = 0; | 68 | mMonthView = 0; |
69 | mListView = 0; | 69 | mListView = 0; |
70 | mJournalView = 0; | 70 | mJournalView = 0; |
71 | mTimeSpanView = 0; | 71 | mTimeSpanView = 0; |
72 | mCurrentAgendaView = 0 ; | 72 | mCurrentAgendaView = 0 ; |
73 | mFlagShowNextxDays = false; | 73 | mFlagShowNextxDays = false; |
74 | } | 74 | } |
75 | 75 | ||
76 | KOViewManager::~KOViewManager() | 76 | KOViewManager::~KOViewManager() |
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | KOrg::BaseView *KOViewManager::currentView() | 81 | KOrg::BaseView *KOViewManager::currentView() |
82 | { | 82 | { |
83 | return mCurrentView; | 83 | return mCurrentView; |
84 | } | 84 | } |
85 | 85 | ||
86 | void KOViewManager::readSettings(KConfig *config) | 86 | void KOViewManager::readSettings(KConfig *config) |
87 | { | 87 | { |
88 | config->setGroup("General"); | 88 | config->setGroup("General"); |
89 | QString view = config->readEntry("Current View"); | 89 | QString view = config->readEntry("Current View"); |
90 | if (view == "WhatsNext") showWhatsNextView(); | 90 | if (view == "WhatsNext") showWhatsNextView(); |
91 | else if (view == "Month") showMonthView(); | 91 | else if (view == "Month") showMonthView(); |
92 | else if (view == "List") showListView(); | 92 | else if (view == "List") showListView(); |
93 | else if (view == "Journal") showJournalView(); | 93 | else if (view == "Journal") showJournalView(); |
94 | else if (view == "TimeSpan") showTimeSpanView(); | 94 | else if (view == "TimeSpan") showTimeSpanView(); |
95 | else if (view == "Todo") showTodoView(); | 95 | else if (view == "Todo") showTodoView(); |
96 | else { | 96 | else { |
97 | showAgendaView(); | 97 | showAgendaView(); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | |||
102 | void KOViewManager::showDateView( int view, QDate date) | ||
103 | { | ||
104 | |||
105 | qDebug("date %d %s", view, date.toString().latin1()); | ||
106 | #if 0 | ||
107 | mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); | ||
108 | mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 ); | ||
109 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 ); | ||
110 | mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 ); | ||
111 | mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); | ||
112 | #endif | ||
113 | if ( view == 3 ) { | ||
114 | mMainView->showDay( date ); | ||
115 | } else if (view == 4 ) { | ||
116 | mMainView->dateNavigator()->selectDates( date, 7 ); | ||
117 | } else if (view == 5 ) { | ||
118 | mMainView->dateNavigator()->selectDates( date, 14); | ||
119 | } else if (view == 6 ) { | ||
120 | showMonthView(); | ||
121 | mMainView->dateNavigator()->selectMonthByDate( date ); | ||
122 | mMainView->dateNavigator()->selectDate( date ); | ||
123 | } else if (view == 7 ) { | ||
124 | mMainView->dateNavigator()->selectDate( date ); | ||
125 | showJournalView(); | ||
126 | } else if (view == 8 ) { | ||
127 | globalFlagBlockAgenda = 1; | ||
128 | if ( mCurrentAgendaView != 3 ) | ||
129 | mCurrentAgendaView = -1; | ||
130 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | ||
131 | globalFlagBlockAgenda = 2; | ||
132 | mMainView->dateNavigator()->selectDates( date , | ||
133 | KOPrefs::instance()->mNextXDays ); | ||
134 | mFlagShowNextxDays = true; | ||
135 | mCurrentAgendaView = 3 ; | ||
136 | } | ||
137 | |||
138 | #if 0 | ||
139 | dateNavigator()->blockSignals( true ); | ||
140 | dateNavigator()->selectDate( d ); | ||
141 | dateNavigator()->blockSignals( false ); | ||
142 | mViewManager->showDayView(); | ||
143 | #endif | ||
144 | |||
145 | } | ||
146 | |||
147 | |||
148 | |||
101 | void KOViewManager::writeSettings(KConfig *config) | 149 | void KOViewManager::writeSettings(KConfig *config) |
102 | { | 150 | { |
103 | config->setGroup("General"); | 151 | config->setGroup("General"); |
104 | 152 | ||
105 | QString view; | 153 | QString view; |
106 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; | 154 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; |
107 | else if (mCurrentView == mMonthView) view = "Month"; | 155 | else if (mCurrentView == mMonthView) view = "Month"; |
108 | else if (mCurrentView == mListView) view = "List"; | 156 | else if (mCurrentView == mListView) view = "List"; |
109 | else if (mCurrentView == mJournalView) view = "Journal"; | 157 | else if (mCurrentView == mJournalView) view = "Journal"; |
110 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; | 158 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; |
111 | else if (mCurrentView == mTodoView) view = "Todo"; | 159 | else if (mCurrentView == mTodoView) view = "Todo"; |
112 | else view = "Agenda"; | 160 | else view = "Agenda"; |
113 | 161 | ||
114 | config->writeEntry("Current View",view); | 162 | config->writeEntry("Current View",view); |
115 | 163 | ||
116 | if (mAgendaView) { | 164 | if (mAgendaView) { |
117 | mAgendaView->writeSettings(config); | 165 | mAgendaView->writeSettings(config); |
118 | } | 166 | } |
119 | if (mTimeSpanView) { | 167 | if (mTimeSpanView) { |
120 | mTimeSpanView->writeSettings(config); | 168 | mTimeSpanView->writeSettings(config); |
121 | } | 169 | } |
122 | if (mListView) { | 170 | if (mListView) { |
123 | mListView->writeSettings(config); | 171 | mListView->writeSettings(config); |
124 | } | 172 | } |
125 | if (mTodoView) { | 173 | if (mTodoView) { |
126 | mTodoView->saveLayout(config,"Todo View"); | 174 | mTodoView->saveLayout(config,"Todo View"); |
127 | } | 175 | } |
128 | } | 176 | } |
129 | 177 | ||
130 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | 178 | void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) |
131 | { | 179 | { |
132 | 180 | ||
133 | //mFlagShowNextxDays = false; | 181 | //mFlagShowNextxDays = false; |
134 | //if(view == mCurrentView) return; | 182 | //if(view == mCurrentView) return; |
135 | if ( view == 0 ) { | 183 | if ( view == 0 ) { |
136 | view = mCurrentView; | 184 | view = mCurrentView; |
137 | if ( view == 0 ) | 185 | if ( view == 0 ) |
138 | return; | 186 | return; |
139 | } | 187 | } |
140 | bool full = fullScreen; | 188 | bool full = fullScreen; |
141 | if(view == mCurrentView && view != mWhatsNextView ) { | 189 | if(view == mCurrentView && view != mWhatsNextView ) { |
142 | if ( mCurrentAgendaView < 0 ) | 190 | if ( mCurrentAgendaView < 0 ) |
143 | return; | 191 | return; |
144 | full = mMainView->leftFrame()->isVisible(); | 192 | full = mMainView->leftFrame()->isVisible(); |
145 | } else { | 193 | } else { |
146 | mCurrentView = view; | 194 | mCurrentView = view; |
147 | 195 | ||
148 | // bool full = fullScreen; | 196 | // bool full = fullScreen; |
149 | bool isFull = !mMainView->leftFrame()->isVisible(); | 197 | bool isFull = !mMainView->leftFrame()->isVisible(); |
150 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) | 198 | if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) |
151 | full = true; | 199 | full = true; |
152 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) | 200 | if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) |
153 | full = false; | 201 | full = false; |
154 | } | 202 | } |
155 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 203 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
156 | //raiseCurrentView( full ); | 204 | //raiseCurrentView( full ); |
157 | mMainView->processIncidenceSelection( 0 ); | 205 | mMainView->processIncidenceSelection( 0 ); |
158 | mMainView->updateView(); | 206 | mMainView->updateView(); |
159 | raiseCurrentView( full ); | 207 | raiseCurrentView( full ); |
160 | mMainView->adaptNavigationUnits(); | 208 | mMainView->adaptNavigationUnits(); |
161 | } | 209 | } |
162 | 210 | ||
163 | void KOViewManager::raiseCurrentView( bool fullScreen ) | 211 | void KOViewManager::raiseCurrentView( bool fullScreen ) |
164 | { | 212 | { |
165 | //qDebug("raiseCurrentView "); | 213 | //qDebug("raiseCurrentView "); |
166 | mCurrentAgendaView = 0; | 214 | mCurrentAgendaView = 0; |
167 | int wid = mMainView->width() ; | 215 | int wid = mMainView->width() ; |
168 | int hei = mMainView->height(); | 216 | int hei = mMainView->height(); |
169 | if ( mCurrentView == mMonthView ) { | 217 | if ( mCurrentView == mMonthView ) { |
170 | mMainView->navigatorBar()->show(); | 218 | mMainView->navigatorBar()->show(); |
171 | hei -= mMainView->navigatorBar()->sizeHint().height(); | 219 | hei -= mMainView->navigatorBar()->sizeHint().height(); |
172 | //mMainView->navigatorBar()->hide(); | 220 | //mMainView->navigatorBar()->hide(); |
173 | } else { | 221 | } else { |
174 | mMainView->navigatorBar()->hide(); | 222 | mMainView->navigatorBar()->hide(); |
175 | } | 223 | } |
176 | if ( fullScreen ) { | 224 | if ( fullScreen ) { |
177 | mMainView->leftFrame()->hide(); | 225 | mMainView->leftFrame()->hide(); |
178 | } else { | 226 | } else { |
179 | mMainView->leftFrame()->show(); | 227 | mMainView->leftFrame()->show(); |
180 | if ( KOPrefs::instance()->mVerticalScreen ) | 228 | if ( KOPrefs::instance()->mVerticalScreen ) |
181 | hei -= mMainView->leftFrame()->height(); | 229 | hei -= mMainView->leftFrame()->height(); |
182 | else | 230 | else |
183 | wid -= mMainView->leftFrame()->width(); | 231 | wid -= mMainView->leftFrame()->width(); |
184 | } | 232 | } |
185 | emit signalFullScreen( !fullScreen ); | 233 | emit signalFullScreen( !fullScreen ); |
186 | if ( globalFlagBlockAgenda == 5 ) { | 234 | if ( globalFlagBlockAgenda == 5 ) { |
187 | globalFlagBlockAgenda = 4; | 235 | globalFlagBlockAgenda = 4; |
188 | globalFlagBlockAgendaItemPaint = 1; | 236 | globalFlagBlockAgendaItemPaint = 1; |
189 | } | 237 | } |
190 | mMainView->viewStack()->raiseWidget(mCurrentView); | 238 | mMainView->viewStack()->raiseWidget(mCurrentView); |
191 | if ( globalFlagBlockAgenda == 4 ) { | 239 | if ( globalFlagBlockAgenda == 4 ) { |
192 | if ( mCurrentView == mAgendaView ) { | 240 | if ( mCurrentView == mAgendaView ) { |
193 | //globalFlagBlockAgenda =1 ; | 241 | //globalFlagBlockAgenda =1 ; |
194 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 242 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
195 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 243 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
196 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 244 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
197 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 245 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |
198 | qApp->processEvents(); | 246 | qApp->processEvents(); |
199 | //qDebug("qApp->processEvents() "); | 247 | //qDebug("qApp->processEvents() "); |
200 | globalFlagBlockAgenda = 0; | 248 | globalFlagBlockAgenda = 0; |
201 | mAgendaView->repaintAgenda(); | 249 | mAgendaView->repaintAgenda(); |
202 | 250 | ||
203 | } | 251 | } |
204 | globalFlagBlockAgenda = 0; | 252 | globalFlagBlockAgenda = 0; |
205 | } | 253 | } |
206 | emit signalAgendaView( mCurrentView == mAgendaView ); | 254 | emit signalAgendaView( mCurrentView == mAgendaView ); |
207 | //qDebug("raiseCurrentView ende "); | 255 | //qDebug("raiseCurrentView ende "); |
208 | 256 | ||
209 | } | 257 | } |
210 | 258 | ||
211 | void KOViewManager::updateView() | 259 | void KOViewManager::updateView() |
212 | { | 260 | { |
213 | // qDebug("KOViewManager::updateView() "); | 261 | // qDebug("KOViewManager::updateView() "); |
214 | // if we are updating mTodoView, we get endless recursion | 262 | // if we are updating mTodoView, we get endless recursion |
215 | if ( mTodoView == mCurrentView ) | 263 | if ( mTodoView == mCurrentView ) |
216 | return; | 264 | return; |
217 | if ( mCurrentView ) mCurrentView->updateView(); | 265 | if ( mCurrentView ) mCurrentView->updateView(); |
218 | 266 | ||
219 | } | 267 | } |
220 | 268 | ||
221 | void KOViewManager::updateView(const QDate &start, const QDate &end) | 269 | void KOViewManager::updateView(const QDate &start, const QDate &end) |
222 | { | 270 | { |
223 | // kdDebug() << "KOViewManager::updateView()" << endl; | 271 | // kdDebug() << "KOViewManager::updateView()" << endl; |
224 | 272 | ||
225 | if (mCurrentView) mCurrentView->showDates(start, end); | 273 | if (mCurrentView) mCurrentView->showDates(start, end); |
226 | 274 | ||
227 | if (mTodoView) mTodoView->updateView(); | 275 | if (mTodoView) mTodoView->updateView(); |
228 | } | 276 | } |
229 | 277 | ||
230 | 278 | ||
231 | void KOViewManager::updateWNview() | 279 | void KOViewManager::updateWNview() |
232 | { | 280 | { |
233 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) | 281 | if ( mCurrentView == mWhatsNextView && mWhatsNextView ) |
234 | mWhatsNextView->updateView(); | 282 | mWhatsNextView->updateView(); |
235 | 283 | ||
236 | } | 284 | } |
237 | void KOViewManager::showWhatsNextView() | 285 | void KOViewManager::showWhatsNextView() |
238 | { | 286 | { |
239 | if (!mWhatsNextView) { | 287 | if (!mWhatsNextView) { |
240 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), | 288 | mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), |
241 | "KOViewManager::WhatsNextView"); | 289 | "KOViewManager::WhatsNextView"); |
242 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); | 290 | mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); |
243 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); | 291 | connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); |
244 | addView(mWhatsNextView); | 292 | addView(mWhatsNextView); |
245 | connect(this, SIGNAL( printWNV() ), | 293 | connect(this, SIGNAL( printWNV() ), |
246 | mWhatsNextView, SLOT( printMe() ) ); | 294 | mWhatsNextView, SLOT( printMe() ) ); |
247 | } | 295 | } |
248 | globalFlagBlockAgenda = 1; | 296 | globalFlagBlockAgenda = 1; |
249 | showView(mWhatsNextView, true ); | 297 | showView(mWhatsNextView, true ); |
250 | //mWhatsNextView->updateView(); | 298 | //mWhatsNextView->updateView(); |
251 | 299 | ||
252 | } | 300 | } |
253 | 301 | ||
254 | void KOViewManager::showListView() | 302 | void KOViewManager::showListView() |
255 | { | 303 | { |
256 | if (!mListView) { | 304 | if (!mListView) { |
257 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); | 305 | mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); |
258 | addView(mListView); | 306 | addView(mListView); |
259 | 307 | ||
260 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), | 308 | connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), |
261 | mMainView, SLOT(showIncidence(Incidence *))); | 309 | mMainView, SLOT(showIncidence(Incidence *))); |
262 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), | 310 | connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), |
263 | mMainView, SLOT(editIncidence(Incidence *))); | 311 | mMainView, SLOT(editIncidence(Incidence *))); |
264 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 312 | connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
265 | mMainView, SLOT(deleteIncidence(Incidence *))); | 313 | mMainView, SLOT(deleteIncidence(Incidence *))); |
266 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), | 314 | connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), |
267 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 315 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
268 | connect( mListView, SIGNAL( signalNewEvent() ), | 316 | connect( mListView, SIGNAL( signalNewEvent() ), |
269 | mMainView, SLOT( newEvent() ) ); | 317 | mMainView, SLOT( newEvent() ) ); |
270 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); | 318 | connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); |
271 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 319 | connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
272 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 320 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
273 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 321 | connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
274 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 322 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
275 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 323 | connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
276 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 324 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
277 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 325 | connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
278 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 326 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
279 | } | 327 | } |
280 | // bool temp = mFlagShowNextxDays; | 328 | // bool temp = mFlagShowNextxDays; |
281 | //globalFlagBlockPainting = true; | 329 | //globalFlagBlockPainting = true; |
282 | globalFlagBlockAgenda = 1; | 330 | globalFlagBlockAgenda = 1; |
283 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { | 331 | if ( KOPrefs::instance()->mListViewMonthTimespan ) { |
284 | mMainView->setBlockShowDates( true ); | 332 | mMainView->setBlockShowDates( true ); |
285 | mMainView->dateNavigator()->selectMonth(); | 333 | mMainView->dateNavigator()->selectMonth(); |
286 | mMainView->setBlockShowDates( false ); | 334 | mMainView->setBlockShowDates( false ); |
287 | } | 335 | } |
288 | showView(mListView, KOPrefs::instance()->mFullViewTodo); | 336 | showView(mListView, KOPrefs::instance()->mFullViewTodo); |
289 | //mFlagShowNextxDays = temp; | 337 | //mFlagShowNextxDays = temp; |
290 | } | 338 | } |
291 | 339 | ||
292 | void KOViewManager::showAgendaView( bool fullScreen ) | 340 | void KOViewManager::showAgendaView( bool fullScreen ) |
293 | { | 341 | { |
294 | 342 | ||
295 | mMainView->dialogManager()->hideSearchDialog(); | 343 | mMainView->dialogManager()->hideSearchDialog(); |
296 | // qDebug("KOViewManager::showAgendaView "); | 344 | // qDebug("KOViewManager::showAgendaView "); |
297 | bool full; | 345 | bool full; |
298 | full = fullScreen; | 346 | full = fullScreen; |
299 | if (!mAgendaView) { | 347 | if (!mAgendaView) { |
300 | full = false; | 348 | full = false; |
301 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); | 349 | mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); |
302 | addView(mAgendaView); | 350 | addView(mAgendaView); |
303 | #ifndef DESKTOP_VERSION | 351 | #ifndef DESKTOP_VERSION |
304 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); | 352 | QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); |
305 | #endif | 353 | #endif |
306 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), | 354 | connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), |
307 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); | 355 | mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); |
308 | 356 | ||
309 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW | 357 | // SIGNALS/SLOTS FOR DAY/WEEK VIEW |
310 | 358 | ||
311 | 359 | connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); | |
312 | 360 | ||
313 | connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), | 361 | connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), |
314 | mMainView, SLOT(newTodoDateTime(QDateTime,bool))); | 362 | mMainView, SLOT(newTodoDateTime(QDateTime,bool))); |
315 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), | 363 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), |
316 | mMainView, SLOT(newEvent(QDateTime))); | 364 | mMainView, SLOT(newEvent(QDateTime))); |
317 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), | 365 | connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), |
318 | mMainView, SLOT(newEvent(QDateTime,QDateTime))); | 366 | mMainView, SLOT(newEvent(QDateTime,QDateTime))); |
319 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), | 367 | connect(mAgendaView,SIGNAL(newEventSignal(QDate)), |
320 | mMainView, SLOT(newEvent(QDate))); | 368 | mMainView, SLOT(newEvent(QDate))); |
321 | 369 | ||
322 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), | 370 | connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), |
323 | mMainView, SLOT(editIncidence(Incidence *))); | 371 | mMainView, SLOT(editIncidence(Incidence *))); |
324 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), | 372 | connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), |
325 | mMainView, SLOT(showIncidence(Incidence *))); | 373 | mMainView, SLOT(showIncidence(Incidence *))); |
326 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 374 | connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
327 | mMainView, SLOT(deleteIncidence(Incidence *))); | 375 | mMainView, SLOT(deleteIncidence(Incidence *))); |
328 | 376 | ||
329 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), | 377 | connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), |
330 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 378 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
331 | 379 | ||
332 | connect(mAgendaView, SIGNAL( toggleExpand() ), | 380 | connect(mAgendaView, SIGNAL( toggleExpand() ), |
333 | mMainView, SLOT( toggleExpand() ) ); | 381 | mMainView, SLOT( toggleExpand() ) ); |
334 | 382 | ||
335 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), | 383 | connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), |
336 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); | 384 | mAgendaView, SLOT( setExpandedButton( bool ) ) ); |
337 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), | 385 | connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), |
338 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; | 386 | mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; |
339 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), | 387 | connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), |
340 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; | 388 | mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; |
341 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); | 389 | connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); |
342 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, | 390 | connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, |
343 | SLOT( updateTodo( Todo *, int ) ) ); | 391 | SLOT( updateTodo( Todo *, int ) ) ); |
344 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), | 392 | connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), |
345 | mMainView, SIGNAL( todoModified( Todo *, int ))); | 393 | mMainView, SIGNAL( todoModified( Todo *, int ))); |
346 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 394 | connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
347 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 395 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
348 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 396 | connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
349 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 397 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
350 | mAgendaView->readSettings(); | 398 | mAgendaView->readSettings(); |
351 | mAgendaView->updateConfig(); | 399 | mAgendaView->updateConfig(); |
352 | } | 400 | } |
353 | 401 | ||
354 | showView( mAgendaView, full); | 402 | showView( mAgendaView, full); |
355 | 403 | ||
356 | } | 404 | } |
357 | 405 | ||
358 | void KOViewManager::showDayView() | 406 | void KOViewManager::showDayView() |
359 | { | 407 | { |
360 | mFlagShowNextxDays = false; | 408 | mFlagShowNextxDays = false; |
361 | globalFlagBlockLabel = 1; | 409 | globalFlagBlockLabel = 1; |
362 | globalFlagBlockAgenda = 1; | 410 | globalFlagBlockAgenda = 1; |
363 | if ( mCurrentAgendaView != 1 ) | 411 | if ( mCurrentAgendaView != 1 ) |
364 | mCurrentAgendaView = -1; | 412 | mCurrentAgendaView = -1; |
365 | showAgendaView(); | 413 | showAgendaView(); |
366 | qApp->processEvents(); | 414 | qApp->processEvents(); |
367 | globalFlagBlockAgenda = 2; | 415 | globalFlagBlockAgenda = 2; |
368 | globalFlagBlockLabel = 0; | 416 | globalFlagBlockLabel = 0; |
369 | mMainView->dateNavigator()->selectDates( 1 ); | 417 | mMainView->dateNavigator()->selectDates( 1 ); |
370 | mCurrentAgendaView = 1 ; | 418 | mCurrentAgendaView = 1 ; |
371 | 419 | ||
372 | } | 420 | } |
373 | 421 | ||
374 | void KOViewManager::showWorkWeekView() | 422 | void KOViewManager::showWorkWeekView() |
375 | { | 423 | { |
376 | mFlagShowNextxDays = false; | 424 | mFlagShowNextxDays = false; |
377 | globalFlagBlockAgenda = 1; | 425 | globalFlagBlockAgenda = 1; |
378 | globalFlagBlockLabel = 1; | 426 | globalFlagBlockLabel = 1; |
379 | if ( mCurrentAgendaView != 5 ) | 427 | if ( mCurrentAgendaView != 5 ) |
380 | mCurrentAgendaView = -1; | 428 | mCurrentAgendaView = -1; |
381 | showAgendaView(); | 429 | showAgendaView(); |
382 | qApp->processEvents(); | 430 | qApp->processEvents(); |
383 | globalFlagBlockAgenda = 2; | 431 | globalFlagBlockAgenda = 2; |
384 | globalFlagBlockLabel = 0; | 432 | globalFlagBlockLabel = 0; |
385 | mMainView->dateNavigator()->selectWorkWeek(); | 433 | mMainView->dateNavigator()->selectWorkWeek(); |
386 | mCurrentAgendaView = 5 ; | 434 | mCurrentAgendaView = 5 ; |
387 | 435 | ||
388 | } | 436 | } |
389 | 437 | ||
390 | void KOViewManager::showWeekView() | 438 | void KOViewManager::showWeekView() |
391 | { | 439 | { |
392 | /* | 440 | /* |
393 | globalFlagBlockAgenda = 2; | 441 | globalFlagBlockAgenda = 2; |
394 | qDebug("4globalFlagBlockAgenda = 2; "); | 442 | qDebug("4globalFlagBlockAgenda = 2; "); |
395 | //globalFlagBlockPainting = true; | 443 | //globalFlagBlockPainting = true; |
396 | mMainView->dateNavigator()->selectWeek(); | 444 | mMainView->dateNavigator()->selectWeek(); |
397 | showAgendaView(); | 445 | showAgendaView(); |
398 | */ | 446 | */ |
399 | 447 | ||
400 | 448 | ||
401 | mFlagShowNextxDays = false; | 449 | mFlagShowNextxDays = false; |
402 | globalFlagBlockAgenda = 1; | 450 | globalFlagBlockAgenda = 1; |
403 | globalFlagBlockLabel = 1; | 451 | globalFlagBlockLabel = 1; |
404 | if ( mCurrentAgendaView != 7 ) | 452 | if ( mCurrentAgendaView != 7 ) |
405 | mCurrentAgendaView = -1; | 453 | mCurrentAgendaView = -1; |
406 | showAgendaView(); | 454 | showAgendaView(); |
407 | qApp->processEvents(); | 455 | qApp->processEvents(); |
408 | globalFlagBlockAgenda = 2; | 456 | globalFlagBlockAgenda = 2; |
409 | globalFlagBlockLabel = 0; | 457 | globalFlagBlockLabel = 0; |
410 | mMainView->dateNavigator()->selectWeek(); | 458 | mMainView->dateNavigator()->selectWeek(); |
411 | mCurrentAgendaView = 7 ; | 459 | mCurrentAgendaView = 7 ; |
412 | } | 460 | } |
413 | 461 | ||
414 | void KOViewManager::showNextXView() | 462 | void KOViewManager::showNextXView() |
415 | { | 463 | { |
416 | 464 | ||
417 | globalFlagBlockAgenda = 1; | 465 | globalFlagBlockAgenda = 1; |
418 | if ( mCurrentAgendaView != 3 ) | 466 | if ( mCurrentAgendaView != 3 ) |
419 | mCurrentAgendaView = -1; | 467 | mCurrentAgendaView = -1; |
420 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 468 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
421 | globalFlagBlockAgenda = 2; | 469 | globalFlagBlockAgenda = 2; |
422 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), | 470 | mMainView->dateNavigator()->selectDates( QDate::currentDate(), |
423 | KOPrefs::instance()->mNextXDays ); | 471 | KOPrefs::instance()->mNextXDays ); |
424 | mFlagShowNextxDays = true; | 472 | mFlagShowNextxDays = true; |
425 | mCurrentAgendaView = 3 ; | 473 | mCurrentAgendaView = 3 ; |
426 | } | 474 | } |
427 | bool KOViewManager::showsNextDays() | 475 | bool KOViewManager::showsNextDays() |
428 | { | 476 | { |
429 | return mFlagShowNextxDays; | 477 | return mFlagShowNextxDays; |
430 | } | 478 | } |
431 | void KOViewManager::showMonthView() | 479 | void KOViewManager::showMonthView() |
432 | { | 480 | { |
433 | if (!mMonthView) { | 481 | if (!mMonthView) { |
434 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); | 482 | mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); |
435 | 483 | ||
436 | addView(mMonthView); | 484 | addView(mMonthView); |
437 | // mMonthView->show(); | 485 | // mMonthView->show(); |
438 | // SIGNALS/SLOTS FOR MONTH VIEW | 486 | // SIGNALS/SLOTS FOR MONTH VIEW |
439 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), | 487 | connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), |
440 | mMainView, SLOT(newEvent(QDateTime))); | 488 | mMainView, SLOT(newEvent(QDateTime))); |
441 | 489 | ||
442 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), | 490 | connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), |
443 | mMainView, SLOT(showIncidence(Incidence *))); | 491 | mMainView, SLOT(showIncidence(Incidence *))); |
444 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), | 492 | connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), |
445 | mMainView, SLOT(editIncidence(Incidence *))); | 493 | mMainView, SLOT(editIncidence(Incidence *))); |
446 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), | 494 | connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), |
447 | mMainView, SLOT(deleteIncidence(Incidence *))); | 495 | mMainView, SLOT(deleteIncidence(Incidence *))); |
448 | 496 | ||
449 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), | 497 | connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), |
450 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); | 498 | mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); |
451 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), | 499 | connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), |
452 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); | 500 | mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); |
453 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), | 501 | connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), |
454 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); | 502 | mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); |
455 | 503 | ||
456 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), | 504 | connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), |
457 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); | 505 | mMainView, SLOT ( moveIncidence( Incidence * ) ) ); |
458 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), | 506 | connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), |
459 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); | 507 | mMainView, SLOT ( beamIncidence( Incidence * ) ) ); |
460 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), | 508 | connect( mMonthView, SIGNAL( selectWeekNum( int ) ), |
461 | mMainView, SLOT ( selectWeekNum( int ) ) ); | 509 | mMainView, SLOT ( selectWeekNum( int ) ) ); |
462 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), | 510 | connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), |
463 | mMainView, SLOT ( showDay( QDate ) ) ); | 511 | mMainView, SLOT ( showDay( QDate ) ) ); |
464 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); | 512 | connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); |
465 | connect( mMonthView, SIGNAL(nextMonth() ), | 513 | connect( mMonthView, SIGNAL(nextMonth() ), |
466 | mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); | 514 | mMainView->navigatorBar(), SIGNAL(goNextMonth() ) ); |
467 | connect( mMonthView, SIGNAL(prevMonth() ), | 515 | connect( mMonthView, SIGNAL(prevMonth() ), |
468 | mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); | 516 | mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) ); |
469 | mMonthView->updateConfig(); | 517 | mMonthView->updateConfig(); |
470 | } | 518 | } |
471 | 519 | ||
472 | globalFlagBlockAgenda = 1; | 520 | globalFlagBlockAgenda = 1; |
473 | //mFlagShowNextxDays = false; | 521 | //mFlagShowNextxDays = false; |
474 | // if(mMonthView == mCurrentView) return; | 522 | // if(mMonthView == mCurrentView) return; |
475 | mMainView->dateNavigator()->selectMonth(); | 523 | mMainView->dateNavigator()->selectMonth(); |
476 | // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); | 524 | // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); |
477 | //mMonthView->showDates(tmpList.first(), tmpList.last()); | 525 | //mMonthView->showDates(tmpList.first(), tmpList.last()); |
478 | 526 | ||
479 | showView(mMonthView, true ); | 527 | showView(mMonthView, true ); |
480 | 528 | ||
481 | } | 529 | } |
482 | 530 | ||
483 | void KOViewManager::showTodoView() | 531 | void KOViewManager::showTodoView() |
484 | { | 532 | { |
485 | //mFlagShowNextxDays = false; | 533 | //mFlagShowNextxDays = false; |
486 | if ( !mTodoView ) { | 534 | if ( !mTodoView ) { |
487 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), | 535 | mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), |
488 | "KOViewManager::TodoView" ); | 536 | "KOViewManager::TodoView" ); |
489 | 537 | ||
490 | addView( mTodoView ); | 538 | addView( mTodoView ); |
491 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); | 539 | // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); |
492 | 540 | ||
493 | // SIGNALS/SLOTS FOR TODO VIEW | 541 | // SIGNALS/SLOTS FOR TODO VIEW |
494 | connect( mTodoView, SIGNAL( newTodoSignal() ), | 542 | connect( mTodoView, SIGNAL( newTodoSignal() ), |
495 | mMainView, SLOT( newTodo() ) ); | 543 | mMainView, SLOT( newTodo() ) ); |
496 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), | 544 | connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), |
497 | mMainView, SLOT( newSubTodo( Todo *) ) ); | 545 | mMainView, SLOT( newSubTodo( Todo *) ) ); |
498 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), | 546 | connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), |
499 | mMainView, SLOT( showTodo( Todo * ) ) ); | 547 | mMainView, SLOT( showTodo( Todo * ) ) ); |
500 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), | 548 | connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), |
501 | mMainView, SLOT( editTodo( Todo * ) ) ); | 549 | mMainView, SLOT( editTodo( Todo * ) ) ); |
502 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), | 550 | connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), |
503 | mMainView, SLOT( deleteTodo( Todo * ) ) ); | 551 | mMainView, SLOT( deleteTodo( Todo * ) ) ); |
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h index c8c7a7a..137eb2d 100644 --- a/korganizer/koviewmanager.h +++ b/korganizer/koviewmanager.h | |||
@@ -1,117 +1,118 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 | 3 | Copyright (c) 2001 |
4 | Cornelius Schumacher <schumacher@kde.org> | 4 | Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef KOVIEWMANAGER_H | 24 | #ifndef KOVIEWMANAGER_H |
25 | #define KOVIEWMANAGER_H | 25 | #define KOVIEWMANAGER_H |
26 | 26 | ||
27 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | 28 | ||
29 | #include <korganizer/baseview.h> | 29 | #include <korganizer/baseview.h> |
30 | 30 | ||
31 | class CalendarView; | 31 | class CalendarView; |
32 | 32 | ||
33 | class KOListView; | 33 | class KOListView; |
34 | class KOAgendaView; | 34 | class KOAgendaView; |
35 | class KOMonthView; | 35 | class KOMonthView; |
36 | class KOTimeSpanView; | 36 | class KOTimeSpanView; |
37 | class KOTodoView; | 37 | class KOTodoView; |
38 | class KOWhatsNextView; | 38 | class KOWhatsNextView; |
39 | class KOJournalView; | 39 | class KOJournalView; |
40 | 40 | ||
41 | using namespace KCal; | 41 | using namespace KCal; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | This class manages the views of the calendar. It owns the objects and handles | 44 | This class manages the views of the calendar. It owns the objects and handles |
45 | creation and selection. | 45 | creation and selection. |
46 | */ | 46 | */ |
47 | class KOViewManager : public QObject | 47 | class KOViewManager : public QObject |
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | KOViewManager( CalendarView * ); | 51 | KOViewManager( CalendarView * ); |
52 | virtual ~KOViewManager(); | 52 | virtual ~KOViewManager(); |
53 | 53 | ||
54 | /** changes the view to be the currently selected view */ | 54 | /** changes the view to be the currently selected view */ |
55 | void showView(KOrg::BaseView *, bool fullScreen = false ); | 55 | void showView(KOrg::BaseView *, bool fullScreen = false ); |
56 | void updateWNview(); | 56 | void updateWNview(); |
57 | void readSettings(KConfig *config); | 57 | void readSettings(KConfig *config); |
58 | void writeSettings(KConfig *config); | 58 | void writeSettings(KConfig *config); |
59 | bool showsNextDays(); | 59 | bool showsNextDays(); |
60 | /** Read which view was shown last from config file */ | 60 | /** Read which view was shown last from config file */ |
61 | void readCurrentView(KConfig *); | 61 | void readCurrentView(KConfig *); |
62 | /** Write which view is currently shown to config file */ | 62 | /** Write which view is currently shown to config file */ |
63 | void writeCurrentView(KConfig *); | 63 | void writeCurrentView(KConfig *); |
64 | 64 | ||
65 | KOrg::BaseView *currentView(); | 65 | KOrg::BaseView *currentView(); |
66 | 66 | ||
67 | void setDocumentId( const QString & ); | 67 | void setDocumentId( const QString & ); |
68 | 68 | ||
69 | void updateView( const QDate &start, const QDate &end ); | 69 | void updateView( const QDate &start, const QDate &end ); |
70 | 70 | ||
71 | void raiseCurrentView( bool fullScreen = false ); | 71 | void raiseCurrentView( bool fullScreen = false ); |
72 | 72 | ||
73 | void addView(KOrg::BaseView *); | 73 | void addView(KOrg::BaseView *); |
74 | 74 | ||
75 | Incidence *currentSelection(); | 75 | Incidence *currentSelection(); |
76 | QDate currentSelectionDate(); | 76 | QDate currentSelectionDate(); |
77 | 77 | ||
78 | KOAgendaView *agendaView() const { return mAgendaView; } | 78 | KOAgendaView *agendaView() const { return mAgendaView; } |
79 | 79 | ||
80 | signals: | 80 | signals: |
81 | void printWNV(); | 81 | void printWNV(); |
82 | void signalFullScreen( bool ); | 82 | void signalFullScreen( bool ); |
83 | void signalAgendaView( bool ); | 83 | void signalAgendaView( bool ); |
84 | public slots: | 84 | public slots: |
85 | void showDateView( int, QDate ); | ||
85 | void updateView(); | 86 | void updateView(); |
86 | void showWhatsNextView(); | 87 | void showWhatsNextView(); |
87 | void showListView(); | 88 | void showListView(); |
88 | void showAgendaView( bool fullScreen = false ); | 89 | void showAgendaView( bool fullScreen = false ); |
89 | void showDayView(); | 90 | void showDayView(); |
90 | void showWorkWeekView(); | 91 | void showWorkWeekView(); |
91 | void showWeekView(); | 92 | void showWeekView(); |
92 | void showNextXView(); | 93 | void showNextXView(); |
93 | void showMonthView(); | 94 | void showMonthView(); |
94 | void showTodoView(); | 95 | void showTodoView(); |
95 | void showJournalView(); | 96 | void showJournalView(); |
96 | void showTimeSpanView(); | 97 | void showTimeSpanView(); |
97 | 98 | ||
98 | private: | 99 | private: |
99 | CalendarView *mMainView; | 100 | CalendarView *mMainView; |
100 | 101 | ||
101 | int mCurrentAgendaView; | 102 | int mCurrentAgendaView; |
102 | KOAgendaView *mAgendaView; | 103 | KOAgendaView *mAgendaView; |
103 | KOListView *mListView; | 104 | KOListView *mListView; |
104 | KOMonthView *mMonthView; | 105 | KOMonthView *mMonthView; |
105 | KOTodoView *mTodoView; | 106 | KOTodoView *mTodoView; |
106 | KOWhatsNextView *mWhatsNextView; | 107 | KOWhatsNextView *mWhatsNextView; |
107 | KOJournalView *mJournalView; | 108 | KOJournalView *mJournalView; |
108 | KOTimeSpanView *mTimeSpanView; | 109 | KOTimeSpanView *mTimeSpanView; |
109 | 110 | ||
110 | KOrg::BaseView *mCurrentView; // currently active event view | 111 | KOrg::BaseView *mCurrentView; // currently active event view |
111 | 112 | ||
112 | int mAgendaViewMode; | 113 | int mAgendaViewMode; |
113 | bool mFlagShowNextxDays; | 114 | bool mFlagShowNextxDays; |
114 | 115 | ||
115 | }; | 116 | }; |
116 | 117 | ||
117 | #endif | 118 | #endif |