author | zautrix <zautrix> | 2005-04-10 13:17:21 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-10 13:17:21 (UTC) |
commit | ef11b9d4de01d601bfcfb8efacb0aeff1e657edb (patch) (unidiff) | |
tree | 5f4e6aa51ef357c6d9ecbe4d9a2908b8c2ca1228 /korganizer | |
parent | 04fe8f3523c46511e846a42e4bb92d6b8d33758b (diff) | |
download | kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.zip kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.tar.gz kdepimpi-ef11b9d4de01d601bfcfb8efacb0aeff1e657edb.tar.bz2 |
fix
-rw-r--r-- | korganizer/calendarview.cpp | 25 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 6 |
2 files changed, 26 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index c530037..bd7376a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2699,21 +2699,42 @@ void CalendarView::cancelIncidence(Incidence * inc ) | |||
2699 | } | 2699 | } |
2700 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 2700 | void CalendarView::cloneIncidence(Incidence * orgInc ) |
2701 | { | 2701 | { |
2702 | Incidence * newInc = orgInc->clone(); | 2702 | Incidence * newInc = orgInc->clone(); |
2703 | newInc->recreate(); | 2703 | newInc->recreate(); |
2704 | 2704 | ||
2705 | if ( newInc->type() == "Todo" ) { | 2705 | if ( newInc->type() == "Todo" ) { |
2706 | Todo* t = (Todo*) newInc; | 2706 | Todo* t = (Todo*) newInc; |
2707 | bool cloneSub = false; | ||
2708 | if ( orgInc->relations().count() ) { | ||
2709 | int result = KMessageBox::warningYesNoCancel(this, | ||
2710 | 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 ) ), | ||
2711 | i18n("Todo has subtodos"), | ||
2712 | i18n("Yes"), | ||
2713 | i18n("No")); | ||
2714 | |||
2715 | if ( result == KMessageBox::Cancel ) { | ||
2716 | delete t; | ||
2717 | return; | ||
2718 | } | ||
2719 | if (result == KMessageBox::Yes) cloneSub = true; | ||
2720 | } | ||
2707 | showTodoEditor(); | 2721 | showTodoEditor(); |
2708 | mTodoEditor->editTodo( t ); | 2722 | mTodoEditor->editTodo( t ); |
2709 | if ( mTodoEditor->exec() ) { | 2723 | if ( mTodoEditor->exec() ) { |
2710 | mCalendar->addTodo( t ); | 2724 | if ( cloneSub ) { |
2711 | updateView(); | 2725 | orgInc->cloneRelations( t ); |
2726 | mCalendar->addIncidenceBranch( t ); | ||
2727 | updateView(); | ||
2728 | |||
2729 | } else { | ||
2730 | mCalendar->addTodo( t ); | ||
2731 | updateView(); | ||
2732 | } | ||
2712 | } else { | 2733 | } else { |
2713 | delete t; | 2734 | delete t; |
2714 | } | 2735 | } |
2715 | } | 2736 | } |
2716 | else { | 2737 | else { |
2717 | Event* e = (Event*) newInc; | 2738 | Event* e = (Event*) newInc; |
2718 | showEventEditor(); | 2739 | showEventEditor(); |
2719 | mEventEditor->editEvent( e ); | 2740 | mEventEditor->editEvent( e ); |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 7ee1eef..9b5d4ce 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -1114,29 +1114,29 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item) | |||
1114 | } | 1114 | } |
1115 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 1115 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
1116 | editItem( item ); | 1116 | editItem( item ); |
1117 | else | 1117 | else |
1118 | showItem( item , QPoint(), 0 ); | 1118 | showItem( item , QPoint(), 0 ); |
1119 | } | 1119 | } |
1120 | void KOTodoView::toggleRunningItem() | 1120 | void KOTodoView::toggleRunningItem() |
1121 | { | 1121 | { |
1122 | qDebug("KOTodoView::toggleRunning() "); | 1122 | // qDebug("KOTodoView::toggleRunning() "); |
1123 | if ( ! mActiveItem ) | 1123 | if ( ! mActiveItem ) |
1124 | return; | 1124 | return; |
1125 | Todo * t = mActiveItem->todo(); | 1125 | Todo * t = mActiveItem->todo(); |
1126 | if ( t->isRunning() ) { | 1126 | if ( t->isRunning() ) { |
1127 | int result = KMessageBox::warningContinueCancel(this, | 1127 | int result = KMessageBox::warningContinueCancel(this, |
1128 | 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); | 1128 | 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); |
1129 | if (result != KMessageBox::Continue) return; | 1129 | if (result != KMessageBox::Continue) return; |
1130 | t->setRunning( false ); | 1130 | t->setRunning( false ); |
1131 | mActiveItem->construct(); | 1131 | mActiveItem->construct(); |
1132 | } else { | 1132 | } else { |
1133 | int result = KMessageBox::warningContinueCancel(this, | 1133 | int result = KMessageBox::warningContinueCancel(this, |
1134 | 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); | 1134 | 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); |
1135 | if (result != KMessageBox::Continue) return; | 1135 | if (result != KMessageBox::Continue) return; |
1136 | t->setRunning( true ); | 1136 | t->setRunning( true ); |
1137 | mActiveItem->construct(); | 1137 | mActiveItem->construct(); |
1138 | } | 1138 | } |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | void KOTodoView::itemClicked(QListViewItem *item) | 1141 | void KOTodoView::itemClicked(QListViewItem *item) |
1142 | { | 1142 | { |