summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
authorzautrix <zautrix>2005-06-27 04:48:41 (UTC)
committer zautrix <zautrix>2005-06-27 04:48:41 (UTC)
commit9b2bf31715226dfa8210f31843616a04f810f012 (patch) (side-by-side diff)
treeb502c4a379b26f74621ba8fabb59fcb53f5a5679 /korganizer/kotodoview.cpp
parent2e566a307bb50ac595fe729ebed0f5336f2af5a8 (diff)
downloadkdepimpi-9b2bf31715226dfa8210f31843616a04f810f012.zip
kdepimpi-9b2bf31715226dfa8210f31843616a04f810f012.tar.gz
kdepimpi-9b2bf31715226dfa8210f31843616a04f810f012.tar.bz2
strat stop tod fixes
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp60
1 files changed, 51 insertions, 9 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 7349d20..1bfdef9 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -63,6 +63,36 @@
using namespace KOrg;
+KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *name ) :
+ QDialog( parent, name, true )
+{
+ mStopAll = true;
+ setCaption( i18n("Start todo") );
+ QVBoxLayout* lay = new QVBoxLayout( this );
+ lay->setSpacing( 3 );
+ lay->setMargin( 3 );
+ QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( sum ), this );
+ lay->addWidget( lab );
+ lab->setAlignment( AlignCenter );
+
+ QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this );
+ lay->addWidget( ok );
+ ok->setDefault( true );
+ QPushButton * start = new QPushButton( i18n("Start todo"), this );
+ lay->addWidget( start );
+ QPushButton * cancel = new QPushButton( i18n("Cancel - do not start"), this );
+ lay->addWidget( cancel );
+ connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
+ connect ( start,SIGNAL(clicked() ),this , SLOT ( doStop() ) );
+ connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
+ resize( sizeHint() );
+
+}
+void KOStartTodoPrefs::doStop()
+{
+ mStopAll = false;
+ accept();
+}
KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name ) :
QDialog( parent, name, true )
{
@@ -1199,9 +1229,9 @@ void KOTodoView::itemDoubleClicked(QListViewItem *item)
toggleRunningItem();
return;
} else {
- t->setRunning( true );
- mActiveItem->construct();
- topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!"));
+ t->setRunning( true );
+ mActiveItem->construct();
+ topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!"));
return;
}
}
@@ -1219,7 +1249,7 @@ void KOTodoView::toggleRunningItem()
Todo * t = mActiveItem->todo();
if ( t->isRunning() ) {
KOStopTodoPrefs tp ( t, this );
- if (QApplication::desktop()->width() < 800 ){
+ if (QApplication::desktop()->width() <= 800 ){
int wid = tp.width();
int hei = tp.height();
int xx = (QApplication::desktop()->width()-wid)/2;
@@ -1229,11 +1259,23 @@ void KOTodoView::toggleRunningItem()
tp.exec();
mActiveItem->construct();
} 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();
+ 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();
+ }
}
}