From ef11b9d4de01d601bfcfb8efacb0aeff1e657edb Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 10 Apr 2005 13:17:21 +0000 Subject: fix --- (limited to 'korganizer/calendarview.cpp') 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; } -- cgit v0.9.0.2