-rw-r--r-- | korganizer/kotodoview.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 98c9bd9..8d957eb 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -1159,57 +1159,70 @@ void KOTodoView::changedCategories(int index) if ( categories.find ( colcat ) != categories.end () ) { categories.remove( colcat ); categories.prepend( colcat ); } } mActiveItem->todo()->setCategories (categories); mActiveItem->construct(); mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); } } void KOTodoView::itemDoubleClicked(QListViewItem *item) { if ( pendingSubtodo != 0 ) { topLevelWidget()->setCaption(i18n("Reparenting aborted!")); } pendingSubtodo = 0; //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); //qDebug("ROW %d ", row); if (!item) { newTodo(); return; } else { - if ( row == 2 || row == 1 ) { + if ( row == 1 ) { mActiveItem = (KOTodoViewItem *) item; newSubTodo(); return; } - if ( row == 5 || row == 6 ) { + if ( row == 5 || row == 6 || row == 2) { mActiveItem = (KOTodoViewItem *) item; - toggleRunningItem(); - return; + Todo * t = mActiveItem->todo(); + if ( t->isRunning() ) { + if ( t->runTime() < 15) { + t->stopRunning(); + mActiveItem->construct(); + return; + } + else + toggleRunningItem(); + return; + } else { + t->setRunning( true ); + mActiveItem->construct(); + 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() ) { KOStopTodoPrefs tp ( t, this ); if (QApplication::desktop()->width() < 800 ){ int wid = tp.width(); int hei = tp.height(); int xx = (QApplication::desktop()->width()-wid)/2; int yy = (QApplication::desktop()->height()-hei)/2; tp.setGeometry( xx,yy,wid,hei ); } tp.exec(); mActiveItem->construct(); |