summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-02-13 19:07:45 (UTC)
committer zautrix <zautrix>2005-02-13 19:07:45 (UTC)
commit7bd83e913399b8be68a7d37e8f02118ec9eab90e (patch) (unidiff)
tree284d1592687ea4d3e0c220fafd289a702718dee4 /korganizer
parent293271fe9e6a9061da329183f8f488d79580f7da (diff)
downloadkdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.zip
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.gz
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.bz2
todo fixi
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp14
-rw-r--r--korganizer/koagendaview.cpp15
-rw-r--r--korganizer/koeventviewer.cpp7
-rw-r--r--korganizer/kolistview.cpp2
-rw-r--r--korganizer/komonthview.cpp3
-rw-r--r--korganizer/kowhatsnextview.cpp6
6 files changed, 44 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 7c8316f..3dac20b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2260,21 +2260,33 @@ void CalendarView::slotSelectPickerDate( QDate d)
2260 if ( mDatePickerMode == 1 ) { 2260 if ( mDatePickerMode == 1 ) {
2261 mNavigator->slotDaySelect( d ); 2261 mNavigator->slotDaySelect( d );
2262 } else if ( mDatePickerMode == 2 ) { 2262 } else if ( mDatePickerMode == 2 ) {
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 {
2269 tim = QTime ( 0,0,0 ); 2272 tim = QTime ( 0,0,0 );
2270 to->setFloats( true ); 2273 to->setFloats( true );
2271 to->setHasDueDate( true ); 2274 to->setHasDueDate( true );
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() ) {
2278#if 0 2290#if 0
2279 // PENDING implement this 2291 // PENDING implement this
2280 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2292 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
@@ -3807,13 +3819,13 @@ bool CalendarView::removeCompletedSubTodos( Todo* t )
3807 subTodos = t->relations(); 3819 subTodos = t->relations();
3808 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { 3820 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
3809 if (! removeCompletedSubTodos( (Todo*) aTodo )) 3821 if (! removeCompletedSubTodos( (Todo*) aTodo ))
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 );
3817 } 3829 }
3818 else 3830 else
3819 deleteTodo = false; 3831 deleteTodo = false;
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 13d8398..4ff6899 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -996,13 +996,26 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
996 } 996 }
997 } 997 }
998 if ( item->incidence()->type() == "Event" ) { 998 if ( item->incidence()->type() == "Event" ) {
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);
1006 item->setItemDate(startDt.date()); 1019 item->setItemDate(startDt.date());
1007 //item->updateItem(); 1020 //item->updateItem();
1008 if ( item->incidence()->type() == "Todo" ) { 1021 if ( item->incidence()->type() == "Todo" ) {
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 39921a0..f6c9624 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -399,12 +399,19 @@ void KOEventViewer::appendTodo(Todo *event, int mode )
399 399
400 if (!event->location().isEmpty()) { 400 if (!event->location().isEmpty()) {
401 addTag("b",i18n("Location: ")); 401 addTag("b",i18n("Location: "));
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 }
408 if (event->hasDueDate()) { 415 if (event->hasDueDate()) {
409 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); 416 mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
410 mMailSubject += i18n(" - " )+event->dtDueStr( true ); 417 mMailSubject += i18n(" - " )+event->dtDueStr( true );
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index acd9265..d8e940b 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -153,13 +153,13 @@ bool ListItemVisitor::visit(Todo *t)
153 mItem->setText(1,"---"); 153 mItem->setText(1,"---");
154 mItem->setText(2,"---"); 154 mItem->setText(2,"---");
155 } 155 }
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()) {
163 mItem->setText(8,"---"); 163 mItem->setText(8,"---");
164 } else { 164 } else {
165 mItem->setText(8,t->dtDueTimeStr()); 165 mItem->setText(8,t->dtDueTimeStr());
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f595d35..d0380e3 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -578,12 +578,15 @@ void MonthViewCell::insertTodo(Todo *todo)
578 } 578 }
579 579
580 } else { 580 } else {
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}
587void MonthViewCell::finishUpdateCell() 590void MonthViewCell::finishUpdateCell()
588{ 591{
589#ifdef DESKTOP_VERSION 592#ifdef DESKTOP_VERSION
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 391b3bb..18dc656 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -665,12 +665,18 @@ bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
665 if ( ev->description().length() > 0 ) { 665 if ( ev->description().length() > 0 ) {
666 if ( !needClose) 666 if ( !needClose)
667 mText +="["; 667 mText +="[";
668 mText += "i"; 668 mText += "i";
669 needClose =true; 669 needClose =true;
670 } 670 }
671 if ( ev->doesRecur() ) {
672 if ( !needClose)
673 mText +="[";
674 mText += "r";
675 needClose =true;
676 }
671 // if ( ev->recurrence()->doesRecur() ) { 677 // if ( ev->recurrence()->doesRecur() ) {
672 // if ( !needClose) 678 // if ( !needClose)
673 // mText +="("; 679 // mText +="(";
674 // mText += "r"; 680 // mText += "r";
675 // needClose =true; 681 // needClose =true;
676 // } 682 // }