summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-13 19:07:45 (UTC)
committer zautrix <zautrix>2005-02-13 19:07:45 (UTC)
commit7bd83e913399b8be68a7d37e8f02118ec9eab90e (patch) (side-by-side diff)
tree284d1592687ea4d3e0c220fafd289a702718dee4
parent293271fe9e6a9061da329183f8f488d79580f7da (diff)
downloadkdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.zip
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.gz
kdepimpi-7bd83e913399b8be68a7d37e8f02118ec9eab90e.tar.bz2
todo fixi
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt4
-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
-rw-r--r--libkcal/icalformatimpl.cpp2
-rw-r--r--libkcal/incidence.cpp8
-rw-r--r--libkcal/kincidenceformatter.cpp12
-rw-r--r--libkcal/todo.cpp4
11 files changed, 69 insertions, 8 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
@@ -1266,14 +1266,14 @@
{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
{ "Synchronize!","Synchronisiere!" },
{ "High clock skew!","Großer Uhrzeitunterschied!" },
{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
{ "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!" },
-{ "","" },
-{ "","" },
+{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
+{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
{ "","" },
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)
if ( mDatePickerMode == 1 ) {
mNavigator->slotDaySelect( d );
} else if ( mDatePickerMode == 2 ) {
if ( mMoveIncidence->type() == "Todo" ) {
Todo * to = (Todo *) mMoveIncidence;
QTime tim;
+ int len = 0;
+ if ( to->hasStartDate() && to->hasDueDate() )
+ len = to->dtStart().secsTo( to->dtDue());
if ( to->hasDueDate() )
tim = to->dtDue().time();
else {
tim = QTime ( 0,0,0 );
to->setFloats( true );
to->setHasDueDate( true );
}
QDateTime dt ( d,tim );
to->setDtDue( dt );
+
+ if ( to->hasStartDate() ) {
+ if ( len>0 )
+ to->setDtStart(to->dtDue().addSecs( -len ));
+ else
+ if (to->dtStart() > to->dtDue() )
+ to->setDtStart(to->dtDue().addDays( -3 ));
+ }
+
todoChanged( to );
} else {
if ( mMoveIncidence->doesRecur() ) {
#if 0
// PENDING implement this
Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
@@ -3807,13 +3819,13 @@ bool CalendarView::removeCompletedSubTodos( Todo* t )
subTodos = t->relations();
for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
if (! removeCompletedSubTodos( (Todo*) aTodo ))
deleteTodo = false;
}
if ( deleteTodo ) {
- if ( t->isCompleted() ) {
+ if ( t->isCompleted() && !t->doesRecur()) {
checkExternalId( t );
mCalendar->deleteTodo( t );
changeTodoDisplay( t,KOGlobals::EVENTDELETED );
}
else
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)
}
}
if ( item->incidence()->type() == "Event" ) {
item->incidence()->setDtStart(startDt);
(static_cast<Event*>(item->incidence()))->setDtEnd(endDt);
} else if ( item->incidence()->type() == "Todo" ) {
- (static_cast<Todo*>(item->incidence()))->setDtDue(endDt);
+ Todo* to = static_cast<Todo*>(item->incidence());
+
+ int len = 0;
+ if ( to->hasStartDate() && to->hasDueDate() )
+ len = to->dtStart().secsTo( to->dtDue());
+ to->setDtDue(endDt);
+ if ( to->hasStartDate() ) {
+ if ( len>0 )
+ to->setDtStart(to->dtDue().addSecs( -len ));
+ else
+ if (to->dtStart() > to->dtDue() )
+ to->setDtStart(to->dtDue().addDays( -3 ));
+ }
+
}
//qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() );
item->incidence()->setRevision(item->incidence()->revision()+1);
item->setItemDate(startDt.date());
//item->updateItem();
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 )
if (!event->location().isEmpty()) {
addTag("b",i18n("Location: "));
mText.append(event->location()+"<br>");
mMailSubject += i18n(" at ") + event->location();
}
+
+ if (event->recurrence()->doesRecur()) {
+
+ QString recurText = event->recurrence()->recurrenceText();
+ addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
+
+ }
if (event->hasStartDate()) {
mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer)));
}
if (event->hasDueDate()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer)));
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)
mItem->setText(1,"---");
mItem->setText(2,"---");
}
mItem->setText(3,"---");
mItem->setText(4,"---");
mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No"));
- mItem->setText(6,"---");
+ mItem->setText(6, t->recurrence()->recurrenceText());
if (t->hasDueDate()) {
mItem->setText(7,t->dtDueDateStr());
if (t->doesFloat()) {
mItem->setText(8,"---");
} else {
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)
}
} else {
pal = mStandardPalette ;
}
item->setPalette( pal );
+ item->setRecur( todo->recurrence()->doesRecur() );
+ item->setAlarm( todo->isAlarmEnabled() );
+ item->setMoreInfo( todo->description().length() > 0 );
mItemList->insertItem( item );
mToolTip += text+"\n";
}
void MonthViewCell::finishUpdateCell()
{
#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 )
if ( ev->description().length() > 0 ) {
if ( !needClose)
mText +="[";
mText += "i";
needClose =true;
}
+ if ( ev->doesRecur() ) {
+ if ( !needClose)
+ mText +="[";
+ mText += "r";
+ needClose =true;
+ }
// if ( ev->recurrence()->doesRecur() ) {
// if ( !needClose)
// mText +="(";
// mText += "r";
// needClose =true;
// }
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index bb9cb29..2e38ae3 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -1207,13 +1207,13 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence)
incidence->setLocation(QString::fromUtf8(text));
break;
case ICAL_RECURRENCEID_PROPERTY:
icaltime = icalproperty_get_recurrenceid(p);
incidence->setRecurrenceID( readICalDateTime(icaltime) );
- qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() );
+ //qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() );
break;
#if 0
// status
if ((vo = isAPropertyOf(vincidence, VCStatusProp)) != 0) {
incidence->setStatus(s = fakeCString(vObjectUStringZValue(vo)));
deleteStr(s);
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 0684af2..708ee6b 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -210,16 +210,24 @@ Incidence* Incidence::recreateCloneException( QDate d )
{
Incidence* newInc = clone();
newInc->recreate();
if ( doesRecur() ) {
addExDate( d );
newInc->recurrence()->unsetRecurs();
+ if ( type() == "Event") {
int len = dtStart().secsTo( ((Event*)this)->dtEnd());
QTime tim = dtStart().time();
newInc->setDtStart( QDateTime(d, tim) );
((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
+ } else {
+ int len = dtStart().secsTo( ((Todo*)this)->dtDue());
+ QTime tim = ((Todo*)this)->dtDue().time();
+ ((Todo*)newInc)->setDtDue( QDateTime(d, tim) );
+ ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) );
+ ((Todo*)this)->setRecurDates();
+ }
}
return newInc;
}
void Incidence::recreate()
{
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp
index 0d9c3f4..cc3088a 100644
--- a/libkcal/kincidenceformatter.cpp
+++ b/libkcal/kincidenceformatter.cpp
@@ -189,12 +189,24 @@ void KIncidenceFormatter::setTodo(Todo *event )
}
if (!event->location().isEmpty()) {
addTag("b",i18n("Location: "));
mText.append(event->location()+"<br>");
}
+
+ if (event->recurrence()->doesRecur()) {
+
+ QString recurText = event->recurrence()->recurrenceText();
+ addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>");
+ }
+
+ if (event->hasStartDate()) {
+ mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(shortDate)));
+ }
+
+
if (event->hasDueDate()) {
mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate)));
}
mText.append(i18n("<p><b>Priority:</b> %2</p>")
.arg(QString::number(event->priority())));
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 1f54c2f..39d16b6 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -366,13 +366,13 @@ int Todo::percentComplete() const
bool Todo::setRecurDates()
{
if ( !mHasRecurrenceID )
return true;
int secs = mDtStart.secsTo( dtDue() );
bool ok;
- qDebug("--------------------setRecurDates() ");
+ qDebug("T:setRecurDates() ");
//qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
QDateTime next = getNextOccurence( mRecurrenceID, &ok );
if ( ok ) {
mRecurrenceID = next;
mDtStart = next;
setDtDue( next.addSecs( secs ) );
@@ -449,9 +449,9 @@ void Todo::checkSetCompletedFalse()
}
// qDebug("Todo::checkSetCompletedFalse()");
//qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
if ( mPercentComplete == 100 && mDtStart == mRecurrenceID && QDateTime::currentDateTime() > mDtStart) {
qDebug("%s %s %s ",mDtStart.toString().latin1(), dtDue().toString().latin1(),mRecurrenceID.toString().latin1() );
setCompleted( false );
- qDebug("Todo::checkSetCompletedFalse++++++++++++++++++++++++++++ ");
+ qDebug("Todo::checkSetCompletedFalse ");
}
}