author | drw <drw> | 2002-12-23 17:13:12 (UTC) |
---|---|---|
committer | drw <drw> | 2002-12-23 17:13:12 (UTC) |
commit | 1cb75c721b69459494cb599730a96bbc1ddc0f65 (patch) (side-by-side diff) | |
tree | 9a45955d74016b639593c4a888acb4e96e17e9fb | |
parent | deb4685b99d6c5917f92ce188ead09fdd9c37859 (diff) | |
download | opie-1cb75c721b69459494cb599730a96bbc1ddc0f65.zip opie-1cb75c721b69459494cb599730a96bbc1ddc0f65.tar.gz opie-1cb75c721b69459494cb599730a96bbc1ddc0f65.tar.bz2 |
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.
-rw-r--r-- | core/pim/todo/.cvsignore | 4 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.cpp | 33 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.h | 5 | ||||
-rw-r--r-- | core/pim/todo/quickeditimpl.cpp | 3 | ||||
-rw-r--r-- | core/pim/todo/tableview.cpp | 3 | ||||
-rw-r--r-- | core/pim/todo/taskeditoralarms.cpp | 76 | ||||
-rw-r--r-- | core/pim/todo/taskeditoralarms.h | 52 | ||||
-rw-r--r-- | core/pim/todo/taskeditoralarms.ui | 144 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverview.cpp | 317 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverview.h | 92 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverview.ui | 542 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverviewimpl.cpp | 221 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverviewimpl.h | 55 | ||||
-rw-r--r-- | core/pim/todo/todo.pro | 12 |
14 files changed, 564 insertions, 995 deletions
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 @@ -1,10 +1,6 @@ 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 @@ -1,100 +1,93 @@ #include <qdatetime.h> #include <qlayout.h> #include <qlabel.h> #include <qmultilineedit.h> -#include <qscrollview.h> #include <opie/orecurrancewidget.h> -#include "taskeditoroverviewimpl.h" +#include "taskeditoroverview.h" #include "taskeditoradvancedimpl.h" #include "taskeditoralarms.h" #include "otaskeditor.h" OTaskEditor::OTaskEditor(int cur) : QDialog(0, 0, TRUE ) { init(); init( cur ); } OTaskEditor::OTaskEditor( const OTodo& to) : QDialog(0, 0, TRUE ) { init(); init( to ); } OTaskEditor::~OTaskEditor() { } void OTaskEditor::init( int cur ) { OTodo to; if ( cur != 0 ) to.setCategories( cur ); load(to); m_uid = 1; // generate a new one } void OTaskEditor::init( const OTodo& to ) { load( to ); m_uid = to.uid(); } OTodo OTaskEditor::todo()const{ qWarning("saving!"); 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 ); 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 */ 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&) ), 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 b43abbf..d13e157 100644 --- a/core/pim/todo/otaskeditor.h +++ b/core/pim/todo/otaskeditor.h @@ -1,43 +1,44 @@ #ifndef OPIE_TASK_EDITOR_H #define OPIE_TASK_EDITOR_H #include <qdialog.h> #include <opie/otodo.h> #include <opie/otabwidget.h> -class TaskEditorOverViewImpl; +class TaskEditorOverView; class TaskEditorAdvancedImpl; class TaskEditorAlarms; class ORecurranceWidget; class QMultiLineEdit; + class OTaskEditor : public QDialog { Q_OBJECT public: OTaskEditor(int cur); OTaskEditor( const OTodo& todo ); ~OTaskEditor(); /* * same as the c'tor but this gives us the * power to 'preload' the dialog */ void init( int cur ); void init( const OTodo& todo ); OTodo todo()const; private: void load( const OTodo& ); void init(); OTabWidget *m_tab; - TaskEditorOverViewImpl* m_overView; + TaskEditorOverView *m_overView; TaskEditorAdvancedImpl *m_adv; TaskEditorAlarms *m_alarm; TaskEditorAlarms* m_remind; ORecurranceWidget* m_rec; int m_uid; }; #endif 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 @@ -1,42 +1,43 @@ #include <qaction.h> #include <qlineedit.h> #include <qwhatsthis.h> #include <qpe/resource.h> #include <opie/oclickablelabel.h> #include "mainwindow.h" #include "quickeditimpl.h" QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible ) : QPEToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) { 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" ); m_lbl = new OClickableLabel( this ); m_lbl->setMinimumWidth( 15 ); m_lbl->setPixmap( priority3 ); connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) ); QWhatsThis::add( m_lbl, tr( "Click here to set the priority of new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); m_edit = new QLineEdit( this ); setStretchableWidget( m_edit ); QWhatsThis::add( m_edit, tr( "Enter description of new task here.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); QAction *a = new QAction( tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) ); a->addTo( this ); a->setWhatsThis( tr( "Click here to enter additional information for new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); a = new QAction( tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) ); a->addTo( this ); a->setWhatsThis( tr( "Click here to add new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); 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 @@ -40,49 +40,50 @@ #include <opie/orecur.h> #include "mainwindow.h" //#include "tableitems.h" #include "tableview.h" using namespace Todo; namespace { static const int BoxSize = 14; static const int RowHeight = 20; } void TableView::initConfig() { Config config( "todo" ); config.setGroup( "Options" ); m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 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++ ) { namestr = "todo/priority"; namestr.append( QString::number( i ) ); m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr ); } setUpdatesEnabled( false ); viewport()->setUpdatesEnabled( false ); m_enablePaint = false; setNumRows(0); setNumCols(4); horizontalHeader()->setLabel( 0, tr("C.") ); horizontalHeader()->setLabel( 1, tr("Priority") ); horizontalHeader()->setLabel( 2, tr("Description" ) ); horizontalHeader()->setLabel( 3, tr("Deadline") ); setShowDeadline( todoWindow()->showDeadline() ); setSorting( TRUE ); setSelectionMode( NoSelection ); 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_,=:_. -<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 "taskeditoralarms.h" + +#include <qpe/resource.h> + +#include <qlistview.h> +#include <qpushbutton.h> +#include <qlayout.h> +#include <qwhatsthis.h> + +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_,=:_. -<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 TASKEDITORALARMS_H +#define TASKEDITORALARMS_H + +#include <qwidget.h> + +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 @@ -<!DOCTYPE UI><UI> -<class>TaskEditorAlarms</class> -<author>zecke</author> -<widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>TaskEditorAlarms</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>195</width> - <height>271</height> - </rect> - </property> - <property> - <name>layoutMargin</name> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>8</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="0" column="0" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout19</cstring> - </property> - <vbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>txtAlarm</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>empty</string> - </property> - </widget> - <widget> - <class>QListView</class> - <property stdset="1"> - <name>name</name> - <cstring>lstAlarms</cstring> - </property> - </widget> - </vbox> - </widget> - <widget row="1" column="0" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout23</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>alAdd</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>4</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>text</name> - <string>&Add</string> - </property> - <property stdset="1"> - <name>autoResize</name> - <bool>true</bool> - </property> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>alEdit</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>4</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>text</name> - <string>&Edit</string> - </property> - <property stdset="1"> - <name>autoResize</name> - <bool>true</bool> - </property> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>alRemove</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>&Remove</string> - </property> - <property stdset="1"> - <name>autoResize</name> - <bool>true</bool> - </property> - </widget> - </hbox> - </widget> - </grid> -</widget> -</UI> 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_,=:_. -<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 "taskeditoroverview.h" + +#include <opie/orecur.h> + +#include <qpe/categoryselect.h> +#include <qpe/datebookmonth.h> +#include <qpe/resource.h> +#include <qpe/timestring.h> + +#include <qcheckbox.h> +#include <qcombobox.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qpushbutton.h> +#include <qtooltip.h> +#include <qvariant.h> +#include <qwhatsthis.h> + +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<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 ); +} + +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_,=:_. -<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 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 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 @@ -<!DOCTYPE UI><UI> -<class>TaskEditorOverView</class> -<author>zecke</author> -<widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>TaskEditorOverView</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>308</width> - <height>445</height> - </rect> - </property> - <property stdset="1"> - <name>caption</name> - <string>Form1</string> - </property> - <property> - <name>layoutMargin</name> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>4</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget row="5" column="0" rowspan="1" colspan="2" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout11</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>txtPrio</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Priority</string> - </property> - </widget> - <widget> - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string>1 - Very High</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>2 - High</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>3 - Normal</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>4 - Low</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>5 - Very Low</string> - </property> - </item> - <property stdset="1"> - <name>name</name> - <cstring>cmbPrio</cstring> - </property> - </widget> - </hbox> - </widget> - <widget row="4" column="0" rowspan="1" colspan="2" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout11</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>txtProgress</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Progress</string> - </property> - </widget> - <widget> - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string>0 %</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>20 %</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>40 %</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>60 %</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>80 %</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>100 %</string> - </property> - </item> - <property stdset="1"> - <name>name</name> - <cstring>cmbProgress</cstring> - </property> - </widget> - </hbox> - </widget> - <widget row="2" column="0" rowspan="1" colspan="2" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout9</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>ckbDue</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Due Date:</string> - </property> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>btnDue</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>1 Januar 2002</string> - </property> - </widget> - </hbox> - </widget> - <widget row="1" column="0" rowspan="1" colspan="2" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout8</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>ckbStart</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Start Date:</string> - </property> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>btnStart</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>1 Januar 2001</string> - </property> - </widget> - </hbox> - </widget> - <widget row="0" column="0" rowspan="1" colspan="2" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout7</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>lblSum</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Summary</string> - </property> - </widget> - <widget> - <class>QComboBox</class> - <item> - <property> - <name>text</name> - <string>Complete</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>work on</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>buy</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>organize</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>get</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Update</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Create</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Plan</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Call</string> - </property> - </item> - <item> - <property> - <name>text</name> - <string>Mail</string> - </property> - </item> - <property stdset="1"> - <name>name</name> - <cstring>cmbSum</cstring> - </property> - <property stdset="1"> - <name>editable</name> - <bool>true</bool> - </property> - </widget> - </hbox> - </widget> - <widget row="3" column="0" rowspan="1" colspan="2" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout10</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>ckbComp</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>true</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>Completed Date</string> - </property> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>btnComp</cstring> - </property> - <property stdset="1"> - <name>enabled</name> - <bool>false</bool> - </property> - <property stdset="1"> - <name>text</name> - <string>1 Januar 2002</string> - </property> - </widget> - </hbox> - </widget> - <widget row="6" column="0" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>ckbCompleted</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Completed</string> - </property> - </widget> - <widget row="7" column="0" rowspan="1" colspan="2" > - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout12</cstring> - </property> - <hbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>txtCategory</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Category</string> - </property> - </widget> - <widget> - <class>CategorySelect</class> - <property stdset="1"> - <name>name</name> - <cstring>comboCategory</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>7</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>minimumSize</name> - <size> - <width>60</width> - <height>20</height> - </size> - </property> - </widget> - </hbox> - </widget> - <widget row="8" column="0" rowspan="1" colspan="2" > - <class>QCheckBox</class> - <property stdset="1"> - <name>name</name> - <cstring>CheckBox7</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Enable Recurrance</string> - </property> - </widget> - <spacer row="9" column="1" > - <property> - <name>name</name> - <cstring>Spacer1</cstring> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Vertical</enum> - </property> - <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> - </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </grid> -</widget> -<customwidgets> - <customwidget> - <class>CategorySelect</class> - <header location="global">qpe/categoryselect.h</header> - <sizehint> - <width>-1</width> - <height>-1</height> - </sizehint> - <container>0</container> - <sizepolicy> - <hordata>7</hordata> - <verdata>1</verdata> - </sizepolicy> - <pixmap>image0</pixmap> - </customwidget> -</customwidgets> -<images> - <image> - <name>image0</name> - <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> - </image> -</images> -<connections> - <connection> - <sender>ckbStart</sender> - <signal>clicked()</signal> - <receiver>TaskEditorOverView</receiver> - <slot>slotStartChecked()</slot> - </connection> - <connection> - <sender>ckbDue</sender> - <signal>clicked()</signal> - <receiver>TaskEditorOverView</receiver> - <slot>slotDueChecked()</slot> - </connection> - <connection> - <sender>ckbComp</sender> - <signal>clicked()</signal> - <receiver>TaskEditorOverView</receiver> - <slot>slotCompletedChecked()</slot> - </connection> - <slot access="protected">slotCompletedChecked()</slot> - <slot access="protected">slotDueChecked()</slot> - <slot access="protected">slotStartChecked()</slot> -</connections> -</UI> 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 <qapplication.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qpopupmenu.h> - -#include <qpe/datebookmonth.h> -#include <qpe/categoryselect.h> -#include <qpe/timestring.h> - -#include <opie/orecur.h> - -#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<int> 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 <qsize.h> - -#include <opie/otodo.h> - -#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 @@ -1,63 +1,65 @@ TEMPLATE = app CONFIG = qt warn_on release DESTDIR = $(OPIEDIR)/bin HEADERS = smalltodo.h \ todomanager.h \ mainwindow.h \ todoview.h \ tableview.h \ todotemplatemanager.h \ todoeditor.h \ todoshow.h \ textviewshow.h \ templateeditor.h \ templatedialog.h \ templatedialogimpl.h \ quickedit.h \ quickeditimpl.h \ otaskeditor.h \ - taskeditoroverviewimpl.h \ - taskeditoradvancedimpl.h + taskeditoroverview.h \ + taskeditoradvancedimpl.h \ + taskeditoralarms.h SOURCES = smalltodo.cpp \ todomanager.cpp \ mainwindow.cpp \ main.cpp \ tableview.cpp \ todoview.cpp \ todotemplatemanager.cpp \ todoeditor.cpp \ todoshow.cpp \ textviewshow.cpp \ templateeditor.cpp \ templatedialog.cpp \ templatedialogimpl.cpp \ quickeditimpl.cpp \ quickedit.cpp \ otaskeditor.cpp \ - taskeditoroverviewimpl.cpp \ - taskeditoradvancedimpl.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 LIBS += -lqpe -lopie TRANSLATIONS = ../../../i18n/de/todolist.ts \ ../../../i18n/da/todolist.ts \ ../../../i18n/xx/todolist.ts \ ../../../i18n/en/todolist.ts \ ../../../i18n/es/todolist.ts \ ../../../i18n/fr/todolist.ts \ ../../../i18n/hu/todolist.ts \ ../../../i18n/ja/todolist.ts \ ../../../i18n/ko/todolist.ts \ ../../../i18n/no/todolist.ts \ ../../../i18n/pl/todolist.ts \ ../../../i18n/pt/todolist.ts \ ../../../i18n/pt_BR/todolist.ts \ ../../../i18n/sl/todolist.ts \ ../../../i18n/zh_CN/todolist.ts \ ../../../i18n/zh_TW/todolist.ts |