author | drw <drw> | 2002-12-29 21:11:47 (UTC) |
---|---|---|
committer | drw <drw> | 2002-12-29 21:11:47 (UTC) |
commit | 786612c0c5a0e4876364b027655017362afd8c67 (patch) (side-by-side diff) | |
tree | ee9e6896804f043c1326de74b7f9584ea78ebb2c /core | |
parent | 82ce361b2b9279d09a3398a3db7c9ba0d1601cb7 (diff) | |
download | opie-786612c0c5a0e4876364b027655017362afd8c67.zip opie-786612c0c5a0e4876364b027655017362afd8c67.tar.gz opie-786612c0c5a0e4876364b027655017362afd8c67.tar.bz2 |
More updates to edit task dialog. Rearranged info on 1st 2 tabs so it is grouped a little more logically, and also renamed these tabs.
-rw-r--r-- | core/pim/todo/otaskeditor.cpp | 22 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.h | 4 | ||||
-rw-r--r-- | core/pim/todo/taskeditoradvanced.cpp | 132 | ||||
-rw-r--r-- | core/pim/todo/taskeditoradvanced.h | 73 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverview.cpp | 285 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverview.h | 35 | ||||
-rw-r--r-- | core/pim/todo/todo.pro | 4 |
7 files changed, 95 insertions, 460 deletions
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp index bde25ef..68b315d 100644 --- a/core/pim/todo/otaskeditor.cpp +++ b/core/pim/todo/otaskeditor.cpp @@ -1,26 +1,26 @@ #include <qdatetime.h> -#include <qlayout.h> #include <qlabel.h> +#include <qlayout.h> #include <qmultilineedit.h> #include <opie/orecurrancewidget.h> #include "taskeditoroverview.h" -#include "taskeditoradvanced.h" +#include "taskeditorstatus.h" #include "taskeditoralarms.h" #include "otaskeditor.h" OTaskEditor::OTaskEditor(int cur) - : QDialog(0, 0, TRUE ) { + : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { init(); init( cur ); } OTaskEditor::OTaskEditor( const OTodo& to) - : QDialog(0, 0, TRUE ) { + : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) { init(); init( to ); } OTaskEditor::~OTaskEditor() { } @@ -37,20 +37,20 @@ void OTaskEditor::init( const OTodo& to ) { } OTodo OTaskEditor::todo()const{ qWarning("saving!"); OTodo to; to.setUid(m_uid ); m_overView->save( to ); - m_adv->save( to ); + m_stat->save( to ); to.setRecurrence( m_rec->recurrence() ); return to; } void OTaskEditor::load(const OTodo& to) { m_overView->load( to ); - m_adv->load( to ); + m_stat->load( to ); m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); } void OTaskEditor::init() { setCaption("Task Editor"); QVBoxLayout* layo = new QVBoxLayout( this ); @@ -58,36 +58,36 @@ void OTaskEditor::init() { layo->addWidget( m_tab ); /* * Add the Widgets */ m_overView = new TaskEditorOverView( m_tab ); - m_tab->addTab( m_overView, "TodoList", tr("Overview") ); + m_tab->addTab( m_overView, "todo/info", tr("Information") ); - m_adv = new TaskEditorAdvanced( m_tab ); - m_tab->addTab( m_adv, "todo/advanced", tr("Advanced") ); + m_stat = new TaskEditorStatus( m_tab ); + m_tab->addTab( m_stat, "TodoList", tr("Status") ); m_alarm = new TaskEditorAlarms( m_tab ); m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") ); m_remind = new TaskEditorAlarms( m_tab ); m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") ); QLabel* lbl = new QLabel( m_tab ); lbl->setText( tr("X-Ref") ); m_tab->addTab( lbl, "todo/xref", tr("X-Ref") ); m_rec = new ORecurranceWidget( true, QDate::currentDate(), this ); - m_tab->addTab( m_rec, "repeat", tr("Recurrance") ); + m_tab->addTab( m_rec, "repeat", tr("Recurrence") ); /* signal and slots */ connect(m_overView, SIGNAL(recurranceEnabled(bool) ), m_rec, SLOT(setEnabled(bool) ) ); /* connect due date changed to the recurrence tab */ - connect(m_overView, SIGNAL(dueDateChanged(const QDate&) ), + connect(m_stat, SIGNAL(dueDateChanged(const QDate&) ), m_rec, SLOT(setStartDate(const QDate& ) ) ); m_tab->setCurrentTab( m_overView ); } diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h index 8232886..795f333 100644 --- a/core/pim/todo/otaskeditor.h +++ b/core/pim/todo/otaskeditor.h @@ -4,13 +4,13 @@ #include <qdialog.h> #include <opie/otodo.h> #include <opie/otabwidget.h> class TaskEditorOverView; -class TaskEditorAdvanced; +class TaskEditorStatus; class TaskEditorAlarms; class ORecurranceWidget; class QMultiLineEdit; class OTaskEditor : public QDialog { Q_OBJECT @@ -30,13 +30,13 @@ public: private: void load( const OTodo& ); void init(); OTabWidget *m_tab; TaskEditorOverView *m_overView; - TaskEditorAdvanced *m_adv; + TaskEditorStatus *m_stat; TaskEditorAlarms *m_alarm; TaskEditorAlarms *m_remind; ORecurranceWidget *m_rec; int m_uid; }; diff --git a/core/pim/todo/taskeditoradvanced.cpp b/core/pim/todo/taskeditoradvanced.cpp deleted file mode 100644 index a431d47..0000000 --- a/core/pim/todo/taskeditoradvanced.cpp +++ b/dev/null @@ -1,132 +0,0 @@ -/* - =. This file is part of the OPIE Project - .=l. Copyright (c) 2002 <> - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = General Public License along with - -- :-=` this library; see the file COPYING.LIB. - If not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - -*/ - -#include "taskeditoradvanced.h" - -#include <opie/otodo.h> -#include <opie/opimmaintainer.h> -#include <opie/opimstate.h> - -#include <qpe/resource.h> - -#include <qcombobox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qmultilineedit.h> -#include <qscrollview.h> -#include <qtoolbutton.h> -#include <qwhatsthis.h> - -TaskEditorAdvanced::TaskEditorAdvanced( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) -{ - QVBoxLayout *vb = new QVBoxLayout( this ); - - QScrollView *sv = new QScrollView( this ); - vb->addWidget( sv ); - sv->setResizePolicy( QScrollView::AutoOneFit ); - sv->setFrameStyle( QFrame::NoFrame ); - - QWidget *container = new QWidget( sv->viewport() ); - sv->addChild( container ); - - QGridLayout *layout = new QGridLayout( container, 5, 3, 4, 4 ); - - QLabel *label = new QLabel( tr( "State:" ), container ); - layout->addWidget( label, 0, 0 ); - - cmbState = new QComboBox( FALSE, container ); - cmbState->insertItem( tr( "Started" ) ); - cmbState->insertItem( tr( "Postponed" ) ); - cmbState->insertItem( tr( "Finished" ) ); - cmbState->insertItem( tr( "Not started" ) ); - layout->addMultiCellWidget( cmbState, 0, 0, 1, 2 ); - - label = new QLabel( tr( "Maintain Mode:" ), container ); - layout->addWidget( label, 1, 0 ); - - cmbMode = new QComboBox( FALSE, container ); - cmbMode->insertItem( tr( "Nothing" ) ); - cmbMode->insertItem( tr( "Responsible" ) ); - cmbMode->insertItem( tr( "Done By" ) ); - cmbMode->insertItem( tr( "Coordinating" ) ); - layout->addMultiCellWidget( cmbMode, 1, 1, 1, 2 ); - - label = new QLabel( tr( "Maintainer:" ), container ); - layout->addWidget( label, 2, 0 ); - - txtMaintainer = new QLabel( tr( "test" ), container ); - txtMaintainer->setTextFormat( QLabel::RichText ); - layout->addWidget( txtMaintainer, 2, 1 ); - - tbtMaintainer = new QToolButton( container ); - tbtMaintainer->setPixmap( Resource::loadPixmap( "todo/more" ) ); - layout->addWidget( tbtMaintainer, 2, 2 ); - - label = new QLabel( tr( "Description:" ), container ); - layout->addWidget( label, 3, 0 ); - - m_edit = new QMultiLineEdit( this ); - m_edit->setWordWrap( QMultiLineEdit::WidgetWidth ); - layout->addMultiCellWidget( m_edit, 4, 4, 0, 2 ); -} - -TaskEditorAdvanced::~TaskEditorAdvanced() -{ -} - -void TaskEditorAdvanced::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 TaskEditorAdvanced::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"); -} diff --git a/core/pim/todo/taskeditoradvanced.h b/core/pim/todo/taskeditoradvanced.h deleted file mode 100644 index 65359e9..0000000 --- a/core/pim/todo/taskeditoradvanced.h +++ b/dev/null @@ -1,73 +0,0 @@ -/* - =. This file is part of the OPIE Project - .=l. Copyright (c) 2002 <> - .>+-= - _;:, .> :=|. This program is free software; you can -.> <`_, > . <= redistribute it and/or modify it under -:`=1 )Y*s>-.-- : the terms of the GNU General Public -.="- .-=="i, .._ License as published by the Free Software - - . .-<_> .<> Foundation; either version 2 of the License, - ._= =} : or (at your option) any later version. - .%`+i> _;_. - .i_,=:_. -<s. This program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = General Public License along with - -- :-=` this library; see the file COPYING.LIB. - If not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - -*/ - -#ifndef TASKEDITORADVANCED_H -#define TASKEDITORADVANCED_H - -#include <qwidget.h> - -class OTodo; -class QComboBox; -class QLabel; -class QMultiLineEdit; -class QToolButton; - -/** - * This is the implementation of the Opie Task Editor Advanced tab - * it features the State! - * MaintainerMode - * Description - */ -class TaskEditorAdvanced : public QWidget -{ - Q_OBJECT - -public: - TaskEditorAdvanced( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~TaskEditorAdvanced(); - - /* - * I could have a struct which returns a QWidget* - * load and save to a OTodo - * and use multiple inheretence with all other widgets - * and then simply iterate over the list of structs - * this way I could easily have plugins for the whole editor.... - * but I do not do it -zecke - */ - void load( const OTodo& ); - void save( OTodo& ); - - QComboBox *cmbState; - QLabel *txtMaintainer; - QToolButton *tbtMaintainer; - QComboBox *cmbMode; - QMultiLineEdit *m_edit; - -}; - -#endif // TASKEDITORADVANCED_H diff --git a/core/pim/todo/taskeditoroverview.cpp b/core/pim/todo/taskeditoroverview.cpp index 6906c26..89e553f 100644 --- a/core/pim/todo/taskeditoroverview.cpp +++ b/core/pim/todo/taskeditoroverview.cpp @@ -36,13 +36,13 @@ #include <qpe/timestring.h> #include <qcheckbox.h> #include <qcombobox.h> #include <qlabel.h> #include <qlayout.h> -#include <qpushbutton.h> +#include <qmultilineedit.h> #include <qwhatsthis.h> TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { // Load icons @@ -52,263 +52,126 @@ TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFla for ( unsigned int i = 1; i < 6; i++ ) { namestr = "todo/priority"; namestr.append( QString::number( i ) ); m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr ); } - QDate curDate = QDate::currentDate(); - m_start = m_comp = m_due = curDate; - QString curDateStr = TimeString::longDateString( curDate ); - QVBoxLayout *vb = new QVBoxLayout( this ); QScrollView *sv = new QScrollView( this ); vb->addWidget( sv ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setFrameStyle( QFrame::NoFrame ); QWidget *container = new QWidget( sv->viewport() ); sv->addChild( container ); - QGridLayout *layout = new QGridLayout( container, 10, 2, 4, 4 ); + QGridLayout *layout = new QGridLayout( container, 7, 2, 4, 4 ); - // Summary - QLabel *label = new QLabel( tr( "Summary:" ), container ); + // Description + QLabel *label = new QLabel( tr( "Description:" ), container ); layout->addWidget( label, 0, 0 ); - cmbSum = new QComboBox( TRUE, container ); - cmbSum->insertItem( tr( "Complete " ) ); - cmbSum->insertItem( tr( "Work on " ) ); - cmbSum->insertItem( tr( "Buy " ) ); - cmbSum->insertItem( tr( "Organize " ) ); - cmbSum->insertItem( tr( "Get " ) ); - cmbSum->insertItem( tr( "Update " ) ); - cmbSum->insertItem( tr( "Create " ) ); - cmbSum->insertItem( tr( "Plan " ) ); - cmbSum->insertItem( tr( "Call " ) ); - cmbSum->insertItem( tr( "Mail " ) ); - cmbSum->clearEdit(); - layout->addMultiCellWidget( cmbSum, 1, 1, 0, 1 ); + QWhatsThis::add( label, tr( "Enter brief description of the task here." ) ); + cmbDesc = new QComboBox( TRUE, container ); + cmbDesc->insertItem( tr( "Complete " ) ); + cmbDesc->insertItem( tr( "Work on " ) ); + cmbDesc->insertItem( tr( "Buy " ) ); + cmbDesc->insertItem( tr( "Organize " ) ); + cmbDesc->insertItem( tr( "Get " ) ); + cmbDesc->insertItem( tr( "Update " ) ); + cmbDesc->insertItem( tr( "Create " ) ); + cmbDesc->insertItem( tr( "Plan " ) ); + cmbDesc->insertItem( tr( "Call " ) ); + cmbDesc->insertItem( tr( "Mail " ) ); + cmbDesc->clearEdit(); + layout->addMultiCellWidget( cmbDesc, 1, 1, 0, 1 ); + QWhatsThis::add( cmbDesc, tr( "Enter brief description of the task here." ) ); // Priority label = new QLabel( tr( "Priority:" ), container ); layout->addWidget( label, 2, 0 ); - cmbPrio = new QComboBox( FALSE, container ); - cmbPrio->setMinimumHeight( 26 ); - cmbPrio->insertItem( m_pic_priority[ 0 ], tr( "Very High" ) ); - cmbPrio->insertItem( m_pic_priority[ 1 ], tr( "High" ) ); - cmbPrio->insertItem( m_pic_priority[ 2 ], tr( "Normal" ) ); - cmbPrio->insertItem( m_pic_priority[ 3 ], tr( "Low" ) ); - cmbPrio->insertItem( m_pic_priority[ 4 ], tr( "Very Low" ) ); - cmbPrio->setCurrentItem( 2 ); - layout->addWidget( cmbPrio, 2, 1 ); + QWhatsThis::add( label, tr( "Select priority of task here." ) ); + cmbPriority = new QComboBox( FALSE, container ); + cmbPriority->setMinimumHeight( 26 ); + cmbPriority->insertItem( m_pic_priority[ 0 ], tr( "Very High" ) ); + cmbPriority->insertItem( m_pic_priority[ 1 ], tr( "High" ) ); + cmbPriority->insertItem( m_pic_priority[ 2 ], tr( "Normal" ) ); + cmbPriority->insertItem( m_pic_priority[ 3 ], tr( "Low" ) ); + cmbPriority->insertItem( m_pic_priority[ 4 ], tr( "Very Low" ) ); + cmbPriority->setCurrentItem( 2 ); + layout->addWidget( cmbPriority, 2, 1 ); + QWhatsThis::add( cmbPriority, tr( "Select priority of task here." ) ); // Category label = new QLabel( tr( "Category:" ), container ); layout->addWidget( label, 3, 0 ); - comboCategory = new CategorySelect( container ); - layout->addWidget( comboCategory, 3, 1 ); - - // Recurrance - CheckBox7 = new QCheckBox( tr( "Recurring task" ), container ); - layout->addMultiCellWidget( CheckBox7, 4, 4, 0, 1 ); - connect( CheckBox7, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) ); - - QSpacerItem *spacer = new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ); - layout->addItem( spacer, 5, 0 ); - - // Start date - ckbStart = new QCheckBox( tr( "Start Date:" ), container ); - layout->addWidget( ckbStart, 6, 0 ); - connect( ckbStart, SIGNAL( clicked() ), this, SLOT( slotStartChecked() ) ); - btnStart = new QPushButton( curDateStr, container ); - btnStart->setEnabled( FALSE ); - layout->addWidget( btnStart, 6, 1 ); - - 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, 7, 0 ); - connect( ckbDue, SIGNAL( clicked() ), this, SLOT( slotDueChecked() ) ); - btnDue = new QPushButton( curDateStr, container ); - btnDue->setEnabled( FALSE ); - layout->addWidget( btnDue, 7, 1 ); - - 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 ) ) ); - - // Progress - label = new QLabel( tr( "Progress:" ), container ); - layout->addWidget( label, 8, 0 ); - cmbProgress = new QComboBox( FALSE, container ); - cmbProgress->insertItem( tr( "0 %" ) ); - cmbProgress->insertItem( tr( "20 %" ) ); - cmbProgress->insertItem( tr( "40 %" ) ); - cmbProgress->insertItem( tr( "60 %" ) ); - cmbProgress->insertItem( tr( "80 %" ) ); - cmbProgress->insertItem( tr( "100 %" ) ); - layout->addWidget( cmbProgress, 8, 1 ); - - // Completed - ckbComp = new QCheckBox( tr( "Completed:" ), container ); - layout->addWidget( ckbComp, 9, 0 ); - connect( ckbComp, SIGNAL( clicked() ), this, SLOT( slotCompChecked() ) ); - btnComp = new QPushButton( curDateStr, container ); - btnComp->setEnabled( FALSE ); - layout->addWidget( btnComp, 9, 1 ); - - popup = new QPopupMenu( this ); - m_compBook = new DateBookMonth( popup, 0, TRUE ); - popup->insertItem( m_compBook ); - btnComp->setPopup( popup ); - connect( m_compBook, SIGNAL( dateClicked( int, int, int ) ), - this, SLOT( slotCompChanged( int, int, int ) ) ); + QWhatsThis::add( label, tr( "Select category to organize this task with." ) ); + cmbCategory = new CategorySelect( container ); + layout->addWidget( cmbCategory, 3, 1 ); + QWhatsThis::add( cmbCategory, tr( "Select category to organize this task with." ) ); + + // Recurrence + ckbRecurrence = new QCheckBox( tr( "Recurring task" ), container ); + layout->addMultiCellWidget( ckbRecurrence, 4, 4, 0, 1 ); + QWhatsThis::add( ckbRecurrence, tr( "Click here if task happens on a regular basis. If selected, frequency can be set on the Recurrence tab." ) ); + connect( ckbRecurrence, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) ); + + // Notes + label = new QLabel( tr( "Notes:" ), container ); + layout->addWidget( label, 5, 0 ); + QWhatsThis::add( label, tr( "Enter any additional information about this task here." ) ); + mleNotes = new QMultiLineEdit( this ); + 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 ) { - /* - * now that we're 'preloaded' we - * need to disable the buttons - * holding the dat - */ - btnDue->setEnabled( FALSE ); - btnComp->setEnabled( FALSE ); - btnStart->setEnabled( FALSE ); - - /* - * get some basic dateinfos for now - */ - QDate date = QDate::currentDate(); - QString str = TimeString::longDateString( date ); - - CheckBox7->setChecked( todo.recurrence().doesRecur() ); - emit recurranceEnabled( todo.recurrence().doesRecur() ); + // Description + cmbDesc->insertItem( todo.summary(), 0 ); + cmbDesc->setCurrentItem( 0 ); - 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 ); + // Priority + cmbPriority->setCurrentItem( todo.priority() - 1 ); - cmbProgress->setCurrentItem( todo.progress() / 20 ); - cmbSum->insertItem( todo.summary(), 0 ); - cmbSum->setCurrentItem( 0 ); + // Category + cmbCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) ); - ckbDue->setChecked( todo.hasDueDate() ); - btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); - btnDue->setEnabled( todo.hasDueDate() ); - m_due = todo.dueDate(); + // Recurrence + ckbRecurrence->setChecked( todo.recurrence().doesRecur() ); + emit recurranceEnabled( todo.recurrence().doesRecur() ); - cmbPrio->setCurrentItem( todo.priority() - 1 ); - ckbComp->setChecked( todo.isCompleted() ); + // Notes + mleNotes->setText( todo.description() ); - comboCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) ); } -void TaskEditorOverView::save( OTodo &to ) +void TaskEditorOverView::save( OTodo &todo ) { - /* a invalid date */ - QDate inval; - /* save our info back */ + // Description + todo.setSummary( cmbDesc->currentText() ); - /* due date */ - if ( ckbDue->isChecked() ) - { - to.setDueDate( m_due ); - to.setHasDueDate( true ); - } - else - to.setHasDueDate( false ); - - /* start date */ - if ( ckbStart->isChecked() ) - { - to.setStartDate( m_start ); - } - else - to.setStartDate( inval ); + // Priority + todo.setPriority( cmbPriority->currentItem() + 1 ); - /* comp date */ - if ( ckbComp->isChecked() ) + // Category + if ( cmbCategory->currentCategory() != -1 ) { - to.setCompletedDate( m_comp ); + QArray<int> arr = cmbCategory->currentCategories(); + todo.setCategories( arr ); } - else - to.setCompletedDate( inval ); + // Recurrence - don't need to save here... - if ( comboCategory->currentCategory() != -1 ) - { - QArray<int> arr = comboCategory->currentCategories(); - to.setCategories( arr ); - } - to.setPriority( cmbPrio->currentItem() + 1 ); - to.setCompleted( ckbComp->isChecked() ); - to.setSummary( cmbSum->currentText() ); - to.setProgress( cmbProgress->currentItem() * 20 ); + // Notes + todo.setDescription( mleNotes->text() ); } void TaskEditorOverView::slotRecClicked() { - emit recurranceEnabled( CheckBox7->isChecked() ); -} - -void TaskEditorOverView::slotStartChecked() -{ - btnStart->setEnabled( ckbStart->isChecked() ); -} - -void TaskEditorOverView::slotCompChecked() -{ - btnComp->setEnabled( ckbComp->isChecked() ); -} - -void TaskEditorOverView::slotDueChecked() -{ - btnDue->setEnabled( ckbDue->isChecked() ); -} - -void TaskEditorOverView::slotStartChanged(int y, int m, int d) -{ - m_start.setYMD( y, m, d ); - btnStart->setText( TimeString::longDateString( m_start ) ); -} - -void TaskEditorOverView::slotCompChanged(int y, int m, int d) -{ - m_comp.setYMD( y, m, d ); - btnComp->setText( TimeString::longDateString( m_comp ) ); -} - -void TaskEditorOverView::slotDueChanged(int y, int m, int d) -{ - m_due.setYMD( y, m, d ); - btnDue->setText( TimeString::longDateString( m_due ) ); + emit recurranceEnabled( ckbRecurrence->isChecked() ); } diff --git a/core/pim/todo/taskeditoroverview.h b/core/pim/todo/taskeditoroverview.h index 223b72c..d5f5125 100644 --- a/core/pim/todo/taskeditoroverview.h +++ b/core/pim/todo/taskeditoroverview.h @@ -28,65 +28,42 @@ #ifndef TASKEDITOROVERVIEW_H #define TASKEDITOROVERVIEW_H #include <opie/otodo.h> -#include <qdatetime.h> #include <qpixmap.h> #include <qwidget.h> class CategorySelect; -class DateBookMonth; class QCheckBox; class QComboBox; -class QPushButton; +class QMultiLineEdit; class TaskEditorOverView : public QWidget { Q_OBJECT public: TaskEditorOverView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~TaskEditorOverView(); - QComboBox *cmbSum; - QComboBox *cmbPrio; - QComboBox *cmbProgress; - QCheckBox *ckbDue; - QPushButton *btnDue; - QCheckBox *ckbStart; - QPushButton *btnStart; - QCheckBox *ckbComp; - QPushButton *btnComp; - CategorySelect *comboCategory; - QCheckBox *CheckBox7; + QComboBox *cmbDesc; + QComboBox *cmbPriority; + CategorySelect *cmbCategory; + QCheckBox *ckbRecurrence; + QMultiLineEdit *mleNotes; void load( const OTodo & ); void save( OTodo & ); signals: void recurranceEnabled( bool ); - void dueDateChanged( const QDate& date ); protected: QPixmap m_pic_priority[ 5 ]; -private: - QDate m_start; - QDate m_comp; - QDate m_due; - DateBookMonth *m_startBook; - DateBookMonth *m_compBook; - DateBookMonth *m_dueBook; - protected slots: void slotRecClicked(); - void slotStartChecked(); - void slotCompChecked(); - void slotDueChecked(); - void slotStartChanged( int, int, int ); - void slotCompChanged( int, int, int ); - void slotDueChanged( int, int, int ); }; #endif // TASKEDITOROVERVIEW_H diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro index 697c005..7f47b06 100644 --- a/core/pim/todo/todo.pro +++ b/core/pim/todo/todo.pro @@ -15,13 +15,13 @@ HEADERS = smalltodo.h \ templatedialog.h \ templatedialogimpl.h \ quickedit.h \ quickeditimpl.h \ otaskeditor.h \ taskeditoroverview.h \ - taskeditoradvanced.h \ + taskeditorstatus.h \ taskeditoralarms.h SOURCES = smalltodo.cpp \ todomanager.cpp \ mainwindow.cpp \ main.cpp \ @@ -35,13 +35,13 @@ SOURCES = smalltodo.cpp \ templatedialog.cpp \ templatedialogimpl.cpp \ quickeditimpl.cpp \ quickedit.cpp \ otaskeditor.cpp \ taskeditoroverview.cpp \ - taskeditoradvanced.cpp \ + taskeditorstatus.cpp \ taskeditoralarms.cpp TARGET = todolist INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopie |