-rw-r--r-- | korganizer/calendarview.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index c530037..bd7376a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2706,2 +2706,16 @@ void CalendarView::cloneIncidence(Incidence * orgInc ) 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(); @@ -2709,4 +2723,11 @@ void CalendarView::cloneIncidence(Incidence * orgInc ) if ( mTodoEditor->exec() ) { - mCalendar->addTodo( t ); - updateView(); + if ( cloneSub ) { + orgInc->cloneRelations( t ); + mCalendar->addIncidenceBranch( t ); + updateView(); + + } else { + mCalendar->addTodo( t ); + updateView(); + } } else { |