-rw-r--r-- | core/pim/todo/mainwindow.cpp | 2 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.cpp | 19 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.h | 7 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverviewimpl.cpp | 12 | ||||
-rw-r--r-- | core/pim/todo/todoeditor.cpp | 32 | ||||
-rw-r--r-- | core/pim/todo/todoeditor.h | 4 |
6 files changed, 59 insertions, 17 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 71e6750..9b2423b 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -177,3 +177,3 @@ void MainWindow::initActions() { | |||
177 | /* initialize the view menu */ | 177 | /* initialize the view menu */ |
178 | a = new QAction( QString::null, tr("Show over due"), | 178 | a = new QAction( QString::null, tr("Show only over due"), |
179 | 0, this, 0, TRUE ); | 179 | 0, this, 0, TRUE ); |
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp index e8e922f..1a68eb5 100644 --- a/core/pim/todo/otaskeditor.cpp +++ b/core/pim/todo/otaskeditor.cpp | |||
@@ -16,6 +16,3 @@ OTaskEditor::OTaskEditor(int cur) | |||
16 | init(); | 16 | init(); |
17 | OTodo to; | 17 | init( cur ); |
18 | to.setCategories( cur ); | ||
19 | load(to); | ||
20 | m_uid = 1; // generate a new one | ||
21 | } | 18 | } |
@@ -24,4 +21,3 @@ OTaskEditor::OTaskEditor( const OTodo& to) | |||
24 | init(); | 21 | init(); |
25 | load( to ); | 22 | init( to ); |
26 | m_uid = to.uid(); | ||
27 | } | 23 | } |
@@ -30,2 +26,13 @@ OTaskEditor::~OTaskEditor() { | |||
30 | } | 26 | } |
27 | void OTaskEditor::init( int cur ) { | ||
28 | OTodo to; | ||
29 | if ( cur != 0 ) | ||
30 | to.setCategories( cur ); | ||
31 | load(to); | ||
32 | m_uid = 1; // generate a new one | ||
33 | } | ||
34 | void OTaskEditor::init( const OTodo& to ) { | ||
35 | load( to ); | ||
36 | m_uid = to.uid(); | ||
37 | } | ||
31 | OTodo OTaskEditor::todo()const{ | 38 | OTodo OTaskEditor::todo()const{ |
diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h index 5842fdc..bcbd543 100644 --- a/core/pim/todo/otaskeditor.h +++ b/core/pim/todo/otaskeditor.h | |||
@@ -20,2 +20,9 @@ public: | |||
20 | 20 | ||
21 | /* | ||
22 | * same as the c'tor but this gives us the | ||
23 | * power to 'preload' the dialog | ||
24 | */ | ||
25 | void init( int cur ); | ||
26 | void init( const OTodo& todo ); | ||
27 | |||
21 | OTodo todo()const; | 28 | OTodo todo()const; |
diff --git a/core/pim/todo/taskeditoroverviewimpl.cpp b/core/pim/todo/taskeditoroverviewimpl.cpp index b9b2ae6..c10ad40 100644 --- a/core/pim/todo/taskeditoroverviewimpl.cpp +++ b/core/pim/todo/taskeditoroverviewimpl.cpp | |||
@@ -22,2 +22,12 @@ TaskEditorOverViewImpl::~TaskEditorOverViewImpl() { | |||
22 | void TaskEditorOverViewImpl::load( const OTodo& todo) { | 22 | void TaskEditorOverViewImpl::load( const OTodo& todo) { |
23 | /* | ||
24 | * now that we're 'preloaded' we | ||
25 | * need to disable the buttons | ||
26 | * holding the dat | ||
27 | */ | ||
28 | btnDue-> setEnabled( FALSE ); | ||
29 | btnComp-> setEnabled( FALSE ); | ||
30 | btnStart->setEnabled( FALSE ); | ||
31 | |||
32 | |||
23 | QDate date = QDate::currentDate(); | 33 | QDate date = QDate::currentDate(); |
@@ -71,2 +81,4 @@ void TaskEditorOverViewImpl::init() { | |||
71 | 81 | ||
82 | |||
83 | |||
72 | /* Start Date Picker */ | 84 | /* Start Date Picker */ |
diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp index e19ab8d..9b8c5cb 100644 --- a/core/pim/todo/todoeditor.cpp +++ b/core/pim/todo/todoeditor.cpp | |||
@@ -8,9 +8,14 @@ Editor::Editor() { | |||
8 | m_accepted = false; | 8 | m_accepted = false; |
9 | m_self = 0l; | ||
9 | } | 10 | } |
10 | Editor::~Editor() { | 11 | Editor::~Editor() { |
12 | delete m_self; | ||
13 | m_self = 0; | ||
11 | } | 14 | } |
12 | OTodo Editor::newTodo( int cur, | 15 | OTodo Editor::newTodo( int cur, |
13 | QWidget* par) { | 16 | QWidget*) { |
14 | 17 | ||
15 | OTaskEditor e( cur); | 18 | OTaskEditor *e = self(); |
19 | e->setCaption( QObject::tr("Enter Task") ); | ||
20 | e->init( cur ); | ||
16 | 21 | ||
@@ -18,6 +23,6 @@ OTodo Editor::newTodo( int cur, | |||
18 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 23 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
19 | e.showMaximized(); | 24 | e->showMaximized(); |
20 | #endif | 25 | #endif |
21 | 26 | ||
22 | int ret = e.exec(); | 27 | int ret = e->exec(); |
23 | if ( QDialog::Accepted == ret ) { | 28 | if ( QDialog::Accepted == ret ) { |
@@ -27,3 +32,3 @@ OTodo Editor::newTodo( int cur, | |||
27 | 32 | ||
28 | OTodo ev = e.todo(); | 33 | OTodo ev = e->todo(); |
29 | qWarning("Todo uid"); | 34 | qWarning("Todo uid"); |
@@ -36,11 +41,12 @@ OTodo Editor::edit( QWidget *wid, | |||
36 | const OTodo& todo ) { | 41 | const OTodo& todo ) { |
37 | OTaskEditor e( todo ); | 42 | OTaskEditor *e = self(); |
38 | e.setCaption( QObject::tr( "Edit Task" ) ); | 43 | e->init( todo ); |
44 | e->setCaption( QObject::tr( "Edit Task" ) ); | ||
39 | 45 | ||
40 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 46 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
41 | e.showMaximized(); | 47 | e->showMaximized(); |
42 | #endif | 48 | #endif |
43 | int ret = e.exec(); | 49 | int ret = e->exec(); |
44 | 50 | ||
45 | OTodo ev = e.todo(); | 51 | OTodo ev = e->todo(); |
46 | if ( ret == QDialog::Accepted ) | 52 | if ( ret == QDialog::Accepted ) |
@@ -55 +61,7 @@ bool Editor::accepted()const { | |||
55 | } | 61 | } |
62 | OTaskEditor* Editor::self() { | ||
63 | if (!m_self ) | ||
64 | m_self = new OTaskEditor(0); | ||
65 | |||
66 | return m_self; | ||
67 | } | ||
diff --git a/core/pim/todo/todoeditor.h b/core/pim/todo/todoeditor.h index bbfdcb5..fe30634 100644 --- a/core/pim/todo/todoeditor.h +++ b/core/pim/todo/todoeditor.h | |||
@@ -6,2 +6,3 @@ | |||
6 | 6 | ||
7 | class OTaskEditor; | ||
7 | namespace Todo { | 8 | namespace Todo { |
@@ -19,4 +20,7 @@ namespace Todo { | |||
19 | bool accepted()const; | 20 | bool accepted()const; |
21 | protected: | ||
22 | OTaskEditor* self(); | ||
20 | private: | 23 | private: |
21 | bool m_accepted: 1; | 24 | bool m_accepted: 1; |
25 | OTaskEditor* m_self; | ||
22 | }; | 26 | }; |