-rw-r--r-- | korganizer/kotodoview.cpp | 56 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 18 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 2 |
3 files changed, 71 insertions, 5 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index b2ff33b..99e6a3a 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -27,2 +27,5 @@ | |||
27 | #include <qwhatsthis.h> | 27 | #include <qwhatsthis.h> |
28 | #include <qdialog.h> | ||
29 | #include <qlabel.h> | ||
30 | #include <qpushbutton.h> | ||
28 | 31 | ||
@@ -60,2 +63,42 @@ using namespace KOrg; | |||
60 | 63 | ||
64 | KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name ) : | ||
65 | QDialog( parent, name, true ) | ||
66 | { | ||
67 | mTodo = todo; | ||
68 | setCaption( i18n("Stop todo") ); | ||
69 | QVBoxLayout* lay = new QVBoxLayout( this ); | ||
70 | lay->setSpacing( 3 ); | ||
71 | lay->setMargin( 3 ); | ||
72 | QLabel * lab = new QLabel( i18n("%1\nis running!").arg( todo->summary() ), this ); | ||
73 | lay->addWidget( lab ); | ||
74 | lab->setAlignment( AlignHCenter ); | ||
75 | |||
76 | QPushButton * ok = new QPushButton( i18n("Stop and save"), this ); | ||
77 | lay->addWidget( ok ); | ||
78 | QPushButton * cancel = new QPushButton( i18n("Continue running"), this ); | ||
79 | lay->addWidget( cancel ); | ||
80 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | ||
81 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | ||
82 | ok = new QPushButton( i18n("Stop - do not save"), this ); | ||
83 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( doNotSave() ) ); | ||
84 | lay->addWidget( ok ); | ||
85 | resize( 200, 200 ); | ||
86 | } | ||
87 | |||
88 | void KOStopTodoPrefs::accept() | ||
89 | { | ||
90 | qDebug("KOStopTodoPrefs::accept() "); | ||
91 | QDialog::accept(); | ||
92 | } | ||
93 | void KOStopTodoPrefs::doNotSave() | ||
94 | { | ||
95 | |||
96 | int result = KMessageBox::warningContinueCancel(this, | ||
97 | i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary() ); | ||
98 | if (result != KMessageBox::Continue) return; | ||
99 | mTodo->stopRunning(); | ||
100 | QDialog::accept(); | ||
101 | } | ||
102 | |||
103 | |||
61 | class KOTodoViewWhatsThis :public QWhatsThis | 104 | class KOTodoViewWhatsThis :public QWhatsThis |
@@ -1129,7 +1172,9 @@ void KOTodoView::toggleRunningItem() | |||
1129 | if ( t->isRunning() ) { | 1172 | if ( t->isRunning() ) { |
1130 | #if 0 | ||
1131 | int result = KMessageBox::warningContinueCancel(this, | ||
1132 | 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 todo"),i18n("Cancel"), true); | ||
1133 | #endif | ||
1134 | 1173 | ||
1174 | |||
1175 | KOStopTodoPrefs tp ( t, this ); | ||
1176 | tp.exec(); | ||
1177 | |||
1178 | |||
1179 | #if 0 | ||
1135 | int result = KMessageBox::warningYesNoCancel(this, | 1180 | int result = KMessageBox::warningYesNoCancel(this, |
@@ -1144,2 +1189,5 @@ void KOTodoView::toggleRunningItem() | |||
1144 | mActiveItem->construct(); | 1189 | mActiveItem->construct(); |
1190 | |||
1191 | |||
1192 | #endif | ||
1145 | } else { | 1193 | } else { |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 1ffc34a..ceabdba 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -34,2 +34,4 @@ | |||
34 | #include <qmap.h> | 34 | #include <qmap.h> |
35 | #include <qdialog.h> | ||
36 | #include <qlabel.h> | ||
35 | #include <qlistview.h> | 37 | #include <qlistview.h> |
@@ -55,2 +57,18 @@ class DocPrefs; | |||
55 | 57 | ||
58 | |||
59 | class KOStopTodoPrefs : public QDialog | ||
60 | { | ||
61 | Q_OBJECT | ||
62 | public: | ||
63 | KOStopTodoPrefs( Todo* todo, QWidget *parent=0, const char *name=0 ) ; | ||
64 | |||
65 | |||
66 | private slots: | ||
67 | void doNotSave(); | ||
68 | void accept(); | ||
69 | private: | ||
70 | Todo* mTodo; | ||
71 | |||
72 | }; | ||
73 | |||
56 | class KOTodoListView : public KListView | 74 | class KOTodoListView : public KListView |
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index f62aab8..0cf6e4c 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -362,3 +362,3 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
362 | QColorGroup::ColorRole role; | 362 | QColorGroup::ColorRole role; |
363 | if ( KOPrefs::instance()->mTodoViewUsesForegroundColor ) | 363 | if ( KOPrefs::instance()->mTodoViewUsesForegroundColor && !mTodo->isRunning()) |
364 | role = QColorGroup::Text; | 364 | role = QColorGroup::Text; |