From 599c58c6ab2ab936890cbbfa4e6299493c141f8a Mon Sep 17 00:00:00 2001 From: zecke Date: Sat, 30 Nov 2002 11:21:35 +0000 Subject: More implementation --- (limited to 'core/pim/todo/taskeditoradvancedimpl.cpp') diff --git a/core/pim/todo/taskeditoradvancedimpl.cpp b/core/pim/todo/taskeditoradvancedimpl.cpp new file mode 100644 index 0000000..89f672c --- a/dev/null +++ b/core/pim/todo/taskeditoradvancedimpl.cpp @@ -0,0 +1,63 @@ +#include +#include +#include +#include + + +#include +#include +#include + +#include "taskeditoradvancedimpl.h" + + +TaskEditorAdvancedImpl::TaskEditorAdvancedImpl( QWidget* parent, const char* name ) + : TaskEditorAdvanced( parent, name ) { + initUI(); +} +TaskEditorAdvancedImpl::~TaskEditorAdvancedImpl() { +} +void TaskEditorAdvancedImpl::load( const OTodo& todo) { + m_edit->setText( todo.description() ); + + /* OPimState */ + int state = todo.state().state(); + + /* defualt to not started */ + if ( state == OPimState::Undefined ) + state = OPimState::NotStarted; + + cmbState->setCurrentItem( state ); + + /* Maintainer Mode */ + state = todo.maintainer().mode(); + if ( state == OPimMaintainer::Undefined ) + state = OPimMaintainer::Nothing; + + cmbMode->setCurrentItem( state ); + +} +void TaskEditorAdvancedImpl::save( OTodo& todo) { + todo.setDescription( m_edit->text() ); + todo.setState( OPimState( cmbState->currentItem() ) ); + + /* Fix me resolve name to uid.....*/ + todo.setMaintainer( OPimMaintainer( cmbMode->currentItem(), -10 ) ); + qWarning("save"); +} +/* + * int the damn UI + */ +void TaskEditorAdvancedImpl::initUI() { + /* a MultiLineEdit */ + m_edit = new QMultiLineEdit( this ); + m_edit->setWordWrap( QMultiLineEdit::WidgetWidth ); + + /* a Label */ + QLabel* lbl = new QLabel(this ); + lbl->setText( tr("Description") ); + + /* add it to the QGridLayout of our base class */ + static_cast(layout() )->addWidget( lbl , 3, 0 ); + static_cast(layout() )->addWidget( m_edit, 4, 0 ); +} -- cgit v0.9.0.2