-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 5 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefs.h | 2 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 16 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 9 |
6 files changed, 24 insertions, 11 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 9476a89..a688eaf 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -964,394 +964,394 @@ { "KDE-Pim sync config","KDE-Pim sync Konfig" }, { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, { "Port number (Default: %1)","Port Nummer (Default: %1)" }, { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, { "Disable Pi-Sync","Schalte Pi-Sync aus" }, { "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen \"Multi-Syncen\"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, { "KDE-Pim Sync","KDE-Pim Sync" }, { "Multiple profiles","Multi-Sync Profile" }, { "Device: ","Gerät: " }, { "Multiple sync started.","Multi-Sync gestartet." }, { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, { "Turn filter on","Schalte Filter an" }, { "Turn filter off","Schalte Filter aus" }, { "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" }, { "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" }, { "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" }, { "<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n","<p><b>Schwarz</b>: Termin/Todo mit Teilnehmern. Sie sind der Organisator!</p>\n" }, { "<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n","<p><b>Dunkelgrün</b>: Information(Beschreibung) verfügbar.([i] in WN Ansicht)</p>\n" }, { "<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n","<p><b>Blau</b>: Wiederholender Termin.([r] in Whats'Next Ansicht)</p>\n" }, { "<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n","<p><b>Rot</b>: Alarm gesetzt.([a] in Whats'Next Ansicht)</p>\n" }, { "<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n","<p><b>Kreuz</b>: Eintrag gecancelt.([c] in Whats'Next Ansicht)</p>\n" }, { "<p><b>(for square icons in agenda and month view)</b></p>\n","<p><b>(für quadratische Icons in Agenda und Monats Ansicht)</b></p>\n" }, { "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" }, { "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" }, { "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" }, { "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" }, { "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" }, { "<p><b>shift+up/down</b>: Goto first/last item</p>\n","<p><b>shift+up/down</b>: Gehe zum ersten/letzten Eintrag</p>\n" }, { "<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n","<p><b>ctrl+up/down</b>: Gehe hoch/runter 20% aller Einträge</p>\n" }, { "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" }, { "<p><b>return+shift</b>: Deselect item+one step down</p>\n","<p><b>return+shift</b>: Deselektiere Item+Cursor einen Eintrag runter</p>\n" }, { "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, { "<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" }, { "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, { "<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" }, { "<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" }, { "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" }, { "<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" }, { "<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" }, { "<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" }, { "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, { "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, { "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, { "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, { "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, { "<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" }, { "<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" }, { "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, { "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, { "<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" }, { "<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X+ctrl</b>: Zeige/verstecke Datumsnavigator</p>\n" }, { "<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" }, { "<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" }, { "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monatsansicht</p>\n" }, { "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochenansicht | <b>U</b>: Wochenansicht</p>\n" }, { "<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" }, { "<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ","<p><b>X</b>: Nächste-X-Tage Ansicht | <b>W</b>: What's Next Ansicht\n " }, { "<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" }, { "<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" }, { "<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" }, { "<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" }, { "<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" }, { "<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" }, { "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, { "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" }, { "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, { "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, { "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, { "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" }, { "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" }, { "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" }, { "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, { "KO/Pi FAQ","KO/Pi FAQ" }, { "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, { "About KOrganizer/Pi","Über KOrganizer/Pi" }, { "From: ","Von: " }, { "Remove sync info","Entferne Sync Info" }, { "For all profiles","Für alle Profile" }, { "Hide not Running","Verstecke nicht Laufende" }, { "ME","ME" }, { "Toolbar","Toolbar" }, { "Undo Delete...","Löschen rückgängig machen..." }, { "Undo Delete","Löschen rückgängig machen" }, { "KDE Sync HowTo...","KDE Sync HowTo..." }, { "Multi Sync HowTo...","Multi Sync HowTo..." }, { "Januar","Januar" }, { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, { "No Filter","Kein Filter" }, { "Multiple Sync options","Multi Sync Optionen" }, { "Sync algo options","Sync Ablauf Optionen" }, { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, { "Incoming calendar filter:","Eingehender Kalender Filter:" }, { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, { "Write back options","Optionen zum Zurückschreiben" }, { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, { "Time period","Zeitspanne" }, { "From ","Von " }, { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, { " weeks in the future "," Wochen in der Zukunft " }, { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, { "Local temp file:","Lokale temp Datei:" }, { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, { "Language","Sprache" }, { "Time Format","Zeit Format" }, { "Time Zone","Zeit Zone" }, { "%1 groups subscribed","%1 Guppen abboniert" }, { "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" }, { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, { "Save settings","Speichere Einstellungen" }, { "Save standard","Speichere Standard" }, { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, { "Data storage path","Daten Speicherpfad" }, { "Language","Sprache" }, { "Show time in agenda items","Zeige Zeit in Agenda Items" }, { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, { "Show events, that are done","Zeige abgelaufene Termine" }, { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, { "KO/Pi","KO/Pi" }, { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, { "Sound.Al.: ","Sound.Al.: " }, { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, { "Restore","Wiederherstellen" }, { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, { "% completed","% erledigt" }, { "%d item(s) found.","%d Item(s) gefunden." }, { "Set complete","Setze auf erledigt" }, { "(cancelled)","(gecancelt)" }, { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, { " Local time "," Locale Zeit " }, { "Form2","Form2" }, { "Filter enabled","Filter angeschaltet" }, { "Edit Filters","Ändere Filter" }, { "Print What's Next View...","Drucke What's Next Ansicht..." }, { "Agenda","Agenda" }, { " ("," (" }, { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, { "Print","Print" }, { "&Setup Printer...","Drucker &Setup..." }, { "View Type","Zeige Typ" }, { "Page &orientation:","Seiten Ausrichtung:" }, { "Use Default of Selected Style","Default des selektierten Stils" }, { "Use Default Setting of Printer","Default Einstellung des Druckers" }, { "Portrait","Portrait" }, { "Landscape","Landschaft" }, { "Print day","Drucke Tag" }, { "CalPrintDay_Base","CalPrintDay_Base" }, { "Date && Time Range","Datum && Zeitspanne" }, { "&End date:","&Enddatum:" }, { "&Start date:","&Startdatum:" }, { "Start &time:","Startzeit:" }, { "End ti&me:","Endzeit:" }, { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, { "Alt+D","Alt+D" }, { "&Use colors","Nutze Farben" }, { "Alt+U","Alt+U" }, { "Print week","Drucke Woche" }, { "CalPrintWeek_Base","CalPrintWeek_Base" }, { "Use &colors","Nutze Farben" }, { "Type of View","Typ der Ansicht" }, { "Print as &Filofax page","Drucke als &Filofax Seite" }, { "Alt+F","Alt+F" }, { "Print as &timetable view:","Drucke als Zeittabelle:" }, { "Alt+T","Alt+T" }, { "Print as split week view","Drucke als gesplittete Wochenansicht" }, { "Print month","Drucke Monat" }, { "CalPrintMonth_Base","CalPrintMonth_Base" }, { "&Start month:","&Startmonat:" }, { "&End month:","&Endmonat:" }, { "Print week &numbers","Drucke Wochen Nummer(n)" }, { "Print todos","Drucke Todos" }, { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, { "Include &description of the item","Inclusive Itembeschreibung" }, { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, { "Include &priority of the item","Inclusive Priorität des Items" }, { "Items to Print","Zu druckende Items" }, { "&From:","Von:" }, { "&To:","Bis:" }, { "Print &all todo items","Drucke alle Todo Items" }, { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, { "Todo List","Todo Liste" }, { "&Title:","&Titel:" }, { "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" }, { "Todo list","Todo Liste" }, { "&Print...","Drucke..." }, { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, { "[Unconfigured]","[Unkonfiguriert]" }, { "OK","OK" }, { "FilterEditor","FilterEditor" }, { "Include","Inclusive" }, { "Exclude","Exclusive" }, { "Edit Selection...","Editiere Auswahl" }, { "recurring events","wiederholende Termine" }, { "recurr. events","wiederh.Termine" }, { "completed to-dos","erledigte Todos" }, { "events","Termine" }, { "todos","Todos" }, { "journals","Journale" }, { "public","öffentl." }, { "private","privat" }, { "confidential","vertraul." }, { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" }, { "Yesterday","Gestern" }, { "Day after tomorrow","Übermorgen" }, { "Tomorrow","Morgen" }, { "Day before yesterday","Vorgestern" }, { "Size %1","Größe %1" }, { "New Agendasize: %1","Neue Agendagröße: %1" }, { " (%1 y.)"," (%1 J.)" }, { "Allday:","Ganztägig:" }, { "compl.todos","erled.Todos" }, { "Day view","Tagesansicht" }, { "Next days","Nächste Tage" }, { "Next week","Nächste Woche" }, { "Next two weeks","Nächste zwei Wochen" }, { "This month","Dieser Monat" }, { "Journal view","Journal" }, { "Display all opened","Zeige alle geöffnet" }, { "Display all closed","Zeige alle geschlossen" }, { "Display all flat","Zeige alle flach" }, { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, { "Default todo done color:","Standard Todo erledigt Farbe" }, { "Select week %1-%2","Wähle Woche %1-%2" }, { "Select Week","Wähle Woche" }, { "Set alarm for selected...","Setze Alarm für Selekt..." }, { "Set Alarm!","Setze Alarm!" }, { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, { " and "," und " }, { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, { "Mail to selected","Mail an Ausgewählte" }, { "Mail to all","Mail an Alle" }, { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, { " on"," am" }, { " completed on "," erledigt am " }, { "Save as Event template","Speichere als Vorlage" }, { "Load Event template","Lade Termin Vorlage" }, { "Save as Journal template","Speichere als Journal Vorlage" }, { "Insert Journal template","Füge Journal Vorlage ein" }, { "Sub todos:<br>","Unter Todos:<br>" }, { "Parent todo:<br>","Über Todo:<br>" }, { "Set current as color category","Setze Gewählte als Farbkategorie" }, { " completed"," erledigt" }, { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, { "Error","Fehler" }, { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, { "Warning","Warnung" }, { "Select week number","Wähle Wochen Nummer" }, { "Februar","Februar" }, { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, { "W","W" }, { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, { "T: %1","T: %1" }, { "Start: ","Start: " }, { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, { "Password for remote access:","Passwort für fernen Zugriff:" }, { "Remote IP address:","Ferne IP Adresse:" }, { "Remote port number:","Ferne Port Nummer:" }, { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, { "Remote from: ","Fern von: " }, { "Local from: ","Lokal von: " }, { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, { "Write back","Schreibe zurück" }, { "KO/Pi Synchronization","KO/Pi Synchronisation" }, { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, { "Received sync request","Sync Anfrage erhalten" }, { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, { "Sending file...","Sende Datei..." }, { "Waiting for synced file...","Warte auf gesyncte Daten..." }, { "Receiving synced file...","Gesyncte Daten erhalten..." }, { "Received %1 bytes","%1 Bytes erhalten" }, { "Writing file to disk...","Speichere Datei..." }, { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, { "Synchronize!","Synchronisiere!" }, { "High clock skew!","Großer Uhrzeitunterschied!" }, { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, { "List week view","Listenwochenansicht" }, { "List week","Listenwochenansicht" }, { "Next Week","Nächste Woche" }, { "Previous Week","Vorherige Woche" }, { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, { "Details","Details" }, { "Created time","Erstellt Zeit" }, { "Last modified time","Geändert Zeit" }, { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, { "View Options","Anzeige Optionen" }, { "<b>Created: ","<b>Erstellt am: " }, { "<b>Last modified: ","<b>Zuletzt geändert am: " }, { "Journal: ","Journal: " }, { "yearly","jährlich" }, { "(%1) ","%1-" }, { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, { "Summary/Loc.","Titel/Ort" }, { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, { "Week Number","Wochennummer" }, { "Import","Importiere" }, { "Export","Exportiere" }, { "Beam","Beame" }, { "Export selected","Exportiere Selektierte" }, { "As iCal (ics) file...","Als iCal (ics) Datei..." }, { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, { "Journal/Details...","Journale/Details..." }, { "Agenda View","Agenda Ansicht" }, { "Show current time","Zeige aktuelle Zeit" }, { "Edit new item","Bearbeite neuen Eintrag" }, { "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, { "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, { "%1 days\n","%1 Tagen\n" }, { "1 day\n","1 Tag\n" }, { "%1 hours\n","%1 Stunden\n" }, { "1 hour\n","1 Stunde\n" }, { "%1 minutes\n","%1 Minuten\n" }, { "1 minute\n","1 Minute\n" }, { "Only one toolbar","Nur eine Toolbar" }, { "Print","Drucke" }, { "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, { "There is nothing selected!","Es ist nichts ausgewählt!" }, { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, { "KO/Pi Printout","KO/Pi Ausdruck" }, { "Print unscaled","Drucke unskaliert" }, { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, { "Printout Mode","Druck Modus" }, { "Filter menu icon","Filtermenu Icon" }, { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, { "%1d","%1t" }, { "%1h","%1std" }, { "%1min","%1min" }, { "( %1 before )","( %1 vorher )" }, { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, { "Show Sync Events in WN+Agenda","Zeige Sync-Ereignisse in WN+Agenda" }, { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, { " on "," am " }, { "On: ","Am: " }, { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, { "Start/Stop todo...","Starte/Stoppe Todo..." }, { "Color for running todos:","Farbe für laufende Todos:" }, { "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, { "Todo is started","Todo is gestarted" }, { "Stop todo","Stoppe Todo" }, { "Todo is stopped","Todo ist gestoppt" }, { "Start todo","Starte Todo" }, { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie\nalle Untertodos auch klonen?" }, { "Todo has subtodos","Todo hat Untertodos" }, -{ "","" }, +{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 18c506e..114ed75 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -8,779 +8,780 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef _WIN32_ #define protected public #include <qwidget.h> #undef protected #endif #include <qintdict.h> #include <qdatetime.h> #include <qapplication.h> #include <qpopupmenu.h> #include <qcursor.h> #include <qpainter.h> #include <kdebug.h> #include <klocale.h> #include <kiconloader.h> #include <kglobal.h> #include "koagendaitem.h" #include "koprefs.h" #include "koglobals.h" #include "koagenda.h" #include <libkcal/event.h> #include <libkcal/todo.h> #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #endif //extern bool globalFlagBlockPainting; extern int globalFlagBlockAgenda; extern int globalFlagBlockAgendaItemPaint; extern int globalFlagBlockAgendaItemUpdate; extern int globalFlagBlockStartup; //////////////////////////////////////////////////////////////////////////// MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) : QFrame(_agenda->viewport(),name), agenda(_agenda) { setLineWidth(0); setMargin(0); setBackgroundColor(Qt::red); minutes = new QTimer(this); connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); minutes->start(0, true); mTimeBox = new QLabel(this); mTimeBox->setAlignment(Qt::AlignRight | Qt::AlignBottom); QPalette pal = mTimeBox->palette(); pal.setColor(QColorGroup::Foreground, Qt::red); mTimeBox->setPalette(pal); //mTimeBox->setAutoMask(true); agenda->addChild(mTimeBox); oldToday = -1; } MarcusBains::~MarcusBains() { delete minutes; } int MarcusBains::todayColumn() { QDate currentDate = QDate::currentDate(); DateList dateList = agenda->dateList(); DateList::ConstIterator it; int col = 0; for(it = dateList.begin(); it != dateList.end(); ++it) { if((*it) == currentDate) return KOGlobals::self()->reverseLayout() ? agenda->columns() - 1 - col : col; ++col; } return -1; } void MarcusBains::updateLoc() { updateLocation(); } void MarcusBains::updateLocation(bool recalculate) { QTime tim = QTime::currentTime(); //qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1()); if((tim.hour() == 0) && (oldTime.hour()==23)) recalculate = true; int mins = tim.hour()*60 + tim.minute(); int minutesPerCell = 24 * 60 / agenda->rows(); int y = mins*agenda->gridSpacingY()/minutesPerCell; int today = recalculate ? todayColumn() : oldToday; int x = agenda->gridSpacingX()*today; bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled); oldTime = tim; oldToday = today; if(disabled || (today<0)) { hide(); mTimeBox->hide(); return; } else { show(); mTimeBox->show(); } if(recalculate) setFixedSize(agenda->gridSpacingX(),1); agenda->moveChild(this, x, y); raise(); if(recalculate) //mTimeBox->setFont(QFont("helvetica",10)); mTimeBox->setFont(KOPrefs::instance()->mMarcusBainsFont); mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds)); mTimeBox->adjustSize(); // the -2 below is there because there is a bug in this program // somewhere, where the last column of this widget is a few pixels // narrower than the other columns. int offs = (today==agenda->columns()-1) ? -4 : 0; agenda->moveChild(mTimeBox, x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, y-mTimeBox->height()); mTimeBox->raise(); //mTimeBox->setAutoMask(true); minutes->start(5000,true); } //////////////////////////////////////////////////////////////////////////// /* Create an agenda widget with rows rows and columns columns. */ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, const char *name,WFlags f) : QScrollView(parent,name,f) { mAllAgendaPopup = 0; mColumns = columns; mRows = rows; mGridSpacingY = rowSize; mAllDayMode = false; #ifndef DESKTOP_VERSION //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); #endif mHolidayMask = 0; init(); } /* Create an agenda widget with columns columns and one row. This is used for all-day events. */ KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : QScrollView(parent,name,f) { mAllAgendaPopup = 0; blockResize = false; mColumns = columns; mRows = 1; //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); mGridSpacingY = KOPrefs::instance()->mAllDaySize; mAllDayMode = true; #ifndef DESKTOP_VERSION //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); #endif mHolidayMask = 0; init(); } KOAgenda::~KOAgenda() { if(mMarcusBains) delete mMarcusBains; } Incidence *KOAgenda::selectedIncidence() const { return (mSelectedItem ? mSelectedItem->incidence() : 0); } QDate KOAgenda::selectedIncidenceDate() const { return (mSelectedItem ? mSelectedItem->itemDate() : QDate()); } void KOAgenda::init() { mPopupTimer = new QTimer(this); connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); mNewItemPopup = new QPopupMenu( this ); connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); QString pathString = ""; if ( !KOPrefs::instance()->mToolBarMiniIcons ) { if ( QApplication::desktop()->width() < 480 ) pathString += "icons16/"; } else pathString += "iconsmini/"; mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); mNewItemPopup->insertSeparator ( ); mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 ); mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); #ifndef _WIN32_ int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase viewport()->setWFlags ( wflags); #endif mGridSpacingX = 80; mResizeBorderWidth = 8; mScrollBorderWidth = 8; mScrollDelay = 30; mScrollOffset = 10; mPaintPixmap.resize( 20,20); //enableClipper(true); // Grab key strokes for keyboard navigation of agenda. Seems to have no // effect. Has to be fixed. setFocusPolicy(WheelFocus); connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); mStartCellX = 0; mStartCellY = 0; mCurrentCellX = 0; mCurrentCellY = 0; mSelectionCellX = 0; mSelectionYTop = 0; mSelectionHeight = 0; mOldLowerScrollValue = -1; mOldUpperScrollValue = -1; mClickedItem = 0; mActionItem = 0; mActionType = NOP; mItemMoved = false; mSelectedItem = 0; // mItems.setAutoDelete(true); resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 ); viewport()->update(); setMinimumSize(30, 1); // setMaximumHeight(mGridSpacingY * mRows + 5); // Disable horizontal scrollbar. This is a hack. The geometry should be // controlled in a way that the contents horizontally always fits. Then it is // not necessary to turn off the scrollbar. setHScrollBarMode(AlwaysOff); if ( ! mAllDayMode ) setVScrollBarMode(AlwaysOn); else setVScrollBarMode(AlwaysOff); setStartHour(KOPrefs::instance()->mDayBegins); calculateWorkingHours(); connect(verticalScrollBar(),SIGNAL(valueChanged(int)), SLOT(checkScrollBoundaries(int))); // Create the Marcus Bains line. if(mAllDayMode) mMarcusBains = 0; else { mMarcusBains = new MarcusBains(this); addChild(mMarcusBains); } mPopupKind = 0; mPopupItem = 0; } void KOAgenda::clear() { KOAgendaItem *item; for ( item=mItems.first(); item != 0; item=mItems.next() ) { mUnusedItems.append( item ); //item->hide(); } mItems.clear(); mSelectedItem = 0; clearSelection(); } void KOAgenda::clearSelection() { mSelectionCellX = 0; mSelectionYTop = 0; mSelectionHeight = 0; } void KOAgenda::marcus_bains() { if(mMarcusBains) mMarcusBains->updateLocation(true); } void KOAgenda::changeColumns(int columns) { if (columns == 0) { qDebug("KOAgenda::changeColumns() called with argument 0 "); return; } clear(); mColumns = columns; computeSizes(); } /* This is the eventFilter function, which gets all events from the KOAgendaItems contained in the agenda. It has to handle moving and resizing for all items. */ bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) { // kdDebug() << "KOAgenda::eventFilter" << endl; switch(event->type()) { case QEvent::MouseButtonPress: case QEvent::MouseButtonDblClick: case QEvent::MouseButtonRelease: case QEvent::MouseMove: return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); case (QEvent::Leave): if (!mActionItem) setCursor(arrowCursor); return true; default: return QScrollView::eventFilter(object,event); } } void KOAgenda::popupMenu() { mPopupTimer->stop(); if ( mPopupKind == 1 ) { if (mActionItem ) { endItemAction(); } mLeftMouseDown = false; // no more leftMouse computation if (mPopupItem) { //mClickedItem = mPopupItem; selectItem(mPopupItem); - if ( mAllAgendaPopup ) + if ( mAllAgendaPopup && KOPrefs::instance()->mBlockPopupMenu ) mAllAgendaPopup->installEventFilter( this ); emit showIncidencePopupSignal(mPopupItem->incidence()); } } else if ( mPopupKind == 2 ) { if ( mLeftMouseDown ) { // we have a simulated right click - clear left mouse action endSelectAction( false ); // do not emit new event signal mLeftMouseDown = false; // no more leftMouse computation } - mNewItemPopup->installEventFilter( this ); + if ( KOPrefs::instance()->mBlockPopupMenu ) + mNewItemPopup->installEventFilter( this ); mNewItemPopup->popup( mPopupPos); } mLeftMouseDown = false; mPopupItem = 0; mPopupKind = 0; } bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) { static int startX = 0; static int startY = 0; static int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 15 : 20 ); static bool blockMoving = true; //qDebug("KOAgenda::eventFilter_mous "); if ( object == mNewItemPopup ) { //qDebug("mNewItemPopup "); if ( me->type() == QEvent::MouseButtonRelease ) { mNewItemPopup->removeEventFilter( this ); int dX = me->globalPos().x() - mPopupPos.x();; if ( dX < 0 ) dX = -dX; int dY = me->globalPos().y() - mPopupPos.y(); if ( dY < 0 ) dY = -dY; if ( dX > blockmoveDist || dY > blockmoveDist ) { mNewItemPopup->hide(); } } return true; } if ( object == mAllAgendaPopup ) { //qDebug(" mAllAgendaPopup "); if ( me->type() == QEvent::MouseButtonRelease ) { mAllAgendaPopup->removeEventFilter( this ); int dX = me->globalPos().x() - mPopupPos.x();; if ( dX < 0 ) dX = -dX; int dY = me->globalPos().y() - mPopupPos.y(); if ( dY < 0 ) dY = -dY; if ( dX > blockmoveDist || dY > blockmoveDist ) { mAllAgendaPopup->hide(); } } return true; } QPoint viewportPos; if (object != viewport()) { viewportPos = ((QWidget *)object)->mapToParent(me->pos()); } else { viewportPos = me->pos(); } switch (me->type()) { case QEvent::MouseButtonPress: if (me->button() == LeftButton) { mPopupTimer->start( 600 ); mLeftMouseDown = true; } blockMoving = true; startX = viewportPos.x(); startY = viewportPos.y(); mPopupPos = me->globalPos(); if (object != viewport()) { mPopupItem = (KOAgendaItem *)object; mPopupKind = 1; if (me->button() == RightButton) { popupMenu(); } else if (me->button() == LeftButton) { mActionItem = (KOAgendaItem *)object; if (mActionItem) { if ( mSelectionHeight > 0 ) { int selectionCellX = mSelectionCellX * mGridSpacingX; int selectionYTop = mSelectionYTop; int gridSpacingX = mGridSpacingX; int selectionHeight = mSelectionHeight; clearSelection(); repaintContents( selectionCellX, selectionYTop, gridSpacingX, selectionHeight,false ); } selectItem(mActionItem); Incidence *incidence = mActionItem->incidence(); if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { mActionItem = 0; } else { startItemAction(viewportPos); } } } } else { // ---------- viewport() mPopupItem = 0; mPopupKind = 2; selectItem(0); mActionItem = 0; if (me->button() == RightButton) { int x,y; viewportToContents(viewportPos.x(),viewportPos.y(),x,y); int gx,gy; contentsToGrid(x,y,gx,gy); mCurrentCellX = gx; mCurrentCellY = gy; mStartCellX = gx; mStartCellY = gy; popupMenu(); } else if (me->button() == LeftButton) { setCursor(arrowCursor); startSelectAction(viewportPos); } } break; case QEvent::MouseButtonRelease: if (me->button() == LeftButton ) { mPopupTimer->stop(); } if (object != viewport()) { if (me->button() == LeftButton && mLeftMouseDown) { if (mActionItem) { QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { mScrollUpTimer.stop(); mScrollDownTimer.stop(); mActionItem->resetMove(); placeSubCells( mActionItem ); // emit startDragSignal( mActionItem->incidence() ); setCursor( arrowCursor ); mActionItem = 0; mActionType = NOP; mItemMoved = 0; mLeftMouseDown = false; return true; } endItemAction(); } } } else { // ---------- viewport() if (me->button() == LeftButton && mLeftMouseDown ) { //left click endSelectAction( true ); // emit new event signal } } if (me->button() == LeftButton) mLeftMouseDown = false; break; case QEvent::MouseMove: //qDebug("mm "); if ( !mLeftMouseDown ) return false; if ( blockMoving ) { int dX, dY; dX = startX - viewportPos.x(); if ( dX < 0 ) dX = -dX; dY = viewportPos.y() - startY; if ( dY < 0 ) dY = -dY; //qDebug("%d %d %d ", dX, dY , blockmoveDist ); if ( dX > blockmoveDist || dY > blockmoveDist ) { blockMoving = false; } } if ( ! blockMoving ) mPopupTimer->stop(); if (object != viewport()) { KOAgendaItem *moveItem = (KOAgendaItem *)object; if (!moveItem->incidence()->isReadOnly() ) { if (!mActionItem) setNoActionCursor(moveItem,viewportPos); else { if ( !blockMoving ) performItemAction(viewportPos); } } } else { // ---------- viewport() mPopupPos = viewport()->mapToGlobal( me->pos() ); if ( mActionType == SELECT ) { performSelectAction( viewportPos ); } } break; case QEvent::MouseButtonDblClick: mPopupTimer->stop(); if (object == viewport()) { selectItem(0); int x,y; viewportToContents(viewportPos.x(),viewportPos.y(),x,y); int gx,gy; contentsToGrid(x,y,gx,gy); emit newEventSignal(gx,gy); } else { KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; selectItem(doubleClickedItem); if ( KOPrefs::instance()->mEditOnDoubleClick ) emit editIncidenceSignal(doubleClickedItem->incidence()); else emit showIncidenceSignal(doubleClickedItem->incidence()); } break; default: break; } return true; #if 0 //qDebug("KOAgenda::eventFilter_mous "); QPoint viewportPos; if (object != viewport()) { viewportPos = ((QWidget *)object)->mapToParent(me->pos()); } else { viewportPos = me->pos(); } static int startX = 0; static int startY = 0; static int blockmoveDist = ( QApplication::desktop()->width() < 480 ? 15 : 20 ); static bool blockMoving = true; static bool leftMouseDown = false; bool rightButtonPressed = false; switch (me->type()) { case QEvent::MouseButtonPress: if (me->button() == LeftButton) { leftMouseDown = true; } else if (me->button() == RightButton) { leftMouseDown = false; } blockMoving = true; startX = viewportPos.x(); startY = viewportPos.y(); if (object != viewport()) { // item clicked ************** if (me->button() == RightButton) { leftMouseDown = false; mClickedItem = (KOAgendaItem *)object; if (mActionItem ) { endItemAction(); } if (mClickedItem) { selectItem(mClickedItem); emit showIncidencePopupSignal(mClickedItem->incidence()); } return true; } else if (me->button() == LeftButton) { mActionItem = (KOAgendaItem *)object; if (mActionItem) { if ( mSelectionHeight > 0 ) { int selectionCellX = mSelectionCellX * mGridSpacingX; int selectionYTop = mSelectionYTop; int gridSpacingX = mGridSpacingX; int selectionHeight = mSelectionHeight; clearSelection(); repaintContents( selectionCellX, selectionYTop, gridSpacingX, selectionHeight,false ); } selectItem(mActionItem); Incidence *incidence = mActionItem->incidence(); if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { mActionItem = 0; } else { startItemAction(viewportPos); } } } } else { // ---------- viewport() selectItem(0); mActionItem = 0; if (me->button() == LeftButton ) { setCursor(arrowCursor); startSelectAction(viewportPos); } else if (me->button() == RightButton ) { setCursor(arrowCursor); if ( leftMouseDown ) { // we have a simulated right click - clear left mouse action endSelectAction( false ); // do not emit new event signal leftMouseDown = false; // no more leftMouse computation } int x,y; viewportToContents(viewportPos.x(),viewportPos.y(),x,y); int gx,gy; contentsToGrid(x,y,gx,gy); mCurrentCellX = gx; mCurrentCellY = gy; mStartCellX = gx; mStartCellY = gy; mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); } } break; case QEvent::MouseButtonRelease: if (object != viewport()) { if (me->button() == LeftButton && leftMouseDown) { if (mActionItem) { QPoint clipperPos = clipper()->mapFromGlobal(viewport()->mapToGlobal(viewportPos)); //qDebug(" %d %d %d ",clipperPos.y(),visibleHeight() , 9 ); if ( mActionType == MOVE && (clipperPos.y() > visibleHeight()-2 ||clipperPos.y() < 0 ) ) { mScrollUpTimer.stop(); mScrollDownTimer.stop(); mActionItem->resetMove(); placeSubCells( mActionItem ); // emit startDragSignal( mActionItem->incidence() ); setCursor( arrowCursor ); mActionItem = 0; mActionType = NOP; mItemMoved = 0; leftMouseDown = false; return true; } endItemAction(); } } } else { // ---------- viewport() if (me->button() == LeftButton && leftMouseDown ) { //left click endSelectAction( true ); // emit new event signal } } if (me->button() == LeftButton) leftMouseDown = false; break; case QEvent::MouseMove: if ( !leftMouseDown ) return true; if ( blockMoving ) { int dX, dY; dX = startX - viewportPos.x(); if ( dX < 0 ) dX = -dX; dY = viewportPos.y() - startY; if ( dY < 0 ) dY = -dY; //qDebug("%d %d %d ", dX, dY , blockmoveDist ); if ( dX > blockmoveDist || dY > blockmoveDist ) { blockMoving = false; } } if (object != viewport()) { KOAgendaItem *moveItem = (KOAgendaItem *)object; if (!moveItem->incidence()->isReadOnly() ) { if (!mActionItem) setNoActionCursor(moveItem,viewportPos); else { if ( !blockMoving ) performItemAction(viewportPos); } } } else { // ---------- viewport() if ( mActionType == SELECT ) { performSelectAction( viewportPos ); } } break; case QEvent::MouseButtonDblClick: blockMoving = false; leftMouseDown = false; if (object == viewport()) { selectItem(0); int x,y; viewportToContents(viewportPos.x(),viewportPos.y(),x,y); int gx,gy; contentsToGrid(x,y,gx,gy); emit newEventSignal(gx,gy); } else { KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; selectItem(doubleClickedItem); if ( KOPrefs::instance()->mEditOnDoubleClick ) emit editIncidenceSignal(doubleClickedItem->incidence()); else emit showIncidenceSignal(doubleClickedItem->incidence()); } break; default: break; } return true; #endif diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index e8c7c76..a571ed4 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -1,508 +1,509 @@ /* This file is part of KOrganizer. Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <time.h> #ifndef _WIN32_ #include <unistd.h> #endif #include <qdir.h> #include <qtextstream.h> #include <qtextcodec.h> #include <qstring.h> #include <qregexp.h> #include <qfont.h> #include <qcolor.h> #include <qstringlist.h> #include <stdlib.h> #include <kglobal.h> #include <kglobalsettings.h> #include <kconfig.h> #include <klocale.h> #include <kdebug.h> #include <kemailsettings.h> #include <kstaticdeleter.h> #include <libkdepim/kpimglobalprefs.h> #include "koprefs.h" #include "mainwindow.h" KOPrefs *KOPrefs::mInstance = 0; static KStaticDeleter<KOPrefs> insd; KOPrefs::KOPrefs() : KPimPrefs("korganizerrc") { mCategoryColors.setAutoDelete(true); fillMailDefaults(); mDefaultCategoryColor = QColor(175,210,255);//196,196,196); QColor defaultHolidayColor = QColor(255,0,0); QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); QColor defaultTodoDueTodayColor = QColor(255,220,100); QColor defaultTodoOverdueColor = QColor(255,153,125); QColor defaultTodoRunColor = QColor(99,194,30); KPrefs::setCurrentGroup("General"); addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); addItemBool("ShowIconSearch",&mShowIconSearch,true); addItemBool("ShowIconList",&mShowIconList,true); addItemBool("ShowIconDay1",&mShowIconDay1,true); addItemBool("ShowIconDay5",&mShowIconDay5,true); addItemBool("ShowIconDay6",&mShowIconDay6,true); addItemBool("ShowIconDay7",&mShowIconDay7,true); addItemBool("ShowIconMonth",&mShowIconMonth,true); addItemBool("ShowIconTodoview",&mShowIconTodoview,true); addItemBool("ShowIconBackFast",&mShowIconBackFast,true); addItemBool("ShowIconBack",&mShowIconBack,true); addItemBool("ShowIconToday",&mShowIconToday,true); addItemBool("ShowIconForward",&mShowIconForward,true); addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); addItemBool("ShowIconNextDays",&mShowIconNextDays,true); addItemBool("ShowIconNext",&mShowIconNext,true); addItemBool("ShowIconJournal",&mShowIconJournal,true); addItemBool("ShowIconStretch",&mShowIconStretch,true); addItemBool("ShowIconFilter",&mShowIconFilter,false); addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); bool addIcons = false; #ifdef DESKTOP_VERSION addIcons = true; #endif addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); addItemInt("LastLoadedLanguage",&mOldLanguage,0); addItemBool("AskForQuit",&mAskForQuit,false); #ifndef DESKTOP_VERSION addItemBool("ShowFullMenu",&mShowFullMenu,false); #else addItemBool("ShowFullMenu",&mShowFullMenu,true); #endif addItemBool("ToolBarHor",&mToolBarHor, true ); addItemBool("ToolBarUp",&mToolBarUp, false ); addItemBool("ToolBarHorV",&mToolBarHorV, true ); addItemBool("ToolBarUpV",&mToolBarUpV, false ); addItemBool("ToolBarHorN",&mToolBarHorN, true ); addItemBool("ToolBarUpN",&mToolBarUpN, false ); addItemBool("ToolBarHorF",&mToolBarHorF, true ); addItemBool("ToolBarUpF",&mToolBarUpF, false ); addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); addItemInt("Whats Next Days",&mWhatsNextDays,3); addItemInt("Whats Next Prios",&mWhatsNextPrios,1); addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); addItemInt("AllDay Size",&mAllDaySize,28); QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); addItemStringList("LocationDefaults",&mLocationDefaults ); addItemStringList("EventSummary User",&mEventSummaryUser); addItemStringList("TodoSummary User",&mTodoSummaryUser); addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); addItemBool("Enable Project View",&mEnableProjectView,false); addItemBool("Auto Save",&mAutoSave,false); addItemInt("Auto Save Interval",&mAutoSaveInterval,3); addItemBool("Confirm Deletes",&mConfirm,true); addItemString("Archive File",&mArchiveFile); addItemString("Html Export File",&mHtmlExportFile, QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); addItemBool("Html With Save",&mHtmlWithSave,false); KPrefs::setCurrentGroup("Personal Settings"); addItemInt("Mail Client",&mMailClient,MailClientKMail); addItemBool("Use Control Center Email",&mEmailControlCenter,false); addItemBool("Bcc",&mBcc,false); KPrefs::setCurrentGroup("Time & Date"); addItemInt("Default Start Time",&mStartTime,10); addItemInt("Default Duration",&mDefaultDuration,2); addItemInt("Default Alarm Time",&mAlarmTime,3); KPrefs::setCurrentGroup("AlarmSettings"); addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); KPrefs::setCurrentGroup("Calendar"); addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); KPrefs::setCurrentGroup("Fonts"); // qDebug(" KPrefs::setCurrentGroup(Fonts); "); QFont fon = KGlobalSettings::generalFont(); addItemFont("TimeBar Font",&mTimeBarFont,fon ); addItemFont("MonthView Font",&mMonthViewFont,fon); addItemFont("AgendaView Font",&mAgendaViewFont,fon); addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); addItemFont("TodoView Font",&mTodoViewFont,fon); addItemFont("ListView Font",&mListViewFont,fon); addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); addItemFont("EditBox Font",&mEditBoxFont,fon); addItemFont("JournalView Font",&mJornalViewFont,fon); addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); addItemFont("EventView Font",&mEventViewFont,fon); KPrefs::setCurrentGroup("RemoteSyncing"); addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); addItemBool("ShowSyncEvents",&mShowSyncEvents,false); addItemInt("LastSyncTime",&mLastSyncTime,0); #ifdef _WIN32_ QString hdp= locateLocal("data","korganizer")+"\\\\"; #else QString hdp= locateLocal("data","korganizer")+"/"; #endif KPrefs::setCurrentGroup("LoadSaveFileNames"); addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); KPrefs::setCurrentGroup("Locale"); addItemBool("ShortDateInViewer",&mShortDateInViewer,false); KPrefs::setCurrentGroup("Colors"); addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); addItemBool("MonthViewWeek",&mMonthViewWeek,false); addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); addItemBool("UseAppColors",&mUseAppColors,false); KPrefs::setCurrentGroup("Views"); + addItemBool("Block Popup Menu",&mBlockPopupMenu,true); addItemBool("Show Date Navigator",&mShowDateNavigator,true); addItemInt("Hour Size",&mHourSize,8); addItemBool("Show Daily Recurrences",&mDailyRecur,true); addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); addItemBool("ShowShortMonthName",&mMonthShowShort,false); addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); #ifdef DESKTOP_VERION addItemBool("Enable ToolTips",&mEnableToolTips,true); #else addItemBool("Enable ToolTips",&mEnableToolTips,false); #endif addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); #ifdef DESKTOP_VERSION addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); #else addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); #endif addItemInt("Day Begins",&mDayBegins,7); addItemInt("Working Hours Start",&mWorkingHoursStart,8); addItemInt("Working Hours End",&mWorkingHoursEnd,17); addItemBool("Exclude Holidays",&mExcludeHolidays,true); addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); addItemBool("Full View Month",&mFullViewMonth,true); addItemBool("Full View Todo",&mFullViewTodo,true); addItemBool("Quick Todo",&mEnableQuickTodo,false); addItemInt("Next X Days",&mNextXDays,3); KPrefs::setCurrentGroup("Printer"); KPrefs::setCurrentGroup("Layout"); addItemBool("CompactDialogs",&mCompactDialogs,false); addItemBool("VerticalScreen",&mVerticalScreen,true); KPrefs::setCurrentGroup("KOrganizer Plugins"); addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); KPrefs::setCurrentGroup("Group Scheduling"); addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); addItemStringList("AdditionalMails",&mAdditionalMails,""); addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); KPrefs::setCurrentGroup( "Editors" ); addItemStringList( "EventTemplates", &mEventTemplates ); addItemStringList( "TodoTemplates", &mTodoTemplates ); addItemInt("DestinationPolicy",&mDestination,standardDestination); KPrefs::setCurrentGroup( "ViewOptions" ); addItemBool("EVshowDetails",&mEVshowDetails,true); addItemBool("EVshowCreated",&mEVshowCreated,true); addItemBool("EVshowChanged",&mEVshowChanged,true); addItemBool("WTshowDetails",&mWTshowDetails,false); addItemBool("WTshowCreated",&mWTshowCreated,false); addItemBool("WTshowChanged",&mWTshowChanged,false); } KOPrefs::~KOPrefs() { if (mInstance == this) mInstance = insd.setObject(0); //qDebug("KOPrefs::~KOPrefs() "); } KOPrefs *KOPrefs::instance() { if (!mInstance) { mInstance = insd.setObject(new KOPrefs()); mInstance->readConfig(); } return mInstance; } void KOPrefs::usrSetDefaults() { } void KOPrefs::fillMailDefaults() { if (mName.isEmpty()) mName = i18n("Anonymous"); if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); } void KOPrefs::setTimeZoneIdDefault() { ; } void KOPrefs::setAllDefaults() { setCategoryDefaults(); mEventSummaryUser = getDefaultList() ; mTodoSummaryUser = getDefaultList() ; mLocationDefaults = getLocationDefaultList(); } void KOPrefs::setCategoryDefaults() { mCustomCategories.clear(); mCustomCategories = getDefaultList(); QStringList::Iterator it; for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { setCategoryColor(*it,mDefaultCategoryColor); } } QStringList KOPrefs::getLocationDefaultList() { QStringList retval ; retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") retval.sort(); return retval; } QStringList KOPrefs::getDefaultList() { QStringList retval ; retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; retval.sort(); //qDebug("cat %s ", retval.join("-").latin1()); return retval; } void KOPrefs::usrReadConfig() { config()->setGroup("General"); //qDebug("KOPrefs::usrReadConfig() "); mCustomCategories = config()->readListEntry("Custom Categories"); mOldLoadedLanguage = mOldLanguage ; mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; if (mLocationDefaults.isEmpty()) { mLocationDefaults = getLocationDefaultList(); } if (mEventSummaryUser.isEmpty()) { mEventSummaryUser = getDefaultList() ; } if (mTodoSummaryUser.isEmpty()) { mTodoSummaryUser = getDefaultList() ; } if (mCustomCategories.isEmpty()) setCategoryDefaults(); config()->setGroup("Personal Settings"); mName = config()->readEntry("user_name",""); mEmail = config()->readEntry("user_email",""); fillMailDefaults(); config()->setGroup("Category Colors"); QStringList::Iterator it; for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); } KPimPrefs::usrReadConfig(); } void KOPrefs::usrWriteConfig() { config()->setGroup("General"); config()->writeEntry("Custom Categories",mCustomCategories); config()->setGroup("Personal Settings"); config()->writeEntry("user_name",mName); config()->writeEntry("user_email",mEmail); config()->setGroup("Category Colors"); QDictIterator<QColor> it(mCategoryColors); while (it.current()) { config()->writeEntry(it.currentKey(),*(it.current())); ++it; } KPimPrefs::usrWriteConfig(); } void KOPrefs::setCategoryColor(QString cat,const QColor & color) { mCategoryColors.replace(cat,new QColor(color)); } QColor *KOPrefs::categoryColor(QString cat) { QColor *color = 0; if (!cat.isEmpty()) color = mCategoryColors[cat]; if (color) return color; else return &mDefaultCategoryColor; } void KOPrefs::setFullName(const QString &name) { mName = name; } void KOPrefs::setEmail(const QString &email) { //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); mEmail = email; } QString KOPrefs::fullName() { if (mEmailControlCenter) { KEMailSettings settings; return settings.getSetting(KEMailSettings::RealName); } else { return mName; } } QString KOPrefs::email() { if (mEmailControlCenter) { KEMailSettings settings; return settings.getSetting(KEMailSettings::EmailAddress); } else { return mEmail; } } KConfig* KOPrefs::getConfig() { return config(); } diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index d511faa..2a0ee64 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -1,317 +1,319 @@ /* This file is part of KOrganizer. Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #ifndef KOPREFS_H #define KOPREFS_H #include <libkdepim/kpimprefs.h> #include <qdict.h> class KConfig; class QFont; class QColor; class QStringList; #define VIEW_WN_VIEW 1 #define VIEW_NX_VIEW 2 #define VIEW_J_VIEW 3 #define VIEW_A_VIEW 4 #define VIEW_ML_VIEW 5 #define VIEW_M_VIEW 6 #define VIEW_L_VIEW 7 #define VIEW_T_VIEW 8 class KOPrefs : public KPimPrefs { public: enum { FormatVCalendar, FormatICalendar }; enum { MailClientKMail, MailClientSendmail }; enum { IMIPDummy, IMIPKMail }; enum { IMIPOutbox, IMIPdirectsend }; enum { neverAuto, addressbookAuto, selectedAuto }; enum { standardDestination, askDestination }; virtual ~KOPrefs(); /** Get instance of KOPrefs. It is made sure that there is only one instance. */ static KOPrefs *instance(); /** Set preferences to default values */ void usrSetDefaults(); /** Read preferences from config file */ void usrReadConfig(); /** Write preferences to config file */ void usrWriteConfig(); void setCategoryDefaults(); void setAllDefaults(); protected: void setTimeZoneIdDefault(); /** Fill empty mail fields with default values. */ void fillMailDefaults(); private: /** Constructor disabled for public. Use instance() to create a KOPrefs object. */ KOPrefs(); static KOPrefs *mInstance; QStringList getDefaultList(); QStringList getLocationDefaultList(); public: // preferences data KConfig* getConfig(); void setFullName(const QString &); QString fullName(); void setEmail(const QString &); QString email(); QString mAdditional; bool mEmailControlCenter; bool mBcc; bool mAutoSave; int mAutoSaveInterval; bool mConfirm; bool mEnableGroupScheduling; bool mEnableProjectView; int mDefaultFormat; int mMailClient; int mStartTime; int mDefaultDuration; int mAlarmTime; int mWorkingHoursStart; int mWorkingHoursEnd; bool mExcludeHolidays; bool mExcludeSaturdays; bool mMarcusBainsShowSeconds; QFont mTimeBarFont; QFont mMonthViewFont; QFont mAgendaViewFont; QFont mMarcusBainsFont; QFont mTimeLabelsFont; QFont mTodoViewFont; QFont mListViewFont; QFont mDateNavigatorFont; QFont mEditBoxFont; QFont mJornalViewFont; QFont mWhatsNextFont; QFont mEventViewFont; QColor mHolidayColor; QColor mHighlightColor; QColor mEventColor; QColor mTodoDoneColor; QColor mAgendaBgColor; QColor mWorkingHoursColor; QColor mTodoDueTodayColor; QColor mTodoOverdueColor; QColor mTodoRunColor; QColor mMonthViewEvenColor; QColor mMonthViewOddColor; QColor mMonthViewHolidayColor; bool mMonthViewUsesDayColors; bool mMonthViewSatSunTog; bool mMonthViewWeek; QColor mAppColor1; QColor mAppColor2; bool mUseAppColors; int mDayBegins; int mHourSize; int mAllDaySize; bool mShowFullMenu; bool mDailyRecur; bool mWeeklyRecur; bool mMonthDailyRecur; bool mMonthWeeklyRecur; bool mMonthShowIcons; bool mMonthShowShort; bool mEnableToolTips; bool mEnableMonthScroll; bool mFullViewMonth; bool mMonthViewUsesCategoryColor; bool mFullViewTodo; bool mShowCompletedTodo; bool mMarcusBainsEnabled; int mNextXDays; int mWhatsNextDays; int mWhatsNextPrios; bool mEnableQuickTodo; bool mCompactDialogs; bool mVerticalScreen; bool mShowIconNewTodo; bool mShowIconNewEvent; bool mShowIconSearch; bool mShowIconList; bool mShowIconDay1; bool mShowIconDay5; bool mShowIconDay6; bool mShowIconDay7; bool mShowIconMonth; bool mShowIconTodoview; bool mShowIconBackFast; bool mShowIconBack; bool mShowIconToday; bool mShowIconForward; bool mShowIconForwardFast; bool mShowIconWhatsThis; bool mShowIconWeekNum; bool mShowIconNextDays; bool mShowIconNext; bool mShowIconJournal; bool mShowIconFilter; bool mShowIconOnetoolbar; bool mShowIconNavigator; bool mShowIconAllday; bool mShowIconFilterview; bool mShowIconToggleFull; bool mShowIconStretch; bool mToolBarHor; bool mToolBarUp; bool mToolBarHorV; bool mToolBarUpV; bool mToolBarHorN; bool mToolBarUpN; bool mToolBarHorF; bool mToolBarUpF; bool mToolBarMiniIcons; bool mAskForQuit; bool mUsePassWd; bool mShowSyncEvents; bool mShowTodoInAgenda; bool mShowTimeInAgenda; bool mHideNonStartedTodos; + bool mBlockPopupMenu; + int mLastSyncTime; void setCategoryColor(QString cat,const QColor & color); QColor *categoryColor(QString cat); QString mArchiveFile; QString mHtmlExportFile; bool mHtmlWithSave; QStringList mSelectedPlugins; QString mLastImportFile; QString mLastVcalFile; QString mLastSaveFile; QString mLastLoadFile; QString mDefaultAlarmFile; int mIMIPScheduler; int mIMIPSend; QStringList mAdditionalMails; int mIMIPAutoRefresh; int mIMIPAutoInsertReply; int mIMIPAutoInsertRequest; int mIMIPAutoFreeBusy; int mIMIPAutoFreeBusyReply; QStringList mTodoTemplates; QStringList mEventTemplates; int mDestination; bool mEditOnDoubleClick; bool mViewChangeHoldFullscreen; bool mViewChangeHoldNonFullscreen; bool mCenterOnCurrentTime; bool mSetTimeToDayStartAt; bool mHighlightCurrentDay; bool mUseHighlightLightColor; bool mListViewMonthTimespan; bool mWNViewShowsParents; bool mWNViewShowsPast; bool mWNViewShowLocation; bool mTodoViewShowsPercentage; bool mTodoViewUsesCatColors; bool mMonthViewUsesBigFont; bool mTodoViewUsesSmallFont; bool mTodoViewUsesForegroundColor; bool mMonthViewUsesForegroundColor; bool mHightlightDateTimeEdit; bool mShortDateInViewer; bool mShowDateNavigator; QStringList mLocationDefaults; QStringList mEventSummaryUser; QStringList mTodoSummaryUser; bool mUseInternalAlarmNotification; int mAlarmPlayBeeps; int mAlarmSuspendTime; int mAlarmSuspendCount; int mAlarmBeepInterval; int mOldLanguage; int mOldLoadedLanguage; QString mActiveSyncPort; QString mActiveSyncIP; // settings for eventviewer bool mEVshowDetails; bool mEVshowCreated; bool mEVshowChanged; bool mWTshowDetails; bool mWTshowCreated; bool mWTshowChanged; int mCurrentDisplayedView; private: QDict<QColor> mCategoryColors; QColor mDefaultCategoryColor; QFont mDefaultTimeBarFont; QFont mDefaultViewFont; QFont mDefaultMonthViewFont; QString mName; QString mEmail; }; #endif diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index a8943de..ad3c61c 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -1,809 +1,817 @@ /* This file is part of KOrganizer. Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <qlayout.h> #include <qlabel.h> #include <qgroupbox.h> #include <qbuttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> #include <qtextstream.h> #include <qcombobox.h> #include <qvbox.h> #include <qhbox.h> #include <qregexp.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qstrlist.h> #include <qapplication.h> #include <kcolorbutton.h> #include <kdebug.h> #include <klocale.h> #include <kglobal.h> #include <kfontdialog.h> #include <kfiledialog.h> #include <kmessagebox.h> #include <kcolordialog.h> #include <kiconloader.h> #include <kemailsettings.h> #include <kstandarddirs.h> #include <kglobalsettings.h> #include <kurlrequester.h> #include <klineedit.h> #if defined(USE_SOLARIS) #include <sys/param.h> #define ZONEINFODIR "/usr/share/lib/zoneinfo" #define INITFILE "/etc/default/init" #endif #include "koprefs.h" #include "koprefsdialog.h" #include "kpimglobalprefs.h" KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : KPrefsDialog(KOPrefs::instance(),parent,name,true) { setFont( KGlobalSettings::generalMaxFont() ); setCaption( i18n("Preferences - some settings need a restart (nr)")); mCategoryDict.setAutoDelete(true); KGlobal::locale()->insertCatalogue("timezones"); mSpacingHint = spacingHintSmall(); mMarginHint = marginHintSmall(); #ifndef DESKTOP_VERSION if ( QApplication::desktop()->height() == 480 ) hideButtons(); #endif setupGlobalTab(); setupMainTab(); // setupLocaleTab(); //setupTimeZoneTab(); setupTimeTab(); //setupLocaleDateTab(); setupFontsTab(); setupColorsTab(); setupViewsTab(); //setupSyncTab(); //setupSyncAlgTab(); //setupPrinterTab(); //setupGroupSchedulingTab(); //setupGroupAutomationTab(); } KOPrefsDialog::~KOPrefsDialog() { } void KOPrefsDialog::setupGlobalTab() { QFrame *topFrame = addPage(i18n("Global"),0,0); kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); QVBoxLayout *topLayout = new QVBoxLayout(topFrame); topLayout->addWidget( kdelibcfg ); } void KOPrefsDialog::setupLocaleDateTab() { #if 0 QFrame *topFrame = addPage(i18n("Date Format"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,3,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; KPrefsDialogWidRadios *syncPrefsGroup = addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); QString format; if ( QApplication::desktop()->width() < 480 ) format = "(%d.%m.%Y)"; else format = "(%d.%m.%Y|%A %d %B %Y)"; syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); if ( QApplication::desktop()->width() < 480 ) format = "(%m.%d.%Y)"; else format = "(%m.%d.%Y|%A %B %d %Y)"; syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); if ( QApplication::desktop()->width() < 480 ) format = "(%Y-%m-%d)"; else format = "(%Y-%m-%d|%A %Y %B %d)"; syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); syncPrefsGroup->addRadio(i18n("User defined")); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; ++iii; QLabel * lab; mUserDateFormatLong = new QLineEdit(topFrame); lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mUserDateFormatLong,iii,1); ++iii; mUserDateFormatShort = new QLineEdit(topFrame); lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mUserDateFormatShort,iii,1); ++iii; lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; #endif } void KOPrefsDialog::setupLocaleTab() { #if 0 QFrame *topFrame = addPage(i18n("Locale"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,4,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; KPrefsDialogWidRadios *syncPrefsGroup = addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); syncPrefsGroup->addRadio(i18n("English")); syncPrefsGroup->addRadio(i18n("German")); syncPrefsGroup->addRadio(i18n("French")); syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); if ( QApplication::desktop()->width() < 300 ) ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; syncPrefsGroup = addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); if ( QApplication::desktop()->width() > 300 ) syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); syncPrefsGroup->addRadio(i18n("24:00")); syncPrefsGroup->addRadio(i18n("12:00am")); syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; KPrefsDialogWidBool *sb; if ( QApplication::desktop()->width() < 300 ) { sb = addWidBool(i18n("Week starts on Sunday"), &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); ++iii; sb = addWidBool(i18n("Use short date in (WN/E) view"), &(KOPrefs::instance()->mShortDateInViewer),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); } else { QWidget * hb = new QWidget( topFrame ); QHBoxLayout *hbLayout = new QHBoxLayout(hb); sb = addWidBool(i18n("Week starts on Sunday"), &(KOPrefs::instance()->mWeekStartsOnSunday),hb); hbLayout->addWidget(sb->checkBox() ); sb = addWidBool(i18n("Use short date in (WN/E) view"), &(KOPrefs::instance()->mShortDateInViewer),hb); hbLayout->addWidget(sb->checkBox() ); topLayout->addMultiCellWidget(hb, iii,iii,0,1); } // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION #if 0 ++iii; sb = addWidBool(i18n("Quick load/save (w/o Unicode)"), &(KOPrefs::instance()->mUseQuicksave),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); #endif #endif } void KOPrefsDialog::showSyncPage() { showPage ( 0 ) ; kdelibcfg->showTimeZoneTab() ; } void KOPrefsDialog::setupSyncAlgTab() { #if 0 QLabel * lab; QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); mSetupSyncAlgTab = topFrame; QGridLayout *topLayout = new QGridLayout(topFrame,6,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); int iii = 0; KPrefsDialogWidBool *sb = addWidBool(i18n("Ask for preferences before syncing"), &(KOPrefs::instance()->mAskForPreferences),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); ++iii; KPrefsDialogWidRadios *syncPrefsGroup = addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), topFrame); syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); syncPrefsGroup->addRadio(i18n("Force take local entry always")); syncPrefsGroup->addRadio(i18n("Force take remote entry always")); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; sb = addWidBool(i18n("Show summary after syncing"), &(KOPrefs::instance()->mShowSyncSummary),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); ++iii; #endif } void KOPrefsDialog::setupSyncTab() { #if 0 QLabel * lab; QFrame *topFrame = addPage(i18n("Sync Network"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,6,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); int iii = 0; topLayout->addMultiCellWidget(lab , iii,iii,0,1); ++iii; mRemoteIPEdit = new QLineEdit(topFrame); lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mRemoteIPEdit,iii,1); ++iii; mRemoteUser = new QLineEdit(topFrame); lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mRemoteUser, iii,1); ++iii; mRemoteFile = new QLineEdit(topFrame); lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mRemoteFile,iii,1); ++iii; mLocalTempFile = new QLineEdit(topFrame); lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mLocalTempFile,iii,1); ++iii; KPrefsDialogWidBool *wb = addWidBool(i18n("Write back synced file"), &(KOPrefs::instance()->mWriteBackFile),topFrame); topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); ++iii; wb = addWidBool(i18n("Write back existing entries only"), &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); ++iii; #endif } void KOPrefsDialog::setupMainTab() { QFrame *topFrame = addPage(i18n("General"),0,0); // DesktopIcon("identity",KIcon::SizeMedium)); QGridLayout *topLayout = new QGridLayout(topFrame,5,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); // KPrefsDialogWidBool *emailControlCenter = // addWidBool(i18n("&Use email settings from Control Center"), // &(KOPrefs::instance()->mEmailControlCenter),topFrame); // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), // SLOT(toggleEmailSettings(bool))); mNameEdit = new QLineEdit(topFrame); mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); topLayout->addWidget(mNameLabel,0,0); topLayout->addWidget(mNameEdit,0,1); mEmailEdit = new QLineEdit(topFrame); mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); topLayout->addWidget(mEmailLabel,1,0); topLayout->addWidget(mEmailEdit,1,1); KPrefsDialogWidBool *wb; KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), &(KOPrefs::instance()->mShowFullMenu),topFrame); topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); KPrefsDialogWidBool *verticalScreen = addWidBool(i18n("Show vertical screen (Needs restart)"), &(KOPrefs::instance()->mVerticalScreen),topFrame); //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); - + + int iii = 5; + widbool = addWidBool(i18n("Block popup until mouse button release"), + &(KOPrefs::instance()->mBlockPopupMenu),topFrame); + topLayout->addMultiCellWidget( widbool->checkBox(), iii,iii,0,1); + ++iii; QHBox *dummy = new QHBox(topFrame); new QLabel(i18n("Days in Next-X-Days:"),dummy); mNextXDaysSpin = new QSpinBox(2,14,1,dummy); - topLayout->addMultiCellWidget(dummy,5,5,0,1); + topLayout->addMultiCellWidget(dummy,iii,iii,0,1); + ++iii; // KPrefsDialogWidBool *bcc = // addWidBool(i18n("Send copy to owner when mailing events"), // &(KOPrefs::instance()->mBcc),topFrame); // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); // addWidBool(i18n("Enable automatic saving of calendar"), // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); QHBox *intervalBox = new QHBox(topFrame); // intervalBox->setSpacing(mSpacingHint); - topLayout->addMultiCellWidget(intervalBox,6,6,0,1); + topLayout->addMultiCellWidget(intervalBox,iii,iii,0,1); + ++iii; QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); /* QHBox * agendasize = new QHBox ( topFrame ); new QLabel (i18n("AllDayAgenda Height:"), agendasize ); mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); topLayout->addMultiCellWidget(agendasize,7,7,0,1); */ KPrefsDialogWidBool *ask = addWidBool(i18n("Ask for quit when closing KO/Pi"), &(KOPrefs::instance()->mAskForQuit),topFrame); - topLayout->addMultiCellWidget(ask->checkBox(),7,7,0,1); + topLayout->addMultiCellWidget(ask->checkBox(),iii,iii,0,1); + ++iii; /* KPrefsDialogWidBool *confirmCheck = addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), topFrame); topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); mEnableGroupScheduling = addWidBool(i18n("Enable group scheduling"), &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), SLOT(warningGroupScheduling())); mEnableProjectView = addWidBool(i18n("Enable project view"), &(KOPrefs::instance()->mEnableProjectView),topFrame); topLayout->addWidget(mEnableProjectView->checkBox(),9,0); connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), SLOT(warningProjectView())); // Can't be disabled anymore mEnableGroupScheduling->checkBox()->hide(); // Disable setting, because this feature now becomes stable mEnableProjectView->checkBox()->hide(); KPrefsDialogWidRadios *defaultFormatGroup = addWidRadios(i18n("Default Calendar Format"), &(KOPrefs::instance()->mDefaultFormat),topFrame); defaultFormatGroup->addRadio(i18n("vCalendar")); defaultFormatGroup->addRadio(i18n("iCalendar")); topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); // Default format unconditionally is iCalendar defaultFormatGroup->groupBox()->hide(); KPrefsDialogWidRadios *mailClientGroup = addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), topFrame); mailClientGroup->addRadio(i18n("KMail")); mailClientGroup->addRadio(i18n("Sendmail")); topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); KPrefsDialogWidBool *htmlsave = addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), topFrame); topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); KPrefsDialogWidRadios *destinationGroup = addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), topFrame); destinationGroup->addRadio(i18n("be added to the standard resource")); destinationGroup->addRadio(i18n("be asked which resource to use")); topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); topLayout->setRowStretch(14,1); */ } void KOPrefsDialog::setupTimeTab() { QFrame *topFrame = addPage(i18n("Time"),0,0); // DesktopIcon("clock",KIcon::SizeMedium)); QGridLayout *topLayout = new QGridLayout(topFrame,4,2); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); QHBox *dummy = new QHBox(topFrame); KPrefsDialogWidTime *dayBegins = addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), dummy); //topLayout->addWidget(dayBegins->label(),2,0); //topLayout->addWidget(dayBegins->spinBox(),2,1); topLayout->addMultiCellWidget(dummy,0,0,0,1); topLayout->addWidget(new QLabel(i18n("Default appointment time:"), topFrame),1,0); mStartTimeSpin = new QSpinBox(0,23,1,topFrame); mStartTimeSpin->setSuffix(":00"); topLayout->addWidget(mStartTimeSpin,1,1); topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), topFrame),2,0); mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); mDefaultDurationSpin->setSuffix(":00"); topLayout->addWidget(mDefaultDurationSpin,2,1); QStringList alarmList; alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 3,0); mAlarmTimeCombo = new QComboBox(topFrame); mAlarmTimeCombo->insertStringList(alarmList); topLayout->addWidget(mAlarmTimeCombo,3,1); QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, i18n("Working Hours"), topFrame); topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); workingHoursGroup->layout()->setSpacing( 0 ); workingHoursGroup->layout()->setMargin( 4 ); QHBox *workStartBox = new QHBox(workingHoursGroup); // workStartBox->setMargin( 0 ); addWidTime(i18n("Daily starting hour:"), &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); QHBox *workEndBox = new QHBox(workingHoursGroup); //workEndBox->setMargin( 0 ); addWidTime(i18n("Daily ending hour:"), &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); QVBox *excludeBox = new QVBox(workingHoursGroup); //excludeBox->setMargin( 0 ); addWidBool(i18n("Exclude holidays"), &(KOPrefs::instance()->mExcludeHolidays),excludeBox); addWidBool(i18n("Exclude Saturdays"), &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), // &(KOPrefs::instance()->mMarcusBainsShowSeconds), // topFrame); // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); // topLayout->setRowStretch(6,1); } void KOPrefsDialog::setupViewsTab() { QFrame *topFrame = addPage(i18n("Views"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); QGridLayout *topLayout = new QGridLayout(topFrame,6,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); // QBoxLayout *dayBeginsLayout = new QHBoxLayout; // topLayout->addLayout(dayBeginsLayout,0,0); // KPrefsDialogWidTime *dayBegins = // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), // topFrame); // dayBeginsLayout->addWidget(dayBegins->label()); // dayBeginsLayout->addStretch(1); // dayBeginsLayout->addWidget(dayBegins->spinBox()); // QBoxLayout *nextDaysLayout = new QHBoxLayout; // topLayout->addLayout(nextDaysLayout,1,0); // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); // nextDaysLayout->addStretch(1); // nextDaysLayout->addWidget(mNextXDaysSpin); int ii = 0; KPrefsDialogWidBool *dummy = addWidBool(i18n("Edit item on doubleclick (if not, show)"), &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); // topLayout->addWidget(hourSizeGroup,ii++,0); // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); //topLayout->setRowStretch(11,1); #if 0 topFrame = addPage(i18n("ViewChange"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); topLayout = new QGridLayout(topFrame,6,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; #endif dummy = addWidBool(i18n("Hold fullscreen on view change"), &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Hold non-fullscreen on view change"), &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); KPrefsDialogWidBool *fullViewMonth = addWidBool(i18n("Next days view uses full window"), &(KOPrefs::instance()->mFullViewMonth),topFrame); topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); KPrefsDialogWidBool *fullViewTodo = addWidBool(i18n("Event list view uses full window"), &(KOPrefs::instance()->mFullViewTodo),topFrame); topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); dummy = addWidBool(i18n("Listview uses monthly timespan"), &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Highlight selection in Time Edit"), &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); topLayout->addWidget( dummy->checkBox(), ii++,0); KPrefsDialogWidBool *dailyRecur = addWidBool(i18n("Show events that recur daily in date nav."), &(KOPrefs::instance()->mDailyRecur),topFrame); topLayout->addWidget(dailyRecur->checkBox(),ii++,0); KPrefsDialogWidBool *weeklyRecur = addWidBool(i18n("Show ev. that recur weekly in date nav."), &(KOPrefs::instance()->mWeeklyRecur),topFrame); topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); #ifdef DESKTOP_VERSION KPrefsDialogWidBool *enableToolTips = addWidBool(i18n("Enable tooltips displaying summary of ev."), &(KOPrefs::instance()->mEnableToolTips),topFrame); topLayout->addWidget(enableToolTips->checkBox(),ii++,0); #endif // ********************************************************* topFrame = addPage(i18n("Agenda View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); topLayout = new QGridLayout(topFrame,5,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; dummy = addWidBool(i18n("Show time in agenda items"), &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Highlight current day in agenda"), &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Use light color for highlight current day"), &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); KPrefsDialogWidBool *marcusBainsEnabled = addWidBool(i18n("Show current time"), &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); dummy = addWidBool(i18n("Set agenda to DayBeginsAt on change"), &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Set agenda to current time on change"), &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); topFrame = addPage(i18n("Month View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); topLayout = new QGridLayout(topFrame,5,1); topLayout->setSpacing(mSpacingHint); topLayout->setMargin(mMarginHint); ii = 0; QLabel *lab; QHBox *habo = new QHBox( topFrame ); if ( QApplication::desktop()->width() <= 480 ) { lab = new QLabel ( i18n("Show events that recur "), topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); ii++; } else { new QLabel ( i18n("Show events that recur "), habo ); } dailyRecur = addWidBool(i18n("daily"), &(KOPrefs::instance()->mMonthDailyRecur),habo); // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); weeklyRecur = addWidBool(i18n("weekly"), &(KOPrefs::instance()->mMonthWeeklyRecur),habo); topLayout->addMultiCellWidget(habo,ii, ii,0,1); ii++; habo = new QHBox( topFrame ); if ( QApplication::desktop()->width() <= 480 ) { lab = new QLabel (i18n("Show in every cell ") , topFrame ); topLayout->addMultiCellWidget(lab,ii, ii,0,1); ii++; } else { new QLabel ( i18n("Show in every cell "), habo ); } weeklyRecur = addWidBool(i18n("short month"), &(KOPrefs::instance()->mMonthShowShort),habo); weeklyRecur = addWidBool(i18n("icons"), &(KOPrefs::instance()->mMonthShowIcons),habo); topLayout->addMultiCellWidget(habo,ii, ii,0,1); ii++; #ifdef DESKTOP_VERSION KPrefsDialogWidBool *enableMonthScroll = addWidBool(i18n("Enable scrollbars in month view cells"), &(KOPrefs::instance()->mEnableMonthScroll),topFrame); topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); #endif dummy = addWidBool(i18n("Week view mode uses bigger font"), &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = addWidBool(i18n("Show Sat/Sun together"), &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); KPrefsDialogWidBool *coloredCategoriesInMonthView = addWidBool(i18n("Month view uses category colors"), &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); dummy = addWidBool(i18n("Categorie colors are applied to text"), &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); coloredCategoriesInMonthView = addWidBool(i18n("Month view uses day colors"), &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); KPrefsDialogWidColor *holidayColor = addWidColor(i18n("Day color odd months"), &(KOPrefs::instance()->mMonthViewOddColor),topFrame); topLayout->addWidget(holidayColor->label(),ii,0); topLayout->addWidget(holidayColor->button(),ii++,1); holidayColor = addWidColor(i18n("Day color even months"), &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); topLayout->addWidget(holidayColor->label(),ii,0); topLayout->addWidget(holidayColor->button(),ii++,1); holidayColor = addWidColor(i18n("Color for Sundays + category \"Holiday\""), &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); topLayout->addWidget(holidayColor->label(),ii,0); topLayout->addWidget(holidayColor->button(),ii++,1); // *********************** What'sNext View diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 9b5d4ce..7817a75 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -714,756 +714,757 @@ void KOTodoView::updateView() // qDebug("yytodo %s ", todo->summary().latin1()); // } //qDebug("for "); for(todo = todoList.first(); todo; todo = todoList.next()) { if (!mTodoMap.contains(todo) && checkTodo( todo ) ) { insertTodoItem(todo); } } //qDebug("for end "); // Restore opened/closed state mTodoListView->blockSignals( true ); if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); mTodoListView->blockSignals( false ); resetCurrentItem(); processSelectionChange(); } void KOTodoView::storeCurrentItem() { mCurItem = 0; mCurItemRootParent = 0; mCurItemParent = 0; mCurItemAbove = 0; mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); if (mActiveItem) { mCurItem = mActiveItem->todo(); KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove (); if ( activeItemAbove ) mCurItemAbove = activeItemAbove->todo(); mCurItemRootParent = mCurItem; mCurItemParent = mCurItemRootParent->relatedTo(); while ( mCurItemRootParent->relatedTo() != 0 ) mCurItemRootParent = mCurItemRootParent->relatedTo(); } mActiveItem = 0; } void KOTodoView::resetCurrentItem() { mTodoListView->setFocus(); KOTodoViewItem* foundItem = 0; KOTodoViewItem* foundItemRoot = 0; KOTodoViewItem* foundItemParent = 0; KOTodoViewItem* foundItemAbove = 0; if ( mTodoListView->firstChild () ) { if ( mCurItem ) { KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild (); while ( item ) { if ( item->todo() == mCurItem ) { foundItem = item; break; } else if ( item->todo() == mCurItemAbove ) { foundItemAbove = item; } if ( item->todo() == mCurItemRootParent ) { foundItemRoot = item; } if ( item->todo() == mCurItemParent ) { foundItemParent = item; } item = (KOTodoViewItem*)item->itemBelow(); } if ( ! foundItem ) { if ( foundItemParent ) { foundItem = foundItemParent; } else { if ( foundItemRoot ) foundItem = foundItemRoot; else foundItem = foundItemAbove; } } } if ( foundItem ) { mTodoListView->setCurrentItem( foundItem ); mTodoListView->ensureItemVisible( foundItem ); } else { mTodoListView->setCurrentItem( mTodoListView->firstChild () ); } } mTodoListView->setFocus(); } //Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove; bool KOTodoView::checkTodo( Todo * todo ) { if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) return false; if ( !todo->isCompleted() ) { if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() ) return true; } if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) { if ( todo->hasStartDate() ) if ( mNavigator->selectedDates().last() < todo->dtStart().date() ) return false; if ( todo->hasDueDate() ) if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) return false; } return true; } void KOTodoView::restoreItemState( QListViewItem *item ) { pendingSubtodo = 0; while( item ) { KOTodoViewItem *todoItem = (KOTodoViewItem *)item; todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); item = item->nextSibling(); } } QMap<Todo *,KOTodoViewItem *>::ConstIterator KOTodoView::insertTodoItem(Todo *todo) { // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; // TODO: Check, if dynmaic cast is necessary pendingSubtodo = 0; Incidence *incidence = todo->relatedTo(); if (incidence && incidence->type() == "Todo") { Todo *relatedTodo = static_cast<Todo *>(incidence); // kdDebug() << " has Related" << endl; QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; itemIterator = mTodoMap.find(relatedTodo); if (itemIterator == mTodoMap.end()) { // kdDebug() << " related not yet in list" << endl; itemIterator = insertTodoItem (relatedTodo); } // isn't this pretty stupid? We give one Todo to the KOTodoViewItem // and one into the map. Sure finding is more easy but why? -zecke KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); return mTodoMap.insert(todo,todoItem); } else { // kdDebug() << " no Related" << endl; // see above -zecke KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); return mTodoMap.insert(todo,todoItem); } } void KOTodoView::updateConfig() { updateView(); mTodoListView->repaintContents(); } QPtrList<Incidence> KOTodoView::selectedIncidences() { QPtrList<Incidence> selected; KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); // if (!item) item = mActiveItem; if (item) selected.append(item->todo()); return selected; } QPtrList<Todo> KOTodoView::selectedTodos() { QPtrList<Todo> selected; KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); // if (!item) item = mActiveItem; if (item) selected.append(item->todo()); return selected; } void KOTodoView::changeEventDisplay(Event *, int) { updateView(); } void KOTodoView::showDates(const QDate &, const QDate &) { } void KOTodoView::showEvents(QPtrList<Event>) { kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; } void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td) { #ifndef KORG_NOPRINTER calPrinter->preview(CalPrinter::Todolist, fd, td); #endif } void KOTodoView::editItem(QListViewItem *item ) { // qDebug("editItem(QListViewItem *item ) "); emit editTodoSignal(((KOTodoViewItem *)item)->todo()); } void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) { emit showTodoSignal(((KOTodoViewItem *)item)->todo()); } void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) { pendingSubtodo = 0; mActiveItem = (KOTodoViewItem *)item; if (item) { switch (column){ case 1: mPriorityPopupMenu->popup(QCursor::pos ()); break; case 2: mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; case 3: moveTodo(); break; case 8: getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; default: mItemPopupMenu->popup(QCursor::pos()); } } else mPopupMenu->popup(QCursor::pos()); } void KOTodoView::newTodo() { emit newTodoSignal(); } void KOTodoView::newSubTodo() { if (mActiveItem) { emit newSubTodoSignal(mActiveItem->todo()); } } void KOTodoView::unparentTodo() { if (mActiveItem) { emit unparentTodoSignal(mActiveItem->todo()); } } void KOTodoView::reparentTodo() { if (mActiveItem) { qDebug("KOTodoView::reparentTodo() "); topLevelWidget()->setCaption(i18n("Click on new parent item")); pendingSubtodo = mActiveItem; } } void KOTodoView::editTodo() { if (mActiveItem) { emit editTodoSignal(mActiveItem->todo()); } } void KOTodoView::cloneTodo() { if (mActiveItem) { emit cloneTodoSignal((Incidence*)mActiveItem->todo()); } } void KOTodoView::cancelTodo() { if (mActiveItem) { emit cancelTodoSignal((Incidence*)mActiveItem->todo()); } } void KOTodoView::moveTodo() { if (mActiveItem) { emit moveTodoSignal((Incidence*)mActiveItem->todo()); } } void KOTodoView::beamTodo() { if (mActiveItem) { emit beamTodoSignal((Incidence*)mActiveItem->todo()); } } void KOTodoView::showTodo() { if (mActiveItem) { emit showTodoSignal(mActiveItem->todo()); } } void KOTodoView::deleteTodo() { if (mActiveItem) { emit deleteTodoSignal(mActiveItem->todo()); } } void KOTodoView::setNewPriority(int index) { if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { mActiveItem->todo()->setPriority(mPriority[index]); mActiveItem->construct(); todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); } } void KOTodoView::setNewPercentage(int index) { if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { mActiveItem->setOn( true ); return; } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); if ( par && par->isOn() ) par->setOn( false ); } if (mPercentage[index] == 100) { mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); } else { mActiveItem->todo()->setCompleted(false); } mActiveItem->todo()->setPercentComplete(mPercentage[index]); mActiveItem->construct(); todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); } } QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem) { QPopupMenu* tempMenu = new QPopupMenu (this); QStringList checkedCategories = todoItem->todo()->categories (); tempMenu->setCheckable (true); for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); it != KOPrefs::instance()->mCustomCategories.end (); ++it) { int index = tempMenu->insertItem (*it); mCategory[index] = *it; if (checkedCategories.find (*it) != checkedCategories.end ()) tempMenu->setItemChecked (index, true); } connect (tempMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); return tempMenu; } void KOTodoView::changedCategories(int index) { if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { QStringList categories = mActiveItem->todo()->categories (); QString colcat = categories.first(); if (categories.find (mCategory[index]) != categories.end ()) categories.remove (mCategory[index]); else categories.insert (categories.end(), mCategory[index]); categories.sort (); if ( !colcat.isEmpty() ) { if ( categories.find ( colcat ) != categories.end () ) { categories.remove( colcat ); categories.prepend( colcat ); } } mActiveItem->todo()->setCategories (categories); mActiveItem->construct(); mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); } } void KOTodoView::itemDoubleClicked(QListViewItem *item) { if ( pendingSubtodo != 0 ) { topLevelWidget()->setCaption(i18n("Reparenting aborted!")); } pendingSubtodo = 0; - int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); - //qDebug("ROW %d ", row); + //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); + int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); + qDebug("ROW %d ", row); if (!item) { newTodo(); return; } else { - if ( row == 2 ) { + if ( row == 2 || row == 1 ) { mActiveItem = (KOTodoViewItem *) item; newSubTodo(); return; } - if ( row == 1 ) { + if ( row == 5 || row == 6 ) { mActiveItem = (KOTodoViewItem *) item; toggleRunningItem(); return; } } if ( KOPrefs::instance()->mEditOnDoubleClick ) editItem( item ); else showItem( item , QPoint(), 0 ); } void KOTodoView::toggleRunningItem() { // qDebug("KOTodoView::toggleRunning() "); if ( ! mActiveItem ) return; Todo * t = mActiveItem->todo(); if ( t->isRunning() ) { int result = KMessageBox::warningContinueCancel(this, i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is started"),i18n("Stop todo"),i18n("Cancel"), true); if (result != KMessageBox::Continue) return; t->setRunning( false ); mActiveItem->construct(); } else { int result = KMessageBox::warningContinueCancel(this, i18n("The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is stopped"),i18n("Start todo"),i18n("Cancel"), true); if (result != KMessageBox::Continue) return; t->setRunning( true ); mActiveItem->construct(); } } void KOTodoView::itemClicked(QListViewItem *item) { //qDebug("KOTodoView::itemClicked %d", item); if (!item) { if ( pendingSubtodo != 0 ) { topLevelWidget()->setCaption(i18n("Reparenting aborted!")); } pendingSubtodo = 0; return; } KOTodoViewItem *todoItem = (KOTodoViewItem *)item; if ( pendingSubtodo != 0 ) { bool allowReparent = true; QListViewItem *par = item; while ( par ) { if ( par == pendingSubtodo ) { allowReparent = false; break; } par = par->parent(); } if ( !allowReparent ) { topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); qDebug("Recursive reparenting not possible "); pendingSubtodo = 0; } else { Todo* newParent = todoItem->todo(); Todo* newSub = pendingSubtodo->todo(); pendingSubtodo = 0; emit reparentTodoSignal( newParent,newSub ); return; } } #if 0 // handled by the item itself bool completed = todoItem->todo()->isCompleted(); // Completed or not? qDebug("com %d ",completed ); qDebug("itemclicked "); if (todoItem->isOn()) { qDebug("on "); if (!completed) { qDebug("set true "); todoItem->todo()->setCompleted(QDateTime::currentDateTime()); } } else { qDebug("not on "); if (completed) { qDebug("set false "); todoItem->todo()->setCompleted(false); } } #endif } void KOTodoView::setDocumentId( const QString &id ) { kdDebug() << "KOTodoView::setDocumentId()" << endl; mDocPrefs->setDoc( id ); } void KOTodoView::itemStateChanged( QListViewItem *item ) { if (!item) return; KOTodoViewItem *todoItem = (KOTodoViewItem *)item; // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); } void KOTodoView::saveLayout(KConfig *config, const QString &group) const { mTodoListView->saveLayout(config,group); } void KOTodoView::restoreLayout(KConfig *config, const QString &group) { mTodoListView->restoreLayout(config,group); } void KOTodoView::processSelectionChange() { // kdDebug() << "KOTodoView::processSelectionChange()" << endl; KOTodoViewItem *item = static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); if ( !item ) { emit incidenceSelected( 0 ); } else { emit incidenceSelected( item->todo() ); } } void KOTodoView::modified(bool b) { emit isModified(b); } void KOTodoView::setTodoModified( Todo* todo ) { todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); } void KOTodoView::clearSelection() { mTodoListView->selectAll( false ); } void KOTodoView::setAllOpen() { if ( isFlatDisplay ) { isFlatDisplay = false; mPopupMenu->setItemChecked( 8,false ); updateView(); } else { storeCurrentItem(); } setOpen(mTodoListView->firstChild(), true); resetCurrentItem(); } void KOTodoView::setAllClose() { if ( isFlatDisplay ) { isFlatDisplay = false; mPopupMenu->setItemChecked( 8,false ); updateView(); } else { storeCurrentItem(); } setOpen(mTodoListView->firstChild(), false); resetCurrentItem(); } void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) { while ( item ) { setOpen( item->firstChild(), setOpenI ); item->setOpen( setOpenI ); item = item->nextSibling(); } } void KOTodoView::displayAllFlat() { pendingSubtodo = 0; if ( mBlockUpdate ) { return; } mPopupMenu->setItemChecked( 8,true ); isFlatDisplay = true; QPtrList<Todo> todoList = calendar()->todos(); mTodoMap.clear(); mTodoListView->clear(); Todo *todo; for(todo = todoList.first(); todo; todo = todoList.next()) { KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); mTodoMap.insert(todo,todoItem); } mTodoListView->setFocus(); processSelectionChange(); } void KOTodoView::setAllFlat() { if ( isFlatDisplay ) { isFlatDisplay = false; mPopupMenu->setItemChecked( 8,false ); updateView(); return; } storeCurrentItem(); displayAllFlat(); resetCurrentItem(); } void KOTodoView::purgeCompleted() { emit purgeCompletedSignal(); } void KOTodoView::toggleQuickTodo() { if ( mQuickAdd->isVisible() ) { mQuickAdd->hide(); KOPrefs::instance()->mEnableQuickTodo = false; } else { mQuickAdd->show(); KOPrefs::instance()->mEnableQuickTodo = true; } mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); } void KOTodoView::toggleRunning() { KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); updateView(); } void KOTodoView::toggleCompleted() { KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); updateView(); } void KOTodoView::addQuickTodo() { Todo *todo = new Todo(); todo->setSummary(mQuickAdd->text()); todo->setOrganizer(KOPrefs::instance()->email()); CalFilter * cf = mCalendar->filter(); if ( cf ) { if ( cf->isEnabled()&& cf->showCategories()) { todo->setCategories(cf->categoryList()); } if ( cf->isEnabled() ) todo->setSecrecy( cf->getSecrecy()); } mCalendar->addTodo(todo); mQuickAdd->setText(""); todoModified (todo, KOGlobals::EVENTADDED ); updateView(); } void KOTodoView::keyPressEvent ( QKeyEvent * e ) { // e->ignore(); //return; //qDebug("KOTodoView::keyPressEvent "); switch ( e->key() ) { case Qt::Key_Down: case Qt::Key_Up: QWidget::keyPressEvent ( e ); break; case Qt::Key_Q: toggleQuickTodo(); break; case Qt::Key_U: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); unparentTodo(); e->accept(); } else e->ignore(); break; case Qt::Key_S: if ( e->state() == Qt::ControlButton ) { e->ignore(); break; } if ( e->state() == Qt::ShiftButton ) { mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); reparentTodo(); e->accept(); } else e->ignore(); break; case Qt::Key_P: if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); if ( pendingSubtodo ) itemClicked(mActiveItem); e->accept(); } else e->ignore(); break; case Qt::Key_Escape: if ( pendingSubtodo ) { itemClicked(0); e->accept(); } else e->ignore(); break; default: e->ignore(); } if ( true ) { if ( e->key() == Qt::Key_I ) { KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); if ( cn ) { mActiveItem = cn; KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); if ( ci ){ showTodo(); cn = (KOTodoViewItem*)cn->itemBelow(); if ( cn ) { mTodoListView->setCurrentItem ( cn ); mTodoListView->ensureItemVisible ( cn ); } } } e->accept(); } } } void KOTodoView::updateTodo( Todo * t, int type ) { if ( mBlockUpdate) return; QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; itemIterator = mTodoMap.find(t); if (itemIterator != mTodoMap.end()) { (*itemIterator)->construct(); } else { if ( type == KOGlobals::EVENTADDED ) { insertTodoItem( t ); } } } void KOTodoView::todoModified(Todo * t , int p ) { mBlockUpdate = true; emit todoModifiedSignal ( t, p ); mBlockUpdate = false; } |