summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp47
-rw-r--r--korganizer/kotodoview.h1
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
@@ -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();