summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
authorzautrix <zautrix>2005-06-17 09:29:18 (UTC)
committer zautrix <zautrix>2005-06-17 09:29:18 (UTC)
commit160b471e4d254fd45dbbd161178de15a14163a0c (patch) (side-by-side diff)
tree149a5bf6ef1eb0399c46c928a53d31fa298ac383 /korganizer/kotodoview.cpp
parentcd71ce2dd43e4cca3b3da3f599616e7b1b6b8deb (diff)
downloadkdepimpi-160b471e4d254fd45dbbd161178de15a14163a0c.zip
kdepimpi-160b471e4d254fd45dbbd161178de15a14163a0c.tar.gz
kdepimpi-160b471e4d254fd45dbbd161178de15a14163a0c.tar.bz2
fixxx
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp49
1 files changed, 37 insertions, 12 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index c5fae17..13e88ef 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -36,6 +36,8 @@
#include "koprefs.h"
#include <klocale.h>
#include <kglobal.h>
+#include <kdateedit.h>
+#include "ktimeedit.h"
#include <kiconloader.h>
#include <kmessagebox.h>
@@ -72,7 +74,26 @@ KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name
QLabel * lab = new QLabel( i18n("%1\nis running!").arg( todo->summary() ), this );
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 );
QPushButton * cancel = new QPushButton( i18n("Continue running"), this );
@@ -82,20 +103,24 @@ KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name
ok = new QPushButton( i18n("Stop - do not save"), this );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( doNotSave() ) );
lay->addWidget( ok );
- resize( 200, 200 );
+ if (QApplication::desktop()->width() < 320 )
+ resize( 240, 200 );
+ else
+ resize( 320, 200 );
+
}
void KOStopTodoPrefs::accept()
{
- qDebug("KOStopTodoPrefs::accept() ");
-
-
-#if 0
- t->setRunningFalse( comment );
-
- t->setRunning( false );
-#endif
-
+ 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;
+ }
+ mTodo->saveRunningInfo( mComment->text(), start, stop );
QDialog::accept();
}
void KOStopTodoPrefs::doNotSave()
@@ -1199,7 +1224,7 @@ void KOTodoView::toggleRunningItem()
#endif
} else {
int result = KMessageBox::warningContinueCancel(this,
- i18n("The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is stopped"),i18n("Start todo"),i18n("Cancel"), true);
+ 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();