summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-13 19:07:45 (UTC)
committer zautrix <zautrix>2005-02-13 19:07:45 (UTC)
commit7bd83e913399b8be68a7d37e8f02118ec9eab90e (patch) (unidiff)
tree284d1592687ea4d3e0c220fafd289a702718dee4
parent293271fe9e6a9061da329183f8f488d79580f7da (diff)
downloadkdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.zip
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.gz
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.bz2
todo fixi
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-rw-r--r--korganizer/calendarview.cpp14
-rw-r--r--korganizer/koagendaview.cpp17
-rw-r--r--korganizer/koeventviewer.cpp7
-rw-r--r--korganizer/kolistview.cpp2
-rw-r--r--korganizer/komonthview.cpp3
-rw-r--r--korganizer/kowhatsnextview.cpp6
-rw-r--r--libkcal/icalformatimpl.cpp2
-rw-r--r--libkcal/incidence.cpp16
-rw-r--r--libkcal/kincidenceformatter.cpp12
-rw-r--r--libkcal/todo.cpp4
11 files changed, 74 insertions, 13 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index c85ca35..2d4cb74 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1269,8 +1269,8 @@
1269{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1269{ "High clock skew!","Großer Uhrzeitunterschied!" },
1270{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1270{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1271{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, 1271{ "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" },
1272{ "","" }, 1272{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1273{ "","" }, 1273{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1274{ "","" }, 1274{ "","" },
1275{ "","" }, 1275{ "","" },
1276{ "","" }, 1276{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 7c8316f..3dac20b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2263,6 +2263,9 @@ void CalendarView::slotSelectPickerDate( QDate d)
2263 if ( mMoveIncidence->type() == "Todo" ) { 2263 if ( mMoveIncidence->type() == "Todo" ) {
2264 Todo * to = (Todo *) mMoveIncidence; 2264 Todo * to = (Todo *) mMoveIncidence;
2265 QTime tim; 2265 QTime tim;
2266 int len = 0;
2267 if ( to->hasStartDate() && to->hasDueDate() )
2268 len = to->dtStart().secsTo( to->dtDue());
2266 if ( to->hasDueDate() ) 2269 if ( to->hasDueDate() )
2267 tim = to->dtDue().time(); 2270 tim = to->dtDue().time();
2268 else { 2271 else {
@@ -2272,6 +2275,15 @@ void CalendarView::slotSelectPickerDate( QDate d)
2272 } 2275 }
2273 QDateTime dt ( d,tim ); 2276 QDateTime dt ( d,tim );
2274 to->setDtDue( dt ); 2277 to->setDtDue( dt );
2278
2279 if ( to->hasStartDate() ) {
2280 if ( len>0 )
2281 to->setDtStart(to->dtDue().addSecs( -len ));
2282 else
2283 if (to->dtStart() > to->dtDue() )
2284 to->setDtStart(to->dtDue().addDays( -3 ));
2285 }
2286
2275 todoChanged( to ); 2287 todoChanged( to );
2276 } else { 2288 } else {
2277 if ( mMoveIncidence->doesRecur() ) { 2289 if ( mMoveIncidence->doesRecur() ) {
@@ -3810,7 +3822,7 @@ bool CalendarView::removeCompletedSubTodos( Todo* t )
3810 deleteTodo = false; 3822 deleteTodo = false;
3811 } 3823 }
3812 if ( deleteTodo ) { 3824 if ( deleteTodo ) {
3813 if ( t->isCompleted() ) { 3825 if ( t->isCompleted() && !t->doesRecur()) {
3814 checkExternalId( t ); 3826 checkExternalId( t );
3815 mCalendar->deleteTodo( t ); 3827 mCalendar->deleteTodo( t );
3816 changeTodoDisplay( t,KOGlobals::EVENTDELETED ); 3828 changeTodoDisplay( t,KOGlobals::EVENTDELETED );
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 13d8398..4ff6899 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -999,7 +999,20 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
999 item->incidence()->setDtStart(startDt); 999 item->incidence()->setDtStart(startDt);
1000 (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); 1000 (static_cast<Event*>(item->incidence()))->setDtEnd(endDt);
1001 } else if ( item->incidence()->type() == "Todo" ) { 1001 } else if ( item->incidence()->type() == "Todo" ) {
1002 (static_cast<Todo*>(item->incidence()))->setDtDue(endDt); 1002 Todo* to = static_cast<Todo*>(item->incidence());
1003
1004 int len = 0;
1005 if ( to->hasStartDate() && to->hasDueDate() )
1006 len = to->dtStart().secsTo( to->dtDue());
1007 to->setDtDue(endDt);
1008 if ( to->hasStartDate() ) {
1009 if ( len>0 )
1010 to->setDtStart(to->dtDue().addSecs( -len ));
1011 else
1012 if (to->dtStart() > to->dtDue() )
1013 to->setDtStart(to->dtDue().addDays( -3 ));
1014 }
1015
1003 } 1016 }
1004 //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); 1017 //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() );
1005 item->incidence()->setRevision(item->incidence()->revision()+1); 1018 item->incidence()->setRevision(item->incidence()->revision()+1);
@@ -1180,7 +1193,7 @@ void KOAgendaView::fillAgenda()
1180 Todo *todo = todos.at(numTodo); 1193 Todo *todo = todos.at(numTodo);
1181 1194
1182 if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date 1195 if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date
1183 1196
1184 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. 1197 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.
1185 // Already completed items can be displayed on their original due date 1198 // Already completed items can be displayed on their original due date
1186 //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda 1199 //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 39921a0..f6c9624 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -402,6 +402,13 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
402 mText.append(event->location()+"<br>"); 402 mText.append(event->location()+"<br>");
403 mMailSubject += i18n(" at ") + event->location(); 403 mMailSubject += i18n(" at ") + event->location();
404 } 404 }
405
406 if (event->recurrence()->doesRecur()) {
407
408 QString recurText = event->recurrence()->recurrenceText();
409 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
410
411 }
405 if (event->hasStartDate()) { 412 if (event->hasStartDate()) {
406 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); 413 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
407 } 414 }
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index acd9265..d8e940b 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -156,7 +156,7 @@ bool ListItemVisitor::visit(Todo *t)
156 mItem->setText(3,"---"); 156 mItem->setText(3,"---");
157 mItem->setText(4,"---"); 157 mItem->setText(4,"---");
158 mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No")); 158 mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No"));
159 mItem->setText(6,"---"); 159 mItem->setText(6, t->recurrence()->recurrenceText());
160 if (t->hasDueDate()) { 160 if (t->hasDueDate()) {
161 mItem->setText(7,t->dtDueDateStr()); 161 mItem->setText(7,t->dtDueDateStr());
162 if (t->doesFloat()) { 162 if (t->doesFloat()) {
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f595d35..d0380e3 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -581,6 +581,9 @@ void MonthViewCell::insertTodo(Todo *todo)
581 pal = mStandardPalette ; 581 pal = mStandardPalette ;
582 } 582 }
583 item->setPalette( pal ); 583 item->setPalette( pal );
584 item->setRecur( todo->recurrence()->doesRecur() );
585 item->setAlarm( todo->isAlarmEnabled() );
586 item->setMoreInfo( todo->description().length() > 0 );
584 mItemList->insertItem( item ); 587 mItemList->insertItem( item );
585 mToolTip += text+"\n"; 588 mToolTip += text+"\n";
586} 589}
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 391b3bb..18dc656 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -667,6 +667,12 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
667 mText +="["; 667 mText +="[";
668 mText += "i"; 668 mText += "i";
669 needClose =true; 669 needClose =true;
670 }
671 if ( ev->doesRecur() ) {
672 if ( !needClose)
673 mText +="[";
674 mText += "r";
675 needClose =true;
670 } 676 }
671 // if ( ev->recurrence()->doesRecur() ) { 677 // if ( ev->recurrence()->doesRecur() ) {
672 // if ( !needClose) 678 // if ( !needClose)
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index bb9cb29..2e38ae3 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -1210,7 +1210,7 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence)
1210 case ICAL_RECURRENCEID_PROPERTY: 1210 case ICAL_RECURRENCEID_PROPERTY:
1211 icaltime = icalproperty_get_recurrenceid(p); 1211 icaltime = icalproperty_get_recurrenceid(p);
1212 incidence->setRecurrenceID( readICalDateTime(icaltime) ); 1212 incidence->setRecurrenceID( readICalDateTime(icaltime) );
1213 qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() ); 1213 //qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() );
1214 break; 1214 break;
1215#if 0 1215#if 0
1216 // status 1216 // status
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 0684af2..708ee6b 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -213,10 +213,18 @@ Incidence* Incidence::recreateCloneException( QDate d )
213 if ( doesRecur() ) { 213 if ( doesRecur() ) {
214 addExDate( d ); 214 addExDate( d );
215 newInc->recurrence()->unsetRecurs(); 215 newInc->recurrence()->unsetRecurs();
216 int len = dtStart().secsTo( ((Event*)this)->dtEnd()); 216 if ( type() == "Event") {
217 QTime tim = dtStart().time(); 217 int len = dtStart().secsTo( ((Event*)this)->dtEnd());
218 newInc->setDtStart( QDateTime(d, tim) ); 218 QTime tim = dtStart().time();
219 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); 219 newInc->setDtStart( QDateTime(d, tim) );
220 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
221 } else {
222 int len = dtStart().secsTo( ((Todo*)this)->dtDue());
223 QTime tim = ((Todo*)this)->dtDue().time();
224 ((Todo*)newInc)->setDtDue( QDateTime(d, tim) );
225 ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) );
226 ((Todo*)this)->setRecurDates();
227 }
220 } 228 }
221 return newInc; 229 return newInc;
222} 230}
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 0d9c3f4..cc3088a 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -192,6 +192,18 @@ void KIncidenceFormatter::setTodo(Todo *event )
192 addTag("b",i18n("Location: ")); 192 addTag("b",i18n("Location: "));
193 mText.append(event->location()+"<br>"); 193 mText.append(event->location()+"<br>");
194 } 194 }
195
196 if (event->recurrence()->doesRecur()) {
197
198 QString recurText = event->recurrence()->recurrenceText();
199 addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
200 }
201
202 if (event->hasStartDate()) {
203 mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(shortDate)));
204 }
205
206
195 if (event->hasDueDate()) { 207 if (event->hasDueDate()) {
196 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); 208 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate)));
197 } 209 }
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 1f54c2f..39d16b6 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -369,7 +369,7 @@ bool Todo::setRecurDates()
369 return true; 369 return true;
370 int secs = mDtStart.secsTo( dtDue() ); 370 int secs = mDtStart.secsTo( dtDue() );
371 bool ok; 371 bool ok;
372 qDebug("--------------------setRecurDates() "); 372 qDebug("T:setRecurDates() ");
373 //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); 373 //qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
374 QDateTime next = getNextOccurence( mRecurrenceID, &ok ); 374 QDateTime next = getNextOccurence( mRecurrenceID, &ok );
375 if ( ok ) { 375 if ( ok ) {
@@ -452,6 +452,6 @@ void Todo::checkSetCompletedFalse()
452 if ( mPercentComplete == 100 && mDtStart == mRecurrenceID && QDateTime::currentDateTime() > mDtStart) { 452 if ( mPercentComplete == 100 && mDtStart == mRecurrenceID && QDateTime::currentDateTime() > mDtStart) {
453 qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() ); 453 qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
454 setCompleted( false ); 454 setCompleted( false );
455 qDebug("Todo::checkSetCompletedFalse++++++++++++++++++++++++++++ "); 455 qDebug("Todo::checkSetCompletedFalse ");
456 } 456 }
457} 457}