From f1b53f2c08c2ce384f663ae6f0a818104db8c53e Mon Sep 17 00:00:00 2001 From: zautrix Date: Mon, 31 Oct 2005 11:08:09 +0000 Subject: fixx --- diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index d79a9b9..ba94057 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -1341,6 +1341,26 @@ void KOTodoView::changedCategories(int index) 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 ) { @@ -1361,23 +1381,8 @@ 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; } } if ( KOPrefs::instance()->mEditOnDoubleClick ) @@ -1708,6 +1713,14 @@ void KOTodoView::keyPressEvent ( QKeyEvent * e ) 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 ) { diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 161ecb0..0cbc087 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -248,6 +248,7 @@ class KOTodoView : public KOrg::BaseView protected slots: void toggleRunningItem(); + void toggleRunningItemQuick(); void paintNeeded(); void processSelectionChange(); void addQuickTodo(); -- cgit v0.9.0.2