summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt10
-rw-r--r--korganizer/koeditorgeneraltodo.cpp21
-rw-r--r--korganizer/kolistview.cpp71
-rw-r--r--korganizer/mainwindow.cpp5
-rw-r--r--libkcal/alarm.cpp0
-rw-r--r--libkcal/event.cpp8
-rw-r--r--libkcal/event.h1
-rw-r--r--libkcal/incidence.cpp29
-rw-r--r--libkcal/incidence.h3
-rw-r--r--libkcal/todo.cpp10
-rw-r--r--libkcal/todo.h1
11 files changed, 104 insertions, 55 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index f3f5333..ab8339f 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -66,195 +66,195 @@
{"Ask for every entry on conflict","Frage bei Konflikten nach"},
{ "Ask for preferences before syncing","Vor dem Syncronisieren nachfragen" },
{ "Ask for quit when closing KO/Pi","Vor dem Beenden von KO/Pi nachfragen" },
{ "Attendees","Teilnehmer" },
{ "Aug","Aug" },
{ "August","August" },
{ "Auto-Save","Automatisches Abspeichern" },
{ "Auto save delay in minutes:","Verzög.autom.Speichern in Min" },
{ "Auto saving...","Automatische Sicherung..." },
{ "Begin on:","Starte mit:" },
{ "Begins on: %1","Starte mit: %1" },
{ "<b>From:</b> %1 <b>To:</b> %2","<b>Vom:</b> %1 <b>Zum:</b> %2" },
{ "<b>On:</b> %1","<b>Am:</b> %1" },
{ "<b>On:</b> %1 <b>From:S</b> %2 <b>To:</b> %3","<b>Am:</b> %1 <b>Vom:S</b> %2 <b>Zum:</b> %3" },
{ "<b>Original event:</b><p>","<b>Original Termin:</b><p>" },
{ " - both are modified after last sync"," - beide wurden nach der letzten Syncronisation verändert" },
{ "Busy","Belegt" },
{ "&Cancel","Abbre&chen" },
{ "Cancel","Abbrechen" },
{ "Cannot delete To-Do\nwhich has children.","Kann Todo nicht löschen,\n da noch Einträge vorhanden sind" },
{ "Can't generate mail:\nNo event selected.","Kann e-Mail nicht erstellen:\nKein Termin ausgewählt." },
{ "Categories...","Kategorien..." },
{ "Categories","Kategorien" },
{ "Category","Kategorie" },
{ "Center View","Zentriere Ansicht" },
{ "Change","Ändere" },
{ "Cinema","Kino" },
{ "Clone Item","Klone Eintrag" },
{ "&Close","S&chließen" },
{ "Close","Schließen" },
{ "Close this dialog to abort deletion!","Zum Abbrechen des Löschvorganges Dialog schließen!" },
{ "Colors","Farben" },
{ "completed","erledigt" },
{ "completed on %1","erledigt am %1" },
{ "Complete","Erledigt" },
{ "Confidential","Vertraulich" },
{ "Configure...","Einstellungen..." },
{ "Confirm &deletes","Löschvogang bestätigen" },
{ "Couldn't load calendar\n '%1'.","Kann Kalender\n '%1' nicht laden." },
{ "Counter-event Viewer","Terminzähler Ansicht" },
{ "Daily ending hour:","Feierabend:" },
{ "Daily starting hour:","Anfangszeit:" },
{ "Daily","Täglich" },
{ "Date Format","Datums Format" },
{ "Date Format:","Datums Format:" },
{ "DateNavigator:(nr)","Datums Navigator" },
{ "Dates: ","Datum: " },
{ "Date && Time","Datum && Zeit" },
{ "Day begins at:","Der Tag beginnt um:" },
{ "Days in Next-X-Days:","Tage in Nächste-X-Tage:" },
{ "Days in What's Next:","Tage in What's Next:" },
{ "day(s)","Tag(e)" },
{ "Days to show in Next-X-Days view:","Welche Tage in Nächste-X-Tagen anzeigen:" },
{ "day","Tag" },
{ "Dec","Dez" },
{ "December","Dezember" },
{ "Default alarm time:","Standard Alarmzeit:" },
{ "Default appointment time:","Standard Termin Startzeit:" },
{ "Default event color:","Standard Terminfarbe:" },
{ "Default","Standard" },
{ "Def. duration of new app.:","Standard Termin Länge:" },
{ "Delete All","Lösche alles" },
{ "Delete all selected","Lösche alle Selektierten" },
{ "Delete Current","Aktuellen löschen" },
{ "Delete Event...","Lösche Termin..." },
{ "Delete Event","Lösche Termin" },
{ "&Delete...","Lösche..." },
{ "Delete...","Lösche..." },
{ "Delete","Lösche" },
{ "Delete Todo...","Lösche Todo..." },
{ "Delete To-Do","Lösche Todo" },
{ "Deleting item %d ...","Lösche Eintrag %d..." },
{ "Descriptions","Beschreibungen" },
{ "Deselect all","Deselektiere Alle" },
{ "Details","Details" },
{ "Dinner","Abendessen" },
{ "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" },
{ "Due Date","Fällig am" },
{ "Due: ","Fällig: "},
{ "Due Time","Fällig um" },
{ "Due:","Fällig:"},
{ "Duration: ","Dauer: " },
{ "Edit...","Bearbeite..." },
{ "Edit Event...","Bearbeite Termin..." },
{ "Edit Event","Bearbeite Termin" },
{ "Edit exceptions","Bearbeite Ausnahmen" },
{ "EditorBox:","Editor Fenster:" },
{ "Edit Recurrence Range","Bearbeite Wiederholung" },
{ "Edit Todo...","Berabeite Todo..." },
{ "Edit To-Do","Todo bearbeiten" },
{ "E&mail address:","E&mail Adresse:" },
{ "(EmptyEmail)","(KeineEmail)" },
{ "(EmptyName)","(KeinName)" },
{ "Enable Recurrence","Wiederholung anschalten" },
{ "End after","Endet nach"},
{ "End by:","Endet am"},
-{ "End Date","End Datum" },
+{ "End/Due Date","Ende/Fällig am" },
{ "End:","Ende:" },
-{ "End Time","End Zeit" },
+{ "End/Due Time","Ende/Fällig um" },
{ "English","Englisch" },
{ "Event","Termin" },
{ "Event list","Termin Liste" },
{ "Events","Termine" },
{ "Event Viewer:","Termin Übersicht:" },
{ "every","jede" },
{ "Exceptions...","Ausnahmen..." },
{ "Exceptions","Ausnahmen" },
{ "Exclude holidays","Ohne freie Tage" },
{ "Exclude Saturdays","Ohne Samstage" },
{ "Feb","Feb" },
{ "February","Februar" },
{ "&Find","Suche!" },
{ "Fonts","Schriftart" },
{ "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" },
{ "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"},
{ "Free","Frei" },
{ "Friday","Freitag" },
{ "Fri","Fr" },
{ "From:","Vom:" },
{ "Full &name:","Vor- und &Nachname:" },
{ "General","Allgemein" },
{ "German","Deutsch" },
{ "Gifts","Geschenke" },
{ "Go to Today","Heute anzeigen" },
{ "Help","Hilfe" },
{ "Hide Dates","Daten ausblenden" },
{ "Highlight color:","Markierungen:" },
{ "Holiday color:","Freie Tage:" },
{ "hour(s)","Stunde(n)" },
{ "In %1 days: ","In %1 Tagen: " },
{ "Incomplete Todo:","Unerledigte Aufgaben:" },
{ "Information","Information" },
{ "Invalid search expression,\ncannot perform ","Kann Suche nicht ausführen" },
{ "Jan","Jan" },
{ "January","Januar" },
{ "JournalView:","Journal Ansicht:" },
{ "Journals","Journale" },
{ "Jul","Jul" },
{ "July","Juli" },
{ "Jump to date","Springe zum Datum" },
{ "June","Juni" },
{ "Jun","Jun" },
{ "Key Bindings...","Tastenzuordnung..." },
{ "Kids","Kinder" },
{ "Known Problems...","Bekannte Probleme..." },
{ "KO/Pi Find ","KO/Pi Suchdialog " },
{ "KO/Pi Find: ","KO/Pi Suchen: " },
{ "KO/Pi is starting ... "," KO/Pi startet ... \n... Zeit für eine Kaffeepause ..." },
{ "Language:(needs restart)","Sprache (Neustart!)" },
{ "Language:","Sprache" },
{ "Large","Etwas mehr" },
{ "List View:","Listenansicht:" },
{ "List View","Listenansicht" },
{ "Load/Save","Laden/Speichern" },
{ "Load Template","Lade Vorlage" },
{ "Locale","Lokalisation" },
{ "Local temp file:","Lokale temp. Datei:" },
{ "Location: ","Ort: " },
{ "Location:","Ort:" },
{ "Mail client","Mail Programm" },
{ "Mail Client","Mail Programm" },
{ "March","März" },
{ "Mar","Mär" },
{ "May","Mai" },
{ "M. Bains line:","M. Bains Linie:" },
{ "Medium","Medium" },
{ "Method","Methode" },
{ "minute(s)","Minute(n)" },
{ "Monday","Montag" },
{ "Mon","Mo" },
{ "Monthly","Monatlich" },
{ "Month not long enough","Monat ist nicht lang genug" },
{ "month(s)","Monat(e)" },
{ "Month view:","Monatsansicht:" },
{ "Month view uses category colors","Monatsansicht zeigt Kategorie Farben" },
{ "Todo view uses category colors","Todo Ansicht zeigt Kategorie Farben" },
{ "Move &Down","Nach unten verschieben" },
{ "Move &Up","Nach oben verschieben" },
{ "Name:","Name:" },
{ "Name","Name" },
{ "\nAre you sure you want\nto delete this event?","\nSind Sie sicher, dass Sie\nden Termin löschen möchten?" },
{ "%n Days","%n Tage" },
{ "Never","Nie" },
{ "New event...","Neuer Termin..." },
{ "New event","Neuer Termin" },
{ "New Event...","Neuer Termin..." },
{ "New Events/Todos should","Neue Termine/Todos sollten" },
{ "&New","&Neu" },
{ "New","Neu", },
{ "New Sub-Todo...","Neues Sub-Todo..." },
{ "New Todo...","Neues Todo..." },
{ "Next Alarm: ","Nächster Alarm: ", },
{ "&Next Day","&Nächster Tag", },
{ "Next days view uses full window","Nächste-X-Tage nutzt Vollbild" },
{ "Next month","Nächster Monat" },
@@ -271,195 +271,195 @@
{ "[No selection]","Keine Selektion", },
{ "No sound set","Kein Sound ausgewählt", },
{ "no time ","keine Zeit ", },
{ "no time","keine Zeit", },
{ "No Time","Keine Zeit" },
{ "November","November" },
{ "Nov","Nov", },
{ "\nThis event recurs\nover multiple dates.\n","\nDieser Termin wiederholt sich an mehreren Tagen.\n" },
{ "occurrence(s)","Vorkommen" },
{ "October","Oktober" },
{ "Oct","Okt", },
{ "O-due!","Ü-fällig! " },
{ "&OK","&OK" },
{ "Ok+Show!","Ok+Anzeigen" },
{ "Organizer: %1","Organisator %1" },
{ "Organizer","Organisator" },
{ "Owner: ","Besitzer: " },
{ "Owner:","Besitzer:" },
{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" },
{ "Pick a date to display","Wähle einen Tag zum anzeigen aus" },
{ "Please specify a valid due date.","Bitte gültiges Fälligkeitsdatum angeben."},
{ "Please specify a valid end date,\nfor example '%1'.","Bitte gültiges Enddatum angeben,\nz.B.'%1'." },
{ "Please specify a valid start date.","Bitte gültiges Startdatum angeben." },
{ "Please specify a valid start date,\nfor example '%1'.","Bitte gültiges Startdatum angeben,\nz.B. '%1'." },
{ "Please specify a valid start time.","Bitte gültige Startzeit angeben."},
{ "Please specify a valid start time,\nfor example '%1'.","Bitte gültige Startzeit angeben,\nz.B. '%1'." },
{ "Preferences - some settings need a restart (nr)","Einstellungen - teilweise Neustart erforderlich (bn)" },
{ "&Previous Day","Vorheriger Tag" },
{ "Previous month","Vorheriger Monat" },
{ "Previous Month","Vorheriger Monat" },
{ "&Previous Week","Vorherige Woche" },
{ "Previous year","Vorheriges Jahr" },
{ "Previous Year","Vorheriges Jahr" },
{ "Printing","Drucken" },
{ "Priority:","Priorität:" },
{ "Private","Privat" },
{ "Proceed","Weiter" },
{ "Public","Öffentlich" },
{ "Purge","Entferne" },
{ "Purge Completed...","Entferne erledigte Todos..." },
{ "Purge Todos","Todos bereinigen" },
{ "read-only","schreibgeschützt" },
{ "Recur every","Wiederh. alle" },
{ "Recur in the month of","Wiederh. im Monat" },
{ "Recur on the","Wiederh. am" },
{ "Recur on this day","Wiederh. am diesen Tag" },
{ "Recurrence Range...","Wiederholungs Zeitraum..." },
{ "Recurrence Range","Wiederholungs Zeitraum" },
{ "Recurrence Rule","Wiederholungs Regel" },
{ "Recurrence","Wiederholung" },
{ "Recurs","Wiederholung" },
{"&Reject","Abweisen"},
{ "Reminder:","Alarm:" },
{ "Rem.:","Alarm:" },
{ "Rem.","Alarm:" },
{ "Remote file:","Remote Datei:"},
{ "Remote IP:","Remote (ferne) IP:" },
{ "Remote syncing (via ssh/scp) network settings ","Remote Sync (via ssh/scp) Netzwerk Einstellungen " },
{ "Remote user:","Remote Benutzer"},
{ "&Remove","Entfe&rnen" },
{ "Remove","Entfernen" },
{ "Request response","Bemerkung anfordern" },
{ "Role:","Rolle:" },
{ "Role","Rolle" },
{ "Sat","Sa" },
{ "Saturday","Samstag" },
{ "Search for:","Suche nach:" },
{ "Search In","Suche in" },
{ "Search...","Suche..." },
{ "Search","Suche" },
{ "Select Addresses","Wähle Adressen" },
{ "Select all","Selektiere Alle" },
{ "Select a month","Wähle Monat" },
{ "Select a week","Wähle Woche" },
{ "Select a year","Wähle Jahr" },
{ "Send directly","Sende direkt" },
{ "&Send Messages","&Sende Nachrichten", },
{ "Sep","Sep" },
{ "September","September" },
{ "Shopping","Einkaufen" },
{ "Show Dates","Zeige Daten" },
{ "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." },
{ "Show Event","Termin anzeigen" },
{ "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." },
{ "Show Marcus Bains line","Zeige Marcus Bains Linie" },
{ "Show summary after syncing","Zeige Zusammenfassung nach Sync." },
{ "Show time as:","Zeige Zeit als" },
{ "Show Todo","Todo anzeigen" },
{ "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" },
{ "&Show","Anzeigen" },
{ "Show...","Anzeigen..." },
{ "Show","Anzeigen" },
{ "Small","Klein" },
{ "Sorry","Tut mir leid" },
{"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"},
{ "Start:","Start:" },
-{ "Start Date","Start Datum" },
+{ "Start Date","Start am" },
{ "Start date: %1","Start Datum: %1" },
-{ "Start Time","Start Zeit" },
+{ "Start Time","Start um" },
{ "Status:","Status:" },
{ "Status","Status:" },
{ "Summaries","Titel" },
{ "Summary:","Titel:" },
{ "Summary","Titel" },
{ "Sunday","Sonntag" },
{ "Sun","So" },
{ "Sync preferences:","Sync Einstellungen" },
{ "Sync Prefs","Sync Einstellungen" },
{ "Syncronize","Daten abgleich" },
{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" },
{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" },
{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" },
{ "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges Todo" },
{ "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" },
{ "Template...","Vorlage..." },
{ "This day","Dieser Tag" },
{ "This is an experimental feature. ","Dieses Feature ist experimentel" },
{ "This item will be\npermanently deleted.","Dieser Eintrag wird\nkomplett gelöscht." },
{ "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." },
{ "Thu","Do" },
{ "Thursday","Donnerstag" },
{ "Time associated","Mit Zeit" },
{ "Time bar:","Uhrzeit Zeile:" },
{ "Time && Date","Zeit und Datum" },
{ "Time Format","Zeit Format" },
{ "Time Format(nr):","Zeit Format(Neustart!)" },
{ "Date Labels:","Datumsleiste:" },
{ "Time: ","Zeit: " },
{ "Timezone:","Zeitzone:" },
{ "To: ","Bis: " },
{ "To:","Bis:" },
{ "Today: ","Heute: " },
{ "Todo due today color:","Heute fällige Todos" },
{ "To-do items:","To-Do items:" },
{ "Todo overdue color:","Überfällige Todos" },
{ "Todo","Todo" },
{ "To-do view shows completed Todos","Todo Ansicht zeigt erledigte Todos" },
{ "ToDoView:","Todo Ansicht:" },
{ "Toggle Alarm","Wechsle Alarm" },
{ "Toggle Allday","Umschalten Ganztag" },
{ "Tomorrow: ","Morgen: " },
{ "Tue","Di" },
{ "Tuesday","Dienstag" },
{ "Two entries are in conflict, if: ","Zwei Einträge haben einen Konflikt, wenn:" },
{ "Unable to find template '%1'.","Kann Vorlage '%1' nicht finden." },
{ "Unknown","Unbekannt" },
{ "Up","Hinauf" },
{ "Use password (if not, ask when syncing)","Passwort: (sonst jedesmal anfragen)" },
{ "User defined","Benutzerdefiniert" },
{ "User long date:","Format langes Datum:" },
{ "User short date:","Forma kurzes Datum:" },
{ "View","Ansicht" },
{ "View Fonts","Schriftarten Ansichten" },
{ "Views","Ansichten" },
{ "Wed","Mi" },
{ "Wednesday","Mittwoch" },
{ "Week %1","Woche %1" },
{ "Weekly","Wöchentlich" },
{ "Week starts on Sunday","Woche beginnt Sonntags" },
{ "What's Next View:","What's Next Anz." },
{ "What's next ?","Was kommt als nächstes?(What's Next)" },
{ "Working Hours","Tägliche Arbeitszeit" },
{ "Working hours color:","Arbeitszeit in der Agenda Ansicht:" },
{ "Write back existing entries only","Nur exisitierende Einträge zurückschreiben" },
{ "Write back synced file","Syncronisierte Datei zurückschreiben" },
{ "Yearly","Jährlich" },
{ "year(s)","Jahr(e)" },
{ "Yes","Ja" },
{ "You have %d item(s) selected.\n","Sie haben %d Einträge ausgewählt.\n" },
{ "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." },
{ "week(s) on:","Woche(n) am: " },
{ "Full menu bar(nr)","Volle Menuleiste(bn)" },
{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" },
{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" },
{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." },
{ "Daylight start:","Sommerzeit Start:" },
{ "Daylight end:","Sommerzeit Ende:" },
{ "Time Zone","Zeitzone" },
{ "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" },
{ "%A: Monday --- %a: Mon","%A: Montag --- %a: Mon" },
{ "minutely","minütlich" },
{ "hourly","stündlich" },
{ "daily","täglich" },
{ "weekly","wöchentlich" },
{ "monthly","monatlich" },
{ "day-monthly","tag-monatlich" },
{ "month-yearly","monat-jährlich" },
{ "day-yearly","tag-jährlich" },
{ "position-yearly","pos-jährlich" },
{ "Edit item on doubleclick (if not, show)","Editiere mit Doppelklick(wenn nicht, zeige)" },
{ "Highlight current day in agenda","Hebe >>heute<< in Agenda hervor" },
{ "Use light color for highlight current day","Helle Farbe für >>heute<< Hervorhebung" },
{ "Highlight selection in Time Edit","Hebe Auswahl in Zeit Edit hervor" },
{ "Hold fullscreen on view change","Behalte Vollbild bei Ansichswechsel" },
{ "Hold non-fullscreen on view change","Behalte Nicht-Vollbild bei Ansichtsw." },
@@ -1438,106 +1438,108 @@
{ "Secrecy","Sichtbar" },
{ "male","männlich" },
{ "female","weiblich" },
{ "Hide!","Verbergen!" },
{ "Show!","Anzeigen!" },
{ "Details","Details" },
{ "Profession","Beruf" },
{ "Children","Kinder" },
{ "Department","Abteilung" },
{ "Backup cancelled","Backup abgebrochen" },
{ "Backup globally disabled","Backup global abgeschaltet" },
{ "Backup succesfully finished","Backup erfolgreich beendet" },
{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" },
{ "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" },
{ "Birthdays","Geburtstage" },
{ "KO/Pi import information!","KO/Pi Import Information!" },
{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" },
{ "Cancel - do not start"," Abbrechen - Todo nicht starten" },
{ "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" },
{ "Reload","Neu laden" },
{ "Timezone settings","Zeitzoneneinstellung" },
{ "Title: ","Titel: " },
{ "Journal from: ","Journal vom: " },
{ "Journal: %1 from ","Journal: %1 vom " },
{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" },
{ "Selected Item","Ausgewähltes Item" },
{ "Select Date...","Wähle Datum..." },
{ "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" },
{ "Change category list now!","Ändere Kategorieliste jetzt!" },
{ "Edit category list...","Ändere Kategorieliste..." },
{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" },
{ "Filepath: ","Dateipfad: " },
{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" },
{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" },
{ "Pending Suspend Alarm","Laufender Suspend Alarm" },
{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" },
{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" },
{ "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" },
{ "Alarm Options","Alarm Einstellungen" },
{ "Delete selected...","Lösche Ausgewählte..." },
{ "None","Nichts" },
{ "Selection","Auswahl" },
{ "Set categories","Setze Kategorien" },
{ "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" },
{ "Reset","Neu setzen" },
{ "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" },
{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" },
{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" },
{ "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" },
{ "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" },
{ "Edit","Edit" },
{ "Last Modified","Zuletzt geändert" },
{ "Journal viewer","Journal Anzeige" },
{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." },
{ "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." },
{ "Hide Completed","Verstecke erledigte Todos" },
{ "Show not Running","Zeige nicht Laufende" },
{ "Click to add new Todo","Klick für neues Todo!" },
{ "Show next conflict for","Zeige nächsten Konflikt für" },
{ "All events","Alle Termine" },
{ "Allday events","Ganztagestermine" },
{ "Events with time","Termine mit Zeit" },
{ "No conflict found","Kein Konflikt gefunden" },
{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" },
{ "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " },
{ "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" },
{ "The event\n%1\nconflicts with event\n%2\nat date\n%3.\n","Der Termin\n%1\nist im Konflikt mit Termin\n%2\nam Datum\n%3.\n" },
{ "KO/Pi Conflict delected","KO/Pi Konflikt erkannt" },
{ "Show date","Zeige Datum" },
{ "No problem!","Null Problemo!" },
{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" },
{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
{ "Pi-Sync Error","Pi-Sync Fehler" },
{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
{ "Receiving file from remote...","Empfange entfernte Datei..." },
{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" },
{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
{ "Writing back file ...","Schreibe Datei zurück..." },
{ "Sending back file ...","Sende Datei zurück..." },
{ "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" },
{ "Created","Angelegt" },
{ "Last Modified Sub","Zuletzt geändertes Sub" },
{ "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" },
{ "Show times on two lines","Zeige Zeiten auf zwei Zeilen" },
{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" },
+{ "Duration","Dauer" },
+{ " day"," Tag" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index 965cf47..10d9a8c 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -4,216 +4,215 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qtooltip.h>
#include <qfiledialog.h>
#include <qlayout.h>
#include <qvbox.h>
#include <qbuttongroup.h>
#include <qvgroupbox.h>
#include <qwidgetstack.h>
#include <qdatetime.h>
#include <qapplication.h>
#include <kglobal.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <krestrictedline.h>
#include <kstandarddirs.h>
#include <kfiledialog.h>
#include <kdialog.h>
#include <libkcal/todo.h>
#include <libkdepim/kdateedit.h>
#include "koprefs.h"
#include "ktimeedit.h"
#include "koeditorgeneraltodo.h"
#include "kolocationbox.h"
KOEditorGeneralTodo::KOEditorGeneralTodo(QObject* parent,
const char* name)
: KOEditorGeneral( parent, name)
{
}
KOEditorGeneralTodo::~KOEditorGeneralTodo()
{
}
void KOEditorGeneralTodo::finishSetup()
{
// QWidget::setTabOrder(mSummaryEdit, mLocationEdit);
// QWidget::setTabOrder(mLocationEdit, mDueCheck);
// QWidget::setTabOrder(mDueCheck, mDueDateEdit);
// QWidget::setTabOrder(mDueDateEdit, mDueTimeEdit);
// QWidget::setTabOrder(mDueTimeEdit, mStartCheck);
// QWidget::setTabOrder(mStartCheck, mStartDateEdit);
// QWidget::setTabOrder(mStartDateEdit, mStartTimeEdit);
// QWidget::setTabOrder(mStartTimeEdit, mTimeButton);
// QWidget::setTabOrder(mTimeButton, mCompletedCombo);
// QWidget::setTabOrder(mCompletedCombo, mPriorityCombo);
// QWidget::setTabOrder(mPriorityCombo, mAlarmButton);
// QWidget::setTabOrder(mAlarmButton, mCategoriesButton);
// QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo);
// QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit);
mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
mSummaryEdit->setFocus();
}
void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout)
{
QBoxLayout *timeLayout = new QVBoxLayout(topLayout);
QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal,
i18n("Date && Time"),parent);
timeLayout->addWidget(timeGroupBox);
timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 );
timeGroupBox->layout()->setMargin( KDialog::marginHint() );
QFrame *timeBoxFrame = new QFrame(timeGroupBox);
QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3);
layoutTimeBox->setSpacing(KDialog::spacingHintSmall());
layoutTimeBox->setColStretch( 1, 1 );
+ mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame);
+ layoutTimeBox->addWidget(mStartCheck,0,0);
+ connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool)));
+
+ mStartDateEdit = new KDateEdit(timeBoxFrame);
+ layoutTimeBox->addWidget(mStartDateEdit,0,1);
+
+ mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
+ layoutTimeBox->addWidget(mStartTimeEdit,0,2);
+
mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame);
layoutTimeBox->addWidget(mDueCheck,1,0);
connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool)));
connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm()));
mDueDateEdit = new KDateEdit(timeBoxFrame);
layoutTimeBox->addWidget(mDueDateEdit,1,1);
mDueTimeEdit = new KOTimeEdit(timeBoxFrame);
layoutTimeBox->addWidget(mDueTimeEdit,1,2);
- mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame);
- layoutTimeBox->addWidget(mStartCheck,0,0);
- connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool)));
-
- mStartDateEdit = new KDateEdit(timeBoxFrame);
- layoutTimeBox->addWidget(mStartDateEdit,0,1);
-
- mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
- layoutTimeBox->addWidget(mStartTimeEdit,0,2);
-
-
mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame);
layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1);
connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool)));
connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime)));
connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime)));
connect(mStartDateEdit, SIGNAL(dateChanged(QDate)),
this, SLOT(startDateChanged(QDate)));
// some more layouting
//layoutTimeBox->setColStretch(3,1);
}
void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
{
mCompletedCombo = new QComboBox(parent);
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 0 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 20 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 40 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 60 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n(" 80 %"));
// xgettext:no-c-format
mCompletedCombo->insertItem(i18n("100 %"));
connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int)));
topLayout->addWidget(mCompletedCombo);
mCompletedLabel = new QLabel(i18n("completed"),parent);
topLayout->addWidget(mCompletedLabel);
mCompleteDateEdit = new KDateEdit(parent);
topLayout->addWidget(mCompleteDateEdit );
mCompleteTimeEdit = new KOTimeEdit(parent);
topLayout->addWidget( mCompleteTimeEdit);
mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) );
mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) );
connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime)));
if ( QApplication::desktop()->width() <= 480 ) {
if ( QApplication::desktop()->width() < 320 )
mCompleteDateEdit->setMaximumWidth( 85 );
else
mCompleteDateEdit->setMaximumWidth( 140 );
topLayout->setSpacing( 0 );
}
}
void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout)
{
QHBox* h = new QHBox ( parent );
topLayout->addWidget( h );
QLabel *priorityLabel = new QLabel(i18n("Priority:"), h);
// topLayout->addWidget(priorityLabel);
mPriorityCombo = new QComboBox( h );
mPriorityCombo->insertItem(i18n("1 (high)"));
mPriorityCombo->insertItem(i18n("2"));
mPriorityCombo->insertItem(i18n("3"));
mPriorityCombo->insertItem(i18n("4"));
mPriorityCombo->insertItem(i18n("5 (low)"));
//topLayout->addWidget(mPriorityCombo);
}
void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout)
{
QBoxLayout *statusLayout = new QHBoxLayout(topLayout);
initCompletion( parent, statusLayout );
statusLayout->addStretch( 1 );
initPriority( parent, statusLayout );
}
void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay)
{
mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
mLocationEdit->load(KOLocationBox::LOCATION);
KOEditorGeneral::setDefaults(allDay);
mTimeButton->setChecked( !allDay );
if(mTimeButton->isChecked()) {
mTimeButton->setEnabled(true);
}
else {
mTimeButton->setEnabled(false);
}
enableTimeEdits( !allDay );
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index e7a5e0e..e560ce4 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -35,366 +35,361 @@
#include <qwhatsthis.h>
#include <qregexp.h>
#include <qpainter.h>
#include <qpaintdevicemetrics.h>
#include <klocale.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <kglobal.h>
#include <libkdepim/kpimglobalprefs.h>
#include <libkcal/calendar.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/icalformat.h>
#include <libkcal/vcalformat.h>
#include <libkcal/recurrence.h>
#include <libkcal/filestorage.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkcal/kincidenceformatter.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
#include <qapplication.h>
#endif
#ifndef KORG_NOPRINTER
#include "calprinter.h"
#endif
#include "koglobals.h"
#include "koprefs.h"
#include "kfiledialog.h"
#include "kolistview.h"
#include "koeventviewer.h"
extern QPixmap* sgListViewCompletedPix[6];
extern QPixmap* sgListViewJournalPix;
class KOListViewWhatsThis :public QWhatsThis
{
public:
KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
protected:
virtual QString text( const QPoint& p)
{
return _view->getWhatsThisText(p) ;
}
private:
QWidget* _wid;
KOListView * _view;
};
ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date )
{
mItem = item;
mDate = date;
}
ListItemVisitor::~ListItemVisitor()
{
}
bool ListItemVisitor::visit(Event *e)
{
bool ok = false;
QString start, end;
QDate ds, de;
if ( e->doesRecur() ) {
ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date();
if ( ok ) {
int days = e->dtStart().date().daysTo(e->dtEnd().date() );
start = KGlobal::locale()->formatDate(ds,true);
de = ds.addDays( days);
end = KGlobal::locale()->formatDate(de,true);
}
}
if ( ! ok ) {
start =e->dtStartDateStr();
end = e->dtEndDateStr();
ds = e->dtStart().date();
de = e->dtEnd().date();
}
mItem->setText(0,e->summary());
mItem->setText(1,start);
if ( e->doesFloat() )
mItem->setText(2,"---");
else
mItem->setText(2,e->dtStartTimeStr());
mItem->setText(3,end);
if ( e->doesFloat() )
mItem->setText(4,"---");
else
mItem->setText(4,e->dtEndTimeStr());
+ mItem->setText(5, e->durationText());
if ( e->isAlarmEnabled() ) {
- mItem->setText(5,e->alarms().first()->offsetText() );
+ mItem->setText(6,e->alarms().first()->offsetText() );
} else {
- mItem->setText(5, i18n("No"));
+ mItem->setText(6, i18n("No"));
}
- mItem->setText(6, e->recurrenceText());
+ mItem->setText(7, e->recurrenceText());
if( ! e->doesRecur() )
- mItem->setSortKey( 6, "-" );
- mItem->setText(7,"---");
- mItem->setText(8,"---");
- mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No"));
- mItem->setText(10,e->categoriesStr());
- mItem->setText(11, KOPrefs::instance()->calName( e->calID() ));
- mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true ));
+ mItem->setSortKey( 7, "-" );
+ mItem->setText(8, e->cancelled() ? i18n("Yes") : i18n("No"));
+ mItem->setText(9,e->categoriesStr());
+ mItem->setText(10, KOPrefs::instance()->calName( e->calID() ));
+ mItem->setText(11, KGlobal::locale()->formatDateTime( e->lastModified(), true, true ));
QString key;
QDate d = e->lastModified().date();
QTime t = e->lastModified().time();
key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() );
mItem->setSortKey(12,key);
t = e->doesFloat() ? QTime(0,0) : e->dtStart().time();
key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute());
mItem->setSortKey(1,key);
t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time();
key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute());
mItem->setSortKey(3,key);
return true;
}
bool ListItemVisitor::visit(Todo *t)
{
mItem->setText(0,t->summary());
if ( t->isCompleted() ) {
mItem->setSortKey(0,"99"+ t->summary().left(10));
} else
mItem->setSortKey(0,QString::number( t->percentComplete()+1 )+ t->summary().left(10));
mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20]));
if (t->hasStartDate()) {
mItem->setText(1,t->dtStartDateStr());
if (t->doesFloat()) {
mItem->setText(2,"---");
} else {
mItem->setText(2,t->dtStartTimeStr());
}
} else {
mItem->setText(1,"---");
mItem->setText(2,"---");
}
- mItem->setText(3,"---");
- mItem->setText(4,"---");
if ( t->isAlarmEnabled() ) {
- mItem->setText(5,t->alarms().first()->offsetText() );
+ mItem->setText(6,t->alarms().first()->offsetText() );
} else {
- mItem->setText(5, i18n("No"));
+ mItem->setText(6, i18n("No"));
}
- mItem->setText(6, t->recurrenceText());
+ mItem->setText(7, t->recurrenceText());
if( ! t->doesRecur() )
- mItem->setSortKey( 6, "-" );
+ mItem->setSortKey( 7, "-" );
if (t->hasDueDate()) {
- mItem->setText(7,t->dtDueDateStr());
+ mItem->setText(3,t->dtDueDateStr());
if (t->doesFloat()) {
- mItem->setText(8,"---");
+ mItem->setText(4,"---");
} else {
- mItem->setText(8,t->dtDueTimeStr());
+ mItem->setText(4,t->dtDueTimeStr());
}
} else {
- mItem->setText(7,"---");
- mItem->setText(8,"---");
+ mItem->setText(3,"---");
+ mItem->setText(4,"---");
}
- mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No"));
- mItem->setText(10,t->categoriesStr());
- mItem->setText(11, KOPrefs::instance()->calName( t->calID() ));
- mItem->setText(12, KGlobal::locale()->formatDateTime( t->lastModified(), true, true ));
+ mItem->setText(5, t->durationText());
+ mItem->setText(8, t->cancelled() ? i18n("Yes") : i18n("No"));
+ mItem->setText(9,t->categoriesStr());
+ mItem->setText(10, KOPrefs::instance()->calName( t->calID() ));
+ mItem->setText(11, KGlobal::locale()->formatDateTime( t->lastModified(), true, true ));
QString key;
QDate d = t->lastModified().date();
QTime tm = t->lastModified().time();
key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() );
- mItem->setSortKey(12,key);
+ mItem->setSortKey(11,key);
if (t->hasDueDate()) {
d = t->dtDue().date();
tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time();
key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute());
- mItem->setSortKey(7,key);
+ mItem->setSortKey(3,key);
}
if ( t->hasStartDate() ) {
d = t->dtStart().date();
tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time();
key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute());
mItem->setSortKey(1,key);
}
return true;
}
bool ListItemVisitor::visit(Journal * j)
{
QString des;
mItem->setPixmap( 0, *sgListViewJournalPix);
if ( !j->summary().isEmpty() ) {
des = j->summary();
} else {
des = j->description().left(30);
des = des.simplifyWhiteSpace ();
des.replace (QRegExp ("\\n"),"" );
des.replace (QRegExp ("\\r"),"" );
}
mItem->setText(0,des.left(25));
mItem->setSortKey(0,"0"+ des.left(25));
mItem->setText(1,j->dtStartDateStr());
mItem->setText(2,"---");
mItem->setText(3,"---");
mItem->setText(4,"---");
mItem->setText(5,"---");
mItem->setText(6,"---");
- mItem->setText(7,j->dtStartDateStr());
+ mItem->setText(7,"---");
mItem->setText(8,"---");
- mItem->setText(9,"---");
- mItem->setText(10,j->categoriesStr());
- mItem->setText(11, KOPrefs::instance()->calName( j->calID() ));
- mItem->setText(12, KGlobal::locale()->formatDateTime( j->lastModified(), true, true ));
+ mItem->setText(9,j->categoriesStr());
+ mItem->setText(10, KOPrefs::instance()->calName( j->calID() ));
+ mItem->setText(11, KGlobal::locale()->formatDateTime( j->lastModified(), true, true ));
QString key;
QDate d = j->lastModified().date();
QTime tm = j->lastModified().time();
key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() );
mItem->setSortKey(12,key);
d = j->dtStart().date();
key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
mItem->setSortKey(1,key);
mItem->setSortKey(7,key);
return true;
}
KOListView::KOListView(Calendar *calendar, QWidget *parent,
const char *name)
: KOEventView(calendar, parent, name)
{
mActiveItem = 0;
mForceShowCompletedTodos = false;
mListView = new KOListViewListView(this);
mListView->addColumn(i18n("Summary"));
mListView->addColumn(i18n("Start Date"));
mListView->addColumn(i18n("Start Time"));
- mListView->addColumn(i18n("End Date"));
- mListView->addColumn(i18n("End Time"));
+ mListView->addColumn(i18n("End/Due Date"));
+ mListView->addColumn(i18n("End/Due Time"));
+ mListView->addColumn(i18n("Duration"));
mListView->addColumn(i18n("Alarm")); // alarm set?
mListView->addColumn(i18n("Recurs")); // recurs?
- mListView->addColumn(i18n("Due Date"));
- mListView->addColumn(i18n("Due Time"));
mListView->addColumn(i18n("Cancelled"));
mListView->addColumn(i18n("Categories"));
mListView->addColumn(i18n("Calendar"));
mListView->addColumn(i18n("Last Modified"));
mListView->setColumnAlignment(0,AlignLeft);
mListView->setColumnAlignment(1,AlignLeft);
mListView->setColumnAlignment(2,AlignHCenter);
mListView->setColumnAlignment(3,AlignLeft);
mListView->setColumnAlignment(4,AlignHCenter);
mListView->setColumnAlignment(5,AlignLeft);
mListView->setColumnAlignment(6,AlignLeft);
mListView->setColumnAlignment(7,AlignLeft);
mListView->setColumnAlignment(8,AlignLeft);
mListView->setColumnAlignment(9,AlignLeft);
mListView->setColumnAlignment(10,AlignLeft);
mListView->setColumnAlignment(11,AlignLeft);
- mListView->setColumnAlignment(12,AlignLeft);
mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this);
int iii = 0;
- for ( iii = 0; iii< 13 ; ++iii )
+ for ( iii = 0; iii< 12 ; ++iii )
mListView->setColumnWidthMode( iii, QListView::Manual );
QBoxLayout *layoutTop = new QVBoxLayout(this);
layoutTop->addWidget(mListView);
mListView->setFont ( KOPrefs::instance()->mListViewFont );
mPopupMenu = eventPopup();
QPopupMenu* selPopup = new QPopupMenu ( this );
mPopupMenu->insertSeparator();
selPopup->insertItem(i18n("All"),this,
SLOT(allSelection()));
selPopup->insertItem(i18n("None"),this,
SLOT(clearSelection()));
selPopup->insertItem(i18n("Delete selected..."),this,
SLOT(deleteAll()));
mPopupMenu->insertItem(i18n("Selection"), selPopup );
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Hide all selected"),this,
SLOT(hideAll()),true);
selPopup->insertSeparator();
QPopupMenu * exportPO = new QPopupMenu ( this );
selPopup->insertItem( i18n("Export"), exportPO );
#ifdef DESKTOP_VERSION
mPopupMenu->insertSeparator();
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Print complete list..."),this,
SLOT(printList()),true);
#endif
mCalPopup = new QPopupMenu ( this );
selPopup->insertItem( i18n("Set Calendar"), mCalPopup );
selPopup->insertItem(i18n("Set categories")+"...",this,
SLOT(setCat()) );
selPopup->insertItem( i18n("Set alarm..."),this,
SLOT(setAlarm()));
#if 0
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Set categories")+"...",this,
SLOT(setCat()),true);
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Set alarm..."),this,
SLOT(setAlarm()),true);
#endif
QObject::connect(mCalPopup,SIGNAL(aboutToShow()),this,
SLOT( populateCalPopup() ));
QObject::connect(mCalPopup,SIGNAL(activated( int )),this,
SLOT( setCalendar( int ) ));
QObject::connect(mPopupMenu,SIGNAL(categoryChanged( Incidence * )),this,
SLOT( catChanged( Incidence * ) ));
exportPO->insertItem( i18n("As iCal (ics) file..."),this,
SLOT(saveToFile()));
exportPO->insertItem( i18n("As vCal (vcs) file..."),this,
SLOT(saveToFileVCS()));
exportPO->insertItem( i18n("Journal/Details..."),this,
SLOT(saveDescriptionToFile()));
// mPopupMenu->insertSeparator();
// mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
// i18n("Add Categ. to selected..."),this,
// SLOT(addCat()),true);
//mPopupMenu->insertSeparator();
#ifndef DESKTOP_VERSION
selPopup->insertSeparator();
selPopup->insertItem( i18n("Beam via IR..."),this,
SLOT(beamSelected()));
#if 0
mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
i18n("Beam via IR"),this,
SLOT(beamSelected()),true);
#endif
#endif
/*
mPopupMenu = new QPopupMenu;
mPopupMenu->insertItem(i18n("Edit Event"), this,
SLOT (editEvent()));
mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this,
SLOT (deleteEvent()));
mPopupMenu->insertSeparator();
mPopupMenu->insertItem(i18n("Show Dates"), this,
SLOT(showDates()));
mPopupMenu->insertItem(i18n("Hide Dates"), this,
SLOT(hideDates()));
*/
QObject::connect(mListView,SIGNAL( newEvent()),
this,SIGNAL(signalNewEvent()));
QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)),
this,SLOT(defaultItemAction(QListViewItem *)));
QObject::connect(mListView,SIGNAL(rightButtonPressed( QListViewItem *,
const QPoint &, int )),
this,SLOT(popupMenu(QListViewItem *,const QPoint &,int)));
QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)),
SLOT(processSelectionChange(QListViewItem *)));
QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)),
SIGNAL(showIncidenceSignal(Incidence *)) );
readSettings(KOGlobals::config(),"KOListView Layout");
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 77d0ac8..98a820d 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -132,193 +132,196 @@ QPixmap* sgListViewCompletedPix[6];
QPixmap* sgListViewJournalPix;
int globalFlagBlockStartup;
MainWindow::MainWindow( QWidget *parent, const char *name ) :
QMainWindow( parent, name )
{
sgListViewCompletedPix[5] = &listviewPix;
sgListViewCompletedPix[0] = &listviewPix0;
sgListViewCompletedPix[1] = &listviewPix20;
sgListViewCompletedPix[2] = &listviewPix40;
sgListViewCompletedPix[3] = &listviewPix60;
sgListViewCompletedPix[4] = &listviewPix80;
//int size = 12;
{
sgListViewCompletedPix[5]->resize( 11, 11 );
sgListViewCompletedPix[5]->fill( Qt::white );
QPainter p ( sgListViewCompletedPix[5] );
p.drawRect( 0,0,11,11);
p.drawLine ( 2, 5, 4 , 7 ) ;
p.drawLine ( 4 , 7 , 8, 3) ;
int iii = 0;
for ( iii = 0; iii < 5; ++iii ) {
sgListViewCompletedPix[iii]->resize( 11, 11 );
sgListViewCompletedPix[iii]->fill( Qt::white );
QPainter p ( sgListViewCompletedPix[iii] );
p.drawRect( 0,0,11,11);
if ( iii )
p.fillRect( 1,1,iii*2,9,Qt::gray );
}
sgListViewJournalPix = &journalPix;
sgListViewJournalPix->resize( 11, 11 );
sgListViewJournalPix->fill( Qt::white );
{
QPainter p ( sgListViewJournalPix );
p.drawRect( 0,0,11,11);
p.drawLine( 2,3,5,3);
p.drawLine( 2,5,8,5);
p.drawLine( 2,7,6,7);
}
}
mClosed = false;
//QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
QString confFile = locateLocal("config","korganizerrc");
QFileInfo finf ( confFile );
bool showWarning = !finf.exists();
setIcon(SmallIcon( "ko24" ) );
mBlockAtStartup = true;
mFlagKeyPressed = false;
setCaption("KO/Pi");
KOPrefs *p = KOPrefs::instance();
//KPimGlobalPrefs::instance()->setGlobalConfig();
p->mCurrentDisplayedView = 0;
if ( p->mHourSize > 22 )
p->mHourSize = 22;
QMainWindow::ToolBarDock tbd;
if ( p->mToolBarHor ) {
if ( p->mToolBarUp )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUp )
tbd = Right;
else
tbd = Left;
}
if ( KOPrefs::instance()->mUseAppColors )
QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
globalFlagBlockStartup = 1;
iconToolBar = new QPEToolBar( this );
addToolBar (iconToolBar , tbd );
#ifdef DESKTOP_VERSION
if ( KOPrefs::instance()->mShowIconFilter )
#else
if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
#endif
{
if ( p->mToolBarHorF ) {
if ( p->mToolBarUpF )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUpF )
tbd = Right;
else
tbd = Left;
}
filterToolBar = new QPEToolBar ( this );
filterMenubar = new KMenuBar( 0 );
QFontMetrics fm ( filterMenubar->font() );
-
+#ifndef DESKTOP_VERSION
+ filterToolBar->setFocusPolicy( NoFocus );
+ filterMenubar->setFocusPolicy( NoFocus );
+#endif
filterPopupMenu = new QPopupMenu( this );
filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
QString addTest = "A";
filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
#ifdef DESKTOP_VERSION
addTest = "AAABBBCCCx";
#else
addTest = "AAx";
#endif
filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
addToolBar (filterToolBar , tbd );
connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
filterToolBar->hide();
} else {
filterToolBar = 0;
filterMenubar = 0;
filterPopupMenu = 0;
}
if ( p->mShowIconOnetoolbar ) {
viewToolBar = iconToolBar ;
navigatorToolBar = iconToolBar ;
} else {
#ifndef DESKTOP_VERSION
setToolBarsMovable( false );
#endif
if ( p->mToolBarHorV ) {
if ( p->mToolBarUpV )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUpV )
tbd = Right;
else
tbd = Left;
}
viewToolBar = new QPEToolBar( this );
addToolBar (viewToolBar , tbd );
if ( p->mToolBarHorN ) {
if ( p->mToolBarUpN )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUpN )
tbd = Right;
else
tbd = Left;
}
navigatorToolBar = new QPEToolBar( this );
addToolBar (navigatorToolBar , tbd );
}
mCalendarModifiedFlag = false;
QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
splash->setAlignment ( AlignCenter );
setCentralWidget( splash );
#ifndef DESKTOP_VERSION
showMaximized();
#endif
//qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
setDefaultPreferences();
mCalendar = new CalendarLocal();
mView = new CalendarView( mCalendar, this,"mCalendar " );
mView->hide();
//mView->resize(splash->size() );
initActions();
mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
mSyncManager->setBlockSave(false);
mView->setSyncManager(mSyncManager);
#ifndef DESKTOP_VERSION
iconToolBar->show();
qApp->processEvents();
#endif
//qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
int vh = height() ;
int vw = width();
//qDebug("Toolbar hei %d ",iconToolBar->height() );
if ( iconToolBar->orientation () == Qt:: Horizontal ) {
vh -= iconToolBar->height();
} else {
vw -= iconToolBar->height();
}
//mView->setMaximumSize( splash->size() );
//mView->resize( splash->size() );
//qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
mView->readSettings();
bool newFile = false;
if( !QFile::exists( defaultFileName() ) ) {
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp
index 79e0464..3157214 100644
--- a/libkcal/alarm.cpp
+++ b/libkcal/alarm.cpp
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index 0766fd9..fdf5657 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -321,96 +321,104 @@ bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime*
incidenceStart = incidenceStart.addSecs( -300 );
else
testincidenceStart = testincidenceStart.addSecs( -300 );
int count = 0;
ok = true;
int countbreak = 2000;
QDateTime stopSearch;
bool testStop = false;
if ( startDT ) {
stopSearch = startDT->addDays( 365*3 );
testStop = true;
}
while ( ok ) {
++count;
if ( count > countbreak ) break;
if ( computeThis ) {
if ( testStop )
if ( testincidenceStart > stopSearch )
break;
incidenceStart = getNextOccurence( incidenceStart.addSecs( 60 ), &ok );
}
else {
if ( testStop )
if ( incidenceStart > stopSearch )
break;
testincidenceStart = testEvent->getNextOccurence( testincidenceStart.addSecs( 60 ), &ok );
}
if ( ok ) {
if ( incidenceStart < testincidenceStart.addSecs( testduration ) && testincidenceStart < incidenceStart.addSecs( duration ) ) {
if ( incidenceStart < testincidenceStart )
*overlapDT = testincidenceStart;
else
*overlapDT = incidenceStart;
if ( startDT ) {
if ( *overlapDT >= *startDT )
return true;
} else
return true;
}
computeThis = ( incidenceStart < testincidenceStart );
}
}
//qDebug("%d rec counter stopped at %d - %s %s", ok ,count, summary().latin1(),testEvent->summary().latin1() );
return false;
}
QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
{
*ok = false;
if ( !alarmEnabled() )
return QDateTime ();
bool yes;
QDateTime incidenceStart = getNextOccurence( start_dt, &yes );
if ( ! yes || cancelled() ) {
*ok = false;
return QDateTime ();
}
bool enabled = false;
Alarm* alarm;
int off = 0;
QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
// if ( QDateTime::currentDateTime() > incidenceStart ){
// *ok = false;
// return incidenceStart;
// }
for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
if (alarm->enabled()) {
if ( alarm->hasTime () ) {
if ( alarm->time() < alarmStart ) {
alarmStart = alarm->time();
enabled = true;
off = alarmStart.secsTo( incidenceStart );
}
} else {
int secs = alarm->startOffset().asSeconds();
if ( incidenceStart.addSecs( secs ) < alarmStart ) {
alarmStart = incidenceStart.addSecs( secs );
enabled = true;
off = -secs;
}
}
}
}
if ( enabled ) {
if ( alarmStart > start_dt ) {
*ok = true;
* offset = off;
return alarmStart;
}
}
*ok = false;
return QDateTime ();
}
+
+QString Event::durationText()
+{
+ int sec = mDtStart.secsTo( mDtEnd );
+ if ( doesFloat() )
+ sec += 86400;
+ return durationText4Time( sec );
+}
diff --git a/libkcal/event.h b/libkcal/event.h
index 2da9770..6a58618 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -1,94 +1,95 @@
/*
This file is part of libkcal.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef EVENT_H
#define EVENT_H
//
// Event component, representing a VEVENT object
//
#include "incidence.h"
namespace KCal {
/**
This class provides an Event in the sense of RFC2445.
*/
class Event : public Incidence
{
public:
enum Transparency { Opaque, Transparent };
typedef ListBase<Event> List;
Event();
Event(const Event &);
~Event();
bool matchTime(QDateTime*startDT, QDateTime* endDT);
QCString type() const { return "Event"; }
IncTypeID typeID() const { return eventID; }
Incidence *clone();
QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
/** for setting an event's ending date/time with a QDateTime. */
void setDtEnd(const QDateTime &dtEnd);
/** Return the event's ending date/time as a QDateTime. */
virtual QDateTime dtEnd() const;
/** returns an event's end time as a string formatted according to the
users locale settings */
QString dtEndTimeStr() const;
/** returns an event's end date as a string formatted according to the
users locale settings */
QString dtEndDateStr(bool shortfmt=true) const;
/** returns an event's end date and time as a string formatted according
to the users locale settings */
QString dtEndStr(bool shortfmt=true) const;
void setHasEndDate(bool);
/** Return whether the event has an end date/time. */
bool hasEndDate() const;
/** Return true if the event spans multiple days, otherwise return false. */
bool isMultiDay() const;
/** set the event's time transparency level. */
void setTransparency(Transparency transparency);
/** get the event's time transparency level. */
Transparency transparency() const;
void setDuration(int seconds);
bool contains ( Event*);
bool isOverlapping ( Event*, QDateTime*, QDateTime* );
+ QString durationText();
private:
bool accept(Visitor &v) { return v.visit(this); }
QDateTime mDtEnd;
bool mHasEndDate;
Transparency mTransparency;
};
bool operator==( const Event&, const Event& );
}
#endif
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 4643a3a..201f593 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -7,193 +7,222 @@
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <kglobal.h>
#include <klocale.h>
#include <kdebug.h>
#include "calformat.h"
#include "incidence.h"
#include "todo.h"
using namespace KCal;
Incidence::Incidence() :
IncidenceBase(),
mRelatedTo(0), mSecrecy(SecrecyPublic), mPriority(3)
{
mRecurrence = 0;//new Recurrence(this);
mCancelled = false;
recreate();
mHasStartDate = true;
mAlarms.setAutoDelete(true);
mAttachments.setAutoDelete(true);
mHasRecurrenceID = false;
mHoliday = false;
mBirthday = false;
mAnniversary = false;
}
Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
{
// TODO: reenable attributes currently commented out.
mRevision = i.mRevision;
mCreated = i.mCreated;
mDescription = i.mDescription;
mSummary = i.mSummary;
mCategories = i.mCategories;
// Incidence *mRelatedTo; Incidence *mRelatedTo;
mRelatedTo = 0;
mRelatedToUid = i.mRelatedToUid;
// QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations;
mExDates = i.mExDates;
mAttachments = i.mAttachments;
mResources = i.mResources;
mSecrecy = i.mSecrecy;
mPriority = i.mPriority;
mLocation = i.mLocation;
mCancelled = i.mCancelled;
mHasStartDate = i.mHasStartDate;
QPtrListIterator<Alarm> it( i.mAlarms );
const Alarm *a;
while( (a = it.current()) ) {
Alarm *b = new Alarm( *a );
b->setParent( this );
mAlarms.append( b );
++it;
}
mAlarms.setAutoDelete(true);
mHasRecurrenceID = i.mHasRecurrenceID;
mRecurrenceID = i.mRecurrenceID;
if ( i.mRecurrence )
mRecurrence = new Recurrence( *(i.mRecurrence), this );
else
mRecurrence = 0;
mHoliday = i.mHoliday ;
mBirthday = i.mBirthday;
mAnniversary = i.mAnniversary;
}
Incidence::~Incidence()
{
Incidence *ev;
QPtrList<Incidence> Relations = relations();
for (ev=Relations.first();ev;ev=Relations.next()) {
if (ev->relatedTo() == this) ev->setRelatedTo(0);
}
if (relatedTo()) relatedTo()->removeRelation(this);
if ( mRecurrence )
delete mRecurrence;
}
+QString Incidence::durationText()
+{
+ return "---";
+}
+QString Incidence::durationText4Time( int offset )
+{
+ int min = offset/60;
+ int hours = min /60;
+ min = min % 60;
+ int days = hours /24;
+ hours = hours % 24;
+
+ if ( doesFloat() || ( min == 0 && hours == 0 ) ) {
+ if ( days == 1 )
+ return "1" + i18n(" day");
+ else
+ return QString::number( days )+ i18n(" days");
+ }
+ QString message = QString::number ( hours ) +":";
+ if ( min < 10 ) message += "0";
+ message += QString::number ( min );
+ if ( days > 0 ) {
+ if ( days == 1 )
+ message = "1" + i18n(" day") + " "+message;
+ else
+ message = QString::number( days )+ i18n(" days") + " "+message;
+ }
+ return message;
+}
bool Incidence::isHoliday() const
{
return mHoliday;
}
bool Incidence::isBirthday() const
{
return mBirthday ;
}
bool Incidence::isAnniversary() const
{
return mAnniversary ;
}
bool Incidence::hasRecurrenceID() const
{
return mHasRecurrenceID;
}
void Incidence::setHasRecurrenceID( bool b )
{
mHasRecurrenceID = b;
}
void Incidence::setRecurrenceID(QDateTime d)
{
mRecurrenceID = d;
mHasRecurrenceID = true;
updated();
}
QDateTime Incidence::recurrenceID () const
{
return mRecurrenceID;
}
bool Incidence::cancelled() const
{
return mCancelled;
}
void Incidence::setCancelled( bool b )
{
mCancelled = b;
updated();
}
bool Incidence::hasStartDate() const
{
return mHasStartDate;
}
void Incidence::setHasStartDate(bool f)
{
if (mReadOnly) return;
mHasStartDate = f;
updated();
}
// A string comparison that considers that null and empty are the same
static bool stringCompare( const QString& s1, const QString& s2 )
{
if ( s1.isEmpty() && s2.isEmpty() )
return true;
return s1 == s2;
}
bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
{
if( i1.alarms().count() != i2.alarms().count() ) {
return false; // no need to check further
}
if ( i1.alarms().count() > 0 ) {
if ( !( *(i1.alarms().first()) == *(i2.alarms().first())) )
{
qDebug("alarm not equal ");
return false;
}
}
#if 0
QPtrListIterator<Alarm> a1( i1.alarms() );
QPtrListIterator<Alarm> a2( i2.alarms() );
for( ; a1.current() && a2.current(); ++a1, ++a2 ) {
if( *a1.current() == *a2.current() ) {
continue;
}
else {
return false;
}
}
#endif
if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) {
if ( i1.hasRecurrenceID() ) {
if ( i1.recurrenceID() != i2.recurrenceID() )
return false;
}
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index 8519f01..88df217 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -188,135 +188,136 @@ class Incidence : public IncidenceBase
void setExDates(const char *dates);
/** Add a date to the list of exceptions of the recurrence rule. */
void addExDate(const QDate &date);
/** returns true if there is an exception for this date in the recurrence
rule set, or false otherwise. */
bool isException(const QDate &qd) const;
/** add attachment to this event */
void addAttachment(Attachment *attachment);
/** remove and delete a specific attachment */
void deleteAttachment(Attachment *attachment);
/** remove and delete all attachments with this mime type */
void deleteAttachments(const QString& mime);
/** return list of all associated attachments */
QPtrList<Attachment> attachments() const;
/** find a list of attachments with this mime type */
QPtrList<Attachment> attachments(const QString& mime) const;
/** sets the event's status the value specified. See the enumeration
* above for possible values. */
void setSecrecy(int);
/** return the event's secrecy. */
int secrecy() const;
/** return the event's secrecy in string format. */
QString secrecyStr() const;
/** return list of all availbale secrecy classes */
static QStringList secrecyList();
/** return human-readable name of secrecy class */
static QString secrecyName(int);
/** returns TRUE if the date specified is one on which the event will
* recur. */
bool recursOn(const QDate &qd) const;
// VEVENT and VTODO, but not VJOURNAL (move to EventBase class?):
/** set resources used, such as Office, Car, etc. */
void setResources(const QStringList &resources);
/** return list of current resources */
QStringList resources() const;
/** set the event's priority, 0 is undefined, 1 highest (decreasing order) */
void setPriority(int priority);
/** get the event's priority */
int priority() const;
/** All alarms that are associated with this incidence */
QPtrList<Alarm> alarms() const;
/** Create a new alarm which is associated with this incidence */
Alarm* newAlarm();
/** Add an alarm which is associated with this incidence */
void addAlarm(Alarm*);
/** Remove an alarm that is associated with this incidence */
void removeAlarm(Alarm*);
/** Remove all alarms that are associated with this incidence */
void clearAlarms();
/** return whether any alarm associated with this incidence is enabled */
bool isAlarmEnabled() const;
/**
Return the recurrence rule associated with this incidence. If there is
none, returns an appropriate (non-0) object.
*/
Recurrence *recurrence();
void setRecurrence(Recurrence * r);
/**
Forward to Recurrence::doesRecur().
*/
ushort doesRecur() const;
/** set the event's/todo's location. Do _not_ use it with journal */
void setLocation(const QString &location);
/** return the event's/todo's location. Do _not_ use it with journal */
QString location() const;
/** returns TRUE or FALSE depending on whether the todo has a start date */
bool hasStartDate() const;
/** sets the event's hasStartDate value. */
void setHasStartDate(bool f);
QDateTime getNextOccurence( const QDateTime& dt, bool* yes ) const;
bool cancelled() const;
void setCancelled( bool b );
bool hasRecurrenceID() const;
void setHasRecurrenceID( bool b );
void setRecurrenceID(QDateTime);
QDateTime recurrenceID () const;
QDateTime dtStart() const;
bool isHoliday() const;
bool isBirthday() const;
bool isAnniversary() const;
QDateTime lastModifiedSub();
QString recurrenceText() const;
void setLastModifiedSubInvalid();
-
+ virtual QString durationText();
+ QString durationText4Time( int secs );
Recurrence *mRecurrence;
protected:
QPtrList<Alarm> mAlarms;
QPtrList<Incidence> mRelations;
QDateTime mRecurrenceID;
bool mHasRecurrenceID;
private:
void checkCategories();
bool mHoliday, mBirthday, mAnniversary;
int mRevision;
bool mCancelled;
// base components of jounal, event and todo
QDateTime mCreated;
QDateTime mLastModifiedSub;
QString mDescription;
QString mSummary;
QStringList mCategories;
Incidence *mRelatedTo;
QString mRelatedToUid;
DateList mExDates;
QPtrList<Attachment> mAttachments;
QStringList mResources;
bool mHasStartDate; // if todo has associated start date
int mSecrecy;
int mPriority; // 1 = highest, 2 = less, etc.
//QPtrList<Alarm> mAlarms;
QString mLocation;
};
bool operator==( const Incidence&, const Incidence& );
}
#endif
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 7bf756a..e4508a0 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -521,96 +521,106 @@ bool Todo::setRecurDates()
return false;
} else {
setHasRecurrenceID( false );
recurrence()->unsetRecurs();
}
return true;
}
void Todo::setPercentComplete(int v)
{
if ( mHasRecurrenceID && v == 100 && mPercentComplete != 100 ) {
if ( !setRecurDates() )
v = 0;
}
mPercentComplete = v;
if ( v != 100 )
mHasCompletedDate = false;
updated();
}
QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
{
*ok = false;
if ( ! hasDueDate() || cancelled() || !alarmEnabled() ) {
return QDateTime ();
}
// if the recurring todo is set to complete and requested time < start time of todo
// we want to get the alarm.
bool iscompleted = isCompleted();
if ( iscompleted && doesRecur() ) {
Todo * to = (Todo*) this;
to->checkSetCompletedFalse();
iscompleted = isCompleted();
if ( hasStartDate() && start_dt < dtStart() ){
iscompleted = false;
}
}
if ( iscompleted ) {
return QDateTime ();
}
QDateTime incidenceStart;
incidenceStart = dtDue();
bool enabled = false;
Alarm* alarm;
int off = 0;
QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
// if ( QDateTime::currentDateTime() > incidenceStart ){
// *ok = false;
// return incidenceStart;
// }
for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
if (alarm->enabled()) {
if ( alarm->hasTime () ) {
if ( alarm->time() < alarmStart ) {
alarmStart = alarm->time();
enabled = true;
off = alarmStart.secsTo( incidenceStart );
}
} else {
int secs = alarm->startOffset().asSeconds();
if ( incidenceStart.addSecs( secs ) < alarmStart ) {
alarmStart = incidenceStart.addSecs( secs );
enabled = true;
off = -secs;
}
}
}
}
if ( enabled ) {
if ( alarmStart > start_dt ) {
*ok = true;
* offset = off;
return alarmStart;
}
}
*ok = false;
return QDateTime ();
}
void Todo::checkSetCompletedFalse()
{
if ( !mHasRecurrenceID ) {
qDebug("ERROR 1 in Todo::checkSetCompletedFalse");
return;
}
// qDebug("Todo::checkSetCompletedFalse()");
//qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
if ( mPercentComplete == 100 ) {
QDateTime dt = QDateTime::currentDateTime();
if ( dt > mDtStart && dt > mRecurrenceID ) {
qDebug("start: %s --due: %s --recID: %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
setCompleted( false );
qDebug("Todo::checkSetCompletedFalse ");
}
}
}
+QString Todo::durationText()
+{
+ if ( mHasDueDate && hasStartDate() ) {
+ int sec = dtStart().secsTo( dtDue() );
+ if ( doesFloat() )
+ sec += 86400;
+ return durationText4Time( sec );
+ }
+ return "---";
+}
diff --git a/libkcal/todo.h b/libkcal/todo.h
index 425dfad..7feb32e 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -37,119 +37,120 @@ namespace KCal {
Q_OBJECT
public:
Todo();
Todo(const Todo &);
~Todo();
typedef ListBase<Todo> List;
QCString type() const { return "Todo"; }
IncTypeID typeID() const { return todoID; }
/** Return an exact copy of this todo. */
Incidence *clone();
QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const;
/** for setting the todo's due date/time with a QDateTime. */
void setDtDue(const QDateTime &dtDue);
/** returns an event's Due date/time as a QDateTime. */
QDateTime dtDue() const;
/** returns an event's due time as a string formatted according to the
users locale settings */
QString dtDueTimeStr() const;
/** returns an event's due date as a string formatted according to the
users locale settings */
QString dtDueDateStr(bool shortfmt=true) const;
/** returns an event's due date and time as a string formatted according
to the users locale settings */
QString dtDueStr(bool shortfmt=true) const;
/** returns TRUE or FALSE depending on whether the todo has a due date */
bool hasDueDate() const;
/** sets the event's hasDueDate value. */
void setHasDueDate(bool f);
/*
Looks for a subtodo (including itself ) which is not complete and is
- overdue, or
- due today.
It returns 0 for nothing found,
1 for found a todo which is due today and no overdue found
2 for found a overdue todo
*/
int hasDueSubTodo( bool checkSubtodos = true );
/* same as above, but a specific date can be specified*/
int hasDueSubTodoForDate( const QDate & date, bool checkSubtodos );
/** sets the event's status to the string specified. The string
* must be a recognized value for the status field, i.e. a string
* equivalent of the possible status enumerations previously described. */
// void setStatus(const QString &statStr);
/** sets the event's status to the value specified. See the enumeration
* above for possible values. */
// void setStatus(int);
/** return the event's status. */
// int status() const;
/** return the event's status in string format. */
// QString statusStr() const;
/** return, if this todo is completed */
bool isCompleted() const;
/** set completed state of this todo */
void setCompleted(bool);
/**
Return how many percent of the task are completed. Returns a value
between 0 and 100.
*/
int percentComplete() const;
/**
Set how many percent of the task are completed. Valid values are in the
range from 0 to 100.
*/
void setPercentComplete(int);
/** return date and time when todo was completed */
QDateTime completed() const;
QString completedStr(bool shortF = true) const;
/** set date and time of completion */
void setCompleted(const QDateTime &completed);
/** Return true, if todo has a date associated with completion */
bool hasCompletedDate() const;
bool contains ( Todo*);
void checkSetCompletedFalse();
bool setRecurDates();
bool isRunning() {return mRunning;}
bool hasRunningSub();
void setRunning( bool );
void setRunningFalse( QString );
void stopRunning();
int runTime();
QDateTime runStart () const { return mRunStart;}
void saveRunningInfo( QString comment, QDateTime start, QDateTime end );
public slots:
void saveRunningInfoToFile( QString st );
void saveRunningInfoToFile( );
void saveParents();
+ QString durationText();
private:
bool mRunning;
QTimer * mRunSaveTimer;
QDateTime mRunStart;
QDateTime mRunEnd;
bool accept(Visitor &v) { return v.visit(this); }
QDateTime mDtDue; // due date of todo
bool mHasDueDate; // if todo has associated due date
// int mStatus; // confirmed/delegated/tentative/etc
QDateTime mCompleted;
bool mHasCompletedDate;
int mPercentComplete;
};
bool operator==( const Todo&, const Todo& );
}
#endif