From 1cb75c721b69459494cb599730a96bbc1ddc0f65 Mon Sep 17 00:00:00 2001 From: drw Date: Mon, 23 Dec 2002 17:13:12 +0000 Subject: Task Editor dialog: 1. added tab icons 2. rearranged the overview tab 3. alarm/reminder tab updates 4. code clean-up. Still need to work on advanced tab and add qwhatsthis. --- (limited to 'core') diff --git a/core/pim/todo/.cvsignore b/core/pim/todo/.cvsignore index dd22a2a..c212d11 100644 --- a/core/pim/todo/.cvsignore +++ b/core/pim/todo/.cvsignore @@ -2,9 +2,5 @@ Makefile* moc_* taskeditoradvanced.cpp taskeditoradvanced.h -taskeditoralarms.cpp -taskeditoralarms.h -taskeditoroverview.cpp -taskeditoroverview.h todoentry.cpp todoentry.h diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp index eeb3c0c..e6ebf60 100644 --- a/core/pim/todo/otaskeditor.cpp +++ b/core/pim/todo/otaskeditor.cpp @@ -2,11 +2,10 @@ #include #include #include -#include #include -#include "taskeditoroverviewimpl.h" +#include "taskeditoroverview.h" #include "taskeditoradvancedimpl.h" #include "taskeditoralarms.h" @@ -41,50 +40,44 @@ OTodo OTaskEditor::todo()const{ OTodo to; to.setUid(m_uid ); m_overView->save( to ); - m_adv->save( to ); + //m_adv->save( to ); to.setRecurrence( m_rec->recurrence() ); return to; } void OTaskEditor::load(const OTodo& to) { m_overView->load( to ); - m_adv->load( to ); + //m_adv->load( to ); m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); } void OTaskEditor::init() { - QVBoxLayout* lay = new QVBoxLayout(this ); - QScrollView* view = new QScrollView( this ); - view->setResizePolicy( QScrollView::AutoOneFit ); - lay->addWidget( view ); - setCaption("Task Editor"); - QWidget* container = new QWidget( view->viewport() ); - view->addChild( container ); - QVBoxLayout* layo = new QVBoxLayout( container ); - m_tab = new OTabWidget(container ); + QVBoxLayout* layo = new QVBoxLayout( this ); + m_tab = new OTabWidget( this ); layo->addWidget( m_tab ); + /* * Add the Widgets */ - m_overView = new TaskEditorOverViewImpl(m_tab ); - m_tab->addTab( m_overView, QString::null, tr("Overview") ); + m_overView = new TaskEditorOverView( m_tab ); + m_tab->addTab( m_overView, "TodoList", tr("Overview") ); m_adv = new TaskEditorAdvancedImpl( m_tab ); - m_tab->addTab( m_adv, QString::null, tr("Advanced") ); + m_tab->addTab( m_adv, "todo/advanced", tr("Advanced") ); m_alarm = new TaskEditorAlarms( m_tab ); - m_tab->addTab( m_alarm, QString::null, tr("Alarms") ); + m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") ); m_remind = new TaskEditorAlarms( m_tab ); - m_tab->addTab( m_remind, QString::null, tr("Reminders") ); + m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") ); - QLabel* lbl = new QLabel(m_tab ); + QLabel* lbl = new QLabel( m_tab ); lbl->setText( tr("X-Ref") ); - m_tab->addTab( lbl, QString::null, 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, QString::null, tr("Recurrance") ); + m_tab->addTab( m_rec, "repeat", tr("Recurrance") ); /* signal and slots */ diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h index b43abbf..d13e157 100644 --- a/core/pim/todo/otaskeditor.h +++ b/core/pim/todo/otaskeditor.h @@ -6,11 +6,12 @@ #include #include -class TaskEditorOverViewImpl; +class TaskEditorOverView; class TaskEditorAdvancedImpl; class TaskEditorAlarms; class ORecurranceWidget; class QMultiLineEdit; + class OTaskEditor : public QDialog { Q_OBJECT public: @@ -30,13 +31,13 @@ private: void load( const OTodo& ); void init(); - OTabWidget *m_tab; - TaskEditorOverViewImpl* m_overView; + OTabWidget *m_tab; + TaskEditorOverView *m_overView; TaskEditorAdvancedImpl *m_adv; - TaskEditorAlarms *m_alarm; - TaskEditorAlarms* m_remind; - ORecurranceWidget* m_rec; - int m_uid; + TaskEditorAlarms *m_alarm; + TaskEditorAlarms *m_remind; + ORecurranceWidget *m_rec; + int m_uid; }; diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp index 7664ee4..91d3131 100644 --- a/core/pim/todo/quickeditimpl.cpp +++ b/core/pim/todo/quickeditimpl.cpp @@ -15,7 +15,8 @@ QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible ) setHorizontalStretchable( TRUE ); // Load priority icons - // TODO - probably should be done globally somewhere else, see also tableview.cpp/h + // TODO - probably should be done globally somewhere else, + // see also tableview.cpp/h, taskeditoroverview.cpp/h priority1 = Resource::loadPixmap( "todo/priority1" ); priority3 = Resource::loadPixmap( "todo/priority3" ); priority5 = Resource::loadPixmap( "todo/priority5" ); diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp index cd6740a..48b4dcc 100644 --- a/core/pim/todo/tableview.cpp +++ b/core/pim/todo/tableview.cpp @@ -61,7 +61,8 @@ TableView::TableView( MainWindow* window, QWidget* wid ) : QTable( wid ), TodoView( window ) { // Load icons - // TODO - probably should be done globally somewhere else, see also quickeditimpl.cpp/h + // TODO - probably should be done globally somewhere else, + // see also quickeditimpl.cpp/h, taskeditoroverview.cpp/h m_pic_completed = Resource::loadPixmap( "todo/completed" ); QString namestr; for ( unsigned int i = 1; i < 6; i++ ) { diff --git a/core/pim/todo/taskeditoralarms.cpp b/core/pim/todo/taskeditoralarms.cpp new file mode 100644 index 0000000..3cb5576 --- a/dev/null +++ b/core/pim/todo/taskeditoralarms.cpp @@ -0,0 +1,76 @@ +/* +               =. 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_,=:_.      -`: 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 "taskeditoralarms.h" + +#include + +#include +#include +#include +#include + +TaskEditorAlarms::TaskEditorAlarms( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + QGridLayout *layout = new QGridLayout( this, 2, 3, 4, 4 ); + + lstAlarms = new QListView( this ); + layout->addMultiCellWidget( lstAlarms, 0, 0, 0, 2 ); + + QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), this ); + //QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); + //connect( btn, SIGNAL( clicked() ), this, SLOT( slotNew() ) ); + layout->addWidget( btn, 1, 0 ); + + btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), this ); + //QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); + //connect( btn, SIGNAL( clicked() ), this, SLOT( slotEdit() ) ); + layout->addWidget( btn, 1, 1 ); + + btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), this ); + //QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) ); + //connect( btn, SIGNAL( clicked() ), this, SLOT( slotDelete() ) ); + layout->addWidget( btn, 1, 2 ); +} + +TaskEditorAlarms::~TaskEditorAlarms() +{ +} + +void TaskEditorAlarms::slotNew() +{ +} + +void TaskEditorAlarms::slotEdit() +{ +} + +void TaskEditorAlarms::slotDelete() +{ +} diff --git a/core/pim/todo/taskeditoralarms.h b/core/pim/todo/taskeditoralarms.h new file mode 100644 index 0000000..f77ded5 --- a/dev/null +++ b/core/pim/todo/taskeditoralarms.h @@ -0,0 +1,52 @@ +/* +               =. 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_,=:_.      -`: 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 TASKEDITORALARMS_H +#define TASKEDITORALARMS_H + +#include + +class QListView; + +class TaskEditorAlarms : public QWidget +{ + Q_OBJECT + +public: + TaskEditorAlarms( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~TaskEditorAlarms(); + + QListView* lstAlarms; + +protected slots: + void slotNew(); + void slotEdit(); + void slotDelete(); +}; + +#endif // TASKEDITORALARMS_H diff --git a/core/pim/todo/taskeditoralarms.ui b/core/pim/todo/taskeditoralarms.ui deleted file mode 100644 index 9f8f58b..0000000 --- a/core/pim/todo/taskeditoralarms.ui +++ b/dev/null @@ -1,144 +0,0 @@ - -TaskEditorAlarms -zecke - - QWidget - - name - TaskEditorAlarms - - - geometry - - 0 - 0 - 195 - 271 - - - - layoutMargin - - - - margin - 8 - - - spacing - 6 - - - QLayoutWidget - - name - Layout19 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - txtAlarm - - - text - empty - - - - QListView - - name - lstAlarms - - - - - - QLayoutWidget - - name - Layout23 - - - - margin - 0 - - - spacing - 6 - - - QPushButton - - name - alAdd - - - sizePolicy - - 4 - 0 - - - - text - &Add - - - autoResize - true - - - - QPushButton - - name - alEdit - - - sizePolicy - - 4 - 0 - - - - text - &Edit - - - autoResize - true - - - - QPushButton - - name - alRemove - - - text - &Remove - - - autoResize - true - - - - - - - diff --git a/core/pim/todo/taskeditoroverview.cpp b/core/pim/todo/taskeditoroverview.cpp new file mode 100644 index 0000000..9aab76a --- a/dev/null +++ b/core/pim/todo/taskeditoroverview.cpp @@ -0,0 +1,317 @@ +/* +               =. 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_,=:_.      -`: 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 "taskeditoroverview.h" + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + // Load icons + // TODO - probably should be done globally somewhere else, + // see also quickeditimpl.cpp/h, tableview.cpp/h + QString namestr; + 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 ); + + // TODO - add QScrollView for contents + 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 ); + + // Summary + QLabel *label = new QLabel( tr( "Summary:" ), 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 ); + + // 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 ); + + // 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 ) ) ); +} + +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() ); + + 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 ); + cmbSum->insertItem( todo.summary(), 0 ); + cmbSum->setCurrentItem( 0 ); + + ckbDue->setChecked( todo.hasDueDate() ); + btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); + btnDue->setEnabled( todo.hasDueDate() ); + m_due = todo.dueDate(); + + cmbPrio->setCurrentItem( todo.priority() - 1 ); + ckbComp->setChecked( todo.isCompleted() ); + + comboCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) ); +} + +void TaskEditorOverView::save( OTodo &to ) +{ + /* a invalid date */ + QDate inval; + /* save our info back */ + + /* 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 ); + + /* comp date */ + if ( ckbComp->isChecked() ) + { + to.setCompletedDate( m_comp ); + } + else + to.setCompletedDate( inval ); + + + if ( comboCategory->currentCategory() != -1 ) + { + QArray arr = comboCategory->currentCategories(); + to.setCategories( arr ); + } + to.setPriority( cmbPrio->currentItem() + 1 ); + to.setCompleted( ckbComp->isChecked() ); + to.setSummary( cmbSum->currentText() ); + to.setProgress( cmbProgress->currentItem() * 20 ); +} + +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 ) ); +} diff --git a/core/pim/todo/taskeditoroverview.h b/core/pim/todo/taskeditoroverview.h new file mode 100644 index 0000000..223b72c --- a/dev/null +++ b/core/pim/todo/taskeditoroverview.h @@ -0,0 +1,92 @@ +/* +               =. 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_,=:_.      -`: 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 TASKEDITOROVERVIEW_H +#define TASKEDITOROVERVIEW_H + +#include + +#include +#include +#include + +class CategorySelect; +class DateBookMonth; +class QCheckBox; +class QComboBox; +class QPushButton; + +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; + + 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/taskeditoroverview.ui b/core/pim/todo/taskeditoroverview.ui deleted file mode 100644 index a6bf645..0000000 --- a/core/pim/todo/taskeditoroverview.ui +++ b/dev/null @@ -1,542 +0,0 @@ - -TaskEditorOverView -zecke - - QWidget - - name - TaskEditorOverView - - - geometry - - 0 - 0 - 308 - 445 - - - - caption - Form1 - - - layoutMargin - - - - margin - 4 - - - spacing - 6 - - - QLayoutWidget - - name - Layout11 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - txtPrio - - - text - Priority - - - - QComboBox - - - text - 1 - Very High - - - - - text - 2 - High - - - - - text - 3 - Normal - - - - - text - 4 - Low - - - - - text - 5 - Very Low - - - - name - cmbPrio - - - - - - QLayoutWidget - - name - Layout11 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - txtProgress - - - text - Progress - - - - QComboBox - - - text - 0 % - - - - - text - 20 % - - - - - text - 40 % - - - - - text - 60 % - - - - - text - 80 % - - - - - text - 100 % - - - - name - cmbProgress - - - - - - QLayoutWidget - - name - Layout9 - - - - margin - 0 - - - spacing - 6 - - - QCheckBox - - name - ckbDue - - - text - Due Date: - - - - QPushButton - - name - btnDue - - - enabled - false - - - text - 1 Januar 2002 - - - - - - QLayoutWidget - - name - Layout8 - - - - margin - 0 - - - spacing - 6 - - - QCheckBox - - name - ckbStart - - - text - Start Date: - - - - QPushButton - - name - btnStart - - - enabled - false - - - text - 1 Januar 2001 - - - - - - QLayoutWidget - - name - Layout7 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - lblSum - - - text - Summary - - - - QComboBox - - - text - Complete - - - - - text - work on - - - - - text - buy - - - - - text - organize - - - - - text - get - - - - - text - Update - - - - - text - Create - - - - - text - Plan - - - - - text - Call - - - - - text - Mail - - - - name - cmbSum - - - editable - true - - - - - - QLayoutWidget - - name - Layout10 - - - - margin - 0 - - - spacing - 6 - - - QCheckBox - - name - ckbComp - - - enabled - true - - - text - Completed Date - - - - QPushButton - - name - btnComp - - - enabled - false - - - text - 1 Januar 2002 - - - - - - QCheckBox - - name - ckbCompleted - - - text - Completed - - - - QLayoutWidget - - name - Layout12 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - txtCategory - - - text - Category - - - - CategorySelect - - name - comboCategory - - - sizePolicy - - 7 - 0 - - - - minimumSize - - 60 - 20 - - - - - - - QCheckBox - - name - CheckBox7 - - - text - Enable Recurrance - - - - - name - Spacer1 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - - CategorySelect -
qpe/categoryselect.h
- - -1 - -1 - - 0 - - 7 - 1 - - image0 -
-
- - - image0 - 789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758 - - - - - ckbStart - clicked() - TaskEditorOverView - slotStartChecked() - - - ckbDue - clicked() - TaskEditorOverView - slotDueChecked() - - - ckbComp - clicked() - TaskEditorOverView - slotCompletedChecked() - - slotCompletedChecked() - slotDueChecked() - slotStartChecked() - -
diff --git a/core/pim/todo/taskeditoroverviewimpl.cpp b/core/pim/todo/taskeditoroverviewimpl.cpp deleted file mode 100644 index aef3b1d..0000000 --- a/core/pim/todo/taskeditoroverviewimpl.cpp +++ b/dev/null @@ -1,221 +0,0 @@ -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include "taskeditoroverviewimpl.h" - -/* - * we need to hack - */ - -TaskEditorOverViewImpl::TaskEditorOverViewImpl( QWidget* parent, const char* name ) - : TaskEditorOverView( parent, name ) { - init(); -} -TaskEditorOverViewImpl::~TaskEditorOverViewImpl() { -} -void TaskEditorOverViewImpl::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() ); - - - 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 ); - cmbSum->insertItem( todo.summary(), 0 ); - cmbSum->setCurrentItem( 0 ); - - ckbDue->setChecked( todo.hasDueDate() ); - btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); - btnDue->setEnabled( todo.hasDueDate() ); - m_due = todo.dueDate(); - - cmbPrio->setCurrentItem( todo.priority() -1 ); - ckbCompleted->setChecked( todo.isCompleted() ); - - comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); - -} -void TaskEditorOverViewImpl::save( OTodo& to) { - /* a invalid date */ - QDate inval; - /* save our info back */ - - /* 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 ); - - /* comp date */ - if ( ckbComp->isChecked() ) { - qWarning("completed checked"); - to.setCompletedDate( m_comp ); - }else - to.setCompletedDate( inval ); - - - if ( comboCategory->currentCategory() != -1 ) { - QArray arr = comboCategory->currentCategories(); - to.setCategories( arr ); - } - to.setPriority( cmbPrio->currentItem() + 1 ); - to.setCompleted( ckbCompleted->isChecked() ); - to.setSummary( cmbSum->currentText() ); - to.setProgress( cmbProgress->currentItem() * 20 ); -} -/* - * here we will init the basic view - * one Popup for each Date Button - * and some other signal and slots connection - */ -void TaskEditorOverViewImpl::init() { - QDate curDate = QDate::currentDate(); - m_start = m_comp = m_due = curDate; - QString str = TimeString::longDateString( curDate ); - - - - /* Start Date Picker */ - m_startPop = new QPopupMenu(this); - m_startBook = new DateBookMonth(m_startPop, 0, TRUE ); - m_startPop->insertItem( m_startBook ); - connect( m_startBook, SIGNAL( dateClicked(int, int, int) ), - this, SLOT(slotStartChanged(int, int, int) ) ); - - - /* Due Date Picker */ - m_duePop = new QPopupMenu(this); - m_dueBook = new DateBookMonth(m_duePop, 0, TRUE ); - m_duePop->insertItem( m_dueBook ); - connect( m_dueBook, SIGNAL( dateClicked(int, int, int) ), - this, SLOT(slotDueChanged(int, int, int) ) ); - - m_compPop = new QPopupMenu(this); - m_compBook = new DateBookMonth(m_compPop, 0, TRUE ); - m_compPop->insertItem(m_compBook ); - connect( m_compBook, SIGNAL(dateClicked(int, int, int) ), - this, SLOT(slotCompletedChanged(int, int, int) ) ); - - - /* - * another part of the hack - * it's deprecated in Qt2 but - * still available in my qt-copy of Qt3.1beta2 - */ - btnDue->setIsMenuButton( TRUE ); - btnStart->setIsMenuButton( TRUE ); - btnComp->setIsMenuButton( TRUE ); - - /* now connect the hack */ - connect(btnDue, SIGNAL(clicked() ), - this, SLOT(hackySlotHack2() ) ); - connect(btnStart, SIGNAL(clicked() ), - this, SLOT(hackySlotHack1() ) ); - connect(btnComp, SIGNAL(clicked() ), - this, SLOT(hackySlotHack3() ) ); - - /* recurrance */ - connect(CheckBox7, SIGNAL(clicked() ), - this, SLOT(slotRecClicked() ) ); -} - -void TaskEditorOverViewImpl::slotStartChecked() { - qWarning("slotStartChecked"); - btnStart->setEnabled( ckbStart->isChecked() ); -} -void TaskEditorOverViewImpl::slotStartChanged(int y, int m, int d) { - m_start.setYMD( y, m, d ); - btnStart->setText( TimeString::longDateString( m_start ) ); -} -void TaskEditorOverViewImpl::slotDueChecked() { - btnDue->setEnabled( ckbDue->isChecked() ); - emit dueDateChanged( m_due ); - qWarning("slotDueChecked"); -} -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() { - btnComp->setEnabled( ckbComp->isChecked() ); - qWarning("slotCompletedChecked"); -} -void TaskEditorOverViewImpl::slotCompletedChanged(int y, int m, int d) { - m_comp.setYMD( y, m, d ); - btnComp->setText( TimeString::longDateString( m_comp ) ); -} -/* - * called by a button pressed event... - * three slots to avoid ugly name() tests - * to sender() - */ -void TaskEditorOverViewImpl::hackySlotHack1() { - btnStart->setDown( FALSE ); - popup( btnStart, m_startPop ); -} -void TaskEditorOverViewImpl::hackySlotHack2() { - btnDue->setDown( FALSE ); - popup( btnDue, m_duePop ); -} -void TaskEditorOverViewImpl::hackySlotHack3() { - btnComp->setDown( FALSE ); - popup( btnComp, m_compPop ); -} -void TaskEditorOverViewImpl::slotRecClicked() { - qWarning("enabled recurrance"); - emit recurranceEnabled( CheckBox7->isChecked() ); -} -/* - * GPL from TT QPushButton code - */ -void TaskEditorOverViewImpl::popup( QPushButton* pu, QPopupMenu* pop) { - if ( pu->mapToGlobal( QPoint(0, pu->rect().bottom() ) ).y() + pop->sizeHint().height() <= qApp->desktop()->height() ) - pop->exec( pu->mapToGlobal( pu->rect().bottomLeft() ) ); - else - pop->exec( pu->mapToGlobal( pu->rect().topLeft() - QPoint(0, pu->sizeHint().height() ) ) ); -} diff --git a/core/pim/todo/taskeditoroverviewimpl.h b/core/pim/todo/taskeditoroverviewimpl.h deleted file mode 100644 index 5ee985e..0000000 --- a/core/pim/todo/taskeditoroverviewimpl.h +++ b/dev/null @@ -1,55 +0,0 @@ -#ifndef OPIE_TASK_EDITOR_VIEW_IMPL_H -#define OPIE_TASK_EDITOR_VIEW_IMPL_H - -#include - -#include - -#include "taskeditoroverview.h" - -class DateBookMonth; -class QPushButton; -class QPopupMenu; -class TaskEditorOverViewImpl : public TaskEditorOverView { - Q_OBJECT -public: - TaskEditorOverViewImpl(QWidget* parent, const char* name = 0); - ~TaskEditorOverViewImpl(); - - void load( const OTodo& ); - void save( OTodo& ); -signals: - void recurranceEnabled( bool ); - void dueDateChanged( const QDate& date ); - -private: - void init(); - void popup(QPushButton*, QPopupMenu*); - DateBookMonth* m_dueBook; - DateBookMonth* m_startBook; - DateBookMonth* m_compBook; - QDate m_start; - QDate m_comp; - QDate m_due; - QPopupMenu* m_startPop; - QPopupMenu* m_compPop; - QPopupMenu* m_duePop; - bool m_bDue : 1; - -private slots: - void slotStartChecked(); - void slotStartChanged(int, int, int ); - void slotDueChecked(); - void slotDueChanged(int, int, int ); - void slotCompletedChecked(); - void slotCompletedChanged(int, int, int ); - - void hackySlotHack1(); - void hackySlotHack2(); - void hackySlotHack3(); - - void slotRecClicked(); -}; - - -#endif diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro index 2714f30..9960c65 100644 --- a/core/pim/todo/todo.pro +++ b/core/pim/todo/todo.pro @@ -16,9 +16,10 @@ HEADERS = smalltodo.h \ templatedialogimpl.h \ quickedit.h \ quickeditimpl.h \ - otaskeditor.h \ - taskeditoroverviewimpl.h \ - taskeditoradvancedimpl.h + otaskeditor.h \ + taskeditoroverview.h \ + taskeditoradvancedimpl.h \ + taskeditoralarms.h SOURCES = smalltodo.cpp \ todomanager.cpp \ @@ -35,11 +36,12 @@ SOURCES = smalltodo.cpp \ templatedialogimpl.cpp \ quickeditimpl.cpp \ quickedit.cpp \ - otaskeditor.cpp \ - taskeditoroverviewimpl.cpp \ - taskeditoradvancedimpl.cpp + otaskeditor.cpp \ + taskeditoroverview.cpp \ + taskeditoradvancedimpl.cpp \ + taskeditoralarms.cpp -INTERFACES = taskeditoradvanced.ui taskeditoralarms.ui taskeditoroverview.ui +INTERFACES = taskeditoradvanced.ui TARGET = todolist INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -- cgit v0.9.0.2