summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index f46a103..82c0f4c 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -1312,114 +1312,114 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item)
} else {
if ( row == 1 ) {
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;
}
}
}
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();
+ updateTodo ( t, 0 );
} else {
KOStartTodoPrefs tp ( t->summary(), 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 );
}
if ( !tp.exec() ) return;
if ( tp.stopAll() ) {
mCalendar->stopAllTodos();
t->setRunning( true );
updateView();
} else {
t->setRunning( true );
- mActiveItem->construct();
+ updateTodo ( t, 0 );
}
}
}
void KOTodoView::itemClicked(QListViewItem *item)
{
//qDebug("KOTodoView::itemClicked %d", item);
if (!item) {
if ( pendingSubtodo != 0 ) {
topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
}
pendingSubtodo = 0;
return;
}
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
if ( pendingSubtodo != 0 ) {
bool allowReparent = true;
QListViewItem *par = item;
while ( par ) {
if ( par == pendingSubtodo ) {
allowReparent = false;
break;
}
par = par->parent();
}
if ( !allowReparent ) {
topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
pendingSubtodo = 0;
} else {
Todo* newParent = todoItem->todo();
Todo* newSub = pendingSubtodo->todo();
pendingSubtodo = 0;
emit reparentTodoSignal( newParent,newSub );
return;
}
}
}
void KOTodoView::setDocumentId( const QString &id )
{
mDocPrefs->setDoc( id );
}
void KOTodoView::itemStateChanged( QListViewItem *item )
{
if (!item) return;