-rw-r--r-- | core/pim/todo/otaskeditor.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp index 84f854f..1ed20b4 100644 --- a/core/pim/todo/otaskeditor.cpp +++ b/core/pim/todo/otaskeditor.cpp | |||
@@ -1,10 +1,7 @@ | |||
1 | #include <qdatetime.h> | ||
2 | #include <qlabel.h> | ||
3 | #include <qlayout.h> | 1 | #include <qlayout.h> |
4 | #include <qmultilineedit.h> | ||
5 | 2 | ||
6 | #include <opie/orecurrancewidget.h> | 3 | #include <opie/orecurrancewidget.h> |
7 | 4 | ||
8 | #include "taskeditoroverview.h" | 5 | #include "taskeditoroverview.h" |
9 | #include "taskeditorstatus.h" | 6 | #include "taskeditorstatus.h" |
10 | #include "taskeditoralarms.h" | 7 | #include "taskeditoralarms.h" |
@@ -23,41 +20,40 @@ OTaskEditor::OTaskEditor( const OTodo& to) | |||
23 | } | 20 | } |
24 | OTaskEditor::~OTaskEditor() { | 21 | OTaskEditor::~OTaskEditor() { |
25 | 22 | ||
26 | } | 23 | } |
27 | void OTaskEditor::init( int cur ) { | 24 | void OTaskEditor::init( int cur ) { |
28 | OTodo to; | 25 | OTodo to; |
26 | to.setUid( 1 ); // generate a new uid | ||
29 | if ( cur != 0 ) | 27 | if ( cur != 0 ) |
30 | to.setCategories( cur ); | 28 | to.setCategories( cur ); |
31 | load(to); | 29 | load(to); |
32 | m_uid = 1; // generate a new one | ||
33 | } | 30 | } |
34 | void OTaskEditor::init( const OTodo& to ) { | 31 | void OTaskEditor::init( const OTodo& to ) { |
35 | load( to ); | 32 | load( to ); |
36 | m_uid = to.uid(); | ||
37 | } | 33 | } |
38 | OTodo OTaskEditor::todo()const{ | 34 | OTodo OTaskEditor::todo()const{ |
39 | qWarning("saving!"); | 35 | qWarning("saving!"); |
40 | OTodo to; | 36 | OTodo to ( m_todo ); |
41 | to.setUid(m_uid ); | ||
42 | m_overView->save( to ); | 37 | m_overView->save( to ); |
43 | m_stat->save( to ); | 38 | m_stat->save( to ); |
44 | to.setRecurrence( m_rec->recurrence() ); | 39 | to.setRecurrence( m_rec->recurrence() ); |
45 | m_alarm->save( to ); | 40 | m_alarm->save( to ); |
46 | 41 | ||
47 | return to; | 42 | return to; |
48 | } | 43 | } |
49 | void OTaskEditor::load(const OTodo& to) { | 44 | void OTaskEditor::load(const OTodo& to) { |
50 | m_overView->load( to ); | 45 | m_overView->load( to ); |
51 | m_stat->load( to ); | 46 | m_stat->load( to ); |
52 | m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); | 47 | m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); |
53 | m_alarm->setEnabled( !to.hasRecurrence() ); | ||
54 | m_alarm->load( to ); | 48 | m_alarm->load( to ); |
49 | |||
50 | m_todo = to; | ||
55 | } | 51 | } |
56 | void OTaskEditor::init() { | 52 | void OTaskEditor::init() { |
57 | setCaption("Task Editor"); | 53 | setCaption(tr("Task Editor") ); |
58 | 54 | ||
59 | QVBoxLayout* layo = new QVBoxLayout( this ); | 55 | QVBoxLayout* layo = new QVBoxLayout( this ); |
60 | m_tab = new OTabWidget( this ); | 56 | m_tab = new OTabWidget( this ); |
61 | layo->addWidget( m_tab ); | 57 | layo->addWidget( m_tab ); |
62 | 58 | ||
63 | /* | 59 | /* |