summaryrefslogtreecommitdiff
authorzecke <zecke>2003-05-07 16:16:44 (UTC)
committer zecke <zecke>2003-05-07 16:16:44 (UTC)
commit1cee00987d34729393fb9383d90babd39517cc68 (patch) (side-by-side diff)
tree03a51eaf8bfcfd242b4bb98d29e941b0b9dcb38a
parent1e9e3371d61cfc404329a8bad51f8b061c1ad73d (diff)
downloadopie-1cee00987d34729393fb9383d90babd39517cc68.zip
opie-1cee00987d34729393fb9383d90babd39517cc68.tar.gz
opie-1cee00987d34729393fb9383d90babd39517cc68.tar.bz2
try to use the has* functions
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/taskeditoroverview.cpp4
-rw-r--r--core/pim/todo/taskeditorstatus.cpp18
2 files changed, 11 insertions, 11 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
@@ -139,14 +139,14 @@ void TaskEditorOverView::load( const OTodo& todo )
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() );
}
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
@@ -61,13 +61,13 @@ TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags f
sv->setResizePolicy( QScrollView::AutoOneFit );
sv->setFrameStyle( QFrame::NoFrame );
QWidget *container = new QWidget( sv->viewport() );
sv->addChild( container );
- QGridLayout *layout = new QGridLayout( container, 7, 3, 4, 4 );
+ QGridLayout *layout = new QGridLayout( container, 7, 3, 4, 4 );
// Status
QLabel *label = new QLabel( tr( "Status:" ), container );
layout->addWidget( label, 0, 0 );
QWhatsThis::add( label, tr( "Click here to set the current status of this task." ) );
cmbStatus = new QComboBox( FALSE, container );
@@ -88,13 +88,13 @@ TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags f
cmbProgress->insertItem( tr( "40 %" ) );
cmbProgress->insertItem( tr( "60 %" ) );
cmbProgress->insertItem( tr( "80 %" ) );
cmbProgress->insertItem( tr( "100 %" ) );
layout->addMultiCellWidget( cmbProgress, 1, 1, 1, 2 );
QWhatsThis::add( cmbProgress, tr( "Select progress made on this task here." ) );
-
+
// Start date
ckbStart = new QCheckBox( tr( "Start Date:" ), container );
layout->addWidget( ckbStart, 2, 0 );
QWhatsThis::add( ckbStart, tr( "Click here to set the date this task was started." ) );
connect( ckbStart, SIGNAL( clicked() ), this, SLOT( slotStartChecked() ) );
btnStart = new QPushButton( curDateStr, container );
@@ -104,13 +104,13 @@ TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags f
QPopupMenu *popup = new QPopupMenu( this );
m_startBook = new DateBookMonth( popup, 0, TRUE );
popup->insertItem( m_startBook );
btnStart->setPopup( popup );
connect( m_startBook, SIGNAL( dateClicked( int, int, int ) ),
this, SLOT( slotStartChanged( int, int, int ) ) );
-
+
// Due date
ckbDue = new QCheckBox( tr( "Due Date:" ), container );
layout->addWidget( ckbDue, 3, 0 );
QWhatsThis::add( ckbDue, tr( "Click here to set the date this task needs to be completed by." ) );
connect( ckbDue, SIGNAL( clicked() ), this, SLOT( slotDueChecked() ) );
btnDue = new QPushButton( curDateStr, container );
@@ -120,13 +120,13 @@ TaskEditorStatus::TaskEditorStatus( QWidget* parent, const char* name, WFlags f
popup = new QPopupMenu( this );
m_dueBook = new DateBookMonth( popup, 0, TRUE );
popup->insertItem( m_dueBook );
btnDue->setPopup( popup );
connect( m_dueBook, SIGNAL( dateClicked( int, int, int ) ),
this, SLOT( slotDueChanged( int, int, int ) ) );
-
+
// Completed
ckbComp = new QCheckBox( tr( "Completed:" ), container );
layout->addWidget( ckbComp, 4, 0 );
QWhatsThis::add( ckbComp, tr( "Click here to mark this task as completed." ) );
connect( ckbComp, SIGNAL( clicked() ), this, SLOT( slotCompChecked() ) );
btnComp = new QPushButton( curDateStr, container );
@@ -176,20 +176,20 @@ 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();
@@ -213,13 +213,13 @@ void TaskEditorStatus::load( const OTodo &todo )
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
}
@@ -227,13 +227,13 @@ void TaskEditorStatus::load( const OTodo &todo )
void TaskEditorStatus::save( OTodo &todo )
{
QDate inval;
// Status
todo.setState( OPimState( cmbStatus->currentItem() ) );
-
+
// Progress
todo.setProgress( cmbProgress->currentItem() * 20 );
// Start date
if ( ckbStart->isChecked() )
{
@@ -256,13 +256,13 @@ void TaskEditorStatus::save( OTodo &todo )
if ( ckbComp->isChecked() )
{
todo.setCompletedDate( m_comp );
}
else
todo.setCompletedDate( inval );
-
+
// Maintainer mode - not implemented yet
// Maintainer
/* TODO - resolve name to uid.....*/
todo.setMaintainer( OPimMaintainer( cmbMaintMode->currentItem(), -10 ) );
}