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 | |||
@@ -2683,53 +2683,74 @@ void CalendarView::beamIncidence() | |||
2683 | } | 2683 | } |
2684 | void CalendarView::toggleCancelIncidence() | 2684 | void CalendarView::toggleCancelIncidence() |
2685 | { | 2685 | { |
2686 | Incidence *incidence = currentSelection(); | 2686 | Incidence *incidence = currentSelection(); |
2687 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2687 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2688 | if ( incidence ) { | 2688 | if ( incidence ) { |
2689 | cancelIncidence(incidence); | 2689 | cancelIncidence(incidence); |
2690 | } | 2690 | } |
2691 | } | 2691 | } |
2692 | 2692 | ||
2693 | 2693 | ||
2694 | void CalendarView::cancelIncidence(Incidence * inc ) | 2694 | void CalendarView::cancelIncidence(Incidence * inc ) |
2695 | { | 2695 | { |
2696 | inc->setCancelled( ! inc->cancelled() ); | 2696 | inc->setCancelled( ! inc->cancelled() ); |
2697 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); | 2697 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); |
2698 | updateView(); | 2698 | updateView(); |
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 ); |
2720 | if ( mEventEditor->exec() ) { | 2741 | if ( mEventEditor->exec() ) { |
2721 | mCalendar->addEvent( e ); | 2742 | mCalendar->addEvent( e ); |
2722 | updateView(); | 2743 | updateView(); |
2723 | } else { | 2744 | } else { |
2724 | delete e; | 2745 | delete e; |
2725 | } | 2746 | } |
2726 | } | 2747 | } |
2727 | setActiveWindow(); | 2748 | setActiveWindow(); |
2728 | } | 2749 | } |
2729 | 2750 | ||
2730 | void CalendarView::newEvent() | 2751 | void CalendarView::newEvent() |
2731 | { | 2752 | { |
2732 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. | 2753 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. |
2733 | KOAgendaView *aView = mViewManager->agendaView(); | 2754 | KOAgendaView *aView = mViewManager->agendaView(); |
2734 | if (aView) { | 2755 | if (aView) { |
2735 | if (aView->selectionStart().isValid()) { | 2756 | if (aView->selectionStart().isValid()) { |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 7ee1eef..9b5d4ce 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -1098,61 +1098,61 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item) | |||
1098 | int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); | 1098 | int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); |
1099 | //qDebug("ROW %d ", row); | 1099 | //qDebug("ROW %d ", row); |
1100 | if (!item) { | 1100 | if (!item) { |
1101 | newTodo(); | 1101 | newTodo(); |
1102 | return; | 1102 | return; |
1103 | } else { | 1103 | } else { |
1104 | if ( row == 2 ) { | 1104 | if ( row == 2 ) { |
1105 | mActiveItem = (KOTodoViewItem *) item; | 1105 | mActiveItem = (KOTodoViewItem *) item; |
1106 | newSubTodo(); | 1106 | newSubTodo(); |
1107 | return; | 1107 | return; |
1108 | } | 1108 | } |
1109 | if ( row == 1 ) { | 1109 | if ( row == 1 ) { |
1110 | mActiveItem = (KOTodoViewItem *) item; | 1110 | mActiveItem = (KOTodoViewItem *) item; |
1111 | toggleRunningItem(); | 1111 | toggleRunningItem(); |
1112 | return; | 1112 | return; |
1113 | } | 1113 | } |
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 | { |
1143 | //qDebug("KOTodoView::itemClicked %d", item); | 1143 | //qDebug("KOTodoView::itemClicked %d", item); |
1144 | if (!item) { | 1144 | if (!item) { |
1145 | if ( pendingSubtodo != 0 ) { | 1145 | if ( pendingSubtodo != 0 ) { |
1146 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1146 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1147 | } | 1147 | } |
1148 | pendingSubtodo = 0; | 1148 | pendingSubtodo = 0; |
1149 | return; | 1149 | return; |
1150 | } | 1150 | } |
1151 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1151 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1152 | if ( pendingSubtodo != 0 ) { | 1152 | if ( pendingSubtodo != 0 ) { |
1153 | bool allowReparent = true; | 1153 | bool allowReparent = true; |
1154 | QListViewItem *par = item; | 1154 | QListViewItem *par = item; |
1155 | while ( par ) { | 1155 | while ( par ) { |
1156 | if ( par == pendingSubtodo ) { | 1156 | if ( par == pendingSubtodo ) { |
1157 | allowReparent = false; | 1157 | allowReparent = false; |
1158 | break; | 1158 | break; |