author | zautrix <zautrix> | 2005-10-31 11:08:09 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-31 11:08:09 (UTC) |
commit | f1b53f2c08c2ce384f663ae6f0a818104db8c53e (patch) (side-by-side diff) | |
tree | 312764b7399d464483042e44b79577c8c7872c85 | |
parent | f8bb077d4016222ebd7a1cf3080010d5e5c65649 (diff) | |
download | kdepimpi-f1b53f2c08c2ce384f663ae6f0a818104db8c53e.zip kdepimpi-f1b53f2c08c2ce384f663ae6f0a818104db8c53e.tar.gz kdepimpi-f1b53f2c08c2ce384f663ae6f0a818104db8c53e.tar.bz2 |
fixx
-rw-r--r-- | korganizer/kotodoview.cpp | 47 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 1 |
2 files changed, 31 insertions, 17 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index d79a9b9..ba94057 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -1338,12 +1338,32 @@ void KOTodoView::changedCategories(int index) mActiveItem->todo()->setCategories (categories); mActiveItem->construct(); mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); } } +void KOTodoView::toggleRunningItemQuick() +{ + if ( !mActiveItem ) return; + Todo * t = mActiveItem->todo(); + if ( t->isRunning() ) { + if ( t->runTime() < 15) { + t->stopRunning(); + mActiveItem->construct(); + topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); + return; + } + else + toggleRunningItem(); + return; + } else { + t->setRunning( true ); + mActiveItem->construct(); + topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); + } +} void KOTodoView::itemDoubleClicked(QListViewItem *item) { if ( pendingSubtodo != 0 ) { topLevelWidget()->setCaption(i18n("Reparenting aborted!")); } pendingSubtodo = 0; @@ -1358,29 +1378,14 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item) mActiveItem = (KOTodoViewItem *) item; newSubTodo(); return; } if ( row == 5 || row == 6 || row == 2) { mActiveItem = (KOTodoViewItem *) item; - Todo * t = mActiveItem->todo(); - if ( t->isRunning() ) { - if ( t->runTime() < 15) { - t->stopRunning(); - mActiveItem->construct(); - topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); - return; - } - else - toggleRunningItem(); - return; - } else { - t->setRunning( true ); - mActiveItem->construct(); - topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); - return; - } + toggleRunningItemQuick(); + return; } } if ( KOPrefs::instance()->mEditOnDoubleClick ) editItem( item ); else showItem( item , QPoint(), 0 ); @@ -1705,12 +1710,20 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); if ( pendingSubtodo ) itemClicked(mActiveItem); e->accept(); } else e->ignore(); + break; + case Qt::Key_R: + if (!( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) ) { + mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); + toggleRunningItemQuick(); + e->accept(); + } else + e->ignore(); break; case Qt::Key_Escape: if ( pendingSubtodo ) { itemClicked(0); e->accept(); } else diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 161ecb0..0cbc087 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -245,12 +245,13 @@ class KOTodoView : public KOrg::BaseView void moveTodoSignal( Incidence * ); void beamTodoSignal( Incidence * ); void purgeCompletedSignal(); protected slots: void toggleRunningItem(); + void toggleRunningItemQuick(); void paintNeeded(); void processSelectionChange(); void addQuickTodo(); void setTodoModified( Todo* ); void todoModified(Todo *, int ); |