author | zautrix <zautrix> | 2005-02-09 13:22:06 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-09 13:22:06 (UTC) |
commit | c3dd5bfd446b893a8b39ddec425a6cf8deff2261 (patch) (side-by-side diff) | |
tree | d0dd74c17fd6101da1d6c403c85924c58bc1ac9b | |
parent | 940cdd0fd1349e7f8e53adff0595c1d946322ef1 (diff) | |
download | kdepimpi-c3dd5bfd446b893a8b39ddec425a6cf8deff2261.zip kdepimpi-c3dd5bfd446b893a8b39ddec425a6cf8deff2261.tar.gz kdepimpi-c3dd5bfd446b893a8b39ddec425a6cf8deff2261.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 12 | ||||
-rw-r--r-- | korganizer/koeditorgeneralevent.cpp | 8 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 2 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 10 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 6 | ||||
-rw-r--r-- | libkdepim/kdateedit.cpp | 9 |
6 files changed, 26 insertions, 21 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 4f29ca3..6587eaa 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -167,261 +167,261 @@ { "End Time","End Zeit" }, { "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","Localisation" }, { "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","To-Do 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" }, { "&Next Week","&Nächste Woche" }, { "Next year","Nächstes Jahr" }, { "Next Year","Nächstes Jahr" }, { "%n h","%n Std" }, { "No ending date","Kein End-Datum", }, { "No event, nothing to do.","Kein Termin, nichts zu tun.", }, { "No event selected.","Kein Termin selektiert" }, { "No","Nein" }, { "No program set","Kein Programm ausgewählt", }, { "Normal","Normal" }, { "[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, for example '%1'.","Bitte gültiges Enddatum angeben, z.B.'%1'." }, +{ "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, for example '%1'.","Bitte gültiges Startdatum angeben, z.B. '%1'." }, +{ "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, for example '%1'.","Bitte gültige Startzeit angeben, z.B. '%1'." }, +{ "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 To-Dos","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" }, { "Use short date in (WN/E) view","Kurzdatum in (WN/Termin) Ansicht" }, { "Show Dates","Zeige Daten" }, { "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." }, { "Show Event...","Zeige Termin..." }, { "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...","Zeige To-Do" }, { "Show topmost todo prios in What's N.:","Anz. höchster Prios in What's N.:"}, { "Show topmost todo prios in What's Next:","Anz. höchster Prios in What's Next:"}, { "Show vertical screen (Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" }, { "&Show","Zeige" }, { "Show...","Zeige..." }, { "Show","Zeige" }, { "Small","Klein" }, { "Sorry","Entschuldigung" }, {"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, { "Start:","Start:" }, { "Start Date","Start Datum" }, { "Start date: %1","Start Datum: %1" }, { "Start Time","Start Zeit" }, { "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 To-Do" }, { "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 To-Do's" }, { "To-do items:","To-Do items:" }, { "Todo overdue color:","Überfällige To-Do's" }, { "Todo","Todo" }, { "To-do view shows completed Todos","To-do Ansicht zeigt erledigte To-dos" }, { "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:" }, @@ -1107,138 +1107,138 @@ { "% completed","% komplett" }, { "%d item(s) found.","%d Item(s) gefunden." }, { "Set complete","Setze auf erledigt" }, { "(cancelled)","(gecancelt)" }, { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, { " Local time "," Locale Zeit " }, { "Form2","Form2" }, { "Filter enabled","Filter angeschaltet" }, { "Edit Filters","Ändere Filter" }, { "Print What's Next View...","Drucke What's Next Ansicht..." }, { "Agenda","Agenda" }, { " ("," (" }, { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, { "Print","Print" }, { "&Setup Printer...","Drucker &Setup..." }, { "View Type","Zeige Typ" }, { "Page &orientation:","Seiten Ausrichtung:" }, { "Use Default of Selected Style","Default des selektierten Stils" }, { "Use Default Setting of Printer","Default Einstellung des Druckers" }, { "Portrait","Portrait" }, { "Landscape","Landschaft" }, { "Print day","Drucke Tag" }, { "CalPrintDay_Base","CalPrintDay_Base" }, { "Date && Time Range","Datum && Zeitspanne" }, { "&End date:","&Enddatum:" }, { "&Start date:","&Startdatum:" }, { "Start &time:","Startzeit:" }, { "End ti&me:","Endzeit:" }, { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, { "Alt+D","Alt+D" }, { "&Use colors","Nutze Farben" }, { "Alt+U","Alt+U" }, { "Print week","Drucke Woche" }, { "CalPrintWeek_Base","CalPrintWeek_Base" }, { "Use &colors","Nutze Farben" }, { "Type of View","Typ der Ansicht" }, { "Print as &Filofax page","Drucke als &Filofax Seite" }, { "Alt+F","Alt+F" }, { "Print as &timetable view:","Drucke als Zeittabelle:" }, { "Alt+T","Alt+T" }, { "Print as split week view","Drucke als gesplittete Wochenansicht" }, { "Print month","Drucke Monat" }, { "CalPrintMonth_Base","CalPrintMonth_Base" }, { "&Start month:","&Startmonat:" }, { "&End month:","&Endmonat:" }, { "Print week &numbers","Drucke Wochen Nummer(n)" }, { "Print todos","Drucke Todos" }, { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, { "Include &description of the item","Inclusive Itembeschreibung" }, { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, { "Include &priority of the item","Inclusive Priorität des Items" }, { "Items to Print","Zu druckende Items" }, { "&From:","Von:" }, { "&To:","Bis:" }, { "Print &all todo items","Drucke alle Todo Items" }, { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, { "Todo List","Todo Liste" }, { "&Title:","&Titel:" }, { "Co&nnect subtodos with its parent","Verbinde Unter-Todos 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 Unter-Todos.\nAlle erledigten Unter-Todos\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" }, { "Next month","Nächster Monat" }, { "Journal view","Journal" }, { "Display all opened","Zeige alle geöffnet" }, { "Display all closed","Zeige alle geschlossen" }, { "Display all flat","Zeige alle flach" }, { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, { "Default todo done color:","Standard Todo erledigt Farbe" }, { "Select week %1-%2","Wähle Woche %1-%2" }, { "Select Week","Wähle Woche" }, { "Set alarm for selected...","Setze Alarm für Selekt..." }, { "Set Alarm!","Setze Alarm!" }, { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, { " and "," und " }, { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, { "Mail to selected","Mail an Ausgewählte" }, { "Mail to all","Mail an Alle" }, { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, { " on"," am" }, { " completed on "," erledigt am " }, { "Save as Event template","Speichere als Vorlage" }, { "Load Event template","Lade Termin Vorlage" }, { "Save as Journal template","Speichere als Journal Vorlage" }, { "Insert Journal template","Füge Journal Vorlage ein" }, { "Sub todos:<br>","Unter Todos:<br>" }, { "Parent todo:<br>","Über Todo:<br>" }, { "Set current as color category","Setze Gewählte als Farbkategorie" }, { " completed"," erledigt" }, { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- 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.net --- 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" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" }, { "","" },
\ No newline at end of file diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index adc733b..2a49528 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp @@ -272,156 +272,156 @@ void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl ) mTemplate = false; switch( event->transparency() ) { case Event::Transparent: mFreeTimeCombo->setCurrentItem(1); break; case Event::Opaque: mFreeTimeCombo->setCurrentItem(0); break; } mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); mLocationEdit->load(KOLocationBox::LOCATION); readIncidence(event); } void KOEditorGeneralEvent::writeEvent(Event *event) { // kdDebug() << "KOEditorGeneralEvent::writeEvent()" << endl; writeIncidence(event); QDate tmpDate; QTime tmpTime; QDateTime tmpDT; // temp. until something better happens. QString tmpStr; if (mNoTimeButton->isChecked()) { event->setFloats(true); // need to change this. tmpDate = mStartDateEdit->date(); tmpTime.setHMS(0,0,0); tmpDT.setDate(tmpDate); tmpDT.setTime(tmpTime); event->setDtStart(tmpDT); tmpDate = mEndDateEdit->date(); tmpTime.setHMS(0,0,0); tmpDT.setDate(tmpDate); tmpDT.setTime(tmpTime); event->setDtEnd(tmpDT); } else { event->setFloats(false); // set date/time end tmpDate = mEndDateEdit->date(); tmpTime = mEndTimeEdit->getTime(); tmpDT.setDate(tmpDate); tmpDT.setTime(tmpTime); event->setDtEnd(tmpDT); // set date/time start tmpDate = mStartDateEdit->date(); tmpTime = mStartTimeEdit->getTime(); tmpDT.setDate(tmpDate); tmpDT.setTime(tmpTime); event->setDtStart(tmpDT); } // check for float mSummaryEdit->save(KOLocationBox::SUMMARYEVENT); event->setTransparency(mFreeTimeCombo->currentItem() > 0 ? KCal::Event::Transparent : KCal::Event::Opaque); // kdDebug() << "KOEditorGeneralEvent::writeEvent() done" << endl; } void KOEditorGeneralEvent::setDuration() { QString tmpStr = "", catStr; int hourdiff, minutediff; // end<date is an accepted temporary state while typing, but don't show // any duration if this happens if(mCurrEndDateTime >= mCurrStartDateTime) { if (mNoTimeButton->isChecked()) { int daydiff = mCurrStartDateTime.date().daysTo(mCurrEndDateTime.date()) + 1; tmpStr = i18n("Duration: "); tmpStr.append(i18n("1 Day","%n Days",daydiff)); } else { int secto = mCurrStartDateTime.secsTo( mCurrEndDateTime ); hourdiff = secto / 3600; minutediff = (secto/60 ) % 60; if (hourdiff || minutediff){ tmpStr = i18n("Duration: "); if (hourdiff){ catStr = i18n("1 h","%n h",hourdiff); tmpStr.append(catStr); } if (hourdiff && minutediff){ tmpStr += i18n(", "); } if (minutediff){ catStr = i18n("1 min","%n min",minutediff); tmpStr += catStr; } } else tmpStr = ""; } } mDurationLabel->setText(tmpStr); } void KOEditorGeneralEvent::emitDateTimeStr() { KLocale *l = KGlobal::locale(); QString from,to; if (mNoTimeButton->isChecked()) { from = l->formatDate(mCurrStartDateTime.date()); to = l->formatDate(mCurrEndDateTime.date()); } else { from = l->formatDateTime(mCurrStartDateTime); to = l->formatDateTime(mCurrEndDateTime); } QString str = i18n("From: %1 To: %2 %3").arg(from).arg(to) .arg(mDurationLabel->text()); emit dateTimeStrChanged(str); } bool KOEditorGeneralEvent::validateInput() { if (!mStartDateEdit->inputIsValid()) { KMessageBox::sorry( 0, - i18n("Please specify a valid start date, for example '%1'.") - .arg( KGlobal::locale()->formatDate( QDate::currentDate() ) ) ); + i18n("Please specify a valid start date,\nfor example '%1'.") + .arg( KGlobal::locale()->formatDate( QDate::currentDate(), true ) ) ); return false; } if (!mEndDateEdit->inputIsValid()) { KMessageBox::sorry( 0, - i18n("Please specify a valid end date, for example '%1'.") - .arg( KGlobal::locale()->formatDate( QDate::currentDate() ) ) ); + i18n("Please specify a valid end date,\nfor example '%1'.") + .arg( KGlobal::locale()->formatDate( QDate::currentDate(), true ) ) ); return false; } QDateTime startDt,endDt; startDt.setDate(mStartDateEdit->date()); endDt.setDate(mEndDateEdit->date()); if (!mNoTimeButton->isChecked()) { startDt.setTime(mStartTimeEdit->getTime()); endDt.setTime(mEndTimeEdit->getTime()); } if (startDt > endDt) { KMessageBox::sorry(0,i18n("The event ends before it starts.\n" "Please correct dates and times.")); return false; } return KOEditorGeneral::validateInput(); } diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index da81586..f595d35 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -428,257 +428,257 @@ void MonthViewCell::startUpdateCell() } else { mItemList->setLineWidth( 1 ); } mItemList->clear(); #ifdef DESKTOP_VERSION QToolTip::remove(this); #endif mToolTip = ""; //qApp->processEvents(); if ( !mHolidayString.isEmpty() ) { MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); item->setPalette( mHolidayPalette ); mItemList->insertItem( item ); mToolTip += mHolidayString+"\n"; } } void MonthViewCell::insertEvent(Event *event) { mItemList->setFocusPolicy(WheelFocus); if ( !(event->doesRecur() == Recurrence::rNone) ) { if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) return; else if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) return; } if ( event->categories().contains("Holiday") || event->categories().contains(i18n("Holiday"))) { setHoliday( true ); if ( mDate.dayOfWeek() == 7 ) mItemList->setLineWidth( 3 ); } QString text; if (event->isMultiDay()) { QString prefix = "<->"; if ( event->doesRecur() ) { if ( event->recursOn( mDate) ) prefix ="->" ; else { int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); if ( event->recursOn( mDate.addDays( -days)) ) prefix ="<-" ; } } else { if (mDate == event->dtStart().date()) { prefix ="->" ; } else if (mDate == event->dtEnd().date()) { prefix ="<-" ; } } if ( !event->doesFloat() ) { if ( mDate == event->dtStart().date () ) prefix += KGlobal::locale()->formatTime(event->dtStart().time())+" "; else if ( mDate == event->dtEnd().date () ) prefix += KGlobal::locale()->formatTime(event->dtEnd().time())+" "; } text = prefix + event->summary(); mToolTip += text; } else { if (event->doesFloat()) { text = event->summary(); mToolTip += text; } else { text = KGlobal::locale()->formatTime(event->dtStart().time()); text += " " + event->summary(); mToolTip += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); } } MonthViewItem *item = new MonthViewItem( event, mDate, text ); QPalette pal; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { QStringList categories = event->categories(); QString cat = categories.first(); if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { pal = getPalette(); if (cat.isEmpty()) { pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); } else { pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); } } else { if (cat.isEmpty()) { pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); } else { pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } } } else { pal = mStandardPalette ; } item->setPalette( pal ); item->setRecur( event->recurrence()->doesRecur() ); item->setAlarm( event->isAlarmEnabled() ); item->setMoreInfo( event->description().length() > 0 ); #ifdef DESKTOP_VERSION Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, KOPrefs::instance()->email()); if ( me != 0 ) { if ( me->status() == Attendee::NeedsAction && me->RSVP()) item->setReply(true); else item->setReply(false); } else item->setReply(false); #endif mItemList->insertItem( item ); mToolTip += "\n"; } void MonthViewCell::insertTodo(Todo *todo) { mItemList->setFocusPolicy(WheelFocus); QString text; if (todo->hasDueDate()) { if (!todo->doesFloat()) { text += KGlobal::locale()->formatTime(todo->dtDue().time()); text += " "; } } - text += i18n("Td: %1").arg(todo->summary()); + text += i18n("T: %1").arg(todo->summary()); MonthViewItem *item = new MonthViewItem( todo, mDate, text ); //item->setPalette( mStandardPalette ); QPalette pal; if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { QStringList categories = todo->categories(); QString cat = categories.first(); if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { pal = getPalette(); if (cat.isEmpty()) { pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); } else { pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); } } else { if (cat.isEmpty()) { pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); } else { pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); } } } else { pal = mStandardPalette ; } item->setPalette( pal ); mItemList->insertItem( item ); mToolTip += text+"\n"; } void MonthViewCell::finishUpdateCell() { #ifdef DESKTOP_VERSION if (mToolTip != "") QToolTip::add(this,mToolTip,toolTipGroup(),""); #endif mItemList->sort(); //setMyPalette(); setMyPalette(); QString text; bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; mLabel->resize( mLabelBigSize ); text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); } else { mLabel->resize( mLabelSize ); text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); } mLabel->setText( text ); resizeEvent( 0 ); } void MonthViewCell::updateCell() { qDebug("MonthViewCell::updateCell() "); if ( !mMonthView->isUpdatePossible() ) return; startUpdateCell(); //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); Event *event; for( event = events.first(); event; event = events.next() ) { // for event insertEvent(event); } // insert due todos QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { insertTodo( todo ); } finishUpdateCell(); // if ( isVisible()) //qApp->processEvents(); } void MonthViewCell::updateConfig( bool bigFont ) // = false { if ( bigFont ) { QFont fo = KOPrefs::instance()->mMonthViewFont; int ps = fo.pointSize() + 2; if ( ps < 18 ) ps += 2; fo.setPointSize( ps ); setFont( fo ); } else setFont( KOPrefs::instance()->mMonthViewFont ); QFontMetrics fm( font() ); mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); mHolidayPalette = mStandardPalette; mPrimaryPalette = mStandardPalette; mNonPrimaryPalette = mStandardPalette; if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); } //updateCell(); } void MonthViewCell::enableScrollBars( bool enabled ) { if ( enabled ) { mItemList->setVScrollBarMode(QScrollView::Auto); mItemList->setHScrollBarMode(QScrollView::Auto); } else { mItemList->setVScrollBarMode(QScrollView::AlwaysOff); mItemList->setHScrollBarMode(QScrollView::AlwaysOff); } } Incidence *MonthViewCell::selectedIncidence() { int index = mItemList->currentItem(); if ( index < 0 ) return 0; MonthViewItem *item = static_cast<MonthViewItem *>( mItemList->item( index ) ); diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 44db209..0e847c2 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -146,283 +146,283 @@ void KOTodoViewItem::construct() #if 0 // Find sort id in description. It's the text behind the last '#' character // found in the description. White spaces are removed from beginning and end // of sort id. int pos = mTodo->description().findRev('#'); if (pos < 0) { setText(6,""); } else { QString str = mTodo->description().mid(pos+1); str.stripWhiteSpace(); setText(6,str); } #endif m_known = false; m_init = false; setMyPixmap(); } void KOTodoViewItem::setMyPixmap() { int size = 5; QPixmap pixi = QPixmap( 1, 1 ); // if ( !mTodo->isCompleted() && mTodo->hasDueDate() && mTodo->dtDue() < QDateTime::currentDateTime() ) { // pixi = SmallIcon("redcross16"); // } else { QPainter p; int pixSize = 0; QPixmap pPix = QPixmap( size, size ); if ( mTodo->description().length() > 0 ) { pixi.resize(size, pixSize+size); pPix.fill( Qt::darkGreen ); p.begin( &pixi ); p. drawPixmap ( 0, pixSize, pPix); p.end(); pixSize += size; } if ( mTodo->isAlarmEnabled() ) { pixi.resize(size, pixSize+size); pPix.fill( Qt::red ); p.begin( &pixi ); p. drawPixmap ( 0, pixSize, pPix); p.end(); pixSize += size; } // } if ( pixi.width() > 1 ) { setPixmap ( 0,pixi ) ; } else { setPixmap ( 0,QPixmap() ) ; } } void KOTodoViewItem::stateChange(bool state) { // qDebug("KOTodoViewItem::stateChange "); // do not change setting on startup if ( m_init ) return; if (isOn()!=state) { setOn(state); //qDebug("SETON "); return; } if ( mTodo->isCompleted() == state ) { //qDebug("STATECHANGE:nothing to do "); return; } QString keyd = "=="; QString keyt = "=="; //qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1()); mTodo->setCompleted(state); if (state) mTodo->setCompleted(QDateTime::currentDateTime()); if (mTodo->hasDueDate()) { setText(3, mTodo->dtDueDateStr()); QDate d = mTodo->dtDue().date(); keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); setSortKey(3,keyd); if (mTodo->doesFloat()) { setText(4,""); } else { setText(4,mTodo->dtDueTimeStr()); QTime t = mTodo->dtDue().time(); keyt.sprintf("%02d%02d",t.hour(),t.minute()); setSortKey(4,keyt); } } if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt); else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); if (mTodo->percentComplete()<100) { if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); else setSortKey(2,QString::number(mTodo->percentComplete())); } else { if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); else setSortKey(2,QString::number(99)); } if ( state ) { QListViewItem * myChild = firstChild(); KOTodoViewItem *item; while( myChild ) { //qDebug("stateCH "); item = static_cast<KOTodoViewItem*>(myChild); item->stateChange(state); myChild = myChild->nextSibling(); } } else { QListViewItem * myChild = parent(); if ( myChild ) (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); } mTodoView->modified(true); setMyPixmap(); mTodoView->setTodoModified( mTodo ); } bool KOTodoViewItem::isAlternate() { KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); if (lv && lv->alternateBackground().isValid()) { KOTodoViewItem *above = 0; - above = dynamic_cast<KOTodoViewItem *>(itemAbove()); + above = static_cast<KOTodoViewItem *>(itemAbove()); m_known = above ? above->m_known : true; if (m_known) { m_odd = above ? !above->m_odd : false; } else { KOTodoViewItem *item; bool previous = true; if (QListViewItem::parent()) { - item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent()); + item = static_cast<KOTodoViewItem *>(QListViewItem::parent()); if (item) previous = item->m_odd; - item = dynamic_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); + item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); } else { - item = dynamic_cast<KOTodoViewItem *>(lv->firstChild()); + item = static_cast<KOTodoViewItem *>(lv->firstChild()); } while(item) { item->m_odd = previous = !previous; item->m_known = true; - item = dynamic_cast<KOTodoViewItem *>(item->nextSibling()); + item = static_cast<KOTodoViewItem *>(item->nextSibling()); } } return m_odd; } return false; } void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) { QColorGroup _cg = cg; QColorGroup::ColorRole role; if ( KOPrefs::instance()->mTodoViewUsesForegroundColor ) role = QColorGroup::Text; else role = QColorGroup::Base; //#ifndef KORG_NOLVALTERNATION if (isAlternate()) _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground()); bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors; QColor colorToSet; if ( setColor ) { QStringList categories = mTodo->categories(); QString cat = categories.first(); if ( !cat.isEmpty()) { colorToSet = *(KOPrefs::instance()->categoryColor(cat) ); } else setColor = false; } int odue = mTodo->hasDueSubTodo( !isOpen()); if (odue == 2) { colorToSet = KOPrefs::instance()->mTodoOverdueColor; setColor = true; } else if ( odue == 1 ) { colorToSet = KOPrefs::instance()->mTodoDueTodayColor; setColor = true; } if ( setColor ) { _cg.setColor(role,colorToSet ); if ( role == QColorGroup::Base) { int rgb = colorToSet.red(); rgb += colorToSet.blue()/2; rgb += colorToSet.green(); if ( rgb < 200 ) _cg.setColor(QColorGroup::Text,Qt::white ); } } //#endif if ( column > 0 ){ if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) { p->save(); int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5); p->fillRect( 0, 0, width, height(), _cg.base() ); // background // p->setPen(Qt::black ); //border // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling QColor fc = KOPrefs::instance()->mHighlightColor; if ( mTodo->percentComplete() == 100 ) fc = darkGreen; p->drawRect( 2, 2, width-4, height()-4); p->fillRect( 3, 3, progress, height()-6, fc ); p->restore(); } else { QCheckListItem::paintCell(p, _cg, column, width, alignment); } return; } int align = alignment; if ( !p ) return; p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); QListView *lv = listView(); if ( !lv ) return; int marg = 2;//lv->itemMargin(); int r = 0; QCheckListItem::Type myType = QCheckListItem::CheckBox; int BoxSize = 20; int boxOffset = 2; int xOffset = 2; if (qApp->desktop()->width() < 300 ) { BoxSize = 14; boxOffset = -1; xOffset = 1; // marg = 0; } if ( height() < BoxSize ) { boxOffset = boxOffset - ((BoxSize - height())/2) ; // qDebug("boxOffset %d height %d", boxOffset, height() ); BoxSize = height(); } //bool winStyle = lv->style() == WindowsStyle; int lineStart = 5; if ( myType == Controller ) { if ( !pixmap( 0 ) ) r += BoxSize + 4; } else { ASSERT( lv ); //### // QFontMetrics fm( lv->font() ); // int d = fm.height(); int x = 0; int y = (height() - BoxSize) / 2; // p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) ); if ( myType == CheckBox ) { if ( isEnabled() ) p->setPen( QPen( _cg.text(), 1 ) ); else p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) ); p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); lineStart = x+marg; ///////////////////// x++; y++; if ( isOn() ) { QPointArray a( 7*2 ); int i, xx, yy; xx = x+xOffset+marg+(boxOffset/2); yy = y+5+boxOffset; for ( i=0; i<3; i++ ) { diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 10665f4..391b3bb 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp @@ -490,257 +490,261 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a } else { if (!ev->doesFloat()) { Event *event = static_cast<Event *>(ev); QDateTime st,end; if ( event->recurrence()->doesRecur() ) { QDate recDate= mEventDate; int days = event->dtStart().date().daysTo (event->dtEnd().date() ); while ( ! event->recursOn( recDate ) ) { recDate = recDate.addDays( -1 ); } st = QDateTime ( recDate, event->dtStart().time() ); end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); } else { st = event->dtStart(); end = event->dtEnd(); } QString dateText; // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() ); if ( st.date() < mEventDate ) dateText = "++:++-"; else dateText = event->dtStartTimeStr() + "-"; if ( end.date() > mEventDate ) dateText += "++:++"; else dateText += event->dtEndTimeStr(); if ( notRed ) tempText += dateText; else { if ( end < cdt ) { if ( !KOPrefs::instance()->mWNViewShowsPast ) return false; tempText += "<font color=\"#F00000\">" + dateText + "</font>"; } else if ( st < cdt ) tempText += "<font color=\"#008000\">" + dateText + "</font>"; else tempText += dateText; } } else { if ( bDay ) { if ( ev->categories().contains( i18n("Birthday") )) tempText += "<font color=\"#F00000\">" + i18n("Birthday") +":</font>"; else tempText += "<font color=\"#F00000\">" + i18n("Anniversary")+":</font>"; } else { tempText += i18n("Allday:"); } } } } else { mTodos.append( ev ); tempText += i18n("ToDo:"); if (reply) { tempText += " "; if ( noc != cdt ) { tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; } } else { if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; QString dfs = KGlobal::locale()->dateFormatShort(); KGlobal::locale()->setDateFormatShort("%d.%b"); tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; KGlobal::locale()->setDateFormatShort(dfs); } else { if (!ev->doesFloat() ) if( ( (Todo*)ev)->dtDue() < cdt ) { tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; } else tempText +=((Todo*)ev)->dtDueTimeStr(); mTodos.append( ev ); } } } tempText += "</b></td><td>"; bool needClose = false; if ( ev->cancelled() ) { tempText += "<font color=\"#F00000\">[c"; needClose =true; } if ( ev->isAlarmEnabled() ) { if ( !needClose) tempText +="["; tempText += "a"; needClose =true; } if ( ev->description().length() > 0 ) { if ( !needClose) tempText +="["; tempText += "i"; needClose =true; } if ( ev->recurrence()->doesRecur() ) { if ( !needClose) tempText +="["; tempText += "r"; needClose =true; } if ( needClose ) { tempText += "] "; } if ( ev->cancelled() ) tempText += "</font>"; tempText += "<a "; if (ev->type()=="Event") tempText += "href=\"event:"; if (ev->type()=="Todo") tempText += "href=\"todo:"; tempText += ev->uid() + "\">"; if ( ev->summary().length() > 0 ) tempText += ev->summary(); else tempText += i18n("-no summary-"); if ( bDay ) { noc = ev->getNextOccurence( cdt.addDays(-1), &ok ); if ( ok ) { - int years = noc.date().year() - ev->dtStart().date().year(); + int years = 0; + if ( ev->type() =="Todo" ) { + years = noc.date().year() -((Todo*)ev)->dtDue().date().year(); + } else + years = noc.date().year() - ev->dtStart().date().year(); tempText += i18n(" (%1 y.)"). arg( years ); } } tempText += "</a>"; if ( KOPrefs::instance()->mWNViewShowLocation ) if ( !ev->location().isEmpty() ) tempText += " ("+ev->location() +")"; if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) tempText += " ["+ev->relatedTo()->summary() +"]"; tempText += "</td></tr>\n"; mText += tempText; return true; } bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) { if ( mTodos.find( ev ) != mTodos.end() ) return false; mTodos.append( ev ); if ( !isSub ) mText += "<p>"; else mText += "<li>"; mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; mText += ind; bool needClose = false; if ( ev->cancelled() ) { mText += "<font color=\"#F00000\">[c"; needClose =true; } if ( ev->isAlarmEnabled() ) { if ( !needClose) mText +="["; mText += "a"; needClose =true; } if ( ev->description().length() > 0 ) { if ( !needClose) mText +="["; mText += "i"; needClose =true; } // if ( ev->recurrence()->doesRecur() ) { // if ( !needClose) // mText +="("; // mText += "r"; // needClose =true; // } if ( needClose ) mText += "] "; if ( ev->cancelled() ) mText += "</font>"; mText += "<a href=\"todo:" + ev->uid() + "\">"; if ( ev->summary().length() > 0 ) mText += ev->summary(); else mText += i18n("-no summary-"); mText += "</a>"; if ( ((Todo*)ev)->hasDueDate () ) { QString year = ""; int ye = ((Todo*)ev)->dtDue().date().year(); if ( QDateTime::currentDateTime().date().year() != ye ) year = QString::number( ye ); QString dfs = KGlobal::locale()->dateFormatShort(); KGlobal::locale()->setDateFormatShort("%d.%b"); mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>"; KGlobal::locale()->setDateFormatShort(dfs); } if ( KOPrefs::instance()->mWNViewShowLocation ) if ( !ev->location().isEmpty() ) mText += " ("+ev->location() +")"; if ( !isSub ) { if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents) mText += " ["+ev->relatedTo()->summary() +"]"; mText += "</p>\n"; } else { ind += "-"; mText += "</li>\n"; } QPtrList<Incidence> Relations = ev->relations(); Incidence *to; for (to=Relations.first();to;to=Relations.next()) { if (!((Todo*)to)->isCompleted()) appendTodo( to, ind , true ); } return true; } /* void KOWhatsNextView::createEventViewer() { if (!mEventViewer) { mEventViewer = new KOEventViewerDialog(this); } } */ void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) { mEventViewer = v; } // TODO: Create this function in CalendarView and remove it from here void KOWhatsNextView::showIncidence(const QString &uid) { if ( !mEventViewer ) { qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set "); return; } //kdDebug() << "KOWhatsNextView::showIncidence(): " << uid << endl; //qDebug("KOWhatsNextView::showIncidence %s ", uid.latin1()); if (uid.startsWith("event:")) { #ifdef DESKTOP_VERSION Event *event = calendar()->event(uid.mid(8)); #else Event *event = calendar()->event(uid.mid(6)); #endif //qDebug("event %d uid %s ", event, uid.mid(6).latin1()); if (!event) return; diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index c4c0081..2c78ea3 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp @@ -301,197 +301,198 @@ void KDateEdit::setDate( QDate date,int *cpos,const int key ,const bool dateForm *cpos = space + allSelectStrLength; emit(dateChanged(date)); return; } void KDateEdit::setHandleInvalid(bool handleInvalid) { mHandleInvalid = handleInvalid; } void KDateEdit::setEnabled(bool on) { mDateEdit->setEnabled(on); mDateButton->setEnabled(on); } QDate KDateEdit::date() const { QDate date = readDate(); if (date.isValid() || mHandleInvalid) { return date; } else { KNotifyClient::beep(); return QDate::currentDate(); } } void KDateEdit::keyPressEvent(QKeyEvent *e) { QDate date = readDate(); int cpos = mDateEdit->cursorPosition(); switch(e->key()) { case Key_Escape: mDateEdit->deselect(); case Key_Tab: QHBox::keyPressEvent(e); break; case Key_Up: // when date invalid then set to currend and return if(!date.isValid()) { date = QDate::currentDate(); setDate(date); mDateEdit->setCursorPosition(cpos); emit(dateChanged(date)); QString text = i18n( "You entered an invalid date!\n Date changed to current date." ); KMessageBox::information( 0, text ); return; } setDate(date, &cpos, Key_Up, dateFormShort); break; case Key_Down: // when date invalid then set to current and return if(!date.isValid()) { date = QDate::currentDate(); setDate(date); mDateEdit->setCursorPosition(cpos); emit(dateChanged(date)); QString text = i18n( "You entered an invalid date!\n Date changed to current date." ); KMessageBox::information( 0, text ); return; } setDate(date, &cpos, Key_Down, dateFormShort); break; default: QHBox::keyPressEvent(e); break; } // switch mDateEdit->setCursorPosition(cpos); } void KDateEdit::setSelect( int from, int to ) { // return; mDateEdit->setSelection( from , to ); } void KDateEdit::toggleDatePicker() { if( mDateFrame->isVisible() ) { mDateFrame->hide(); } else { QPoint tmpPoint = mapToGlobal(mDateButton->geometry().bottomRight()); QSize datepickersize = mDatePicker->sizeHint(); if ( tmpPoint.x() < 7+datepickersize.width() ) tmpPoint.setX( 7+datepickersize.width() ); int h = QApplication::desktop()->height(); if ( tmpPoint.y() + datepickersize.height() > h ) tmpPoint.setY( h - datepickersize.height() ); mDateFrame->setGeometry(tmpPoint.x()-datepickersize.width()-7, tmpPoint.y(), datepickersize.width()+2*mDateFrame->lineWidth(), datepickersize.height()+2*mDateFrame->lineWidth()); QDate date = readDate(); if(date.isValid()) { mDatePicker->setDate(date); } else { mDatePicker->setDate(QDate::currentDate()); } mDateFrame->show(); } } void KDateEdit::lineEnterPressed() { QDate date = readDate(); if(date.isValid()) { // Update the edit. This is needed if the user has entered a // word rather than the actual date. setDate(date); emit(dateChanged(date)); emit returnPressed(); } else { if ( withoutDp ) { KNotifyClient::beep(); } else { if ( !mDateEdit->text().isEmpty() ) { mTextChanged = false; QString text = i18n( "You entered an invalid date!\n Will use current date instead." ); - if ( KMessageBox::warningContinueCancel( 0, text ) == KMessageBox::Continue ) { - setDate( QDate::currentDate() ); - emit dateChanged( QDate::currentDate() ); - } + if ( isVisible() ) + if ( KMessageBox::warningContinueCancel( 0, text ) == KMessageBox::Continue ) { + setDate( QDate::currentDate() ); + emit dateChanged( QDate::currentDate() ); + } } } } } bool KDateEdit::inputIsValid() { return readDate().isValid(); } QDate KDateEdit::readDate() const { QString text = mDateEdit->text(); QDate date; if (mKeywordMap.contains(text.lower())) { date = QDate::currentDate().addDays(mKeywordMap[text.lower()]); } else { date = KGlobal::locale()->readDate(text); } return date; } bool KDateEdit::eventFilter(QObject *, QEvent *e) { // We only process the focus out event if the text has changed // since we got focus if ((e->type() == QEvent::FocusOut) && mTextChanged) { lineEnterPressed(); mTextChanged = false; } // switch dateFormShort by double klick with mouse else if (e->type() == QEvent::MouseButtonDblClick) { toggleDateFormat(); } else if (e->type() == QEvent::FocusIn) { maxDay = readDate().day(); } return false; } void KDateEdit::toggleDateFormat() { dateFormShort = ! dateFormShort; mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort)); } void KDateEdit::textChanged(const QString &) { if(mHandleInvalid && mDateEdit->text().stripWhiteSpace().isEmpty()) { QDate date; //invalid date emit(dateChanged(date)); } else { mTextChanged = true; } maxDay = readDate().day(); } |