Diffstat (limited to 'core/pim/todo/taskeditoroverviewimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/todo/taskeditoroverviewimpl.cpp | 49 |
1 files changed, 44 insertions, 5 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 | |||
@@ -4,12 +4,14 @@ | |||
4 | #include <qpopupmenu.h> | 4 | #include <qpopupmenu.h> |
5 | 5 | ||
6 | #include <qpe/datebookmonth.h> | 6 | #include <qpe/datebookmonth.h> |
7 | #include <qpe/categoryselect.h> | 7 | #include <qpe/categoryselect.h> |
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 | ||
12 | /* | 14 | /* |
13 | * we need to hack | 15 | * we need to hack |
14 | */ | 16 | */ |
15 | 17 | ||
@@ -26,44 +28,79 @@ void TaskEditorOverViewImpl::load( const OTodo& todo) { | |||
26 | * holding the dat | 28 | * holding the dat |
27 | */ | 29 | */ |
28 | btnDue-> setEnabled( FALSE ); | 30 | btnDue-> setEnabled( FALSE ); |
29 | btnComp-> setEnabled( FALSE ); | 31 | btnComp-> setEnabled( FALSE ); |
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() ); |
42 | |||
43 | |||
44 | ckbStart->setChecked( todo.hasStartDate() ); | ||
45 | btnStart->setEnabled( todo.hasStartDate() ); | ||
46 | if ( todo.hasStartDate() ) { | ||
47 | m_start = todo.startDate(); | ||
48 | btnStart->setText( TimeString::longDateString( m_start ) ); | ||
49 | } else | ||
38 | btnStart->setText( str ); | 50 | btnStart->setText( str ); |
39 | 51 | ||
40 | ckbComp->setChecked( FALSE ); | 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 | ||
41 | btnComp->setText( str ); | 58 | btnComp->setText( str ); |
42 | 59 | ||
43 | cmbProgress->setCurrentItem( todo.progress()/20 ); | 60 | cmbProgress->setCurrentItem( todo.progress()/20 ); |
44 | cmbSum->insertItem( todo.summary(), 0 ); | 61 | cmbSum->insertItem( todo.summary(), 0 ); |
45 | cmbSum->setCurrentItem( 0 ); | 62 | cmbSum->setCurrentItem( 0 ); |
46 | 63 | ||
47 | ckbDue->setChecked( todo.hasDueDate() ); | 64 | ckbDue->setChecked( todo.hasDueDate() ); |
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 ); |
52 | ckbCompleted->setChecked( todo.isCompleted() ); | 70 | ckbCompleted->setChecked( todo.isCompleted() ); |
53 | 71 | ||
54 | comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); | 72 | comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); |
55 | 73 | ||
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 ); |
61 | to.setHasDueDate( true ); | 83 | to.setHasDueDate( true ); |
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(); |
66 | to.setCategories( arr ); | 103 | to.setCategories( arr ); |
67 | } | 104 | } |
68 | to.setPriority( cmbPrio->currentItem() + 1 ); | 105 | to.setPriority( cmbPrio->currentItem() + 1 ); |
69 | to.setCompleted( ckbCompleted->isChecked() ); | 106 | to.setCompleted( ckbCompleted->isChecked() ); |
@@ -133,17 +170,19 @@ void TaskEditorOverViewImpl::slotStartChecked() { | |||
133 | void TaskEditorOverViewImpl::slotStartChanged(int y, int m, int d) { | 170 | void TaskEditorOverViewImpl::slotStartChanged(int y, int m, int d) { |
134 | m_start.setYMD( y, m, d ); | 171 | m_start.setYMD( y, m, d ); |
135 | btnStart->setText( TimeString::longDateString( m_start ) ); | 172 | btnStart->setText( TimeString::longDateString( m_start ) ); |
136 | } | 173 | } |
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 | } |
141 | void TaskEditorOverViewImpl::slotDueChanged(int y, int m, int d ) { | 179 | 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() { |
146 | btnComp->setEnabled( ckbComp->isChecked() ); | 185 | btnComp->setEnabled( ckbComp->isChecked() ); |
147 | qWarning("slotCompletedChecked"); | 186 | qWarning("slotCompletedChecked"); |
148 | } | 187 | } |
149 | void TaskEditorOverViewImpl::slotCompletedChanged(int y, int m, int d) { | 188 | void TaskEditorOverViewImpl::slotCompletedChanged(int y, int m, int d) { |