Diffstat (limited to 'core/pim/todo/taskeditoroverviewimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/taskeditoroverviewimpl.cpp | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/core/pim/todo/taskeditoroverviewimpl.cpp b/core/pim/todo/taskeditoroverviewimpl.cpp index 24b3386..aef3b1d 100644 --- a/core/pim/todo/taskeditoroverviewimpl.cpp +++ b/core/pim/todo/taskeditoroverviewimpl.cpp | |||
@@ -8,4 +8,6 @@ | |||
8 | #include <qpe/timestring.h> | 8 | #include <qpe/timestring.h> |
9 | 9 | ||
10 | #include <opie/orecur.h> | ||
11 | |||
10 | #include "taskeditoroverviewimpl.h" | 12 | #include "taskeditoroverviewimpl.h" |
11 | 13 | ||
@@ -21,5 +23,5 @@ TaskEditorOverViewImpl::~TaskEditorOverViewImpl() { | |||
21 | } | 23 | } |
22 | void TaskEditorOverViewImpl::load( const OTodo& todo) { | 24 | void TaskEditorOverViewImpl::load( const OTodo& todo) { |
23 | /* | 25 | /* |
24 | * now that we're 'preloaded' we | 26 | * now that we're 'preloaded' we |
25 | * need to disable the buttons | 27 | * need to disable the buttons |
@@ -30,14 +32,29 @@ void TaskEditorOverViewImpl::load( const OTodo& todo) { | |||
30 | btnStart->setEnabled( FALSE ); | 32 | btnStart->setEnabled( FALSE ); |
31 | 33 | ||
32 | 34 | /* | |
35 | * get some basic dateinfos for now | ||
36 | */ | ||
33 | QDate date = QDate::currentDate(); | 37 | QDate date = QDate::currentDate(); |
34 | QString str = TimeString::longDateString( date ); | 38 | QString str = TimeString::longDateString( date ); |
35 | 39 | ||
36 | emit recurranceEnabled( FALSE ); | 40 | CheckBox7->setChecked( todo.recurrence().doesRecur() ); |
37 | ckbStart->setChecked( FALSE ); | 41 | emit recurranceEnabled( todo.recurrence().doesRecur() ); |
38 | btnStart->setText( str ); | 42 | |
39 | 43 | ||
40 | ckbComp->setChecked( FALSE ); | 44 | ckbStart->setChecked( todo.hasStartDate() ); |
41 | btnComp->setText( str ); | 45 | btnStart->setEnabled( todo.hasStartDate() ); |
46 | if ( todo.hasStartDate() ) { | ||
47 | m_start = todo.startDate(); | ||
48 | btnStart->setText( TimeString::longDateString( m_start ) ); | ||
49 | } else | ||
50 | btnStart->setText( str ); | ||
51 | |||
52 | ckbComp->setChecked( todo.hasCompletedDate() ); | ||
53 | btnComp->setEnabled( todo.hasCompletedDate() ); | ||
54 | if ( todo.hasCompletedDate() ) { | ||
55 | m_comp = todo.completedDate(); | ||
56 | btnComp->setText( TimeString::longDateString( m_comp ) ); | ||
57 | }else | ||
58 | btnComp->setText( str ); | ||
42 | 59 | ||
43 | cmbProgress->setCurrentItem( todo.progress()/20 ); | 60 | cmbProgress->setCurrentItem( todo.progress()/20 ); |
@@ -48,4 +65,5 @@ void TaskEditorOverViewImpl::load( const OTodo& todo) { | |||
48 | btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); | 65 | btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); |
49 | btnDue->setEnabled( todo.hasDueDate() ); | 66 | btnDue->setEnabled( todo.hasDueDate() ); |
67 | m_due = todo.dueDate(); | ||
50 | 68 | ||
51 | cmbPrio->setCurrentItem( todo.priority() -1 ); | 69 | cmbPrio->setCurrentItem( todo.priority() -1 ); |
@@ -56,5 +74,9 @@ void TaskEditorOverViewImpl::load( const OTodo& todo) { | |||
56 | } | 74 | } |
57 | void TaskEditorOverViewImpl::save( OTodo& to) { | 75 | void TaskEditorOverViewImpl::save( OTodo& to) { |
58 | qWarning("save it now"); | 76 | /* a invalid date */ |
77 | QDate inval; | ||
78 | /* save our info back */ | ||
79 | |||
80 | /* due date */ | ||
59 | if ( ckbDue->isChecked() ) { | 81 | if ( ckbDue->isChecked() ) { |
60 | to.setDueDate( m_due ); | 82 | to.setDueDate( m_due ); |
@@ -62,4 +84,19 @@ void TaskEditorOverViewImpl::save( OTodo& to) { | |||
62 | }else | 84 | }else |
63 | to.setHasDueDate( false ); | 85 | to.setHasDueDate( false ); |
86 | |||
87 | /* start date */ | ||
88 | if ( ckbStart->isChecked() ) { | ||
89 | to.setStartDate( m_start ); | ||
90 | }else | ||
91 | to.setStartDate( inval ); | ||
92 | |||
93 | /* comp date */ | ||
94 | if ( ckbComp->isChecked() ) { | ||
95 | qWarning("completed checked"); | ||
96 | to.setCompletedDate( m_comp ); | ||
97 | }else | ||
98 | to.setCompletedDate( inval ); | ||
99 | |||
100 | |||
64 | if ( comboCategory->currentCategory() != -1 ) { | 101 | if ( comboCategory->currentCategory() != -1 ) { |
65 | QArray<int> arr = comboCategory->currentCategories(); | 102 | QArray<int> arr = comboCategory->currentCategories(); |
@@ -137,4 +174,5 @@ void TaskEditorOverViewImpl::slotStartChanged(int y, int m, int d) { | |||
137 | void TaskEditorOverViewImpl::slotDueChecked() { | 174 | void TaskEditorOverViewImpl::slotDueChecked() { |
138 | btnDue->setEnabled( ckbDue->isChecked() ); | 175 | btnDue->setEnabled( ckbDue->isChecked() ); |
176 | emit dueDateChanged( m_due ); | ||
139 | qWarning("slotDueChecked"); | 177 | qWarning("slotDueChecked"); |
140 | } | 178 | } |
@@ -142,4 +180,5 @@ void TaskEditorOverViewImpl::slotDueChanged(int y, int m, int d ) { | |||
142 | m_due.setYMD(y, m, d ); | 180 | m_due.setYMD(y, m, d ); |
143 | btnDue->setText( TimeString::longDateString( m_due ) ); | 181 | btnDue->setText( TimeString::longDateString( m_due ) ); |
182 | emit dueDateChanged( m_due ); | ||
144 | } | 183 | } |
145 | void TaskEditorOverViewImpl::slotCompletedChecked() { | 184 | void TaskEditorOverViewImpl::slotCompletedChecked() { |