author | zecke <zecke> | 2003-05-07 16:16:44 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-05-07 16:16:44 (UTC) |
commit | 1cee00987d34729393fb9383d90babd39517cc68 (patch) (side-by-side diff) | |
tree | 03a51eaf8bfcfd242b4bb98d29e941b0b9dcb38a | |
parent | 1e9e3371d61cfc404329a8bad51f8b061c1ad73d (diff) | |
download | opie-1cee00987d34729393fb9383d90babd39517cc68.zip opie-1cee00987d34729393fb9383d90babd39517cc68.tar.gz opie-1cee00987d34729393fb9383d90babd39517cc68.tar.bz2 |
try to use the has* functions
-rw-r--r-- | core/pim/todo/taskeditoroverview.cpp | 4 | ||||
-rw-r--r-- | core/pim/todo/taskeditorstatus.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/pim/todo/taskeditoroverview.cpp b/core/pim/todo/taskeditoroverview.cpp index 92408ba..9a8abea 100644 --- a/core/pim/todo/taskeditoroverview.cpp +++ b/core/pim/todo/taskeditoroverview.cpp @@ -121,50 +121,50 @@ TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFla QWhatsThis::add( label, tr( "Enter any additional information about this task here." ) ); mleNotes = new QMultiLineEdit( container ); mleNotes->setWordWrap( QMultiLineEdit::WidgetWidth ); layout->addMultiCellWidget( mleNotes, 6, 6, 0, 1 ); QWhatsThis::add( mleNotes, tr( "Enter any additional information about this task here." ) ); } TaskEditorOverView::~TaskEditorOverView() { } void TaskEditorOverView::load( const OTodo& todo ) { // Description cmbDesc->insertItem( todo.summary(), 0 ); cmbDesc->setCurrentItem( 0 ); // Priority cmbPriority->setCurrentItem( todo.priority() - 1 ); // Category cmbCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) ); // Recurrence - ckbRecurrence->setChecked( todo.recurrence().doesRecur() ); - emit recurranceEnabled( todo.recurrence().doesRecur() ); + ckbRecurrence->setChecked( todo.hasRecurrence() ); + emit recurranceEnabled( todo.hasRecurrence() ); // Notes mleNotes->setText( todo.description() ); } void TaskEditorOverView::save( OTodo &todo ) { // Description todo.setSummary( cmbDesc->currentText() ); // Priority todo.setPriority( cmbPriority->currentItem() + 1 ); // Category if ( cmbCategory->currentCategory() != -1 ) { QArray<int> arr = cmbCategory->currentCategories(); todo.setCategories( arr ); } // Recurrence - don't need to save here... // Notes diff --git a/core/pim/todo/taskeditorstatus.cpp b/core/pim/todo/taskeditorstatus.cpp index b11fdab..4331877 100644 --- a/core/pim/todo/taskeditorstatus.cpp +++ b/core/pim/todo/taskeditorstatus.cpp @@ -158,86 +158,86 @@ TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags f // Maintainer label = new QLabel( tr( "Maintainer:" ), container ); layout->addWidget( label, 7, 0 ); QWhatsThis::add( label, tr( "This is the name of the current task maintainer." ) ); txtMaintainer = new QLabel( tr( "test" ), container ); txtMaintainer->setTextFormat( QLabel::RichText ); layout->addWidget( txtMaintainer, 7, 1 ); QWhatsThis::add( txtMaintainer, tr( "This is the name of the current task maintainer." ) ); tbtMaintainer = new QToolButton( container ); tbtMaintainer->setPixmap( Resource::loadPixmap( "todo/more" ) ); layout->addWidget( tbtMaintainer, 7, 2 ); QWhatsThis::add( tbtMaintainer, tr( "Click here to select the task maintainer." ) ); } TaskEditorStatus::~TaskEditorStatus() { } void TaskEditorStatus::load( const OTodo &todo ) { QDate date = QDate::currentDate(); QString str = TimeString::longDateString( date ); // Status - int state = todo.state().state(); + int state = todo.hasState()? todo.state().state() : OPimState::NotStarted; if ( state == OPimState::Undefined ) state = OPimState::NotStarted; cmbStatus->setCurrentItem( state ); // Progress cmbProgress->setCurrentItem( todo.progress() / 20 ); // Start date 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 ); // Due date ckbDue->setChecked( todo.hasDueDate() ); btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); btnDue->setEnabled( todo.hasDueDate() ); m_due = todo.dueDate(); // Completed ckbComp->setChecked( todo.isCompleted() ); btnComp->setEnabled( todo.hasCompletedDate() ); if ( todo.hasCompletedDate() ) { m_comp = todo.completedDate(); btnComp->setText( TimeString::longDateString( m_comp ) ); } else btnComp->setText( str ); // Maintainer Mode - state = todo.maintainer().mode(); + state = todo.hasMaintainer() ? todo.maintainer().mode() : OPimMaintainer::Nothing; if ( state == OPimMaintainer::Undefined ) state = OPimMaintainer::Nothing; cmbMaintMode->setCurrentItem( state ); // Maintainer - not implemented yet } void TaskEditorStatus::save( OTodo &todo ) { QDate inval; // Status todo.setState( OPimState( cmbStatus->currentItem() ) ); // Progress todo.setProgress( cmbProgress->currentItem() * 20 ); // Start date if ( ckbStart->isChecked() ) { todo.setStartDate( m_start ); } else todo.setStartDate( inval ); |