-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 26 | ||||
-rw-r--r-- | korganizer/koeventviewer.h | 1 | ||||
-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 1 | ||||
-rw-r--r-- | korganizer/koeventviewerdialog.h | 1 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 53 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 6 |
9 files changed, 80 insertions, 18 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 30bb856..71d7208 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -1,193 +1,198 @@ Info about the changes in new versions of KDE-Pim/Pi +********** VERSION 2.1.13 ************ + +Fixed a problem in KA/Pi search. + + ********** VERSION 2.1.12 ************ KO/Pi: Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus. Fixed a problem with the month view when file was saved but KO/Pi was not the active window. Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only). Fixed some other small problems. ********** VERSION 2.1.11 ************ KO/Pi: Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. Added features to handle (and add ) more than one journal entry per day. Added option for a journal title. Added info about the calendar, the item belongs to, to the event/todo/journal viewer. Fixed a problem of the alarm of completed recurring todos. Added to the event/todo editor to set quickly the category of an item. Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet. Added KA/Pi multi sync to the multi sync called from the alarm applet. ********** VERSION 2.1.10 ************ KO/Pi: Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. Fixed a bug in searching for a small timerange, i.e. one day. KA/Pi: Fixed two problems in csv export. Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. ********** VERSION 2.1.9 ************ KO/Pi: Fixed some problems of the new search options in the search dialog. Fixed some problems in the new resource config options. Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. Fixed a problem in recurrence range in syncing with DTM. KA/Pi: Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) PwM/Pi: Added "sec" to the timeout config settings to make it clear the timeout values are seconds. ********** VERSION 2.1.8 ************ KO/Pi: Added info about the completion state of a todo in the ListView/Searchdialog. If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. Fixed some updating problems when changing the filter. KA/Pi: In the addressee selection dialog now the formatted name is shown, if not empty. Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. Fixed the sorting for size in the file selector on the Z. Changed the color selection dialog on the Zaurus to a more user friendly version. ********** VERSION 2.1.7 ************ KO/Pi: Fixed several problems in the new Resource handling. Added more options to the search dialog. Fixed a problem in the Month view. Added more options to the dialog when setting a todo to stopped. Fixed two small problems in KO/Pi Alarm applet. ********** VERSION 2.1.6 ************ This release is for testing only. KO/Pi: Added to the list view (the list view is used in search dialog as well) the possibility to print it. Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. Added to the list view the possibility to add all subtodos of selected todos to an export/beam. Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. Now on every sync the set of calendars is synced which are enabled in the resource view. A calendar is enabled in the resource view if the "eye" column is checked. You can set a calendar to be the default for new items( "+" column ). You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... ********** VERSION 2.1.5 ************ This is the new stable version. Bugfix: Fixed a problem with agenda popup on the desktop in KO/Pi. Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. Added config option to not display completed todos in agenda view. Addressee view is now using the formatted name, if defined. That makes it possible to display "lastname, firstname" in that view now. To set the formatted name for all contacts, please use menu: Edit->Change->Set formatted name. Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. ********** VERSION 2.1.4 ************ Fixed two more bugs in the KA/Pi CSV import dialog: Made it possible to read multi-line fields and import it to the "Note" field. Fixed a problem in mapping custom fields, whatever a custem field is... ********** VERSION 2.1.3 ************ Changed the menu structure of the alarm applet: Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". Fixed several problems in the KA/Pi CSV import dialog: Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. ********** VERSION 2.1.2 ************ Fixed a problem closing the alarm dialog on Zaurus with "OK" button. Fixed a problem when importing data from Outlook with mutiple categories set. Changed display of days in datenavigator: Birthdays are now blue, not dark green. When todo view is shown, no birtdays are shown and days with due todos are shown blue. When journal view is shown, only holidays are shown and days with journals are blue. Added Backup options to global config: You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. ********** VERSION 2.1.1 ************ Stable release 2.1.1! KO/Pi: Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. ********** VERSION 2.1.0 ************ Stable release 2.1.0! Summary of changes/fixes compared to version 2.0.6: Many bugs of version 2.0.6 fixed. Most of them were small bugs, but some of them were important. It is recommended to use version 2.1.0 and not version 2.0.6. Important changes: Added recurring todos to KO/Pi. Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. Datenavigator can now display many months. Very useful on the desktop. KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. Made alarm sound working on Linux desktop. Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. Many other usebility enhancements. Special thanks to Ben for his suggestions! You can find the complete changelog from version 1.7.7 to 2.1.0 in the source package or on http://www.pi-sync.net/html/changelog.html diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index d7954c6..bc5cbb7 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1019,386 +1019,386 @@ { "<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>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...","UNDO Löschen..." }, { "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 wirklich\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 "," Lokale 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...","Setze Alarm..." }, { "Set Alarm!","Setze Alarm!" }, { "Changed 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>" }, +{ "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","Exportiere" }, { "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","Zeige Sync-Ereignisse" }, { "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 ist gestartet" }, { "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 alle\nUntertodos auch klonen?" }, { "Todo has subtodos","Todo hat Untertodos" }, { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, { "Colors","Farben" }, { "Click on new parent item","Klicke auf neues Übertodo" }, { "Reparenting aborted!","Übertodo setzen abgebrochen" }, { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, { "times","Zeiten" }, { "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, { "Backup enabled","Backup angeschaltet" }, { "Use standard backup dir","Standard Backupverzeichnis" }, { "Number of Backups:","Anzahl der Backups" }, { "Make backup every ","Mache ein Backup alle " }, { " days"," Tage" }, { "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, { "Backup Failed!","Backup Problem!" }, { "Try again now","Versuche jetzt nochmal" }, { "Try again later","Versuche später nochmal" }, { "Try again tomorrow","Versuche morgen nochmal" }, { "Disable backup","Schalte Backup ab" }, { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, { "Choose action","Wähle Aktion" }, { "Comment for todo:","Kommentar zum Todo:" }, { "Stop+note","Stop+Notiz" }, { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, { "Print complete list...","Drucke komplette Liste..." }, { "Hide all selected","Verstecke Ausgewählte" }, { "Add items","hinzufügen" }, { "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" }, { "Print List View...","Drucke Listenansicht..." }, { "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." }, { "Configure KO/Pi...","Konfiguriere KO/Pi..." }, { "Global Settings...","Globale Einstellungen..." }, { "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, { "(disabled)","(abgeschaltet)" }, { "New Calendar","Neuer Kalender" }, { "Calendar","Kalender" }, { "Filter selector","Filterauswahl" }, { "Filtermenu","Filtermenu" }, { "Toggle Fullscreen","Vollbild umschalten" }, { "Toggle Resource View","Resourcenansicht umschalten" }, { "Storage HowTo...","Speicherort HowTo..." }, { "Timetracking HowTo...","Timetracking HowTo..." }, { "Juni","Juni" }, { "Juli","Juli" }, { "ToDo:","ToDo:" }, { "Set Calendar","Setze Kalender" }, { "Todo: %1","Todo: %1" }, { ": (Prio ",": (Prio " }, { "Todos","Todos" }, { "Todo Viewer","Todo Anzeige" }, { "Todo ","Todo " }, { " Calendar \n Resource "," Kalender \n Resource " }, { " Color "," Farbe " }, { "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" }, { "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, { "Add new Calendar","Füge Kalender hinzu" }, { "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, { "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, { "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 72221fd..1785b8a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -3160,384 +3160,385 @@ void CalendarView::cloneIncidence(Incidence * orgInc ) } else { Event* e = (Event*) newInc; showEventEditor(); mEventEditor->editEvent( e ); if ( mEventEditor->exec() ) { mCalendar->addEvent( e ); updateView(); } else { delete e; } } setActiveWindow(); } void CalendarView::newEvent() { // TODO: Replace this code by a common eventDurationHint of KOBaseView. KOAgendaView *aView = mViewManager->agendaView(); if (aView) { if (aView->selectionStart().isValid()) { if (aView->selectedIsAllDay()) { newEvent(aView->selectionStart(),aView->selectionEnd(),true); } else { newEvent(aView->selectionStart(),aView->selectionEnd()); } return; } } QDate date = mNavigator->selectedDates().first(); QDateTime current = QDateTime::currentDateTime(); if ( date <= current.date() ) { int hour = current.time().hour() +1; newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); } else newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), QDateTime( date, QTime( KOPrefs::instance()->mStartTime + KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); } void CalendarView::newEvent(QDateTime fh) { newEvent(fh, QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); } void CalendarView::newEvent(QDate dt) { newEvent(QDateTime(dt, QTime(0,0,0)), QDateTime(dt, QTime(0,0,0)), true); } void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) { newEvent(fromHint, toHint, false); } void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) { showEventEditor(); mEventEditor->newEvent(fromHint,toHint,allDay); if ( mFilterView->filtersEnabled() ) { CalFilter *filter = mFilterView->selectedFilter(); if (filter && filter->showCategories()) { mEventEditor->setCategories(filter->categoryList().join(",") ); } if ( filter ) mEventEditor->setSecrecy( filter->getSecrecy() ); } mEventEditor->exec(); setActiveWindow(); } void CalendarView::todoAdded(Todo * t) { changeTodoDisplay ( t ,KOGlobals::EVENTADDED); updateTodoViews(); } void CalendarView::todoChanged(Todo * t) { emit todoModified( t, 4 ); // updateTodoViews(); } void CalendarView::todoToBeDeleted(Todo *) { //qDebug("todoToBeDeleted(Todo *) "); updateTodoViews(); } void CalendarView::todoDeleted() { //qDebug(" todoDeleted()"); updateTodoViews(); } void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) { showTodoEditor(); mTodoEditor->newTodo(dt,0,allday); if ( mFilterView->filtersEnabled() ) { CalFilter *filter = mFilterView->selectedFilter(); if (filter && filter->showCategories()) { mTodoEditor->setCategories(filter->categoryList().join(",") ); } if ( filter ) mTodoEditor->setSecrecy( filter->getSecrecy() ); } mTodoEditor->exec(); setActiveWindow(); } void CalendarView::newTodo() { newTodoDateTime( QDateTime(),true ); } void CalendarView::newSubTodo() { Todo *todo = selectedTodo(); if ( todo ) newSubTodo( todo ); } void CalendarView::newSubTodo(Todo *parentEvent) { showTodoEditor(); mTodoEditor->newTodo(QDateTime(),parentEvent,true); mTodoEditor->exec(); setActiveWindow(); } void CalendarView::newFloatingEvent() { DateList tmpList = mNavigator->selectedDates(); QDate date = tmpList.first(); newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), QDateTime( date, QTime( 12, 0, 0 ) ), true ); } void CalendarView::editEvent( Event *event ) { if ( !event ) return; if ( event->isReadOnly() ) { showEvent( event ); return; } showEventEditor(); mEventEditor->editEvent( event , mFlagEditDescription); mEventEditor->exec(); setActiveWindow(); } void CalendarView::editJournal( Journal *jour ) { if ( !jour ) return; mDialogManager->hideSearchDialog(); mViewManager->showJournalView(); mNavigator->slotDaySelect( jour->dtStart().date() ); } void CalendarView::editTodo( Todo *todo ) { if ( !todo ) return; if ( todo->isReadOnly() ) { showTodo( todo ); return; } showTodoEditor(); mTodoEditor->editTodo( todo ,mFlagEditDescription); mTodoEditor->exec(); setActiveWindow(); } KOEventViewerDialog* CalendarView::getEventViewerDialog() { if ( !mEventViewerDialog ) { mEventViewerDialog = new KOEventViewerDialog(0); connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), viewManager(), SLOT( showAgendaView( bool ) ) ); connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), this, SLOT( slotViewerClosed() ) ); connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), this, SLOT( todoChanged(Todo *) ) ); + connect( mEventViewerDialog, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); mEventViewerDialog->resize( 640, 480 ); } return mEventViewerDialog; } void CalendarView::showEvent(Event *event) { getEventViewerDialog()->setEvent(event); getEventViewerDialog()->showMe(); } void CalendarView::showTodo(Todo *event) { getEventViewerDialog()->setTodo(event); getEventViewerDialog()->showMe(); } void CalendarView::showJournal( Journal *jour ) { getEventViewerDialog()->setJournal(jour); getEventViewerDialog()->showMe(); } // void CalendarView::todoModified (Todo *event, int changed) // { // // if (mDialogList.find (event) != mDialogList.end ()) { // // kdDebug() << "Todo modified and open" << endl; // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; // // temp->modified (changed); // // } // mViewManager->updateView(); // } void CalendarView::appointment_show() { Event *anEvent = 0; Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); if (mViewManager->currentView()->isEventView()) { if ( incidence && incidence->typeID() == eventID ) { anEvent = static_cast<Event *>(incidence); } } if (!anEvent) { KNotifyClient::beep(); return; } showEvent(anEvent); } void CalendarView::appointment_edit() { Event *anEvent = 0; Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); if (mViewManager->currentView()->isEventView()) { if ( incidence && incidence->typeID() == eventID ) { anEvent = static_cast<Event *>(incidence); } } if (!anEvent) { KNotifyClient::beep(); return; } editEvent(anEvent); } void CalendarView::appointment_delete() { Event *anEvent = 0; Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); if (mViewManager->currentView()->isEventView()) { if ( incidence && incidence->typeID() == eventID ) { anEvent = static_cast<Event *>(incidence); } } if (!anEvent) { KNotifyClient::beep(); return; } deleteEvent(anEvent); } void CalendarView::todo_resub( Todo * parent, Todo * sub ) { if (!sub) return; if ( sub->relatedTo() == parent ) return; sub->setRelatedTo(parent); sub->updated(); setModified(true); updateView(); } void CalendarView::todo_unsub(Todo *anTodo ) { todo_resub( 0, anTodo ); } void CalendarView::deleteTodo(Todo *todo) { if (!todo) { KNotifyClient::beep(); return; } if (KOPrefs::instance()->mConfirm) { QString text = todo->summary().left(20); if (!todo->relations().isEmpty()) { text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); } switch (msgItemDelete(text)) { case KMessageBox::Continue: // OK bool deleteT = false; if (!todo->relations().isEmpty()) { deleteT = removeCompletedSubTodos( todo ); } // deleteT == true: todo already deleted in removeCompletedSubTodos if ( !deleteT ) { checkExternalId( todo ); calendar()->deleteTodo(todo); changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); updateView(); } break; } // switch } else { checkExternalId( todo ); mCalendar->deleteTodo(todo); changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); updateView(); } emit updateSearchDialog(); } void CalendarView::deleteJournal(Journal *jour) { if (!jour) { KNotifyClient::beep(); return; } if (KOPrefs::instance()->mConfirm) { switch (msgItemDelete( jour->description().left(20))) { case KMessageBox::Continue: // OK calendar()->deleteJournal(jour); updateView(); break; } // switch } else { calendar()->deleteJournal(jour);; updateView(); } emit updateSearchDialog(); } void CalendarView::deleteEvent(Event *anEvent) { if (!anEvent) { KNotifyClient::beep(); return; } if (anEvent->recurrence()->doesRecur()) { QDate itemDate = mViewManager->currentSelectionDate(); int km; if (!itemDate.isValid()) { //kdDebug() << "Date Not Valid" << endl; if (KOPrefs::instance()->mConfirm) { km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), i18n("KO/Pi Confirmation"),i18n("Delete All")); if ( km == KMessageBox::Continue ) km = KMessageBox::No; // No = all below } else km = KMessageBox::No; } else { km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), i18n("KO/Pi Confirmation"),i18n("Current"), i18n("All")); } diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index f6c252b..2d0bfff 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -1,304 +1,314 @@ /* 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. */ #include <qcstring.h> #include <qwhatsthis.h> #include <qdialog.h> #include <qapplication.h> #include <qlabel.h> #include <qlayout.h> #include <klocale.h> #include <kapplication.h> #include <libkcal/event.h> #include <libkcal/todo.h> #include <kdebug.h> #include <kiconloader.h> #include <krun.h> #include <kglobal.h> #include <kprocess.h> #include "koprefs.h" #include <kabc/stdaddressbook.h> #ifndef KORG_NODCOP #include <dcopclient.h> #include "korganizer.h" #include "koprefs.h" #include "actionmanager.h" #endif #include "koeventviewer.h" //#ifndef KORG_NOKABC //#include <kabc/stdaddressbook.h> //#define size count //#endif #ifdef DESKTOP_VERSION #include <kabc/addresseedialog.h> #include <kabc/addresseeview.h> #include <qprinter.h> #include <qpainter.h> #include <qpaintdevicemetrics.h> #else //DESKTOP_VERSION #include <externalapphandler.h> #include <qtopia/qcopenvelope_qws.h> #endif //DESKTOP_VERSION KOEventViewer::KOEventViewer(QWidget *parent,const char *name) : QTextBrowser(parent,name) { mSyncMode = false; mColorMode = 0; } KOEventViewer::~KOEventViewer() { } void KOEventViewer::printMe() { #ifdef DESKTOP_VERSION KOPrintPrefs pp ( this ); if (!pp.exec() ) return; int scaleval = pp.printMode() ; QPrinter printer; if (!printer.setup() ) return; QPainter p; p.begin ( &printer ); QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); float dx, dy; int wid = (m.width() * 9)/10; dx = (float) wid/(float)contentsWidth (); dy = (float)(m.height()) / (float)contentsHeight (); float scale; // scale to fit the width or height of the paper if ( dx < dy ) scale = dx; else scale = dy; p.translate( m.width()/10,0 ); if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { p.scale( scale, scale ); } drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); p.end(); #endif } void KOEventViewer::setSource(const QString& n) { + if ( n.left(8) == "todo_uid" ) { + int midstr = 9; +#ifdef DESKTOP_VERSION + midstr = 11; +#endif + qDebug("-%s- ", n.mid(midstr).latin1()); + emit showIncidence( n.mid(midstr) ); + return; + } + if ( n.left(3) == "uid" ) #ifdef DESKTOP_VERSION { KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); KABC::AddressBook::Iterator it; for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { // LR I do not understand, why the uid string is different on zaurus and desktop QString uid = "uid://"+(*it).uid(); //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); if (n == uid ) { //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); QDialog dia( this,"dia123", true ); dia.setCaption( i18n("Details of attendee") ); QVBoxLayout lay ( &dia ); KABC::AddresseeView av ( &dia ); av.setAddressee( (*it) ); lay.addWidget( &av ); if ( QApplication::desktop()->width() < 480 ) dia.resize( 220, 240); else { dia.resize( 400,400); } dia.exec(); break; } } return; } #else { if ( "uid:organizer" == n ) { ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); return; } QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); if (attendees.count()) { Attendee *a; for(a=attendees.first();a;a=attendees.next()) { if ( "uid:"+a->uid() == n ) { bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); return; } } } return; } //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); // the result should now arrive through method insertAttendees //QString uid = "uid:"+(*it).uid(); #endif if ( n.left(6) == "mailto" ) { // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); #ifndef DESKTOP_VERSION if ( n.mid(7,3) == "ALL" ) { mailToAttendees( true ); } else if ( n.mid(7,4) == "RSVP" ) { mailToAttendees( false ); } else { QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); e << n.mid(7); } #endif } #ifndef KORG_NODCOP kdDebug() << "KOEventViewer::setSource(): " << n << endl; QString tmpStr; if (n.startsWith("mailto:")) { KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); //emit showIncidence(n); return; } else if (n.startsWith("uid:")) { DCOPClient *client = KApplication::kApplication()->dcopClient(); const QByteArray noParamData; const QByteArray paramData; QByteArray replyData; QCString replyTypeStr; #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) bool foundAbbrowser = PING_ABBROWSER; if (foundAbbrowser) { //KAddressbook is already running, so just DCOP to it to bring up the contact editor //client->send("kaddressbook","KAddressBookIface", QDataStream arg(paramData, IO_WriteOnly); arg << n.mid(6); client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); return; } else { /* KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. We start it without its main interface */ KIconLoader* iconLoader = new KIconLoader(); QString iconPath = iconLoader->iconPath("go",KIcon::Small); ActionManager::setStartedKAddressBook(true); tmpStr = "kaddressbook --editor-only --uid "; tmpStr += KProcess::quote(n.mid(6)); KRun::runCommand(tmpStr,"KAddressBook",iconPath); return; } } else { //QTextBrowser::setSource(n); } #endif } void KOEventViewer::mailToAttendees( bool all ) { QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); if (attendees.count() == 0) return; QStringList nameList; QStringList emailList; QStringList uidList; Attendee* a; for(a=attendees.first();a;a=attendees.next()) { if ( !all && !a->RSVP() ) continue; if (!a->email().isEmpty()) { nameList.append (a->name() ); emailList.append (a->email() ); uidList.append (a->uid() ); } } QString uid = "ComposeMailUIpick2"+mMailSubject; #ifndef DESKTOP_VERSION bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); #endif } void KOEventViewer::addTag(const QString & tag,const QString & text) { int number=text.contains("\n"); QString str = "<" + tag + ">"; QString tmpText=text; QString tmpStr=str; if(number !=-1) { if (number > 0) { int pos=0; QString tmp; for(int i=0;i<=number;i++) { pos=tmpText.find("\n"); tmp=tmpText.left(pos); tmpText=tmpText.right(tmpText.length()-pos-1); tmpStr+=tmp+"<br>"; } } else tmpStr += tmpText; tmpStr+="</" + tag + ">"; mText.append(tmpStr); } else { str += text + "</" + tag + ">"; mText.append(str); } } void KOEventViewer::setColorMode( int m ) { mColorMode = m; } void KOEventViewer::appendEvent(Event *event, int mode ) { mMailSubject = ""; mCurrentIncidence = event; bool shortDate = KOPrefs::instance()->mShortDateInViewer; bool wideScreen = ( QApplication::desktop()->width() >= 640 ); topLevelWidget()->setCaption(i18n("Event Viewer")); if ( mode == 0 ) { addTag("h2",deTag(event->summary())); formatReadOnly(event); } else { if ( mColorMode == 1 ) { mText +="<font color=\"#00A000\">"; } if ( mColorMode == 2 ) { mText +="<font color=\"#C00000\">"; } // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; if ( mode == 1 ) { addTag("h2",i18n( "Local: " ) +deTag(event->summary())); } else { addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); } formatReadOnly(event); addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); if ( mColorMode ) mText += "</font>"; } @@ -341,392 +351,404 @@ void KOEventViewer::appendEvent(Event *event, int mode ) QString recurText = event->recurrence()->recurrenceText(); addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); bool ok; QDate start = QDate::currentDate(); QDateTime next; next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); if ( ok ) { if ( wideScreen ){ addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) ); } else { addTag("p",i18n("<b>Next recurrence is on:</b>") ); addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); } mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); } else { bool last; QDate nextd; nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); if ( last ) { if ( wideScreen ){ addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate )); } else{ addTag("p",i18n("<b>Last recurrence was on:</b>") ); addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); } } } } else { mMailSubject += i18n(" - " )+event->dtStartStr( true ); } if (event->isAlarmEnabled()) { Alarm *alarm =event->alarms().first() ; QDateTime t = alarm->time(); QString s =i18n("( %1 before )").arg( alarm->offsetText() ); if(wideScreen ){ addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); }else{ addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); } //addTag("p",s); } addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); formatCategories(event); formatAttendees(event); if ( KOPrefs::instance()->mEVshowCreated ) { if(wideScreen ){ addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); }else{ addTag("p",i18n("<b>Created: ") +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); } } if ( KOPrefs::instance()->mEVshowChanged ) { if(wideScreen ){ addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); }else{ addTag("p",i18n("<b>Last modified: ") +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); } } if ( KOPrefs::instance()->mEVshowDetails ) { if (!event->description().isEmpty()) { addTag("p",i18n("<b>Details: </b>")); addTag("p",deTag(event->description())); } } setText(mText); //QWhatsThis::add(this,mText); } void KOEventViewer::appendTodo(Todo *event, int mode ) { mMailSubject = ""; mCurrentIncidence = event; topLevelWidget()->setCaption(i18n("Todo Viewer")); bool shortDate = KOPrefs::instance()->mShortDateInViewer; bool wideScreen = ( QApplication::desktop()->width() >= 640 ); if (mode == 0 ) { addTag("h2",deTag(event->summary())); formatReadOnly(event); } else { if ( mColorMode == 1 ) { mText +="<font color=\"#00A000\">"; } if ( mColorMode == 2 ) { mText +="<font color=\"#B00000\">"; } if ( mode == 1 ) { addTag("h2",i18n( "Local: " ) +deTag(event->summary())); } else { addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); } formatReadOnly(event); addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); if ( mColorMode ) mText += "</font>"; } mMailSubject += i18n( "Todo " )+ event->summary(); if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { mText +="<font color=\"#B00000\">"; addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); mText += "</font>"; } else { mText.append(i18n("<p><i>%1 % completed</i></p>") .arg(event->percentComplete())); } if (event->cancelled ()) { mText +="<font color=\"#B00000\">"; addTag("i",i18n("This todo has been cancelled!")); mText.append("<br>"); mText += "</font>"; mMailSubject += i18n("(cancelled)"); } if (event->recurrence()->doesRecur()) { QString recurText = event->recurrence()->recurrenceText(); addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); } if (event->hasStartDate()) { mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); } if (event->hasDueDate()) { mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); mMailSubject += i18n(" - " )+event->dtDueStr( true ); } if (!event->location().isEmpty()) { addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); mMailSubject += i18n(" at ") + event->location(); } mText.append(i18n("<p><b>Priority:</b> %2</p>") .arg(QString::number(event->priority()))); if (event->isAlarmEnabled()) { Alarm *alarm =event->alarms().first() ; QDateTime t = alarm->time(); QString s =i18n("( %1 before )").arg( alarm->offsetText() ); if ( wideScreen ) { addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); } else { addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); } } addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); formatCategories(event); formatAttendees(event); if ( KOPrefs::instance()->mEVshowCreated ) { if(wideScreen ){ addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); } else { addTag("p",i18n("<b>Created: ") +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); } } if ( KOPrefs::instance()->mEVshowChanged ) { if(wideScreen ){ addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); } else { addTag("p",i18n("<b>Last modified: ") +" </b>"); addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); } } if ( event->relatedTo() ) { addTag("b",i18n("Parent todo:<br>")); - mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); + + QString t_name = "[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] ";// +event->relatedTo()->summary()); + + mText += t_name; + mText += "<a href=\"todo_uid:" + event->relatedTo()->uid() + "\">"; + mText += deTag(event->relatedTo()->summary()); + mText += "</a><br>"; + + // mText.append(deTag("[" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] " +event->relatedTo()->summary()) +"<br>"); } QPtrList<Incidence> Relations = event->relations(); Incidence *to; if ( Relations.first() ) addTag("b",i18n("Sub todos:<br>")); for (to=Relations.first();to;to=Relations.next()) { - mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); + QString t_name = "[" +QString::number(((Todo*)to)->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%] ";// +to->relatedTo()->summary()); + mText += t_name; + mText += "<a href=\"todo_uid:" + to->uid() + "\">"; + mText += deTag(to->summary()); + mText += "</a><br>"; } if ( KOPrefs::instance()->mEVshowDetails ) { if (!event->description().isEmpty()) { addTag("p",i18n("<b>Details: </b>")); addTag("p",deTag(event->description())); } } setText(mText); } void KOEventViewer::formatCategories(Incidence *event) { if (!event->categoriesStr().isEmpty()) { if (event->categories().count() == 1) { addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace()); } else { addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ; } } } void KOEventViewer::formatAttendees(Incidence *event) { QPtrList<Attendee> attendees = event->attendees(); if (attendees.count()) { QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); addTag("h3",i18n("Organizer")); mText.append("<ul><li>"); #ifndef KORG_NOKABC #ifdef DESKTOP_VERSION KABC::AddressBook *add_book = KABC::StdAddressBook::self(); KABC::Addressee::List addressList; addressList = add_book->findByEmail(event->organizer()); KABC::Addressee o = addressList.first(); if (!o.isEmpty() && addressList.size()<2) { mText += "<a href=\"uid:" + o.uid() + "\">"; mText += o.formattedName(); mText += "</a>\n"; } else { mText.append(event->organizer()); } #else //DESKTOP_VERSION mText += "<a href=\"uid:organizer\">"; mText += event->organizer(); mText += "</a>\n"; #endif //DESKTOP_VERSION #else mText.append(event->organizer()); #endif if (iconPath) { mText += " <a href=\"mailto:" + event->organizer() + "\">"; mText += "<IMG src=\"" + iconPath + "\">"; mText += "</a>\n"; } mText.append("</li></ul>"); addTag("h3",i18n("Attendees")); Attendee *a; mText.append("<ul>"); int a_count = 0; int a_count_nr = 0; for(a=attendees.first();a;a=attendees.next()) { #ifndef KORG_NOKABC #ifdef DESKTOP_VERSION if (a->name().isEmpty()) { addressList = add_book->findByEmail(a->email()); KABC::Addressee o = addressList.first(); if (!o.isEmpty() && addressList.size()<2) { mText += "<a href=\"uid:" + o.uid() + "\">"; mText += o.formattedName(); mText += "</a>\n"; } else { mText += "<li>"; mText.append(a->email()); mText += "\n"; } } else { mText += "<li><a href=\"uid:" + a->uid() + "\">"; if (!a->name().isEmpty()) mText += a->name(); else mText += a->email(); mText += "</a>\n"; } #else //DESKTOP_VERSION mText += "<li><a href=\"uid:" + a->uid() + "\">"; if (!a->name().isEmpty()) mText += a->name(); else mText += a->email(); mText += "</a>\n"; #endif //DESKTOP_VERSION #else //qDebug("nokabc "); mText += "<li><a href=\"uid:" + a->uid() + "\">"; if (!a->name().isEmpty()) mText += a->name(); else mText += a->email(); mText += "</a>\n"; #endif if (!a->email().isEmpty()) { if (iconPath) { mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; if ( a->RSVP() ) { ++a_count_nr; mText += "<IMG src=\"" + iconPath + "\">"; } else { ++a_count; mText += "<IMG src=\"" + NOiconPath + "\">"; } mText += "</a>\n"; } } if (a->status() != Attendee::NeedsAction ) mText +="[" + a->statusStr() + "] "; if (a->role() == Attendee::Chair ) mText +="(" + a->roleStr().left(1) + ".)"; } mText.append("</li></ul>"); if ( (a_count+a_count_nr) > 1 ) { mText += "<a href=\"mailto:ALL\">"; mText += i18n( "Mail to all" ); mText += "</a> ( "; mText += "<IMG src=\"" + iconPath + "\">"; mText += i18n( " and " ); mText += "<IMG src=\"" + NOiconPath + "\"> )"; mText += "<br>\n"; } if ( a_count_nr > 1 ) { mText += "<a href=\"mailto:RSVP\">"; mText += i18n( "Mail to selected" ); mText += "</a> ( "; mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); mText += "<br>\n"; } } } void KOEventViewer::appendJournal(Journal *jour, int mode ) { bool shortDate = KOPrefs::instance()->mShortDateInViewer; QString text_d = i18n("Journal from: "); if ( !jour->summary().isEmpty() ) text_d = jour->summary(); if (mode == 0 ) { addTag("h2", text_d ); } else { if ( mode == 1 ) { addTag("h3",i18n( "Local: " ) + text_d ); } else { addTag("h3",i18n( "Remote: " ) + text_d ); } } topLevelWidget()->setCaption(i18n("Journal viewer")); mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); formatReadOnly(jour); addTag("p","<b>"+i18n( "Last modified: " ) + "</b>"+KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); if (!jour->description().isEmpty()) { addTag("p",deTag(jour->description())); } setText(mText); } void KOEventViewer::formatReadOnly(Incidence *event) { int id = event->calID(); if ( id > 1 ) { addTag("p", "<em>("+i18n("Calendar:")+" " + KOPrefs::instance()->getCalendar( id )->mName + ")</em>"); } if (event->isReadOnly()) { addTag("p","<em>(" + i18n("read-only") + ")</em>"); } } void KOEventViewer::setSyncMode( bool b ) { mSyncMode = b; } void KOEventViewer::setTodo(Todo *event, bool clearV ) { if ( clearV ) diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 1eeb8d1..64eb4ff 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h @@ -1,131 +1,132 @@ /* 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. */ #ifndef KOEVENTVIEWER_H #define KOEVENTVIEWER_H // // Viewer widget for events. // #include <qtextbrowser.h> #include <libkcal/event.h> #include <libkcal/journal.h> using namespace KCal; #ifdef DESKTOP_VERSION #include <qradiobutton.h> #include <qpushbutton.h> #include <qlayout.h> #include <qdialog.h> #include <qlabel.h> #include <qbuttongroup.h> #include <kglobal.h> class KOPrintPrefs : public QDialog { public: KOPrintPrefs( QWidget *parent=0, const char *name=0 ) : QDialog( parent, name, true ) { setCaption( i18n("KO/Pi Printout") ); QVBoxLayout* lay = new QVBoxLayout( this ); lay->setSpacing( 9 ); lay->setMargin( 9 ); QLabel * lab = new QLabel( i18n("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"), this ); lay->addWidget( lab ); lab->setAlignment( AlignCenter ); QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("Printout Mode"), this ); lay->addWidget( format ); format->setExclusive ( true ) ; pmNo = new QRadioButton(i18n("Print unscaled"), format ); pmScaledDown = new QRadioButton(i18n("Print scaled down to fit one page"), format ); new QRadioButton(i18n("Print scaled up/down to fit one page"), format ); pmScaledDown->setChecked( true ); QPushButton * ok = new QPushButton( i18n("OK"), this ); lay->addWidget( ok ); QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); lay->addWidget( cancel ); connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); } int printMode() { if ( pmNo->isChecked() ) return 0; if ( pmScaledDown->isChecked() ) return 1; return 2; } private: QRadioButton* pmNo; QRadioButton* pmScaledDown; }; #endif class KOEventViewer : public QTextBrowser { Q_OBJECT public: KOEventViewer(QWidget *parent=0,const char *name=0); virtual ~KOEventViewer(); void setSource(const QString &); void setEvent(Event *event); void addEvent(Event *event); void setTodo(Todo *event, bool clearV = true ); void setJournal(Journal *jour, bool clearV = true ); void appendEvent(Event *event, int mode = 0 ); void appendTodo(Todo *event, int mode = 0 ); void appendJournal(Journal *jour, int mode = 0 ); void clearEvents(bool now=false); void addText(QString text); void setSyncMode( bool ); void setColorMode( int ); void mailToAttendees( bool all ); void printMe(); protected: int mColorMode; void addTag(const QString & tag,const QString & text); void formatCategories(Incidence *event); void formatAttendees(Incidence *event); void formatReadOnly(Incidence *event); void keyPressEvent ( QKeyEvent * e ); private: QTextBrowser *mEventTextView; bool mSyncMode; QString deTag(QString text); QString mText; QString mMailSubject; Incidence* mCurrentIncidence; signals: void launchaddressbook(QString uid); + void showIncidence(QString uid); }; #endif diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index 02f13c7..0763825 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp @@ -1,245 +1,246 @@ /* 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. */ #include <klocale.h> #include <libkcal/event.h> #include <qtimer.h> #include <qpushbutton.h> #include "koeventviewer.h" #include <kmessagebox.h> #include "koprefs.h" #include <libkcal/todo.h> #include "qapp.h" #include "koeventviewerdialog.h" extern int globalFlagBlockAgenda; KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) : KDialogBase(parent,name, #ifndef DESKTOP_VERSION true , #else false, #endif i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) { sendSignalViewerClosed = true; mEventViewer = new KOEventViewer(this); mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); setMainWidget(mEventViewer); setButtonText(Ok, i18n("Edit") ); QObject::connect(findButton( Ok ),SIGNAL(clicked()), SLOT(editIncidence())); QObject::connect(this,SIGNAL(user1Clicked()), SLOT(showIncidence())); + connect( mEventViewer, SIGNAL( showIncidence( QString ) ),SIGNAL( showIncidence( QString ) )); mIncidence = 0; // TODO: Set a sensible size (based on the content?). //showMaximized(); //qDebug("++++++++++++KOEventViewerDialog() "); // if ( KOPrefs::instance()->mCompactDialogs ) { // setFixedSize( 240,284 ); // move( 0, 15 ); // } else { // setMinimumSize(300,200); // resize(320,300); // } mSyncMode = false; mSyncResult = 0; } KOEventViewerDialog::~KOEventViewerDialog() { //qDebug("-------~KOEventViewerDialog() "); } void KOEventViewerDialog::showMe() { #ifdef DESKTOP_VERSION int x,y,w,h; x = geometry().x(); y = geometry().y(); w = width(); h = height(); show(); setGeometry(x,y,w,h); raise(); #else showMaximized(); #endif QTimer::singleShot( 1, this, SLOT ( setMyFocus() ) ); } void KOEventViewerDialog::setMyFocus() { setActiveWindow(); mEventViewer->setFocus(); } void KOEventViewerDialog::print() { mEventViewer->printMe(); } void KOEventViewerDialog::setSyncMode( bool b ) { mSyncMode = b; //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); if ( mSyncMode ) { findButton( Close )->setText( i18n("Cancel Sync")); findButton( Ok )->setText( i18n("Remote")); findButton( User1 )->setText( i18n("Local")); } else { findButton( Close )->setText( i18n("Close")); findButton( Ok )->setText( i18n("Edit")); findButton( User1 )->setText( i18n("Agenda")); } mEventViewer->setSyncMode( b ); } void KOEventViewerDialog::setColorMode( int m ) { mEventViewer->setColorMode( m ); } int KOEventViewerDialog::executeS( bool local ) { mSyncResult = 3; if ( local ) findButton( User1 )->setFocus(); else findButton( Ok )->setFocus(); exec(); return mSyncResult; } void KOEventViewerDialog::updateConfig() { mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); } void KOEventViewerDialog::setEvent(Event *event) { mEventViewer->setEvent(event); mIncidence = event; mEventViewer->setFocus(); //findButton( Close )->setFocus(); if ( !mSyncMode ) { findButton( User1 )->setText( i18n("Agenda")); } } void KOEventViewerDialog::setIncidence(Incidence *in ) { if ( in->typeID() == eventID ) setEvent( (Event*) in ); else if ( in->typeID() == todoID ) setTodo( (Todo*) in ); else if ( in->typeID() == journalID ) setJournal( (Journal*) in ); } void KOEventViewerDialog::addIncidence(Incidence *in) { if ( in->typeID() == eventID ) addEvent( (Event*) in ); else if ( in->typeID() == todoID ) mEventViewer->setTodo( (Todo*) in, false ); else if ( in->typeID() == journalID ) mEventViewer->setJournal( (Journal*) in, false ); if ( mSyncMode ) { findButton( User1 )->setFocus(); setCaption(i18n("Conflict! Please choose entry")); } } void KOEventViewerDialog::addEvent(Event *event) { mEventViewer->addEvent(event); mIncidence = event; mEventViewer->setFocus(); //findButton( Close )->setFocus(); if ( !mSyncMode ) { findButton( User1 )->setText( i18n("Agenda")); } } void KOEventViewerDialog::setTodo(Todo *event) { mEventViewer->setTodo(event); mIncidence = (Incidence*)event; mEventViewer->setFocus(); //findButton( Close )->setFocus(); if ( !mSyncMode ) { findButton( User1 )->setText( i18n("Set complete")); } } void KOEventViewerDialog::setJournal(Journal *j) { mEventViewer->setJournal(j); mIncidence = (Incidence*)j; mEventViewer->setFocus(); //findButton( Close )->setFocus(); if ( !mSyncMode ) { findButton( User1 )->setText( i18n("Agenda")); } } void KOEventViewerDialog::addText(QString text) { mEventViewer->addText(text); mEventViewer->setFocus(); //findButton( Close )->setFocus(); } void KOEventViewerDialog::editIncidence() { sendSignalViewerClosed = false; if ( mSyncMode ) { mSyncResult = 2; accept(); return; } if ( mIncidence ){ close(); emit editIncidence( mIncidence ); } } void KOEventViewerDialog::showIncidence() { sendSignalViewerClosed = false; if ( mSyncMode ) { mSyncResult = 1; accept(); return; } if ( mIncidence ){ QDate date; if ( mIncidence->type() == "Todo" ) { /* if ( ((Todo*)mIncidence)->hasDueDate() ) date = ((Todo*)mIncidence)->dtDue().date(); else { globalFlagBlockAgenda = 2; emit showAgendaView( false ); return; } */ ((Todo*)mIncidence)->setCompleted( true ); ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() ); diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h index 29fee49..71696f4 100644 --- a/korganizer/koeventviewerdialog.h +++ b/korganizer/koeventviewerdialog.h @@ -1,77 +1,78 @@ /* 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. */ #ifndef KOEVENTVIEWERDIALOG_H #define KOEVENTVIEWERDIALOG_H // // Viewer dialog for events. // #include <qtextview.h> #include <kdialogbase.h> #include <libkcal/event.h> using namespace KCal; class KOEventViewer; class KOEventViewerDialog : public KDialogBase { Q_OBJECT public: KOEventViewerDialog(QWidget *parent=0,const char *name=0); virtual ~KOEventViewerDialog(); void setEvent(Event *event); void addEvent(Event *event); void setTodo(Todo *event); void setJournal(Journal *journal); void setIncidence(Incidence *inc); void addIncidence(Incidence *inc); void addText(QString text); void showMe(); void setSyncMode( bool ); void setColorMode( int m ); int executeS( bool ); public slots: void updateConfig(); void print(); void setMyFocus(); signals: + void showIncidence( QString ); void editIncidence( Incidence* ); void jumpToTime( const QDate &); void showAgendaView( bool ); void todoCompleted(Todo*); void signalViewerClosed(); private slots: void slotViewerClosed(); void editIncidence(); void showIncidence(); protected: void hideEvent ( QHideEvent * e ); private: bool sendSignalViewerClosed; bool mSyncMode; int mSyncResult; KOEventViewer *mEventViewer; Incidence* mIncidence; void keyPressEvent ( QKeyEvent * e ); }; #endif diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index e2966f8..4f42c83 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -378,402 +378,416 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) if ( !internalDrop ) { //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); qDebug("Dnd: External move: Delete drag source "); } else qDebug("Dnd: Internal move "); } else { if ( !internalDrop ) { qDebug("Dnd: External Copy"); } else qDebug("DnD: Internal copy: Copy pending"); } } } #endif } void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) { if ( !e->isAutoRepeat() ) { mFlagKeyPressed = false; } } void KOTodoListView::keyPressEvent ( QKeyEvent * e ) { qApp->processEvents(); if ( e->isAutoRepeat() && !mFlagKeyPressed ) { e->ignore(); // qDebug(" ignore %d",e->isAutoRepeat() ); return; } if (! e->isAutoRepeat() ) mFlagKeyPressed = true; QListViewItem* cn; if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { cn = currentItem(); if ( cn ) { KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); if ( ci ){ if ( e->state() == ShiftButton ) ci->setOn( false ); else ci->setOn( true ); cn = cn->itemBelow(); if ( cn ) { setCurrentItem ( cn ); ensureItemVisible ( cn ); } } } return; } if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { switch ( e->key() ) { case Qt::Key_Down: case Qt::Key_Up: QListView::keyPressEvent ( e ); break; case Qt::Key_Left: case Qt::Key_Right: QListView::keyPressEvent ( e ); e->accept(); return; break; default: e->ignore(); break; } return; } e->ignore(); } void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) { QListView::contentsMouseReleaseEvent(e); mMousePressed = false; } void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) { if (!e) return; QPoint vp = contentsToViewport(e->pos()); QListViewItem *item = itemAt(vp); emit double_Clicked(item); if (!item) return; emit doubleClicked(item,vp,0); } ///////////////////////////////////////////////////////////////////////////// KOQuickTodo::KOQuickTodo(QWidget *parent) : QLineEdit(parent) { setText(i18n("Click to add a new Todo")); } void KOQuickTodo::focusInEvent(QFocusEvent *ev) { if ( text()==i18n("Click to add a new Todo") ) setText(""); QLineEdit::focusInEvent(ev); } void KOQuickTodo::focusOutEvent(QFocusEvent *ev) { setText(i18n("Click to add a new Todo")); QLineEdit::focusOutEvent(ev); } ///////////////////////////////////////////////////////////////////////////// KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : KOrg::BaseView(calendar,parent,name) { mCategoryPopupMenu = 0; mPendingUpdateBeforeRepaint = false; isFlatDisplay = false; mNavigator = 0; QBoxLayout *topLayout = new QVBoxLayout(this); mName = QString ( name ); mBlockUpdate = false; mQuickAdd = new KOQuickTodo(this); topLayout->addWidget(mQuickAdd); if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); mTodoListView = new KOTodoListView(calendar,this, name ); topLayout->addWidget(mTodoListView); //mTodoListView->header()->setMaximumHeight(30); mTodoListView->setRootIsDecorated(true); mTodoListView->setAllColumnsShowFocus(true); mTodoListView->setShowSortIndicator(true); mTodoListView->addColumn(i18n("Todo")); mTodoListView->addColumn(i18n("Prio")); mTodoListView->setColumnAlignment(1,AlignHCenter); mTodoListView->addColumn(i18n("Complete")); mTodoListView->setColumnAlignment(2,AlignCenter); mTodoListView->addColumn(i18n("Due Date")); mTodoListView->setColumnAlignment(3,AlignLeft); mTodoListView->addColumn(i18n("Due Time")); mTodoListView->setColumnAlignment(4,AlignHCenter); mTodoListView->addColumn(i18n("Start Date")); mTodoListView->setColumnAlignment(5,AlignLeft); mTodoListView->addColumn(i18n("Start Time")); mTodoListView->setColumnAlignment(6,AlignHCenter); mTodoListView->addColumn(i18n("Cancelled")); mTodoListView->addColumn(i18n("Categories")); mTodoListView->addColumn(i18n("Calendar")); #if 0 mTodoListView->addColumn(i18n("Sort Id")); mTodoListView->setColumnAlignment(4,AlignHCenter); #endif mTodoListView->setMinimumHeight( 60 ); mTodoListView->setItemsRenameable( true ); mTodoListView->setRenameable( 0 ); mTodoListView->setColumnWidth( 0, 120 ); int iii = 0; for ( iii = 0; iii< 10 ; ++iii ) mTodoListView->setColumnWidthMode( iii, QListView::Manual ); mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); mPriorityPopupMenu = new QPopupMenu(this); for (int i = 1; i <= 5; i++) { QString label = QString ("%1").arg (i); mPriority[mPriorityPopupMenu->insertItem (label)] = i; } connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); mPercentageCompletedPopupMenu = new QPopupMenu(this); for (int i = 0; i <= 100; i+=20) { QString label = QString ("%1 %").arg (i); mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; } connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); + mCategoryPopupMenu = new QPopupMenu (this); + mCategoryPopupMenu->setCheckable (true); + connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); + connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); + + mCalPopupMenu = new QPopupMenu (this); + mCalPopupMenu->setCheckable (true); + connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); + connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); + + + mItemPopupMenu = new QPopupMenu(this); - mItemPopupMenu->insertItem(i18n("Show..."), this, + mItemPopupMenu->insertItem(i18n("Show"), this, SLOT (showTodo())); mItemPopupMenu->insertItem(i18n("Edit..."), this, SLOT (editTodo())); mItemPopupMenu->insertItem( i18n("Delete"), this, SLOT (deleteTodo())); mItemPopupMenu->insertItem( i18n("Clone..."), this, SLOT (cloneTodo())); mItemPopupMenu->insertItem( i18n("Move..."), this, SLOT (moveTodo())); #ifndef DESKTOP_VERSION mItemPopupMenu->insertItem( i18n("Beam..."), this, SLOT (beamTodo())); #endif mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, SLOT (cancelTodo())); + mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu); + mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu); mItemPopupMenu->insertSeparator(); mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, SLOT (toggleRunningItem())); mItemPopupMenu->insertSeparator(); /* mItemPopupMenu->insertItem( i18n("New Todo..."), this, SLOT (newTodo())); */ mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, SLOT (newSubTodo())); mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, SLOT (unparentTodo()),0,21); mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, SLOT (reparentTodo()),0,22); mItemPopupMenu->insertSeparator(); #if 0 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."), this, SLOT( purgeCompleted() ) ); mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), this, SLOT( toggleCompleted() ),0, 33 ); mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), this, SLOT( toggleQuickTodo() ),0, 34 ); mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), this, SLOT( toggleRunning() ),0, 35 ); #endif mPopupMenu = new QPopupMenu(this); mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, SLOT (newTodo()),0,1); mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), this, SLOT(purgeCompleted()),0,2); mPopupMenu->insertItem(i18n("Show Completed"), this, SLOT( toggleCompleted() ),0,3 ); mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), this, SLOT( toggleRunning() ),0,5 ); mPopupMenu->insertItem(i18n(" set all open","Display all opened"), this, SLOT( setAllOpen() ),0,6 ); mPopupMenu->insertItem(i18n(" set all close","Display all closed"), this, SLOT( setAllClose() ),0,7 ); mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), this, SLOT( setAllFlat() ),0,8 ); mPopupMenu->insertSeparator(); mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), this, SLOT( toggleQuickTodo() ),0,4 ); mDocPrefs = new DocPrefs( name ); mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); mPopupMenu->setCheckable( true ); mItemPopupMenu->setCheckable( true ); mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); // Double clicking conflicts with opening/closing the subtree connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), SLOT( editItem( QListViewItem *) ) ); /* connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, const QPoint &,int ) ), SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); */ connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, const QPoint &,int ) ), SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), SLOT( itemClicked( QListViewItem * ) ) ); connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), SLOT( itemDoubleClicked( QListViewItem * ) ) ); connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), SLOT( updateView() ) ); connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), SLOT( todoModified(Todo *, int) ) ); connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), SLOT( itemStateChanged( QListViewItem * ) ) ); connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), SLOT( itemStateChanged( QListViewItem * ) ) ); connect( mTodoListView, SIGNAL( paintNeeded() ), SLOT( paintNeeded()) ); #if 0 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), SLOT(selectionChanged(QListViewItem *))); connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), SLOT(selectionChanged(QListViewItem *))); connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), SLOT(selectionChanged(QListViewItem *))); #endif connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); connect( mTodoListView, SIGNAL(selectionChanged() ), SLOT( processSelectionChange() ) ); connect( mQuickAdd, SIGNAL( returnPressed () ), SLOT( addQuickTodo() ) ); } KOTodoView::~KOTodoView() { #if QT_VERSION >= 0x030000 #else delete mKOTodoViewWhatsThis; #endif delete mDocPrefs; } QString KOTodoView::getWhatsThisText(QPoint p) { KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); if ( item ) return KIncidenceFormatter::instance()->getFormattedText( item->todo(), KOPrefs::instance()->mWTshowDetails, KOPrefs::instance()->mWTshowCreated, KOPrefs::instance()->mWTshowChanged); return i18n("That is the todo view" ); } void KOTodoView::jumpToDate () { // if (mActiveItem) { // mActiveItem->todo()); // if ( mActiveItem->todo()->hasDueDate() ) // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); } void KOTodoView::paintNeeded() { if ( mPendingUpdateBeforeRepaint ) { updateView(); mPendingUpdateBeforeRepaint = false; } } void KOTodoView::paintEvent(QPaintEvent * pevent) { if ( mPendingUpdateBeforeRepaint ) { updateView(); mPendingUpdateBeforeRepaint = false; } KOrg::BaseView::paintEvent( pevent); } void KOTodoView::updateView() { pendingSubtodo = 0; if ( mBlockUpdate ) { return; } if ( !isVisible() ) { mPendingUpdateBeforeRepaint = true; return; } //qDebug("KOTodoView::updateView() %x", this); if ( isFlatDisplay ) { displayAllFlat(); return; } storeCurrentItem(); //qDebug("update "); // kdDebug() << "KOTodoView::updateView()" << endl; QFont fo = KOPrefs::instance()->mTodoViewFont; mTodoListView->clear(); if ( mName == "todolistsmall" ) { if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { int ps = fo.pointSize() -2; if ( ps > 12 ) ps -= 2; fo.setPointSize( ps ); } } mTodoListView->setFont( fo ); // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); //mTodoListView->header()->setMaximumHeight(fm.height()); QPtrList<Todo> todoList = calendar()->todos(); /* kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; Event *t; @@ -864,514 +878,529 @@ void KOTodoView::resetCurrentItem() 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->setSelected ( foundItem, true ); mTodoListView->setCurrentItem( foundItem ); mTodoListView->ensureItemVisible( foundItem ); } else { if ( mTodoListView->firstChild () ) { mTodoListView->setSelected ( mTodoListView->firstChild (), true ); mTodoListView->setCurrentItem( mTodoListView->firstChild () ); } } } processSelectionChange(); QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); } void KOTodoView::resetFocusToList() { topLevelWidget()->setActiveWindow(); 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(); while ( incidence && !incidence->calEnabled() ) incidence = incidence->relatedTo(); if (incidence && incidence->typeID() == todoID ) { 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 ) { 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; + mCategoryPopupMenu->popup(QCursor::pos ()); break; + case 9: + mCalPopupMenu->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) { 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) +void KOTodoView::fillCategories () { - if ( !mCategoryPopupMenu ) { - mCategoryPopupMenu = new QPopupMenu (this); - mCategoryPopupMenu->setCheckable (true); - connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); - } mCategoryPopupMenu->clear(); - QStringList checkedCategories = todoItem->todo()->categories (); - + if ( ! mActiveItem ) return; + QStringList checkedCategories = mActiveItem->todo()->categories (); for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); it != KOPrefs::instance()->mCustomCategories.end (); ++it) { int index = mCategoryPopupMenu->insertItem (*it); mCategory[index] = *it; if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true); } - return mCategoryPopupMenu; +} +void KOTodoView::fillCal () +{ + mCalPopupMenu->clear(); + if (!mActiveItem) return; + bool readO = mActiveItem->todo()->isReadOnly(); + KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); + while ( kkf ) { + int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber); + if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO ) + mCalPopupMenu->setItemEnabled( index, false ); + mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID()); + kkf = KOPrefs::instance()->mCalendars.next(); + } +} +void KOTodoView::changedCal (int index ) +{ + if (!mActiveItem) return; + mActiveItem->todo()->setCalID( index ); + mActiveItem->construct(); } 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() ); int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); //qDebug("ROW %d ", row); if (!item) { newTodo(); return; } else { if ( row == 1 ) { mActiveItem = (KOTodoViewItem *) item; newSubTodo(); return; } if ( row == 5 || row == 6 || row == 2) { mActiveItem = (KOTodoViewItem *) item; Todo * t = mActiveItem->todo(); if ( t->isRunning() ) { if ( t->runTime() < 15) { t->stopRunning(); mActiveItem->construct(); topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); return; } else toggleRunningItem(); return; } else { t->setRunning( true ); mActiveItem->construct(); topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); 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() ) { KOStopTodoPrefs tp ( t, this ); if (QApplication::desktop()->width() <= 800 ){ int wid = tp.width(); int hei = tp.height(); int xx = (QApplication::desktop()->width()-wid)/2; int yy = (QApplication::desktop()->height()-hei)/2; tp.setGeometry( xx,yy,wid,hei ); } tp.exec(); mActiveItem->construct(); } else { KOStartTodoPrefs tp ( t->summary(), this ); if (QApplication::desktop()->width() <= 800 ){ int wid = tp.width(); int hei = tp.height(); int xx = (QApplication::desktop()->width()-wid)/2; int yy = (QApplication::desktop()->height()-hei)/2; tp.setGeometry( xx,yy,wid,hei ); } if ( !tp.exec() ) return; if ( tp.stopAll() ) { mCalendar->stopAllTodos(); t->setRunning( true ); updateView(); } else { 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!")); pendingSubtodo = 0; } else { Todo* newParent = todoItem->todo(); Todo* newSub = pendingSubtodo->todo(); pendingSubtodo = 0; emit reparentTodoSignal( newParent,newSub ); return; } } } void KOTodoView::setDocumentId( const QString &id ) { 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 ); diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 9ae7f53..79cc756 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -1,303 +1,305 @@ /* 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 KOTODOVIEW_H #define KOTODOVIEW_H #include <qfont.h> #include <qfontmetrics.h> #include <qlineedit.h> #include <qptrlist.h> #include <qstrlist.h> #include <qlistbox.h> #include <qpopupmenu.h> #include <qlabel.h> #include <qmap.h> #include <qdialog.h> #include <qlabel.h> #include <qlistview.h> #include <klistview.h> #include <libkcal/calendar.h> #include <libkcal/todo.h> #include <korganizer/baseview.h> #include "kotodoviewitem.h" #include "koprefs.h" #include "koglobals.h" #include "datenavigator.h" class QDragEnterEvent; class QDragMoveEvent; class QDragLeaveEvent; class QDropEvent; class KOTodoViewWhatsThis; class KDateEdit; class KOTimeEdit; class DocPrefs; class KOStopTodoPrefs : public QDialog { Q_OBJECT public: KOStopTodoPrefs( Todo* todo, QWidget *parent=0, const char *name=0 ) ; private slots: void doNotSave(); void accept(); private: Todo* mTodo; QLineEdit* mComment; KDateEdit *sde, *ede; KOTimeEdit *ste, *ete; }; class KOStartTodoPrefs : public QDialog { Q_OBJECT public: KOStartTodoPrefs( QString sum, QWidget *parent=0, const char *name=0 ) ; bool stopAll() { return mStopAll; } private slots: void doStop(); private: bool mStopAll; }; class KOTodoListView : public KListView { Q_OBJECT public: KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); virtual ~KOTodoListView() {} signals: void paintNeeded(); void todoDropped(Todo *, int); void double_Clicked(QListViewItem *item); void reparentTodoSignal( Todo *,Todo * ); void unparentTodoSignal(Todo *); void deleteTodo( Todo * ); protected: void wheelEvent (QWheelEvent *e); void contentsDragEnterEvent(QDragEnterEvent *); void contentsDragMoveEvent(QDragMoveEvent *); void contentsDragLeaveEvent(QDragLeaveEvent *); void contentsDropEvent(QDropEvent *); void contentsMousePressEvent(QMouseEvent *); void contentsMouseMoveEvent(QMouseEvent *); void contentsMouseReleaseEvent(QMouseEvent *); void contentsMouseDoubleClickEvent(QMouseEvent *); private: void paintEvent(QPaintEvent * pevent); bool internalDrop; QString mName; Calendar *mCalendar; QPoint mPressPos; bool mMousePressed; QListViewItem *mOldCurrent; bool mFlagKeyPressed; void keyPressEvent ( QKeyEvent * ) ; void keyReleaseEvent ( QKeyEvent * ) ; }; /** This is the line-edit on top of the todoview for fast addition of new todos */ class KOQuickTodo : public QLineEdit { public: KOQuickTodo(QWidget *parent=0); protected: void focusInEvent(QFocusEvent *ev); void focusOutEvent(QFocusEvent *ev); }; /** This class provides a multi-column list view of todo events. @short multi-column list view of todo events. @author Cornelius Schumacher <schumacher@kde.org> */ class KOTodoView : public KOrg::BaseView { Q_OBJECT public: KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); ~KOTodoView(); QPtrList<Incidence> selectedIncidences(); QPtrList<Todo> selectedTodos(); DateList selectedDates() {DateList q; return q;} /** Return number of shown dates. TodoView does not show dates, */ int currentDateCount() { return 0; } void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); void setDocumentId( const QString & ); void saveLayout(KConfig *config, const QString &group) const; void restoreLayout(KConfig *config, const QString &group); - /** Create a popup menu to set categories */ - QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); void setNavigator( DateNavigator* nav ) {mNavigator = nav;} QString getWhatsThisText(QPoint p); void clearList() {mTodoListView->clear(); } public slots: void updateView(); void updateConfig(); void changeEventDisplay(Event *, int); void showDates(const QDate &start, const QDate &end); void showEvents(QPtrList<Event> eventList); void clearSelection(); void jumpToDate (); void editItem(QListViewItem *item); void showItem(QListViewItem *item,const QPoint &,int); void popupMenu(QListViewItem *item,const QPoint &,int); void newTodo(); void newSubTodo(); void unparentTodo(); void reparentTodo(); void showTodo(); void editTodo(); void cloneTodo(); void cancelTodo(); void moveTodo(); void beamTodo(); void deleteTodo(); void setNewPriority(int); void setNewPercentage(int); void changedCategories(int); void setAllOpen(); void setAllClose(); void setAllFlat(); void displayAllFlat(); void purgeCompleted(); void toggleCompleted(); void toggleRunning(); void toggleQuickTodo(); void updateTodo( Todo *, int ); void itemClicked(QListViewItem *); void itemStateChanged(QListViewItem *); void modified(bool); void itemDoubleClicked(QListViewItem *item); void resetFocusToList(); + void fillCategories (); + void fillCal (); + void changedCal (int); signals: void newTodoSignal(); void newSubTodoSignal(Todo *); void unparentTodoSignal(Todo *); void reparentTodoSignal( Todo *,Todo * ); void showTodoSignal(Todo *); void editTodoSignal(Todo *); void deleteTodoSignal(Todo *); void todoModifiedSignal (Todo *, int); void isModified(bool); void cloneTodoSignal( Incidence * ); void cancelTodoSignal( Incidence * ); void moveTodoSignal( Incidence * ); void beamTodoSignal( Incidence * ); void purgeCompletedSignal(); protected slots: void toggleRunningItem(); void paintNeeded(); void processSelectionChange(); void addQuickTodo(); void setTodoModified( Todo* ); void todoModified(Todo *, int ); private: /* * the TodoEditor approach is rather unscaling in the long * run. * Korganizer keeps it in memory and we need to update * 1. make KOTodoViewItem a QObject again? * 2. add a public method for setting one todo modified? * 3. add a private method for setting a todo modified + friend here? * -- zecke 2002-07-08 */ KOTodoViewWhatsThis* mKOTodoViewWhatsThis; friend class KOTodoListView; void paintEvent(QPaintEvent * pevent); bool mPendingUpdateBeforeRepaint; friend class KOTodoViewItem; QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); void restoreItemState( QListViewItem * ); bool checkTodo( Todo * ); bool isFlatDisplay; void setOpen( QListViewItem*, bool setOpen); KOTodoListView *mTodoListView; QPopupMenu *mItemPopupMenu; QPopupMenu *mPopupMenu; QPopupMenu *mPriorityPopupMenu; QPopupMenu *mPercentageCompletedPopupMenu; QPopupMenu *mCategoryPopupMenu; + QPopupMenu *mCalPopupMenu; QMap<int, int> mPercentage; QMap<int, int> mPriority; QMap<int, QString> mCategory; KOTodoViewItem *mActiveItem; QMap<Todo *,KOTodoViewItem *> mTodoMap; QString mName; DocPrefs *mDocPrefs; QString mCurrentDoc; KOQuickTodo *mQuickAdd; bool mBlockUpdate; void keyPressEvent ( QKeyEvent * ) ; KOTodoViewItem * pendingSubtodo; DateNavigator* mNavigator; void storeCurrentItem(); void resetCurrentItem(); Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove; }; #endif |