-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 10 | ||||
-rw-r--r-- | korganizer/koeditorgeneraltodo.cpp | 21 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 71 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 5 | ||||
-rw-r--r-- | libkcal/alarm.cpp | 2 | ||||
-rw-r--r-- | libkcal/event.cpp | 8 | ||||
-rw-r--r-- | libkcal/event.h | 1 | ||||
-rw-r--r-- | libkcal/incidence.cpp | 29 | ||||
-rw-r--r-- | libkcal/incidence.h | 3 | ||||
-rw-r--r-- | libkcal/todo.cpp | 10 | ||||
-rw-r--r-- | libkcal/todo.h | 1 |
11 files changed, 105 insertions, 56 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index f3f5333..ab8339f 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -146,35 +146,35 @@ | |||
146 | { "Due:","Fällig:"}, | 146 | { "Due:","Fällig:"}, |
147 | { "Duration: ","Dauer: " }, | 147 | { "Duration: ","Dauer: " }, |
148 | { "Edit...","Bearbeite..." }, | 148 | { "Edit...","Bearbeite..." }, |
149 | { "Edit Event...","Bearbeite Termin..." }, | 149 | { "Edit Event...","Bearbeite Termin..." }, |
150 | { "Edit Event","Bearbeite Termin" }, | 150 | { "Edit Event","Bearbeite Termin" }, |
151 | { "Edit exceptions","Bearbeite Ausnahmen" }, | 151 | { "Edit exceptions","Bearbeite Ausnahmen" }, |
152 | { "EditorBox:","Editor Fenster:" }, | 152 | { "EditorBox:","Editor Fenster:" }, |
153 | { "Edit Recurrence Range","Bearbeite Wiederholung" }, | 153 | { "Edit Recurrence Range","Bearbeite Wiederholung" }, |
154 | { "Edit Todo...","Berabeite Todo..." }, | 154 | { "Edit Todo...","Berabeite Todo..." }, |
155 | { "Edit To-Do","Todo bearbeiten" }, | 155 | { "Edit To-Do","Todo bearbeiten" }, |
156 | { "E&mail address:","E&mail Adresse:" }, | 156 | { "E&mail address:","E&mail Adresse:" }, |
157 | { "(EmptyEmail)","(KeineEmail)" }, | 157 | { "(EmptyEmail)","(KeineEmail)" }, |
158 | { "(EmptyName)","(KeinName)" }, | 158 | { "(EmptyName)","(KeinName)" }, |
159 | { "Enable Recurrence","Wiederholung anschalten" }, | 159 | { "Enable Recurrence","Wiederholung anschalten" }, |
160 | { "End after","Endet nach"}, | 160 | { "End after","Endet nach"}, |
161 | { "End by:","Endet am"}, | 161 | { "End by:","Endet am"}, |
162 | { "End Date","End Datum" }, | 162 | { "End/Due Date","Ende/Fällig am" }, |
163 | { "End:","Ende:" }, | 163 | { "End:","Ende:" }, |
164 | { "End Time","End Zeit" }, | 164 | { "End/Due Time","Ende/Fällig um" }, |
165 | { "English","Englisch" }, | 165 | { "English","Englisch" }, |
166 | { "Event","Termin" }, | 166 | { "Event","Termin" }, |
167 | { "Event list","Termin Liste" }, | 167 | { "Event list","Termin Liste" }, |
168 | { "Events","Termine" }, | 168 | { "Events","Termine" }, |
169 | { "Event Viewer:","Termin Übersicht:" }, | 169 | { "Event Viewer:","Termin Übersicht:" }, |
170 | { "every","jede" }, | 170 | { "every","jede" }, |
171 | { "Exceptions...","Ausnahmen..." }, | 171 | { "Exceptions...","Ausnahmen..." }, |
172 | { "Exceptions","Ausnahmen" }, | 172 | { "Exceptions","Ausnahmen" }, |
173 | { "Exclude holidays","Ohne freie Tage" }, | 173 | { "Exclude holidays","Ohne freie Tage" }, |
174 | { "Exclude Saturdays","Ohne Samstage" }, | 174 | { "Exclude Saturdays","Ohne Samstage" }, |
175 | { "Feb","Feb" }, | 175 | { "Feb","Feb" }, |
176 | { "February","Februar" }, | 176 | { "February","Februar" }, |
177 | { "&Find","Suche!" }, | 177 | { "&Find","Suche!" }, |
178 | { "Fonts","Schriftart" }, | 178 | { "Fonts","Schriftart" }, |
179 | { "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" }, | 179 | { "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" }, |
180 | { "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"}, | 180 | { "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"}, |
@@ -351,35 +351,35 @@ | |||
351 | { "Show Dates","Zeige Daten" }, | 351 | { "Show Dates","Zeige Daten" }, |
352 | { "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." }, | 352 | { "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." }, |
353 | { "Show Event","Termin anzeigen" }, | 353 | { "Show Event","Termin anzeigen" }, |
354 | { "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." }, | 354 | { "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." }, |
355 | { "Show Marcus Bains line","Zeige Marcus Bains Linie" }, | 355 | { "Show Marcus Bains line","Zeige Marcus Bains Linie" }, |
356 | { "Show summary after syncing","Zeige Zusammenfassung nach Sync." }, | 356 | { "Show summary after syncing","Zeige Zusammenfassung nach Sync." }, |
357 | { "Show time as:","Zeige Zeit als" }, | 357 | { "Show time as:","Zeige Zeit als" }, |
358 | { "Show Todo","Todo anzeigen" }, | 358 | { "Show Todo","Todo anzeigen" }, |
359 | { "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" }, | 359 | { "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" }, |
360 | { "&Show","Anzeigen" }, | 360 | { "&Show","Anzeigen" }, |
361 | { "Show...","Anzeigen..." }, | 361 | { "Show...","Anzeigen..." }, |
362 | { "Show","Anzeigen" }, | 362 | { "Show","Anzeigen" }, |
363 | { "Small","Klein" }, | 363 | { "Small","Klein" }, |
364 | { "Sorry","Tut mir leid" }, | 364 | { "Sorry","Tut mir leid" }, |
365 | {"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, | 365 | {"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, |
366 | { "Start:","Start:" }, | 366 | { "Start:","Start:" }, |
367 | { "Start Date","Start Datum" }, | 367 | { "Start Date","Start am" }, |
368 | { "Start date: %1","Start Datum: %1" }, | 368 | { "Start date: %1","Start Datum: %1" }, |
369 | { "Start Time","Start Zeit" }, | 369 | { "Start Time","Start um" }, |
370 | { "Status:","Status:" }, | 370 | { "Status:","Status:" }, |
371 | { "Status","Status:" }, | 371 | { "Status","Status:" }, |
372 | { "Summaries","Titel" }, | 372 | { "Summaries","Titel" }, |
373 | { "Summary:","Titel:" }, | 373 | { "Summary:","Titel:" }, |
374 | { "Summary","Titel" }, | 374 | { "Summary","Titel" }, |
375 | { "Sunday","Sonntag" }, | 375 | { "Sunday","Sonntag" }, |
376 | { "Sun","So" }, | 376 | { "Sun","So" }, |
377 | { "Sync preferences:","Sync Einstellungen" }, | 377 | { "Sync preferences:","Sync Einstellungen" }, |
378 | { "Sync Prefs","Sync Einstellungen" }, | 378 | { "Sync Prefs","Sync Einstellungen" }, |
379 | { "Syncronize","Daten abgleich" }, | 379 | { "Syncronize","Daten abgleich" }, |
380 | { "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, | 380 | { "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, |
381 | { "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, | 381 | { "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, |
382 | { "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" }, | 382 | { "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" }, |
383 | { "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges Todo" }, | 383 | { "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges Todo" }, |
384 | { "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" }, | 384 | { "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" }, |
385 | { "Template...","Vorlage..." }, | 385 | { "Template...","Vorlage..." }, |
@@ -1518,26 +1518,28 @@ | |||
1518 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, | 1518 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, |
1519 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, | 1519 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, |
1520 | { "Receiving file from remote...","Empfange entfernte Datei..." }, | 1520 | { "Receiving file from remote...","Empfange entfernte Datei..." }, |
1521 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, | 1521 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, |
1522 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, | 1522 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, |
1523 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, | 1523 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, |
1524 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, | 1524 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, |
1525 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, | 1525 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, |
1526 | { "Writing back file ...","Schreibe Datei zurück..." }, | 1526 | { "Writing back file ...","Schreibe Datei zurück..." }, |
1527 | { "Sending back file ...","Sende Datei zurück..." }, | 1527 | { "Sending back file ...","Sende Datei zurück..." }, |
1528 | { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, | 1528 | { "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, |
1529 | { "Created","Angelegt" }, | 1529 | { "Created","Angelegt" }, |
1530 | { "Last Modified Sub","Zuletzt geändertes Sub" }, | 1530 | { "Last Modified Sub","Zuletzt geändertes Sub" }, |
1531 | { "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, | 1531 | { "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, |
1532 | { "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, | 1532 | { "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, |
1533 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, | 1533 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, |
1534 | { "Duration","Dauer" }, | ||
1535 | { " day"," Tag" }, | ||
1534 | { "","" }, | 1536 | { "","" }, |
1535 | { "","" }, | 1537 | { "","" }, |
1536 | { "","" }, | 1538 | { "","" }, |
1537 | { "","" }, | 1539 | { "","" }, |
1538 | { "","" }, | 1540 | { "","" }, |
1539 | { "","" }, | 1541 | { "","" }, |
1540 | { "","" }, | 1542 | { "","" }, |
1541 | { "","" }, | 1543 | { "","" }, |
1542 | { "","" }, | 1544 | { "","" }, |
1543 | { "","" }, | 1545 | { "","" }, |
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp index 965cf47..10d9a8c 100644 --- a/korganizer/koeditorgeneraltodo.cpp +++ b/korganizer/koeditorgeneraltodo.cpp | |||
@@ -84,56 +84,55 @@ void KOEditorGeneralTodo::finishSetup() | |||
84 | 84 | ||
85 | void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) | 85 | void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) |
86 | { | 86 | { |
87 | QBoxLayout *timeLayout = new QVBoxLayout(topLayout); | 87 | QBoxLayout *timeLayout = new QVBoxLayout(topLayout); |
88 | 88 | ||
89 | QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, | 89 | QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, |
90 | i18n("Date && Time"),parent); | 90 | i18n("Date && Time"),parent); |
91 | timeLayout->addWidget(timeGroupBox); | 91 | timeLayout->addWidget(timeGroupBox); |
92 | timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); | 92 | timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 ); |
93 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); | 93 | timeGroupBox->layout()->setMargin( KDialog::marginHint() ); |
94 | QFrame *timeBoxFrame = new QFrame(timeGroupBox); | 94 | QFrame *timeBoxFrame = new QFrame(timeGroupBox); |
95 | 95 | ||
96 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); | 96 | QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); |
97 | layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); | 97 | layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); |
98 | layoutTimeBox->setColStretch( 1, 1 ); | 98 | layoutTimeBox->setColStretch( 1, 1 ); |
99 | 99 | ||
100 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); | ||
101 | layoutTimeBox->addWidget(mStartCheck,0,0); | ||
102 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); | ||
103 | |||
104 | mStartDateEdit = new KDateEdit(timeBoxFrame); | ||
105 | layoutTimeBox->addWidget(mStartDateEdit,0,1); | ||
106 | |||
107 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); | ||
108 | layoutTimeBox->addWidget(mStartTimeEdit,0,2); | ||
109 | |||
100 | mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame); | 110 | mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame); |
101 | layoutTimeBox->addWidget(mDueCheck,1,0); | 111 | layoutTimeBox->addWidget(mDueCheck,1,0); |
102 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool))); | 112 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool))); |
103 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm())); | 113 | connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm())); |
104 | 114 | ||
105 | 115 | ||
106 | mDueDateEdit = new KDateEdit(timeBoxFrame); | 116 | mDueDateEdit = new KDateEdit(timeBoxFrame); |
107 | layoutTimeBox->addWidget(mDueDateEdit,1,1); | 117 | layoutTimeBox->addWidget(mDueDateEdit,1,1); |
108 | 118 | ||
109 | mDueTimeEdit = new KOTimeEdit(timeBoxFrame); | 119 | mDueTimeEdit = new KOTimeEdit(timeBoxFrame); |
110 | layoutTimeBox->addWidget(mDueTimeEdit,1,2); | 120 | layoutTimeBox->addWidget(mDueTimeEdit,1,2); |
111 | 121 | ||
112 | 122 | ||
113 | mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); | ||
114 | layoutTimeBox->addWidget(mStartCheck,0,0); | ||
115 | connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); | ||
116 | |||
117 | mStartDateEdit = new KDateEdit(timeBoxFrame); | ||
118 | layoutTimeBox->addWidget(mStartDateEdit,0,1); | ||
119 | |||
120 | mStartTimeEdit = new KOTimeEdit(timeBoxFrame); | ||
121 | layoutTimeBox->addWidget(mStartTimeEdit,0,2); | ||
122 | |||
123 | |||
124 | mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame); | 123 | mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame); |
125 | layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); | 124 | layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); |
126 | 125 | ||
127 | connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); | 126 | connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); |
128 | connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime))); | 127 | connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime))); |
129 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); | 128 | connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); |
130 | connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), | 129 | connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), |
131 | this, SLOT(startDateChanged(QDate))); | 130 | this, SLOT(startDateChanged(QDate))); |
132 | // some more layouting | 131 | // some more layouting |
133 | //layoutTimeBox->setColStretch(3,1); | 132 | //layoutTimeBox->setColStretch(3,1); |
134 | } | 133 | } |
135 | 134 | ||
136 | 135 | ||
137 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) | 136 | void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) |
138 | { | 137 | { |
139 | mCompletedCombo = new QComboBox(parent); | 138 | mCompletedCombo = new QComboBox(parent); |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index e7a5e0e..e560ce4 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -115,46 +115,45 @@ bool ListItemVisitor::visit(Event *e) | |||
115 | start =e->dtStartDateStr(); | 115 | start =e->dtStartDateStr(); |
116 | end = e->dtEndDateStr(); | 116 | end = e->dtEndDateStr(); |
117 | ds = e->dtStart().date(); | 117 | ds = e->dtStart().date(); |
118 | de = e->dtEnd().date(); | 118 | de = e->dtEnd().date(); |
119 | } | 119 | } |
120 | mItem->setText(0,e->summary()); | 120 | mItem->setText(0,e->summary()); |
121 | mItem->setText(1,start); | 121 | mItem->setText(1,start); |
122 | if ( e->doesFloat() ) | 122 | if ( e->doesFloat() ) |
123 | mItem->setText(2,"---"); | 123 | mItem->setText(2,"---"); |
124 | else | 124 | else |
125 | mItem->setText(2,e->dtStartTimeStr()); | 125 | mItem->setText(2,e->dtStartTimeStr()); |
126 | mItem->setText(3,end); | 126 | mItem->setText(3,end); |
127 | if ( e->doesFloat() ) | 127 | if ( e->doesFloat() ) |
128 | mItem->setText(4,"---"); | 128 | mItem->setText(4,"---"); |
129 | else | 129 | else |
130 | mItem->setText(4,e->dtEndTimeStr()); | 130 | mItem->setText(4,e->dtEndTimeStr()); |
131 | mItem->setText(5, e->durationText()); | ||
131 | if ( e->isAlarmEnabled() ) { | 132 | if ( e->isAlarmEnabled() ) { |
132 | mItem->setText(5,e->alarms().first()->offsetText() ); | 133 | mItem->setText(6,e->alarms().first()->offsetText() ); |
133 | } else { | 134 | } else { |
134 | mItem->setText(5, i18n("No")); | 135 | mItem->setText(6, i18n("No")); |
135 | } | 136 | } |
136 | mItem->setText(6, e->recurrenceText()); | 137 | mItem->setText(7, e->recurrenceText()); |
137 | if( ! e->doesRecur() ) | 138 | if( ! e->doesRecur() ) |
138 | mItem->setSortKey( 6, "-" ); | 139 | mItem->setSortKey( 7, "-" ); |
139 | mItem->setText(7,"---"); | 140 | mItem->setText(8, e->cancelled() ? i18n("Yes") : i18n("No")); |
140 | mItem->setText(8,"---"); | 141 | mItem->setText(9,e->categoriesStr()); |
141 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 142 | mItem->setText(10, KOPrefs::instance()->calName( e->calID() )); |
142 | mItem->setText(10,e->categoriesStr()); | 143 | mItem->setText(11, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); |
143 | mItem->setText(11, KOPrefs::instance()->calName( e->calID() )); | ||
144 | mItem->setText(12, KGlobal::locale()->formatDateTime( e->lastModified(), true, true )); | ||
145 | 144 | ||
146 | QString key; | 145 | QString key; |
147 | QDate d = e->lastModified().date(); | 146 | QDate d = e->lastModified().date(); |
148 | QTime t = e->lastModified().time(); | 147 | QTime t = e->lastModified().time(); |
149 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); | 148 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() ); |
150 | mItem->setSortKey(12,key); | 149 | mItem->setSortKey(12,key); |
151 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 150 | t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
152 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 151 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
153 | mItem->setSortKey(1,key); | 152 | mItem->setSortKey(1,key); |
154 | 153 | ||
155 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 154 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
156 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 155 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
157 | mItem->setSortKey(3,key); | 156 | mItem->setSortKey(3,key); |
158 | return true; | 157 | return true; |
159 | } | 158 | } |
160 | 159 | ||
@@ -164,157 +163,153 @@ bool ListItemVisitor::visit(Todo *t) | |||
164 | if ( t->isCompleted() ) { | 163 | if ( t->isCompleted() ) { |
165 | mItem->setSortKey(0,"99"+ t->summary().left(10)); | 164 | mItem->setSortKey(0,"99"+ t->summary().left(10)); |
166 | } else | 165 | } else |
167 | mItem->setSortKey(0,QString::number( t->percentComplete()+1 )+ t->summary().left(10)); | 166 | mItem->setSortKey(0,QString::number( t->percentComplete()+1 )+ t->summary().left(10)); |
168 | mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20])); | 167 | mItem->setPixmap( 0, *(sgListViewCompletedPix[t->percentComplete()/20])); |
169 | if (t->hasStartDate()) { | 168 | if (t->hasStartDate()) { |
170 | mItem->setText(1,t->dtStartDateStr()); | 169 | mItem->setText(1,t->dtStartDateStr()); |
171 | if (t->doesFloat()) { | 170 | if (t->doesFloat()) { |
172 | mItem->setText(2,"---"); | 171 | mItem->setText(2,"---"); |
173 | } else { | 172 | } else { |
174 | mItem->setText(2,t->dtStartTimeStr()); | 173 | mItem->setText(2,t->dtStartTimeStr()); |
175 | } | 174 | } |
176 | } else { | 175 | } else { |
177 | mItem->setText(1,"---"); | 176 | mItem->setText(1,"---"); |
178 | mItem->setText(2,"---"); | 177 | mItem->setText(2,"---"); |
179 | } | 178 | } |
180 | mItem->setText(3,"---"); | ||
181 | mItem->setText(4,"---"); | ||
182 | if ( t->isAlarmEnabled() ) { | 179 | if ( t->isAlarmEnabled() ) { |
183 | mItem->setText(5,t->alarms().first()->offsetText() ); | 180 | mItem->setText(6,t->alarms().first()->offsetText() ); |
184 | } else { | 181 | } else { |
185 | mItem->setText(5, i18n("No")); | 182 | mItem->setText(6, i18n("No")); |
186 | } | 183 | } |
187 | mItem->setText(6, t->recurrenceText()); | 184 | mItem->setText(7, t->recurrenceText()); |
188 | if( ! t->doesRecur() ) | 185 | if( ! t->doesRecur() ) |
189 | mItem->setSortKey( 6, "-" ); | 186 | mItem->setSortKey( 7, "-" ); |
190 | if (t->hasDueDate()) { | 187 | if (t->hasDueDate()) { |
191 | mItem->setText(7,t->dtDueDateStr()); | 188 | mItem->setText(3,t->dtDueDateStr()); |
192 | if (t->doesFloat()) { | 189 | if (t->doesFloat()) { |
193 | mItem->setText(8,"---"); | 190 | mItem->setText(4,"---"); |
194 | } else { | 191 | } else { |
195 | mItem->setText(8,t->dtDueTimeStr()); | 192 | mItem->setText(4,t->dtDueTimeStr()); |
196 | } | 193 | } |
197 | } else { | 194 | } else { |
198 | mItem->setText(7,"---"); | 195 | mItem->setText(3,"---"); |
199 | mItem->setText(8,"---"); | 196 | mItem->setText(4,"---"); |
200 | } | 197 | } |
201 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); | 198 | mItem->setText(5, t->durationText()); |
202 | mItem->setText(10,t->categoriesStr()); | 199 | mItem->setText(8, t->cancelled() ? i18n("Yes") : i18n("No")); |
203 | mItem->setText(11, KOPrefs::instance()->calName( t->calID() )); | 200 | mItem->setText(9,t->categoriesStr()); |
204 | mItem->setText(12, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); | 201 | mItem->setText(10, KOPrefs::instance()->calName( t->calID() )); |
202 | mItem->setText(11, KGlobal::locale()->formatDateTime( t->lastModified(), true, true )); | ||
205 | QString key; | 203 | QString key; |
206 | QDate d = t->lastModified().date(); | 204 | QDate d = t->lastModified().date(); |
207 | QTime tm = t->lastModified().time(); | 205 | QTime tm = t->lastModified().time(); |
208 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); | 206 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); |
209 | mItem->setSortKey(12,key); | 207 | mItem->setSortKey(11,key); |
210 | if (t->hasDueDate()) { | 208 | if (t->hasDueDate()) { |
211 | d = t->dtDue().date(); | 209 | d = t->dtDue().date(); |
212 | tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 210 | tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
213 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 211 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
214 | mItem->setSortKey(7,key); | 212 | mItem->setSortKey(3,key); |
215 | } | 213 | } |
216 | if ( t->hasStartDate() ) { | 214 | if ( t->hasStartDate() ) { |
217 | d = t->dtStart().date(); | 215 | d = t->dtStart().date(); |
218 | tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); | 216 | tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); |
219 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 217 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
220 | mItem->setSortKey(1,key); | 218 | mItem->setSortKey(1,key); |
221 | } | 219 | } |
222 | return true; | 220 | return true; |
223 | } | 221 | } |
224 | 222 | ||
225 | bool ListItemVisitor::visit(Journal * j) | 223 | bool ListItemVisitor::visit(Journal * j) |
226 | { | 224 | { |
227 | 225 | ||
228 | QString des; | 226 | QString des; |
229 | mItem->setPixmap( 0, *sgListViewJournalPix); | 227 | mItem->setPixmap( 0, *sgListViewJournalPix); |
230 | if ( !j->summary().isEmpty() ) { | 228 | if ( !j->summary().isEmpty() ) { |
231 | des = j->summary(); | 229 | des = j->summary(); |
232 | } else { | 230 | } else { |
233 | des = j->description().left(30); | 231 | des = j->description().left(30); |
234 | des = des.simplifyWhiteSpace (); | 232 | des = des.simplifyWhiteSpace (); |
235 | des.replace (QRegExp ("\\n"),"" ); | 233 | des.replace (QRegExp ("\\n"),"" ); |
236 | des.replace (QRegExp ("\\r"),"" ); | 234 | des.replace (QRegExp ("\\r"),"" ); |
237 | } | 235 | } |
238 | mItem->setText(0,des.left(25)); | 236 | mItem->setText(0,des.left(25)); |
239 | mItem->setSortKey(0,"0"+ des.left(25)); | 237 | mItem->setSortKey(0,"0"+ des.left(25)); |
240 | mItem->setText(1,j->dtStartDateStr()); | 238 | mItem->setText(1,j->dtStartDateStr()); |
241 | mItem->setText(2,"---"); | 239 | mItem->setText(2,"---"); |
242 | mItem->setText(3,"---"); | 240 | mItem->setText(3,"---"); |
243 | mItem->setText(4,"---"); | 241 | mItem->setText(4,"---"); |
244 | mItem->setText(5,"---"); | 242 | mItem->setText(5,"---"); |
245 | mItem->setText(6,"---"); | 243 | mItem->setText(6,"---"); |
246 | mItem->setText(7,j->dtStartDateStr()); | 244 | mItem->setText(7,"---"); |
247 | mItem->setText(8,"---"); | 245 | mItem->setText(8,"---"); |
248 | mItem->setText(9,"---"); | 246 | mItem->setText(9,j->categoriesStr()); |
249 | mItem->setText(10,j->categoriesStr()); | 247 | mItem->setText(10, KOPrefs::instance()->calName( j->calID() )); |
250 | mItem->setText(11, KOPrefs::instance()->calName( j->calID() )); | 248 | mItem->setText(11, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); |
251 | mItem->setText(12, KGlobal::locale()->formatDateTime( j->lastModified(), true, true )); | ||
252 | 249 | ||
253 | QString key; | 250 | QString key; |
254 | QDate d = j->lastModified().date(); | 251 | QDate d = j->lastModified().date(); |
255 | QTime tm = j->lastModified().time(); | 252 | QTime tm = j->lastModified().time(); |
256 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); | 253 | key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute(),tm.second() ); |
257 | mItem->setSortKey(12,key); | 254 | mItem->setSortKey(12,key); |
258 | d = j->dtStart().date(); | 255 | d = j->dtStart().date(); |
259 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 256 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
260 | mItem->setSortKey(1,key); | 257 | mItem->setSortKey(1,key); |
261 | mItem->setSortKey(7,key); | 258 | mItem->setSortKey(7,key); |
262 | 259 | ||
263 | return true; | 260 | return true; |
264 | } | 261 | } |
265 | 262 | ||
266 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 263 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
267 | const char *name) | 264 | const char *name) |
268 | : KOEventView(calendar, parent, name) | 265 | : KOEventView(calendar, parent, name) |
269 | { | 266 | { |
270 | 267 | ||
271 | mActiveItem = 0; | 268 | mActiveItem = 0; |
272 | mForceShowCompletedTodos = false; | 269 | mForceShowCompletedTodos = false; |
273 | mListView = new KOListViewListView(this); | 270 | mListView = new KOListViewListView(this); |
274 | mListView->addColumn(i18n("Summary")); | 271 | mListView->addColumn(i18n("Summary")); |
275 | mListView->addColumn(i18n("Start Date")); | 272 | mListView->addColumn(i18n("Start Date")); |
276 | mListView->addColumn(i18n("Start Time")); | 273 | mListView->addColumn(i18n("Start Time")); |
277 | mListView->addColumn(i18n("End Date")); | 274 | mListView->addColumn(i18n("End/Due Date")); |
278 | mListView->addColumn(i18n("End Time")); | 275 | mListView->addColumn(i18n("End/Due Time")); |
276 | mListView->addColumn(i18n("Duration")); | ||
279 | mListView->addColumn(i18n("Alarm")); // alarm set? | 277 | mListView->addColumn(i18n("Alarm")); // alarm set? |
280 | mListView->addColumn(i18n("Recurs")); // recurs? | 278 | mListView->addColumn(i18n("Recurs")); // recurs? |
281 | mListView->addColumn(i18n("Due Date")); | ||
282 | mListView->addColumn(i18n("Due Time")); | ||
283 | mListView->addColumn(i18n("Cancelled")); | 279 | mListView->addColumn(i18n("Cancelled")); |
284 | mListView->addColumn(i18n("Categories")); | 280 | mListView->addColumn(i18n("Categories")); |
285 | mListView->addColumn(i18n("Calendar")); | 281 | mListView->addColumn(i18n("Calendar")); |
286 | mListView->addColumn(i18n("Last Modified")); | 282 | mListView->addColumn(i18n("Last Modified")); |
287 | 283 | ||
288 | mListView->setColumnAlignment(0,AlignLeft); | 284 | mListView->setColumnAlignment(0,AlignLeft); |
289 | mListView->setColumnAlignment(1,AlignLeft); | 285 | mListView->setColumnAlignment(1,AlignLeft); |
290 | mListView->setColumnAlignment(2,AlignHCenter); | 286 | mListView->setColumnAlignment(2,AlignHCenter); |
291 | mListView->setColumnAlignment(3,AlignLeft); | 287 | mListView->setColumnAlignment(3,AlignLeft); |
292 | mListView->setColumnAlignment(4,AlignHCenter); | 288 | mListView->setColumnAlignment(4,AlignHCenter); |
293 | mListView->setColumnAlignment(5,AlignLeft); | 289 | mListView->setColumnAlignment(5,AlignLeft); |
294 | mListView->setColumnAlignment(6,AlignLeft); | 290 | mListView->setColumnAlignment(6,AlignLeft); |
295 | mListView->setColumnAlignment(7,AlignLeft); | 291 | mListView->setColumnAlignment(7,AlignLeft); |
296 | mListView->setColumnAlignment(8,AlignLeft); | 292 | mListView->setColumnAlignment(8,AlignLeft); |
297 | mListView->setColumnAlignment(9,AlignLeft); | 293 | mListView->setColumnAlignment(9,AlignLeft); |
298 | mListView->setColumnAlignment(10,AlignLeft); | 294 | mListView->setColumnAlignment(10,AlignLeft); |
299 | mListView->setColumnAlignment(11,AlignLeft); | 295 | mListView->setColumnAlignment(11,AlignLeft); |
300 | mListView->setColumnAlignment(12,AlignLeft); | ||
301 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); | 296 | mKOListViewWhatsThis = new KOListViewWhatsThis(mListView->viewport(),this); |
302 | 297 | ||
303 | int iii = 0; | 298 | int iii = 0; |
304 | for ( iii = 0; iii< 13 ; ++iii ) | 299 | for ( iii = 0; iii< 12 ; ++iii ) |
305 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 300 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
306 | 301 | ||
307 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 302 | QBoxLayout *layoutTop = new QVBoxLayout(this); |
308 | layoutTop->addWidget(mListView); | 303 | layoutTop->addWidget(mListView); |
309 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 304 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
310 | mPopupMenu = eventPopup(); | 305 | mPopupMenu = eventPopup(); |
311 | QPopupMenu* selPopup = new QPopupMenu ( this ); | 306 | QPopupMenu* selPopup = new QPopupMenu ( this ); |
312 | mPopupMenu->insertSeparator(); | 307 | mPopupMenu->insertSeparator(); |
313 | 308 | ||
314 | selPopup->insertItem(i18n("All"),this, | 309 | selPopup->insertItem(i18n("All"),this, |
315 | SLOT(allSelection())); | 310 | SLOT(allSelection())); |
316 | selPopup->insertItem(i18n("None"),this, | 311 | selPopup->insertItem(i18n("None"),this, |
317 | SLOT(clearSelection())); | 312 | SLOT(clearSelection())); |
318 | selPopup->insertItem(i18n("Delete selected..."),this, | 313 | selPopup->insertItem(i18n("Delete selected..."),this, |
319 | SLOT(deleteAll())); | 314 | SLOT(deleteAll())); |
320 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); | 315 | mPopupMenu->insertItem(i18n("Selection"), selPopup ); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 77d0ac8..98a820d 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -212,33 +212,36 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) : | |||
212 | { | 212 | { |
213 | if ( p->mToolBarHorF ) { | 213 | if ( p->mToolBarHorF ) { |
214 | if ( p->mToolBarUpF ) | 214 | if ( p->mToolBarUpF ) |
215 | tbd = Bottom; | 215 | tbd = Bottom; |
216 | else | 216 | else |
217 | tbd = Top; | 217 | tbd = Top; |
218 | } | 218 | } |
219 | else { | 219 | else { |
220 | if ( p->mToolBarUpF ) | 220 | if ( p->mToolBarUpF ) |
221 | tbd = Right; | 221 | tbd = Right; |
222 | else | 222 | else |
223 | tbd = Left; | 223 | tbd = Left; |
224 | } | 224 | } |
225 | filterToolBar = new QPEToolBar ( this ); | 225 | filterToolBar = new QPEToolBar ( this ); |
226 | filterMenubar = new KMenuBar( 0 ); | 226 | filterMenubar = new KMenuBar( 0 ); |
227 | QFontMetrics fm ( filterMenubar->font() ); | 227 | QFontMetrics fm ( filterMenubar->font() ); |
228 | 228 | #ifndef DESKTOP_VERSION | |
229 | filterToolBar->setFocusPolicy( NoFocus ); | ||
230 | filterMenubar->setFocusPolicy( NoFocus ); | ||
231 | #endif | ||
229 | filterPopupMenu = new QPopupMenu( this ); | 232 | filterPopupMenu = new QPopupMenu( this ); |
230 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 233 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
231 | QString addTest = "A"; | 234 | QString addTest = "A"; |
232 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); | 235 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); |
233 | #ifdef DESKTOP_VERSION | 236 | #ifdef DESKTOP_VERSION |
234 | addTest = "AAABBBCCCx"; | 237 | addTest = "AAABBBCCCx"; |
235 | #else | 238 | #else |
236 | addTest = "AAx"; | 239 | addTest = "AAx"; |
237 | #endif | 240 | #endif |
238 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); | 241 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); |
239 | addToolBar (filterToolBar , tbd ); | 242 | addToolBar (filterToolBar , tbd ); |
240 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 243 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
241 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 244 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
242 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) | 245 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) |
243 | filterToolBar->hide(); | 246 | filterToolBar->hide(); |
244 | } else { | 247 | } else { |
diff --git a/libkcal/alarm.cpp b/libkcal/alarm.cpp index 79e0464..3157214 100644 --- a/libkcal/alarm.cpp +++ b/libkcal/alarm.cpp | |||
@@ -337,33 +337,33 @@ void Alarm::setTime(const QDateTime &alarmTime) | |||
337 | } | 337 | } |
338 | int Alarm::offset() | 338 | int Alarm::offset() |
339 | { | 339 | { |
340 | if ( hasTime() ) { | 340 | if ( hasTime() ) { |
341 | if (mParent->typeID() == todoID ) { | 341 | if (mParent->typeID() == todoID ) { |
342 | Todo *t = static_cast<Todo*>(mParent); | 342 | Todo *t = static_cast<Todo*>(mParent); |
343 | return t->dtDue().secsTo( mAlarmTime ) ; | 343 | return t->dtDue().secsTo( mAlarmTime ) ; |
344 | } else | 344 | } else |
345 | return mParent->dtStart().secsTo( mAlarmTime ) ; | 345 | return mParent->dtStart().secsTo( mAlarmTime ) ; |
346 | } | 346 | } |
347 | else | 347 | else |
348 | { | 348 | { |
349 | return mOffset.asSeconds(); | 349 | return mOffset.asSeconds(); |
350 | } | 350 | } |
351 | 351 | ||
352 | } | 352 | } |
353 | QString Alarm::offsetText() | 353 | QString Alarm::offsetText() |
354 | { | 354 | { |
355 | int min = -offset()/60; | 355 | int min = -offset()/60; |
356 | int hours = min /60; | 356 | int hours = min /60; |
357 | min = min % 60; | 357 | min = min % 60; |
358 | int days = hours /24; | 358 | int days = hours /24; |
359 | hours = hours % 24; | 359 | hours = hours % 24; |
360 | QString message; | 360 | QString message; |
361 | //qDebug("%d %d %d ", days, hours, min ); | 361 | //qDebug("%d %d %d ", days, hours, min ); |
362 | if ( days > 0 ) | 362 | if ( days > 0 ) |
363 | message += i18n("%1d").arg( days ); | 363 | message += i18n("%1d").arg( days ); |
364 | if ( hours > 0 ) { | 364 | if ( hours > 0 ) { |
365 | if ( !message.isEmpty() ) message += "/"; | 365 | if ( !message.isEmpty() ) message += "/"; |
366 | message += i18n("%1h").arg( hours ); | 366 | message += i18n("%1h").arg( hours ); |
367 | } | 367 | } |
368 | if ( min > 0 ) { | 368 | if ( min > 0 ) { |
369 | if ( !message.isEmpty() ) message += "/"; | 369 | if ( !message.isEmpty() ) message += "/"; |
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index 0766fd9..fdf5657 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -401,16 +401,24 @@ QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_ | |||
401 | off = -secs; | 401 | off = -secs; |
402 | } | 402 | } |
403 | } | 403 | } |
404 | } | 404 | } |
405 | } | 405 | } |
406 | if ( enabled ) { | 406 | if ( enabled ) { |
407 | if ( alarmStart > start_dt ) { | 407 | if ( alarmStart > start_dt ) { |
408 | *ok = true; | 408 | *ok = true; |
409 | * offset = off; | 409 | * offset = off; |
410 | return alarmStart; | 410 | return alarmStart; |
411 | } | 411 | } |
412 | } | 412 | } |
413 | *ok = false; | 413 | *ok = false; |
414 | return QDateTime (); | 414 | return QDateTime (); |
415 | 415 | ||
416 | } | 416 | } |
417 | |||
418 | QString Event::durationText() | ||
419 | { | ||
420 | int sec = mDtStart.secsTo( mDtEnd ); | ||
421 | if ( doesFloat() ) | ||
422 | sec += 86400; | ||
423 | return durationText4Time( sec ); | ||
424 | } | ||
diff --git a/libkcal/event.h b/libkcal/event.h index 2da9770..6a58618 100644 --- a/libkcal/event.h +++ b/libkcal/event.h | |||
@@ -63,32 +63,33 @@ class Event : public Incidence | |||
63 | /** Return whether the event has an end date/time. */ | 63 | /** Return whether the event has an end date/time. */ |
64 | bool hasEndDate() const; | 64 | bool hasEndDate() const; |
65 | 65 | ||
66 | /** Return true if the event spans multiple days, otherwise return false. */ | 66 | /** Return true if the event spans multiple days, otherwise return false. */ |
67 | bool isMultiDay() const; | 67 | bool isMultiDay() const; |
68 | 68 | ||
69 | /** set the event's time transparency level. */ | 69 | /** set the event's time transparency level. */ |
70 | void setTransparency(Transparency transparency); | 70 | void setTransparency(Transparency transparency); |
71 | /** get the event's time transparency level. */ | 71 | /** get the event's time transparency level. */ |
72 | Transparency transparency() const; | 72 | Transparency transparency() const; |
73 | 73 | ||
74 | void setDuration(int seconds); | 74 | void setDuration(int seconds); |
75 | 75 | ||
76 | bool contains ( Event*); | 76 | bool contains ( Event*); |
77 | 77 | ||
78 | bool isOverlapping ( Event*, QDateTime*, QDateTime* ); | 78 | bool isOverlapping ( Event*, QDateTime*, QDateTime* ); |
79 | QString durationText(); | ||
79 | 80 | ||
80 | private: | 81 | private: |
81 | bool accept(Visitor &v) { return v.visit(this); } | 82 | bool accept(Visitor &v) { return v.visit(this); } |
82 | 83 | ||
83 | QDateTime mDtEnd; | 84 | QDateTime mDtEnd; |
84 | bool mHasEndDate; | 85 | bool mHasEndDate; |
85 | Transparency mTransparency; | 86 | Transparency mTransparency; |
86 | }; | 87 | }; |
87 | 88 | ||
88 | bool operator==( const Event&, const Event& ); | 89 | bool operator==( const Event&, const Event& ); |
89 | 90 | ||
90 | 91 | ||
91 | } | 92 | } |
92 | 93 | ||
93 | 94 | ||
94 | #endif | 95 | #endif |
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 4643a3a..201f593 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -87,33 +87,62 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) | |||
87 | mAnniversary = i.mAnniversary; | 87 | mAnniversary = i.mAnniversary; |
88 | } | 88 | } |
89 | 89 | ||
90 | Incidence::~Incidence() | 90 | Incidence::~Incidence() |
91 | { | 91 | { |
92 | 92 | ||
93 | Incidence *ev; | 93 | Incidence *ev; |
94 | QPtrList<Incidence> Relations = relations(); | 94 | QPtrList<Incidence> Relations = relations(); |
95 | for (ev=Relations.first();ev;ev=Relations.next()) { | 95 | for (ev=Relations.first();ev;ev=Relations.next()) { |
96 | if (ev->relatedTo() == this) ev->setRelatedTo(0); | 96 | if (ev->relatedTo() == this) ev->setRelatedTo(0); |
97 | } | 97 | } |
98 | if (relatedTo()) relatedTo()->removeRelation(this); | 98 | if (relatedTo()) relatedTo()->removeRelation(this); |
99 | if ( mRecurrence ) | 99 | if ( mRecurrence ) |
100 | delete mRecurrence; | 100 | delete mRecurrence; |
101 | 101 | ||
102 | } | 102 | } |
103 | QString Incidence::durationText() | ||
104 | { | ||
105 | return "---"; | ||
106 | } | ||
107 | QString Incidence::durationText4Time( int offset ) | ||
108 | { | ||
109 | int min = offset/60; | ||
110 | int hours = min /60; | ||
111 | min = min % 60; | ||
112 | int days = hours /24; | ||
113 | hours = hours % 24; | ||
114 | |||
115 | if ( doesFloat() || ( min == 0 && hours == 0 ) ) { | ||
116 | if ( days == 1 ) | ||
117 | return "1" + i18n(" day"); | ||
118 | else | ||
119 | return QString::number( days )+ i18n(" days"); | ||
103 | 120 | ||
121 | } | ||
122 | QString message = QString::number ( hours ) +":"; | ||
123 | if ( min < 10 ) message += "0"; | ||
124 | message += QString::number ( min ); | ||
125 | if ( days > 0 ) { | ||
126 | if ( days == 1 ) | ||
127 | message = "1" + i18n(" day") + " "+message; | ||
128 | else | ||
129 | message = QString::number( days )+ i18n(" days") + " "+message; | ||
130 | } | ||
131 | return message; | ||
132 | } | ||
104 | bool Incidence::isHoliday() const | 133 | bool Incidence::isHoliday() const |
105 | { | 134 | { |
106 | return mHoliday; | 135 | return mHoliday; |
107 | } | 136 | } |
108 | bool Incidence::isBirthday() const | 137 | bool Incidence::isBirthday() const |
109 | { | 138 | { |
110 | 139 | ||
111 | return mBirthday ; | 140 | return mBirthday ; |
112 | } | 141 | } |
113 | bool Incidence::isAnniversary() const | 142 | bool Incidence::isAnniversary() const |
114 | { | 143 | { |
115 | return mAnniversary ; | 144 | return mAnniversary ; |
116 | 145 | ||
117 | } | 146 | } |
118 | 147 | ||
119 | bool Incidence::hasRecurrenceID() const | 148 | bool Incidence::hasRecurrenceID() const |
diff --git a/libkcal/incidence.h b/libkcal/incidence.h index 8519f01..88df217 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h | |||
@@ -268,33 +268,34 @@ class Incidence : public IncidenceBase | |||
268 | bool cancelled() const; | 268 | bool cancelled() const; |
269 | void setCancelled( bool b ); | 269 | void setCancelled( bool b ); |
270 | 270 | ||
271 | bool hasRecurrenceID() const; | 271 | bool hasRecurrenceID() const; |
272 | void setHasRecurrenceID( bool b ); | 272 | void setHasRecurrenceID( bool b ); |
273 | 273 | ||
274 | void setRecurrenceID(QDateTime); | 274 | void setRecurrenceID(QDateTime); |
275 | QDateTime recurrenceID () const; | 275 | QDateTime recurrenceID () const; |
276 | QDateTime dtStart() const; | 276 | QDateTime dtStart() const; |
277 | bool isHoliday() const; | 277 | bool isHoliday() const; |
278 | bool isBirthday() const; | 278 | bool isBirthday() const; |
279 | bool isAnniversary() const; | 279 | bool isAnniversary() const; |
280 | QDateTime lastModifiedSub(); | 280 | QDateTime lastModifiedSub(); |
281 | QString recurrenceText() const; | 281 | QString recurrenceText() const; |
282 | void setLastModifiedSubInvalid(); | 282 | void setLastModifiedSubInvalid(); |
283 | 283 | ||
284 | 284 | virtual QString durationText(); | |
285 | QString durationText4Time( int secs ); | ||
285 | Recurrence *mRecurrence; | 286 | Recurrence *mRecurrence; |
286 | protected: | 287 | protected: |
287 | QPtrList<Alarm> mAlarms; | 288 | QPtrList<Alarm> mAlarms; |
288 | QPtrList<Incidence> mRelations; | 289 | QPtrList<Incidence> mRelations; |
289 | QDateTime mRecurrenceID; | 290 | QDateTime mRecurrenceID; |
290 | bool mHasRecurrenceID; | 291 | bool mHasRecurrenceID; |
291 | private: | 292 | private: |
292 | void checkCategories(); | 293 | void checkCategories(); |
293 | bool mHoliday, mBirthday, mAnniversary; | 294 | bool mHoliday, mBirthday, mAnniversary; |
294 | int mRevision; | 295 | int mRevision; |
295 | bool mCancelled; | 296 | bool mCancelled; |
296 | 297 | ||
297 | // base components of jounal, event and todo | 298 | // base components of jounal, event and todo |
298 | QDateTime mCreated; | 299 | QDateTime mCreated; |
299 | QDateTime mLastModifiedSub; | 300 | QDateTime mLastModifiedSub; |
300 | QString mDescription; | 301 | QString mDescription; |
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 7bf756a..e4508a0 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -601,16 +601,26 @@ void Todo::checkSetCompletedFalse() | |||
601 | { | 601 | { |
602 | if ( !mHasRecurrenceID ) { | 602 | if ( !mHasRecurrenceID ) { |
603 | qDebug("ERROR 1 in Todo::checkSetCompletedFalse"); | 603 | qDebug("ERROR 1 in Todo::checkSetCompletedFalse"); |
604 | return; | 604 | return; |
605 | } | 605 | } |
606 | // qDebug("Todo::checkSetCompletedFalse()"); | 606 | // qDebug("Todo::checkSetCompletedFalse()"); |
607 | //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); | 607 | //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); |
608 | if ( mPercentComplete == 100 ) { | 608 | if ( mPercentComplete == 100 ) { |
609 | QDateTime dt = QDateTime::currentDateTime(); | 609 | QDateTime dt = QDateTime::currentDateTime(); |
610 | if ( dt > mDtStart && dt > mRecurrenceID ) { | 610 | if ( dt > mDtStart && dt > mRecurrenceID ) { |
611 | qDebug("start: %s --due: %s --recID: %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); | 611 | qDebug("start: %s --due: %s --recID: %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); |
612 | setCompleted( false ); | 612 | setCompleted( false ); |
613 | qDebug("Todo::checkSetCompletedFalse "); | 613 | qDebug("Todo::checkSetCompletedFalse "); |
614 | } | 614 | } |
615 | } | 615 | } |
616 | } | 616 | } |
617 | QString Todo::durationText() | ||
618 | { | ||
619 | if ( mHasDueDate && hasStartDate() ) { | ||
620 | int sec = dtStart().secsTo( dtDue() ); | ||
621 | if ( doesFloat() ) | ||
622 | sec += 86400; | ||
623 | return durationText4Time( sec ); | ||
624 | } | ||
625 | return "---"; | ||
626 | } | ||
diff --git a/libkcal/todo.h b/libkcal/todo.h index 425dfad..7feb32e 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h | |||
@@ -117,32 +117,33 @@ namespace KCal { | |||
117 | bool hasCompletedDate() const; | 117 | bool hasCompletedDate() const; |
118 | bool contains ( Todo*); | 118 | bool contains ( Todo*); |
119 | void checkSetCompletedFalse(); | 119 | void checkSetCompletedFalse(); |
120 | bool setRecurDates(); | 120 | bool setRecurDates(); |
121 | bool isRunning() {return mRunning;} | 121 | bool isRunning() {return mRunning;} |
122 | bool hasRunningSub(); | 122 | bool hasRunningSub(); |
123 | void setRunning( bool ); | 123 | void setRunning( bool ); |
124 | void setRunningFalse( QString ); | 124 | void setRunningFalse( QString ); |
125 | void stopRunning(); | 125 | void stopRunning(); |
126 | int runTime(); | 126 | int runTime(); |
127 | QDateTime runStart () const { return mRunStart;} | 127 | QDateTime runStart () const { return mRunStart;} |
128 | void saveRunningInfo( QString comment, QDateTime start, QDateTime end ); | 128 | void saveRunningInfo( QString comment, QDateTime start, QDateTime end ); |
129 | public slots: | 129 | public slots: |
130 | void saveRunningInfoToFile( QString st ); | 130 | void saveRunningInfoToFile( QString st ); |
131 | void saveRunningInfoToFile( ); | 131 | void saveRunningInfoToFile( ); |
132 | void saveParents(); | 132 | void saveParents(); |
133 | QString durationText(); | ||
133 | private: | 134 | private: |
134 | bool mRunning; | 135 | bool mRunning; |
135 | QTimer * mRunSaveTimer; | 136 | QTimer * mRunSaveTimer; |
136 | QDateTime mRunStart; | 137 | QDateTime mRunStart; |
137 | QDateTime mRunEnd; | 138 | QDateTime mRunEnd; |
138 | bool accept(Visitor &v) { return v.visit(this); } | 139 | bool accept(Visitor &v) { return v.visit(this); } |
139 | 140 | ||
140 | QDateTime mDtDue; // due date of todo | 141 | QDateTime mDtDue; // due date of todo |
141 | 142 | ||
142 | bool mHasDueDate; // if todo has associated due date | 143 | bool mHasDueDate; // if todo has associated due date |
143 | 144 | ||
144 | // int mStatus; // confirmed/delegated/tentative/etc | 145 | // int mStatus; // confirmed/delegated/tentative/etc |
145 | 146 | ||
146 | QDateTime mCompleted; | 147 | QDateTime mCompleted; |
147 | bool mHasCompletedDate; | 148 | bool mHasCompletedDate; |
148 | 149 | ||