From ef11b9d4de01d601bfcfb8efacb0aeff1e657edb Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 10 Apr 2005 13:17:21 +0000 Subject: fix --- diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index be0d2b2..aa6ab0a 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -1,5 +1,18 @@ Info about the changes in new versions of KDE-Pim/Pi +********** VERSION 2.0.27 ************ + +More bugfixes. +Added possibility to clone in KO/Pi a todo with all its subtodos. +Added a timetracker funtionality in KO/Pi for todos in the todo view. +If a todo is set to started and then to stopped it is saving information about the runtime in +/kdepim/apps/timetrackerdir. +To read, display, print this information an external program is needed which will be developed. +It will display the data in a Gantt timetable view with one row for each todo. +It will have many possibilities sorting the data after category, parent todos, attendees, ... and for creating/printing status reports/summaries. +Merging of data from different computers/users will be quite easy because every run is stored in a single file. +The program will be only available for the desktop (Linux+Windows) and it will be not Open Source. + ********** VERSION 2.0.26 ************ Added two more fields to the KA/Pi view config: diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 5257bff..9476a89 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1158,7 +1158,7 @@ { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, { "Todo List","Todo Liste" }, { "&Title:","&Titel:" }, -{ "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, +{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" }, { "Todo list","Todo Liste" }, { "&Print...","Drucke..." }, { "Printing on printer %1","Drucke auf Drucker %1" }, @@ -1177,7 +1177,7 @@ { "public","öffentl." }, { "private","privat" }, { "confidential","vertraul." }, -{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, +{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" }, { "Yesterday","Gestern" }, { "Day after tomorrow","Übermorgen" }, { "Tomorrow","Morgen" }, @@ -1343,6 +1343,11 @@ { "Todo is stopped","Todo ist gestoppt" }, { "Start todo","Starte Todo" }, { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, +{ "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie\nalle Untertodos auch klonen?" }, +{ "Todo has subtodos","Todo hat Untertodos" }, +{ "","" }, +{ "","" }, +{ "","" }, { "","" }, { "","" }, { "","" }, diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index c530037..bd7376a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2704,11 +2704,32 @@ void CalendarView::cloneIncidence(Incidence * orgInc ) if ( newInc->type() == "Todo" ) { Todo* t = (Todo*) newInc; + bool cloneSub = false; + if ( orgInc->relations().count() ) { + int result = KMessageBox::warningYesNoCancel(this, + i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ), + i18n("Todo has subtodos"), + i18n("Yes"), + i18n("No")); + + if ( result == KMessageBox::Cancel ) { + delete t; + return; + } + if (result == KMessageBox::Yes) cloneSub = true; + } showTodoEditor(); mTodoEditor->editTodo( t ); if ( mTodoEditor->exec() ) { - mCalendar->addTodo( t ); - updateView(); + if ( cloneSub ) { + orgInc->cloneRelations( t ); + mCalendar->addIncidenceBranch( t ); + updateView(); + + } else { + mCalendar->addTodo( t ); + updateView(); + } } else { delete t; } diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 7ee1eef..9b5d4ce 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -1119,19 +1119,19 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item) } void KOTodoView::toggleRunningItem() { - qDebug("KOTodoView::toggleRunning() "); + // qDebug("KOTodoView::toggleRunning() "); if ( ! mActiveItem ) return; Todo * t = mActiveItem->todo(); if ( t->isRunning() ) { int result = KMessageBox::warningContinueCancel(this, - i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 20 ) ),i18n("Todo is started"),i18n("Stop todo"),i18n("Cancel"), true); + i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is started"),i18n("Stop todo"),i18n("Cancel"), true); if (result != KMessageBox::Continue) return; t->setRunning( false ); mActiveItem->construct(); } else { int result = KMessageBox::warningContinueCancel(this, - i18n("The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?").arg(mActiveItem->text(0).left( 20 ) ),i18n("Todo is stopped"),i18n("Start todo"),i18n("Cancel"), true); + i18n("The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is stopped"),i18n("Start todo"),i18n("Cancel"), true); if (result != KMessageBox::Continue) return; t->setRunning( true ); mActiveItem->construct(); diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 406cd48..ed39ddb 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp @@ -335,7 +335,15 @@ QPtrList Calendar::events() mFilter->apply(&el); return el; } - +void Calendar::addIncidenceBranch(Incidence *i) +{ + addIncidence( i ); + Incidence * inc; + QPtrList Relations = i->relations(); + for (inc=Relations.first();inc;inc=Relations.next()) { + addIncidenceBranch( inc ); + } +} bool Calendar::addIncidence(Incidence *i) { diff --git a/libkcal/calendar.h b/libkcal/calendar.h index 2f2c3aa..ab40970 100644 --- a/libkcal/calendar.h +++ b/libkcal/calendar.h @@ -139,7 +139,10 @@ public: @return true on success, false on error. */ - virtual bool addIncidence( Incidence * ); + virtual bool addIncidence( Incidence * ); + + // Adds an incidence and all relatedto incidences to the cal + void addIncidenceBranch( Incidence * ); /** Return filtered list of all incidences of this calendar. */ diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 6bca12c..78fa24f 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -263,7 +263,19 @@ void Incidence::recreate() setIDStr( ":" ); setLastModified(QDateTime::currentDateTime()); } - +void Incidence::cloneRelations( Incidence * newInc ) +{ + // newInc is already a clone of this incidence + Incidence * inc; + Incidence * cloneInc; + QPtrList Relations = relations(); + for (inc=Relations.first();inc;inc=Relations.next()) { + cloneInc = inc->clone(); + cloneInc->recreate(); + cloneInc->setRelatedTo( newInc ); + inc->cloneRelations( cloneInc ); + } +} void Incidence::setReadOnly( bool readOnly ) { IncidenceBase::setReadOnly( readOnly ); diff --git a/libkcal/incidence.h b/libkcal/incidence.h index f8da342..60070a2 100644 --- a/libkcal/incidence.h +++ b/libkcal/incidence.h @@ -112,6 +112,7 @@ class Incidence : public IncidenceBase virtual bool accept(Visitor &) { return false; } virtual Incidence *clone() = 0; + virtual void cloneRelations( Incidence * ); virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const = 0; void setReadOnly( bool ); -- cgit v0.9.0.2