author | zautrix <zautrix> | 2005-01-26 12:45:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-26 12:45:38 (UTC) |
commit | 96fc3903cf690957d0242d7aa2894bd64800edcc (patch) (side-by-side diff) | |
tree | 6d4f6f565ffc2a0e72a55a5e4ff3c7d6bb08cbe0 | |
parent | ebe38bec081a9ab226ea0de7e38ac2377d6bd1c0 (diff) | |
download | kdepimpi-96fc3903cf690957d0242d7aa2894bd64800edcc.zip kdepimpi-96fc3903cf690957d0242d7aa2894bd64800edcc.tar.gz kdepimpi-96fc3903cf690957d0242d7aa2894bd64800edcc.tar.bz2 |
small fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 2 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 1 | ||||
-rw-r--r-- | korganizer/koeditorgeneralevent.cpp | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index d260be3..73940c6 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1,445 +1,445 @@ { "10 minutes","10 Minuten" }, { "10th","10." }, { "11th","11." }, { "12 pm Format","12 AM/PM Format" }, { "12th","12." }, { "13th","13." }, { "14th","14." }, { "15th","15." }, { "16th","16." }, { "17th","17." }, { "18th","18." }, { "19th","19." }, { "1 Day","1 Tag" }, { "1 h","1 Std" }, { "1 (high)","1 (hoch)" }, { "5 (low)","5" }, { "1st","1." }, { "20th","20." }, { "21st","21." }, { "22nd","22." }, { "23rd","23." }, { "24:00 Hour Format","24:00 Stunden Format" }, { "24th","24." }, { "25th","25." }, { "26th","26." }, { "27th","27." }, { "28th","28." }, { "29th","29." }, { "2nd","2." }, { "30 minutes","30 Minuten" }, { "30th","30." }, { "31st","31." }, { "3rd","3." }, { "4th","4." }, { "5 (lowest)","5 (Niedrigster)" }, { "5th","5." }, { "6th","6." }, { "7th","7." }, { "8th","8." }, { "9th","9." }, { "About...","Über..." }, { "&Accept","&Akzeptieren" }, { "Accept","Akzeptieren" }, { "Accept A&ll","A&lles Akzepieren" }, { "Access:","Zugriff:" }, { "A corresponding event is missing in your calendar!","Ein zugehöriger Termin fehlt in ihrem Kalender!" }, { "Actions","Aktionen" }, { "Add Filter","Filter Hinzufügen" }, { "&Add","Hinzufügen" }, { "Add","Hinzufügen" }, { "Additional email addresses:","Zusätzliche E-Mail Adressen:" }, { "Additional email address:","Zusätzliche E-Mail Adresse:" }, { "&Addressbook","&Adressbuch" }, { "Address &Book...","Adress&buch..." }, { "Agenda Size","Agende Größe" }, { "Agenda Size:","Größe der Agenda:" }, { "Agenda view:","Agenda Ansicht:" }, { "Agenda view background color:","Hintergrund der Agenda Ansicht:" }, { "All attendees","Alle Teilnehmer" }, { "AllDayAgenda Height:","Höhe Ganztages Agenda:" }, -{ "Allday","Ganztägig" }, +{ "All day event","Ganztägig" }, { "Anonymous","Anonym" }, { "Apply","Anwenden" }, { "Apr","Apr" }, { "April","April" }, {"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" }, { "Bigger","Größer" }, { "Biggest","Riesig" }, { "Big","Groß" }, { "<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" }, { "Click to add a new Todo","Hier klicken, um ein neues Todo anzulegen" }, { "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 completed To-Dos?","Alle bereits erledigten Todos löschen?" }, { "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öschen" }, { "Delete...","Löschen..." }, { "Delete","Löschen" }, { "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","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","Wiederholender Termin" }, { "End after","Endet nach"}, { "End by:","Endet am"}, { "End Date","End Datum" }, { "End:","Ende:" }, { "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 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 time.","Bitte gültige Startzeit angeben."}, { "Please specify a valid start time, for example '%1'.","Bitte gültige Startzeit angeben, z.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:" }, { "Tiny","Sehr klein" }, { "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:" }, { "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" }, diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 69802a4..b73ceaa 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -1,473 +1,474 @@ // $Id$ #include <qvbox.h> #include <qlistbox.h> #include <qwidget.h> #include <qfile.h> #include <qimage.h> #include <qcombobox.h> #include <qapplication.h> #include <qdragobject.h> #include <qevent.h> #include <qurl.h> #include <qpixmap.h> #include <kabc/addressbook.h> #include <kapplication.h> #include <kconfig.h> #include <kcolorbutton.h> #include <kdebug.h> #include <kglobal.h> #include <kiconloader.h> #include <klineedit.h> #include <klocale.h> #include <kmessagebox.h> #include <kurl.h> #include <kurlrequester.h> //US#include "configuretableviewdialog.h" #include "contactlistview.h" #include "kabprefs.h" #include "undocmds.h" #include "viewmanager.h" #include <qlayout.h> #include <qheader.h> #include <qregexp.h> #include "kaddressbooktableview.h" KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, QWidget *parent, const char *name ) : KAddressBookView( ab, parent, name ) { mainLayout = new QVBoxLayout( viewWidget(), 2 ); // The list view will be created when the config is read. mListView = 0; } KAddressBookTableView::~KAddressBookTableView() { } void KAddressBookTableView::setFocusAV() { if ( mListView ) mListView->setFocus(); } void KAddressBookTableView::scrollUP() { QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); QApplication::postEvent( mListView, ev ); } void KAddressBookTableView::scrollDOWN() { QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); QApplication::postEvent( mListView, ev ); } void KAddressBookTableView::reconstructListView() { if (mListView) { disconnect(mListView, SIGNAL(selectionChanged()), this, SLOT(addresseeSelected())); disconnect(mListView, SIGNAL(executed(QListViewItem*)), this, SLOT(addresseeExecuted(QListViewItem*))); disconnect(mListView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(addresseeExecuted(QListViewItem*))); disconnect(mListView, SIGNAL(startAddresseeDrag()), this, SIGNAL(startDrag())); disconnect(mListView, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(addresseeExecuted(QListViewItem*))); disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, SIGNAL(dropped(QDropEvent*))); delete mListView; } mListView = new ContactListView( this, addressBook(), viewWidget() ); connect(this, SIGNAL(printView()), mListView , SLOT(printMe())); //US set singleClick manually, because it is no global configparameter in embedded space mListView->setSingleClick(KABPrefs::instance()->mHonorSingleClick); // Add the columns KABC::Field::List fieldList = fields(); KABC::Field::List::ConstIterator it; int c = 0; for( it = fieldList.begin(); it != fieldList.end(); ++it ) { mListView->addColumn( (*it)->label() ); mListView->setColumnWidthMode(c++, QListView::Manual); //US // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); } connect(mListView, SIGNAL(selectionChanged()), this, SLOT(addresseeSelected())); connect(mListView, SIGNAL(startAddresseeDrag()), this, SIGNAL(startDrag())); connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, SIGNAL(dropped(QDropEvent*))); if (KABPrefs::instance()->mHonorSingleClick) { // qDebug("KAddressBookTableView::reconstructListView single"); connect(mListView, SIGNAL(executed(QListViewItem*)), this, SLOT(addresseeExecuted(QListViewItem*))); } else { // qDebug("KAddressBookTableView::reconstructListView double"); connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(addresseeExecuted(QListViewItem*))); } connect(mListView, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(addresseeExecuted(QListViewItem*))); connect(mListView, SIGNAL(signalDelete()), this, SLOT(addresseeDeleted())); //US performceimprovement. Refresh is done from the outside //US refresh(); mListView->setSorting( 0, true ); mainLayout->addWidget( mListView ); mainLayout->activate(); mListView->show(); } void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) { mListView->clear(); if ( s.isEmpty() || s == "*" ) { refresh(); return; } QString pattern = s.lower()+"*"; QRegExp re; re.setWildcard(true); // most people understand these better. re.setCaseSensitive(false); re.setPattern( pattern ); if (!re.isValid()) return; KABC::Addressee::List addresseeList = addressees(); KABC::Addressee::List::Iterator it; if ( field ) { for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) continue; #if QT_VERSION >= 0x030000 if (re.search(field->value( *it ).lower()) == 0) #else if (re.match(field->value( *it ).lower()) != -1) #endif ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); } } else { KABC::Field::List fieldList = allFields(); KABC::Field::List::ConstIterator fieldIt; for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) continue; for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { #if QT_VERSION >= 0x030000 if (re.search((*fieldIt)->value( *it ).lower()) != -1) #else if (re.match((*fieldIt)->value( *it ).lower()) != -1) #endif { + //qDebug("match %s %s %s", pattern.latin1(), (*fieldIt)->value( *it ).latin1(), (*fieldIt)->label().latin1() ); ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); break; } } } } // Sometimes the background pixmap gets messed up when we add lots // of items. mListView->repaint(); if ( mListView->firstChild() ) { mListView->setCurrentItem ( mListView->firstChild() ); mListView->setSelected ( mListView->firstChild(), true ); } else emit selected(QString::null); } void KAddressBookTableView::writeConfig(KConfig *config) { KAddressBookView::writeConfig(config); mListView->saveLayout(config, config->group()); } void KAddressBookTableView::readConfig(KConfig *config) { KAddressBookView::readConfig( config ); // The config could have changed the fields, so we need to reconstruct // the listview. reconstructListView(); // costum colors? if ( config->readBoolEntry( "EnableCustomColors", false ) ) { QPalette p( mListView->palette() ); QColor c = p.color(QPalette::Normal, QColorGroup::Base ); p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); c = p.color(QPalette::Normal, QColorGroup::Text ); p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); c = p.color(QPalette::Normal, QColorGroup::Button ); p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); c = p.color(QPalette::Normal, QColorGroup::ButtonText ); p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); c = p.color(QPalette::Normal, QColorGroup::Highlight ); p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); #ifndef KAB_EMBEDDED c = KGlobalSettings::alternateBackgroundColor(); #else //KAB_EMBEDDED c = QColor(240, 240, 240); #endif //KAB_EMBEDDED c = config->readColorEntry ("AlternatingBackgroundColor", &c); mListView->setAlternateColor(c); //US mListView->viewport()->setPalette( p ); mListView->setPalette( p ); } else { // needed if turned off during a session. //US mListView->viewport()->setPalette( mListView->palette() ); mListView->setPalette( mListView->palette() ); } //custom fonts? QFont f( font() ); if ( config->readBoolEntry( "EnableCustomFonts", false ) ) { mListView->setFont( config->readFontEntry( "TextFont", &f) ); f.setBold( true ); //US mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); mListView->header()->setFont( config->readFontEntry( "HeaderFont", &f ) ); } else { mListView->setFont( f ); f.setBold( true ); //US mListView->setHeaderFont( f ); mListView->header()->setFont( f ); } // Set the list view options mListView->setAlternateBackgroundEnabled(config->readBoolEntry("ABackground", true)); mListView->setSingleLineEnabled(config->readBoolEntry("SingleLine", false)); mListView->setToolTipsEnabled(config->readBoolEntry("ToolTips", true)); if (config->readBoolEntry("Background", false)) mListView->setBackgroundPixmap(config->readEntry("BackgroundName")); // Restore the layout of the listview mListView->restoreLayout(config, config->group()); } void KAddressBookTableView::refresh(QString uid) { // For now just repopulate. In reality this method should // check the value of uid, and if valid iterate through // the listview to find the entry, then tell it to refresh. if (uid.isNull()) { // Clear the list view QString currentUID, nextUID; #ifndef KAB_EMBEDDED ContactListViewItem *currentItem = dynamic_cast<ContactListViewItem*>( mListView->currentItem() ); #else //KAB_EMBEDDED ContactListViewItem *currentItem = (ContactListViewItem*)( mListView->currentItem() ); #endif //KAB_EMBEDDED if ( currentItem ) { #ifndef KAB_EMBEDDED ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() ); #else //KAB_EMBEDDED ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() ); #endif //KAB_EMBEDDED if ( nextItem ) nextUID = nextItem->addressee().uid(); currentUID = currentItem->addressee().uid(); } mListView->clear(); currentItem = 0; KABC::Addressee::List addresseeList = addressees(); KABC::Addressee::List::Iterator it; for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) continue; ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); if ( (*it).uid() == currentUID ) currentItem = item; else if ( (*it).uid() == nextUID && !currentItem ) currentItem = item; } // Sometimes the background pixmap gets messed up when we add lots // of items. mListView->repaint(); if ( currentItem ) { mListView->setCurrentItem( currentItem ); mListView->ensureItemVisible( currentItem ); } } else { // Only need to update on entry. Iterate through and try to find it ContactListViewItem *ceItem; QListViewItemIterator it( mListView ); while ( it.current() ) { #ifndef KAB_EMBEDDED ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); #else //KAB_EMBEDDED ceItem = (ContactListViewItem*)( it.current() ); #endif //KAB_EMBEDDED if ( ceItem && ceItem->addressee().uid() == uid ) { ceItem->refresh(); return; } ++it; } refresh( QString::null ); } } QStringList KAddressBookTableView::selectedUids() { QStringList uidList; QListViewItem *item; ContactListViewItem *ceItem; for(item = mListView->firstChild(); item; item = item->itemBelow()) { if (mListView->isSelected( item )) { #ifndef KAB_EMBEDDED ceItem = dynamic_cast<ContactListViewItem*>(item); #else //KAB_EMBEDDED ceItem = (ContactListViewItem*)(item); #endif //KAB_EMBEDDED if (ceItem != 0L) uidList << ceItem->addressee().uid(); } } if ( uidList.count() == 0 ) if ( mListView->currentItem() ) { ceItem = (ContactListViewItem*)(mListView->currentItem()) ; uidList << ceItem->addressee().uid(); } return uidList; } void KAddressBookTableView::setSelected(QString uid, bool selected) { QListViewItem *item; ContactListViewItem *ceItem; if (uid.isNull()) { mListView->selectAll(selected); } else { for(item = mListView->firstChild(); item; item = item->itemBelow()) { #ifndef KAB_EMBEDDED ceItem = dynamic_cast<ContactListViewItem*>(item); #else //KAB_EMBEDDED ceItem = (ContactListViewItem*)(item); #endif //KAB_EMBEDDED if ((ceItem != 0L) && (ceItem->addressee().uid() == uid)) { mListView->setSelected(item, selected); if (selected) mListView->ensureItemVisible(item); } } } } void KAddressBookTableView::addresseeSelected() { // We need to try to find the first selected item. This might not be the // last selected item, but when QListView is in multiselection mode, // there is no way to figure out which one was // selected last. QListViewItem *item; bool found =false; for (item = mListView->firstChild(); item && !found; item = item->nextSibling()) { if (item->isSelected()) { found = true; #ifndef KAB_EMBEDDED ContactListViewItem *ceItem = dynamic_cast<ContactListViewItem*>(item); #else //KAB_EMBEDDED ContactListViewItem *ceItem = (ContactListViewItem*)(item); #endif //KAB_EMBEDDED if ( ceItem ) emit selected(ceItem->addressee().uid()); } } if (!found) emit selected(QString::null); } void KAddressBookTableView::addresseeExecuted(QListViewItem *item) { if (item) { #ifndef KAB_EMBEDDED ContactListViewItem *ceItem = dynamic_cast<ContactListViewItem*>(item); #else //KAB_EMBEDDED ContactListViewItem *ceItem = (ContactListViewItem*)(item); #endif //KAB_EMBEDDED if (ceItem) { emit executed(ceItem->addressee().uid()); } } else { emit executed(QString::null); } } void KAddressBookTableView::addresseeDeleted() { emit deleteRequest(); } #ifndef KAB_EMBEDDED #include "kaddressbooktableview.moc" #endif //KAB_EMBEDDED diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 30b792b..adc733b 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp @@ -1,427 +1,427 @@ /* This file is part of KOrganizer. Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ #include <qtooltip.h> #include <qlayout.h> #include <qvbox.h> #include <qbuttongroup.h> #include <qvgroupbox.h> #include <qwidgetstack.h> #include <qdatetime.h> #include <kdebug.h> #include <kglobal.h> #include <klocale.h> #include <kiconloader.h> #include <kmessagebox.h> #include <kfiledialog.h> #include <kstandarddirs.h> #include <libkcal/event.h> #include <libkdepim/kdateedit.h> #include "koprefs.h" #include "koeditorgeneralevent.h" #include "kolocationbox.h" KOEditorGeneralEvent::KOEditorGeneralEvent(QObject* parent, const char* name) : KOEditorGeneral( parent, name) { mTemplate = false; connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), SLOT(setDuration())); connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), SLOT(emitDateTimeStr())); } KOEditorGeneralEvent::~KOEditorGeneralEvent() { } void KOEditorGeneralEvent::finishSetup() { //disabled // QWidget::setTabOrder( mSummaryEdit, mLocationEdit ); // QWidget::setTabOrder( mLocationEdit, mStartDateEdit ); // QWidget::setTabOrder( mStartDateEdit, mStartTimeEdit ); // QWidget::setTabOrder( mStartTimeEdit, mEndDateEdit ); // QWidget::setTabOrder( mEndDateEdit, mEndTimeEdit ); // QWidget::setTabOrder( mEndTimeEdit, mNoTimeButton ); // QWidget::setTabOrder( mNoTimeButton, mAlarmButton ); // QWidget::setTabOrder( mAlarmButton, mAlarmTimeEdit ); // QWidget::setTabOrder( mFreeTimeCombo, mCategoriesButton ); // QWidget::setTabOrder( mCategoriesButton, mSecrecyCombo ); // QWidget::setTabOrder( mSecrecyCombo, mDescriptionEdit ); mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); mSummaryEdit->setFocus(); } void KOEditorGeneralEvent::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( 0 ); timeGroupBox->layout()->setMargin( 5 ); QFrame *timeBoxFrame = new QFrame(timeGroupBox); QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3); layoutTimeBox->setSpacing(topLayout->spacing()); mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame); layoutTimeBox->addWidget(mStartDateLabel,0,0); mStartDateEdit = new KDateEdit(timeBoxFrame); layoutTimeBox->addWidget(mStartDateEdit,0,1); mStartTimeEdit = new KOTimeEdit(timeBoxFrame); layoutTimeBox->addWidget(mStartTimeEdit,0,2); mEndDateLabel = new QLabel(i18n("End:"),timeBoxFrame); layoutTimeBox->addWidget(mEndDateLabel,1,0); mEndDateEdit = new KDateEdit(timeBoxFrame); layoutTimeBox->addWidget(mEndDateEdit,1,1); mEndTimeEdit = new KOTimeEdit(timeBoxFrame); layoutTimeBox->addWidget(mEndTimeEdit,1,2); QWidget* duration = new QWidget( timeBoxFrame ); QHBoxLayout *flagsBox = new QHBoxLayout( duration ); - mNoTimeButton = new QCheckBox(i18n("Allday"),duration); + mNoTimeButton = new QCheckBox(i18n("All day event"),duration); flagsBox->addWidget(mNoTimeButton); connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool))); mDurationLabel = new QLabel( duration ); // if ( KOPrefs::instance()->mCompactDialogs ) { //layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 ); //} else { flagsBox->addWidget( mDurationLabel ); //} flagsBox->setStretchFactor(mDurationLabel, 10 ); mDurationLabel->setAlignment( AlignRight | AlignVCenter); layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 ); // time widgets are checked if they contain a valid time connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(startTimeChanged(QTime))); connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)), this, SLOT(endTimeChanged(QTime))); // date widgets are checked if they contain a valid date connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(startDateChanged(QDate))); connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), this, SLOT(endDateChanged(QDate))); } void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) { QBoxLayout *classLayout = new QHBoxLayout(topLayout); QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent); classLayout->addWidget(freeTimeLabel); mFreeTimeCombo = new QComboBox(false, parent); mFreeTimeCombo->insertItem(i18n("Busy")); mFreeTimeCombo->insertItem(i18n("Free")); classLayout->addWidget(mFreeTimeCombo); } void KOEditorGeneralEvent::timeStuffDisable(bool disable) { mStartTimeEdit->setEnabled( !disable ); mEndTimeEdit->setEnabled( !disable ); setDuration(); emitDateTimeStr(); } void KOEditorGeneralEvent::dontAssociateTime(bool noTime) { timeStuffDisable(noTime); //if(alarmButton->isChecked()) alarmStuffDisable(noTime); allDayChanged(noTime); } void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) { // kdDebug() << "KOEditorGeneralEvent::setDateTimes(): Start DateTime: " << start.toString() << endl; if ( !mTemplate ) mStartDateEdit->setDate(start.date()); // KTimeEdit seems to emit some signals when setTime() is called. mStartTimeEdit->blockSignals( true ); mStartTimeEdit->setTime(start.time()); mStartTimeEdit->blockSignals( false ); if ( !mTemplate ) mEndDateEdit->setDate(end.date()); mEndTimeEdit->setTime(end.time()); mCurrStartDateTime = start; mCurrEndDateTime = end; setDuration(); emitDateTimeStr(); } void KOEditorGeneralEvent::startTimeChanged(QTime newtime) { kdDebug() << "KOEditorGeneralEvent::startTimeChanged() " << newtime.toString() << endl; int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime); mCurrStartDateTime.setTime(newtime); // adjust end time so that the event has the same duration as before. mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep); mEndTimeEdit->setTime(mCurrEndDateTime.time()); mEndDateEdit->setDate(mCurrEndDateTime.date()); emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); } void KOEditorGeneralEvent::endTimeChanged(QTime newtime) { // kdDebug() << "KOEditorGeneralEvent::endTimeChanged " << newtime.toString() << endl; QDateTime newdt(mCurrEndDateTime.date(), newtime); mCurrEndDateTime = newdt; emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); } void KOEditorGeneralEvent::startDateChanged(QDate newdate) { int daysep = mCurrStartDateTime.daysTo(mCurrEndDateTime); mCurrStartDateTime.setDate(newdate); // adjust end date so that the event has the same duration as before mCurrEndDateTime.setDate(mCurrStartDateTime.date().addDays(daysep)); mEndDateEdit->setDate(mCurrEndDateTime.date()); emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); } void KOEditorGeneralEvent::endDateChanged(QDate newdate) { QDateTime newdt(newdate, mCurrEndDateTime.time()); if(newdt < mCurrStartDateTime) { // oops, we can't let that happen. newdt = mCurrStartDateTime; mEndDateEdit->setDate(newdt.date()); mEndTimeEdit->setTime(newdt.time()); } mCurrEndDateTime = newdt; emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); } void KOEditorGeneralEvent::setDefaults(QDateTime from,QDateTime to,bool allDay) { mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); mLocationEdit->load(KOLocationBox::LOCATION); KOEditorGeneral::setDefaults(allDay); mNoTimeButton->setChecked(allDay); timeStuffDisable(allDay); mFreeTimeCombo->setCurrentItem( 0 ); setDateTimes(from,to); } void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl ) { QString tmpStr; mTemplate = tmpl; // the rest is for the events only mNoTimeButton->setChecked(event->doesFloat()); timeStuffDisable(event->doesFloat()); setDateTimes(event->dtStart(),event->dtEnd()); 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() ) ) ); return false; } if (!mEndDateEdit->inputIsValid()) { KMessageBox::sorry( 0, i18n("Please specify a valid end date, for example '%1'.") .arg( KGlobal::locale()->formatDate( QDate::currentDate() ) ) ); 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(); } |