Diffstat (limited to 'core/pim/todo/taskeditorstatus.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/taskeditorstatus.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/pim/todo/taskeditorstatus.cpp b/core/pim/todo/taskeditorstatus.cpp index 98e3cea..367dd58 100644 --- a/core/pim/todo/taskeditorstatus.cpp +++ b/core/pim/todo/taskeditorstatus.cpp | |||
@@ -15,35 +15,34 @@ | |||
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = General Public License along with | 21 | -_. . . )=. = General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "taskeditorstatus.h" | 29 | #include "taskeditorstatus.h" |
30 | 30 | ||
31 | #include <opie/otodo.h> | 31 | #include <opie2/opimmaintainer.h> |
32 | #include <opie/opimmaintainer.h> | 32 | #include <opie2/opimstate.h> |
33 | #include <opie/opimstate.h> | ||
34 | 33 | ||
35 | #include <qpe/datebookmonth.h> | 34 | #include <qpe/datebookmonth.h> |
36 | 35 | ||
37 | #include <qcheckbox.h> | 36 | #include <qcheckbox.h> |
38 | #include <qcombobox.h> | 37 | #include <qcombobox.h> |
39 | #include <qlabel.h> | 38 | #include <qlabel.h> |
40 | #include <qlayout.h> | 39 | #include <qlayout.h> |
41 | #include <qwhatsthis.h> | 40 | #include <qwhatsthis.h> |
42 | 41 | ||
43 | // FIXME add the hack slots instead of setPopup!!!! | 42 | // FIXME add the hack slots instead of setPopup!!!! |
44 | // drw you shouldn't have removed them | 43 | // drw you shouldn't have removed them |
45 | 44 | ||
46 | TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags fl ) | 45 | TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags fl ) |
47 | : QWidget( parent, name, fl ) | 46 | : QWidget( parent, name, fl ) |
48 | { | 47 | { |
49 | QDate curDate = QDate::currentDate(); | 48 | QDate curDate = QDate::currentDate(); |
@@ -158,33 +157,33 @@ TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags f | |||
158 | QWhatsThis::add( label, tr( "This is the name of the current task maintainer." ) ); | 157 | QWhatsThis::add( label, tr( "This is the name of the current task maintainer." ) ); |
159 | txtMaintainer = new QLabel( tr( "test" ), container ); | 158 | txtMaintainer = new QLabel( tr( "test" ), container ); |
160 | txtMaintainer->setTextFormat( QLabel::RichText ); | 159 | txtMaintainer->setTextFormat( QLabel::RichText ); |
161 | layout->addWidget( txtMaintainer, 7, 1 ); | 160 | layout->addWidget( txtMaintainer, 7, 1 ); |
162 | QWhatsThis::add( txtMaintainer, tr( "This is the name of the current task maintainer." ) ); | 161 | QWhatsThis::add( txtMaintainer, tr( "This is the name of the current task maintainer." ) ); |
163 | tbtMaintainer = new QToolButton( container ); | 162 | tbtMaintainer = new QToolButton( container ); |
164 | tbtMaintainer->setPixmap( Resource::loadPixmap( "todo/more" ) ); | 163 | tbtMaintainer->setPixmap( Resource::loadPixmap( "todo/more" ) ); |
165 | // layout->addWidget( tbtMaintainer, 7, 2 ); | 164 | // layout->addWidget( tbtMaintainer, 7, 2 ); |
166 | QWhatsThis::add( tbtMaintainer, tr( "Click here to select the task maintainer." ) ); | 165 | QWhatsThis::add( tbtMaintainer, tr( "Click here to select the task maintainer." ) ); |
167 | #endif | 166 | #endif |
168 | } | 167 | } |
169 | 168 | ||
170 | TaskEditorStatus::~TaskEditorStatus() | 169 | TaskEditorStatus::~TaskEditorStatus() |
171 | { | 170 | { |
172 | } | 171 | } |
173 | 172 | ||
174 | void TaskEditorStatus::load( const OTodo &todo ) | 173 | void TaskEditorStatus::load( const OPimTodo &todo ) |
175 | { | 174 | { |
176 | QDate date = QDate::currentDate(); | 175 | QDate date = QDate::currentDate(); |
177 | QString str = TimeString::longDateString( date ); | 176 | QString str = TimeString::longDateString( date ); |
178 | 177 | ||
179 | // Status | 178 | // Status |
180 | int state = todo.hasState()? todo.state().state() : OPimState::NotStarted; | 179 | int state = todo.hasState()? todo.state().state() : OPimState::NotStarted; |
181 | if ( state == OPimState::Undefined ) | 180 | if ( state == OPimState::Undefined ) |
182 | state = OPimState::NotStarted; | 181 | state = OPimState::NotStarted; |
183 | cmbStatus->setCurrentItem( state ); | 182 | cmbStatus->setCurrentItem( state ); |
184 | 183 | ||
185 | // Progress | 184 | // Progress |
186 | cmbProgress->setCurrentItem( todo.progress() / 20 ); | 185 | cmbProgress->setCurrentItem( todo.progress() / 20 ); |
187 | 186 | ||
188 | // Start date | 187 | // Start date |
189 | ckbStart->setChecked( todo.hasStartDate() ); | 188 | ckbStart->setChecked( todo.hasStartDate() ); |
190 | btnStart->setEnabled( todo.hasStartDate() ); | 189 | btnStart->setEnabled( todo.hasStartDate() ); |
@@ -210,33 +209,33 @@ void TaskEditorStatus::load( const OTodo &todo ) | |||
210 | m_comp = todo.completedDate(); | 209 | m_comp = todo.completedDate(); |
211 | btnComp->setText( TimeString::longDateString( m_comp ) ); | 210 | btnComp->setText( TimeString::longDateString( m_comp ) ); |
212 | } | 211 | } |
213 | else | 212 | else |
214 | btnComp->setText( str ); | 213 | btnComp->setText( str ); |
215 | 214 | ||
216 | // Maintainer Mode | 215 | // Maintainer Mode |
217 | #if 0 | 216 | #if 0 |
218 | state = todo.hasMaintainer() ? todo.maintainer().mode() : OPimMaintainer::Nothing; | 217 | state = todo.hasMaintainer() ? todo.maintainer().mode() : OPimMaintainer::Nothing; |
219 | if ( state == OPimMaintainer::Undefined ) | 218 | if ( state == OPimMaintainer::Undefined ) |
220 | state = OPimMaintainer::Nothing; | 219 | state = OPimMaintainer::Nothing; |
221 | cmbMaintMode->setCurrentItem( state ); | 220 | cmbMaintMode->setCurrentItem( state ); |
222 | #endif | 221 | #endif |
223 | // Maintainer - not implemented yet | 222 | // Maintainer - not implemented yet |
224 | } | 223 | } |
225 | 224 | ||
226 | void TaskEditorStatus::save( OTodo &todo ) | 225 | void TaskEditorStatus::save( OPimTodo &todo ) |
227 | { | 226 | { |
228 | QDate inval; | 227 | QDate inval; |
229 | 228 | ||
230 | // Status | 229 | // Status |
231 | todo.setState( OPimState( cmbStatus->currentItem() ) ); | 230 | todo.setState( OPimState( cmbStatus->currentItem() ) ); |
232 | 231 | ||
233 | // Progress | 232 | // Progress |
234 | todo.setProgress( cmbProgress->currentItem() * 20 ); | 233 | todo.setProgress( cmbProgress->currentItem() * 20 ); |
235 | 234 | ||
236 | // Start date | 235 | // Start date |
237 | if ( ckbStart->isChecked() ) | 236 | if ( ckbStart->isChecked() ) |
238 | { | 237 | { |
239 | todo.setStartDate( m_start ); | 238 | todo.setStartDate( m_start ); |
240 | } | 239 | } |
241 | else | 240 | else |
242 | todo.setStartDate( inval ); | 241 | todo.setStartDate( inval ); |