-rw-r--r-- | korganizer/kotodoview.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index e95039d..8fe9999 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -21,16 +21,18 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qheader.h> | 25 | #include <qheader.h> |
26 | #include <qcursor.h> | 26 | #include <qcursor.h> |
27 | #include <qwhatsthis.h> | 27 | #include <qwhatsthis.h> |
28 | 28 | ||
29 | #include <qinputdialog.h> | ||
30 | |||
29 | #include <qvbox.h> | 31 | #include <qvbox.h> |
30 | #include <kdebug.h> | 32 | #include <kdebug.h> |
31 | #include "koprefs.h" | 33 | #include "koprefs.h" |
32 | #include <klocale.h> | 34 | #include <klocale.h> |
33 | #include <kglobal.h> | 35 | #include <kglobal.h> |
34 | #include <kiconloader.h> | 36 | #include <kiconloader.h> |
35 | #include <kmessagebox.h> | 37 | #include <kmessagebox.h> |
36 | 38 | ||
@@ -1121,20 +1123,30 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item) | |||
1121 | } | 1123 | } |
1122 | void KOTodoView::toggleRunningItem() | 1124 | void KOTodoView::toggleRunningItem() |
1123 | { | 1125 | { |
1124 | // qDebug("KOTodoView::toggleRunning() "); | 1126 | // qDebug("KOTodoView::toggleRunning() "); |
1125 | if ( ! mActiveItem ) | 1127 | if ( ! mActiveItem ) |
1126 | return; | 1128 | return; |
1127 | Todo * t = mActiveItem->todo(); | 1129 | Todo * t = mActiveItem->todo(); |
1128 | if ( t->isRunning() ) { | 1130 | if ( t->isRunning() ) { |
1131 | #if 0 | ||
1129 | int result = KMessageBox::warningContinueCancel(this, | 1132 | int result = KMessageBox::warningContinueCancel(this, |
1130 | 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); | 1133 | 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); |
1131 | if (result != KMessageBox::Continue) return; | 1134 | #endif |
1132 | t->setRunning( false ); | 1135 | |
1136 | int result = KMessageBox::warningYesNoCancel(this, | ||
1137 | 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"),i18n("Stop+note")); | ||
1138 | if (result == KMessageBox::Cancel) return; | ||
1139 | if ( result == KMessageBox::No ) { | ||
1140 | QString comment = QInputDialog::getText(mActiveItem->text(0).left( 25 ),i18n("Comment for todo:") ); | ||
1141 | t->setRunningFalse( comment ); | ||
1142 | } else { | ||
1143 | t->setRunning( false ); | ||
1144 | } | ||
1133 | mActiveItem->construct(); | 1145 | mActiveItem->construct(); |
1134 | } else { | 1146 | } else { |
1135 | int result = KMessageBox::warningContinueCancel(this, | 1147 | int result = KMessageBox::warningContinueCancel(this, |
1136 | 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); | 1148 | 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); |
1137 | if (result != KMessageBox::Continue) return; | 1149 | if (result != KMessageBox::Continue) return; |
1138 | t->setRunning( true ); | 1150 | t->setRunning( true ); |
1139 | mActiveItem->construct(); | 1151 | mActiveItem->construct(); |
1140 | } | 1152 | } |