summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
authorzautrix <zautrix>2005-04-09 20:21:58 (UTC)
committer zautrix <zautrix>2005-04-09 20:21:58 (UTC)
commit9e43ebbe5867b2da957bb17c35bd357715424cba (patch) (side-by-side diff)
treeb506ba029b50fc46a33d35a39e6f1c768c995f22 /korganizer/kotodoview.cpp
parent2c39ac46121e8796e780a5321ab777f08792e5ba (diff)
downloadkdepimpi-9e43ebbe5867b2da957bb17c35bd357715424cba.zip
kdepimpi-9e43ebbe5867b2da957bb17c35bd357715424cba.tar.gz
kdepimpi-9e43ebbe5867b2da957bb17c35bd357715424cba.tar.bz2
todo tt
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 935a5f5..7ee1eef 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -481,6 +481,8 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
SLOT (cancelTodo()));
mItemPopupMenu->insertSeparator();
+ mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
+ SLOT (toggleRunningItem()));
mItemPopupMenu->insertItem( i18n("New Todo..."), this,
SLOT (newTodo()));
mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
@@ -1099,17 +1101,43 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item)
newTodo();
return;
} else {
- if ( row == 1 || row == 2 ) {
+ if ( row == 2 ) {
mActiveItem = (KOTodoViewItem *) item;
newSubTodo();
return;
}
+ if ( row == 1 ) {
+ mActiveItem = (KOTodoViewItem *) item;
+ toggleRunningItem();
+ return;
+ }
}
if ( KOPrefs::instance()->mEditOnDoubleClick )
editItem( item );
else
showItem( item , QPoint(), 0 );
}
+void KOTodoView::toggleRunningItem()
+{
+ qDebug("KOTodoView::toggleRunning() ");
+ if ( ! mActiveItem )
+ return;
+ Todo * t = mActiveItem->todo();
+ if ( t->isRunning() ) {
+ int result = KMessageBox::warningContinueCancel(this,
+ 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);
+ if (result != KMessageBox::Continue) return;
+ t->setRunning( false );
+ mActiveItem->construct();
+ } else {
+ int result = KMessageBox::warningContinueCancel(this,
+ 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);
+ if (result != KMessageBox::Continue) return;
+ t->setRunning( true );
+ mActiveItem->construct();
+ }
+}
+
void KOTodoView::itemClicked(QListViewItem *item)
{
//qDebug("KOTodoView::itemClicked %d", item);