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 /korganizer/kotodoview.cpp | |
parent | f8bb077d4016222ebd7a1cf3080010d5e5c65649 (diff) | |
download | kdepimpi-f1b53f2c08c2ce384f663ae6f0a818104db8c53e.zip kdepimpi-f1b53f2c08c2ce384f663ae6f0a818104db8c53e.tar.gz kdepimpi-f1b53f2c08c2ce384f663ae6f0a818104db8c53e.tar.bz2 |
fixx
-rw-r--r-- | korganizer/kotodoview.cpp | 47 |
1 files changed, 30 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 @@ -1342,4 +1342,24 @@ void KOTodoView::changedCategories(int index) } } +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) { @@ -1362,21 +1382,6 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item) 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; } } @@ -1709,4 +1714,12 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) } 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: |