summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 13e88ef..926a136 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -75,48 +75,49 @@ KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name
lay->addWidget( lab );
lab->setAlignment( AlignHCenter );
lab = new QLabel( i18n("Additional Comment:"), this );
lay->addWidget( lab );
mComment = new QLineEdit( this );
lay->addWidget( mComment );
QHBox * start = new QHBox ( this );
lay->addWidget( start );
lab = new QLabel( i18n("Start:"), start );
QHBox * end = new QHBox ( this );
lay->addWidget( end );
lab = new QLabel( i18n("End:"), end );
sde = new KDateEdit( start );
ste = new KOTimeEdit( start );
connect ( sde,SIGNAL(setTimeTo( QTime ) ),ste , SLOT ( setTime(QTime ) ) );
ede = new KDateEdit( end );
ete = new KOTimeEdit(end );
connect ( ede,SIGNAL(setTimeTo( QTime ) ),ete , SLOT ( setTime(QTime ) ) );
sde->setDate( mTodo->runStart().date() );
ste->setTime( mTodo->runStart().time() );
ede->setDate( QDate::currentDate());
ete->setTime( QTime::currentTime() );
QPushButton * ok = new QPushButton( i18n("Stop and save"), this );
lay->addWidget( ok );
+ ok->setDefault( true );
QPushButton * cancel = new QPushButton( i18n("Continue running"), this );
lay->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
ok = new QPushButton( i18n("Stop - do not save"), this );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( doNotSave() ) );
lay->addWidget( ok );
if (QApplication::desktop()->width() < 320 )
resize( 240, 200 );
else
resize( 320, 200 );
}
void KOStopTodoPrefs::accept()
{
QDateTime start = QDateTime( sde->date(), ste->getTime() );
QDateTime stop = QDateTime( ede->date(), ete->getTime() );
if ( start > stop ) {
KMessageBox::sorry(this,
i18n("The start time is\nafter the end time!"),
i18n("Time mismatch!"));
return;
}
@@ -1181,68 +1182,51 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item)
} else {
if ( row == 2 || row == 1 ) {
mActiveItem = (KOTodoViewItem *) item;
newSubTodo();
return;
}
if ( row == 5 || row == 6 ) {
mActiveItem = (KOTodoViewItem *) item;
toggleRunningItem();
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 );
tp.exec();
-
-
-#if 0
- int result = KMessageBox::warningYesNoCancel(this,
- i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is started"),i18n("Stop"),i18n("Stop+note"));
- if (result == KMessageBox::Cancel) return;
- if ( result == KMessageBox::No ) {
- QString comment = QInputDialog::getText(mActiveItem->text(0).left( 25 ),i18n("Comment for todo:") );
- t->setRunningFalse( comment );
- } else {
- t->setRunning( false );
- }
mActiveItem->construct();
-
-
-#endif
} else {
int result = KMessageBox::warningContinueCancel(this,
i18n("<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>").arg(mActiveItem->text(0).left( 25 ) ),i18n("Start todo"),i18n("Start todo"),i18n("Cancel"), true);
if (result != KMessageBox::Continue) return;
t->setRunning( true );
mActiveItem->construct();
}
}
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 ) {