summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp25
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
@@ -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;
}