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 @@ #include <qpe/timestring.h> +#include <opie/orecur.h> + #include "taskeditoroverviewimpl.h" @@ -21,5 +23,5 @@ TaskEditorOverViewImpl::~TaskEditorOverViewImpl() { } void TaskEditorOverViewImpl::load( const OTodo& todo) { - /* + /* * now that we're 'preloaded' we * need to disable the buttons @@ -30,14 +32,29 @@ void TaskEditorOverViewImpl::load( const OTodo& todo) { btnStart->setEnabled( FALSE ); - + /* + * get some basic dateinfos for now + */ QDate date = QDate::currentDate(); QString str = TimeString::longDateString( date ); - emit recurranceEnabled( FALSE ); - ckbStart->setChecked( FALSE ); - btnStart->setText( str ); + CheckBox7->setChecked( todo.recurrence().doesRecur() ); + emit recurranceEnabled( todo.recurrence().doesRecur() ); + - ckbComp->setChecked( FALSE ); - btnComp->setText( str ); + ckbStart->setChecked( todo.hasStartDate() ); + btnStart->setEnabled( todo.hasStartDate() ); + if ( todo.hasStartDate() ) { + m_start = todo.startDate(); + btnStart->setText( TimeString::longDateString( m_start ) ); + } else + btnStart->setText( str ); + + ckbComp->setChecked( todo.hasCompletedDate() ); + btnComp->setEnabled( todo.hasCompletedDate() ); + if ( todo.hasCompletedDate() ) { + m_comp = todo.completedDate(); + btnComp->setText( TimeString::longDateString( m_comp ) ); + }else + btnComp->setText( str ); cmbProgress->setCurrentItem( todo.progress()/20 ); @@ -48,4 +65,5 @@ void TaskEditorOverViewImpl::load( const OTodo& todo) { btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); btnDue->setEnabled( todo.hasDueDate() ); + m_due = todo.dueDate(); cmbPrio->setCurrentItem( todo.priority() -1 ); @@ -56,5 +74,9 @@ void TaskEditorOverViewImpl::load( const OTodo& todo) { } void TaskEditorOverViewImpl::save( OTodo& to) { - qWarning("save it now"); + /* a invalid date */ + QDate inval; + /* save our info back */ + + /* due date */ if ( ckbDue->isChecked() ) { to.setDueDate( m_due ); @@ -62,4 +84,19 @@ void TaskEditorOverViewImpl::save( OTodo& to) { }else to.setHasDueDate( false ); + + /* start date */ + if ( ckbStart->isChecked() ) { + to.setStartDate( m_start ); + }else + to.setStartDate( inval ); + + /* comp date */ + if ( ckbComp->isChecked() ) { + qWarning("completed checked"); + to.setCompletedDate( m_comp ); + }else + to.setCompletedDate( inval ); + + if ( comboCategory->currentCategory() != -1 ) { QArray<int> arr = comboCategory->currentCategories(); @@ -137,4 +174,5 @@ void TaskEditorOverViewImpl::slotStartChanged(int y, int m, int d) { void TaskEditorOverViewImpl::slotDueChecked() { btnDue->setEnabled( ckbDue->isChecked() ); + emit dueDateChanged( m_due ); qWarning("slotDueChecked"); } @@ -142,4 +180,5 @@ void TaskEditorOverViewImpl::slotDueChanged(int y, int m, int d ) { m_due.setYMD(y, m, d ); btnDue->setText( TimeString::longDateString( m_due ) ); + emit dueDateChanged( m_due ); } void TaskEditorOverViewImpl::slotCompletedChecked() { |