summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/otaskeditor.cpp22
-rw-r--r--core/pim/todo/otaskeditor.h4
-rw-r--r--core/pim/todo/taskeditoradvanced.cpp132
-rw-r--r--core/pim/todo/taskeditoradvanced.h73
-rw-r--r--core/pim/todo/taskeditoroverview.cpp285
-rw-r--r--core/pim/todo/taskeditoroverview.h35
-rw-r--r--core/pim/todo/todo.pro4
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,93 +1,93 @@
1#include <qdatetime.h> 1#include <qdatetime.h>
2#include <qlayout.h>
3#include <qlabel.h> 2#include <qlabel.h>
3#include <qlayout.h>
4#include <qmultilineedit.h> 4#include <qmultilineedit.h>
5 5
6#include <opie/orecurrancewidget.h> 6#include <opie/orecurrancewidget.h>
7 7
8#include "taskeditoroverview.h" 8#include "taskeditoroverview.h"
9#include "taskeditoradvanced.h" 9#include "taskeditorstatus.h"
10#include "taskeditoralarms.h" 10#include "taskeditoralarms.h"
11 11
12#include "otaskeditor.h" 12#include "otaskeditor.h"
13 13
14OTaskEditor::OTaskEditor(int cur) 14OTaskEditor::OTaskEditor(int cur)
15 : QDialog(0, 0, TRUE ) { 15 : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) {
16 init(); 16 init();
17 init( cur ); 17 init( cur );
18} 18}
19OTaskEditor::OTaskEditor( const OTodo& to) 19OTaskEditor::OTaskEditor( const OTodo& to)
20 : QDialog(0, 0, TRUE ) { 20 : QDialog( 0, 0, TRUE, WStyle_ContextHelp ) {
21 init(); 21 init();
22 init( to ); 22 init( to );
23} 23}
24OTaskEditor::~OTaskEditor() { 24OTaskEditor::~OTaskEditor() {
25 25
26} 26}
27void OTaskEditor::init( int cur ) { 27void OTaskEditor::init( int cur ) {
28 OTodo to; 28 OTodo to;
29 if ( cur != 0 ) 29 if ( cur != 0 )
30 to.setCategories( cur ); 30 to.setCategories( cur );
31 load(to); 31 load(to);
32 m_uid = 1; // generate a new one 32 m_uid = 1; // generate a new one
33} 33}
34void OTaskEditor::init( const OTodo& to ) { 34void OTaskEditor::init( const OTodo& to ) {
35 load( to ); 35 load( to );
36 m_uid = to.uid(); 36 m_uid = to.uid();
37} 37}
38OTodo OTaskEditor::todo()const{ 38OTodo OTaskEditor::todo()const{
39 qWarning("saving!"); 39 qWarning("saving!");
40 OTodo to; 40 OTodo to;
41 to.setUid(m_uid ); 41 to.setUid(m_uid );
42 m_overView->save( to ); 42 m_overView->save( to );
43 m_adv->save( to ); 43 m_stat->save( to );
44 to.setRecurrence( m_rec->recurrence() ); 44 to.setRecurrence( m_rec->recurrence() );
45 45
46 return to; 46 return to;
47} 47}
48void OTaskEditor::load(const OTodo& to) { 48void OTaskEditor::load(const OTodo& to) {
49 m_overView->load( to ); 49 m_overView->load( to );
50 m_adv->load( to ); 50 m_stat->load( to );
51 m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() ); 51 m_rec->setRecurrence( to.recurrence(), to.hasDueDate() ? to.dueDate() : QDate::currentDate() );
52} 52}
53void OTaskEditor::init() { 53void OTaskEditor::init() {
54 setCaption("Task Editor"); 54 setCaption("Task Editor");
55 55
56 QVBoxLayout* layo = new QVBoxLayout( this ); 56 QVBoxLayout* layo = new QVBoxLayout( this );
57 m_tab = new OTabWidget( this ); 57 m_tab = new OTabWidget( this );
58 layo->addWidget( m_tab ); 58 layo->addWidget( m_tab );
59 59
60 /* 60 /*
61 * Add the Widgets 61 * Add the Widgets
62 */ 62 */
63 m_overView = new TaskEditorOverView( m_tab ); 63 m_overView = new TaskEditorOverView( m_tab );
64 m_tab->addTab( m_overView, "TodoList", tr("Overview") ); 64 m_tab->addTab( m_overView, "todo/info", tr("Information") );
65 65
66 m_adv = new TaskEditorAdvanced( m_tab ); 66 m_stat = new TaskEditorStatus( m_tab );
67 m_tab->addTab( m_adv, "todo/advanced", tr("Advanced") ); 67 m_tab->addTab( m_stat, "TodoList", tr("Status") );
68 68
69 m_alarm = new TaskEditorAlarms( m_tab ); 69 m_alarm = new TaskEditorAlarms( m_tab );
70 m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") ); 70 m_tab->addTab( m_alarm, "todo/alarm", tr("Alarms") );
71 71
72 m_remind = new TaskEditorAlarms( m_tab ); 72 m_remind = new TaskEditorAlarms( m_tab );
73 m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") ); 73 m_tab->addTab( m_remind, "todo/reminder", tr("Reminders") );
74 74
75 QLabel* lbl = new QLabel( m_tab ); 75 QLabel* lbl = new QLabel( m_tab );
76 lbl->setText( tr("X-Ref") ); 76 lbl->setText( tr("X-Ref") );
77 m_tab->addTab( lbl, "todo/xref", tr("X-Ref") ); 77 m_tab->addTab( lbl, "todo/xref", tr("X-Ref") );
78 78
79 m_rec = new ORecurranceWidget( true, QDate::currentDate(), this ); 79 m_rec = new ORecurranceWidget( true, QDate::currentDate(), this );
80 m_tab->addTab( m_rec, "repeat", tr("Recurrance") ); 80 m_tab->addTab( m_rec, "repeat", tr("Recurrence") );
81 81
82 82
83 /* signal and slots */ 83 /* signal and slots */
84 connect(m_overView, SIGNAL(recurranceEnabled(bool) ), 84 connect(m_overView, SIGNAL(recurranceEnabled(bool) ),
85 m_rec, SLOT(setEnabled(bool) ) ); 85 m_rec, SLOT(setEnabled(bool) ) );
86 86
87 /* connect due date changed to the recurrence tab */ 87 /* connect due date changed to the recurrence tab */
88 connect(m_overView, SIGNAL(dueDateChanged(const QDate&) ), 88 connect(m_stat, SIGNAL(dueDateChanged(const QDate&) ),
89 m_rec, SLOT(setStartDate(const QDate& ) ) ); 89 m_rec, SLOT(setStartDate(const QDate& ) ) );
90 90
91 91
92 m_tab->setCurrentTab( m_overView ); 92 m_tab->setCurrentTab( m_overView );
93} 93}
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
@@ -1,22 +1,22 @@
1#ifndef OPIE_TASK_EDITOR_H 1#ifndef OPIE_TASK_EDITOR_H
2#define OPIE_TASK_EDITOR_H 2#define OPIE_TASK_EDITOR_H
3 3
4#include <qdialog.h> 4#include <qdialog.h>
5 5
6#include <opie/otodo.h> 6#include <opie/otodo.h>
7#include <opie/otabwidget.h> 7#include <opie/otabwidget.h>
8 8
9class TaskEditorOverView; 9class TaskEditorOverView;
10class TaskEditorAdvanced; 10class TaskEditorStatus;
11class TaskEditorAlarms; 11class TaskEditorAlarms;
12class ORecurranceWidget; 12class ORecurranceWidget;
13class QMultiLineEdit; 13class QMultiLineEdit;
14 14
15class OTaskEditor : public QDialog { 15class OTaskEditor : public QDialog {
16 Q_OBJECT 16 Q_OBJECT
17public: 17public:
18 OTaskEditor(int cur); 18 OTaskEditor(int cur);
19 OTaskEditor( const OTodo& todo ); 19 OTaskEditor( const OTodo& todo );
20 ~OTaskEditor(); 20 ~OTaskEditor();
21 21
22 /* 22 /*
@@ -24,21 +24,21 @@ public:
24 * power to 'preload' the dialog 24 * power to 'preload' the dialog
25 */ 25 */
26 void init( int cur ); 26 void init( int cur );
27 void init( const OTodo& todo ); 27 void init( const OTodo& todo );
28 28
29 OTodo todo()const; 29 OTodo todo()const;
30private: 30private:
31 void load( const OTodo& ); 31 void load( const OTodo& );
32 void init(); 32 void init();
33 33
34 OTabWidget *m_tab; 34 OTabWidget *m_tab;
35 TaskEditorOverView *m_overView; 35 TaskEditorOverView *m_overView;
36 TaskEditorAdvanced *m_adv; 36 TaskEditorStatus *m_stat;
37 TaskEditorAlarms *m_alarm; 37 TaskEditorAlarms *m_alarm;
38 TaskEditorAlarms *m_remind; 38 TaskEditorAlarms *m_remind;
39 ORecurranceWidget *m_rec; 39 ORecurranceWidget *m_rec;
40 int m_uid; 40 int m_uid;
41 41
42}; 42};
43 43
44#endif 44#endif
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 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <>
4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include "taskeditoradvanced.h"
30
31#include <opie/otodo.h>
32#include <opie/opimmaintainer.h>
33#include <opie/opimstate.h>
34
35#include <qpe/resource.h>
36
37#include <qcombobox.h>
38#include <qlabel.h>
39#include <qlayout.h>
40#include <qmultilineedit.h>
41#include <qscrollview.h>
42#include <qtoolbutton.h>
43#include <qwhatsthis.h>
44
45TaskEditorAdvanced::TaskEditorAdvanced( QWidget* parent, const char* name, WFlags fl )
46 : QWidget( parent, name, fl )
47{
48 QVBoxLayout *vb = new QVBoxLayout( this );
49
50 QScrollView *sv = new QScrollView( this );
51 vb->addWidget( sv );
52 sv->setResizePolicy( QScrollView::AutoOneFit );
53 sv->setFrameStyle( QFrame::NoFrame );
54
55 QWidget *container = new QWidget( sv->viewport() );
56 sv->addChild( container );
57
58 QGridLayout *layout = new QGridLayout( container, 5, 3, 4, 4 );
59
60 QLabel *label = new QLabel( tr( "State:" ), container );
61 layout->addWidget( label, 0, 0 );
62
63 cmbState = new QComboBox( FALSE, container );
64 cmbState->insertItem( tr( "Started" ) );
65 cmbState->insertItem( tr( "Postponed" ) );
66 cmbState->insertItem( tr( "Finished" ) );
67 cmbState->insertItem( tr( "Not started" ) );
68 layout->addMultiCellWidget( cmbState, 0, 0, 1, 2 );
69
70 label = new QLabel( tr( "Maintain Mode:" ), container );
71 layout->addWidget( label, 1, 0 );
72
73 cmbMode = new QComboBox( FALSE, container );
74 cmbMode->insertItem( tr( "Nothing" ) );
75 cmbMode->insertItem( tr( "Responsible" ) );
76 cmbMode->insertItem( tr( "Done By" ) );
77 cmbMode->insertItem( tr( "Coordinating" ) );
78 layout->addMultiCellWidget( cmbMode, 1, 1, 1, 2 );
79
80 label = new QLabel( tr( "Maintainer:" ), container );
81 layout->addWidget( label, 2, 0 );
82
83 txtMaintainer = new QLabel( tr( "test" ), container );
84 txtMaintainer->setTextFormat( QLabel::RichText );
85 layout->addWidget( txtMaintainer, 2, 1 );
86
87 tbtMaintainer = new QToolButton( container );
88 tbtMaintainer->setPixmap( Resource::loadPixmap( "todo/more" ) );
89 layout->addWidget( tbtMaintainer, 2, 2 );
90
91 label = new QLabel( tr( "Description:" ), container );
92 layout->addWidget( label, 3, 0 );
93
94 m_edit = new QMultiLineEdit( this );
95 m_edit->setWordWrap( QMultiLineEdit::WidgetWidth );
96 layout->addMultiCellWidget( m_edit, 4, 4, 0, 2 );
97}
98
99TaskEditorAdvanced::~TaskEditorAdvanced()
100{
101}
102
103void TaskEditorAdvanced::load( const OTodo &todo )
104{
105 m_edit->setText( todo.description() );
106
107 /* OPimState */
108 int state = todo.state().state();
109
110 /* defualt to not started */
111 if ( state == OPimState::Undefined )
112 state = OPimState::NotStarted;
113
114 cmbState->setCurrentItem( state );
115
116 /* Maintainer Mode */
117 state = todo.maintainer().mode();
118 if ( state == OPimMaintainer::Undefined )
119 state = OPimMaintainer::Nothing;
120
121 cmbMode->setCurrentItem( state );
122}
123
124void TaskEditorAdvanced::save( OTodo &todo )
125{
126 todo.setDescription( m_edit->text() );
127 todo.setState( OPimState( cmbState->currentItem() ) );
128
129 /* Fix me resolve name to uid.....*/
130 todo.setMaintainer( OPimMaintainer( cmbMode->currentItem(), -10 ) );
131 qWarning("save");
132}
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 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 <>
4           .>+-=
5 _;:,     .>    :=|. This program is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This program is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef TASKEDITORADVANCED_H
30#define TASKEDITORADVANCED_H
31
32#include <qwidget.h>
33
34class OTodo;
35class QComboBox;
36class QLabel;
37class QMultiLineEdit;
38class QToolButton;
39
40/**
41 * This is the implementation of the Opie Task Editor Advanced tab
42 * it features the State!
43 * MaintainerMode
44 * Description
45 */
46class TaskEditorAdvanced : public QWidget
47{
48 Q_OBJECT
49
50public:
51 TaskEditorAdvanced( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
52 ~TaskEditorAdvanced();
53
54 /*
55 * I could have a struct which returns a QWidget*
56 * load and save to a OTodo
57 * and use multiple inheretence with all other widgets
58 * and then simply iterate over the list of structs
59 * this way I could easily have plugins for the whole editor....
60 * but I do not do it -zecke
61 */
62 void load( const OTodo& );
63 void save( OTodo& );
64
65 QComboBox *cmbState;
66 QLabel *txtMaintainer;
67 QToolButton *tbtMaintainer;
68 QComboBox *cmbMode;
69 QMultiLineEdit *m_edit;
70
71};
72
73#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
@@ -30,285 +30,148 @@
30 30
31#include <opie/orecur.h> 31#include <opie/orecur.h>
32 32
33#include <qpe/categoryselect.h> 33#include <qpe/categoryselect.h>
34#include <qpe/datebookmonth.h> 34#include <qpe/datebookmonth.h>
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36#include <qpe/timestring.h> 36#include <qpe/timestring.h>
37 37
38#include <qcheckbox.h> 38#include <qcheckbox.h>
39#include <qcombobox.h> 39#include <qcombobox.h>
40#include <qlabel.h> 40#include <qlabel.h>
41#include <qlayout.h> 41#include <qlayout.h>
42#include <qpushbutton.h> 42#include <qmultilineedit.h>
43#include <qwhatsthis.h> 43#include <qwhatsthis.h>
44 44
45TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl ) 45TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl )
46 : QWidget( parent, name, fl ) 46 : QWidget( parent, name, fl )
47{ 47{
48 // Load icons 48 // Load icons
49 // TODO - probably should be done globally somewhere else, 49 // TODO - probably should be done globally somewhere else,
50 // see also quickeditimpl.cpp/h, tableview.cpp/h 50 // see also quickeditimpl.cpp/h, tableview.cpp/h
51 QString namestr; 51 QString namestr;
52 for ( unsigned int i = 1; i < 6; i++ ) { 52 for ( unsigned int i = 1; i < 6; i++ ) {
53 namestr = "todo/priority"; 53 namestr = "todo/priority";
54 namestr.append( QString::number( i ) ); 54 namestr.append( QString::number( i ) );
55 m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr ); 55 m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr );
56 } 56 }
57 57
58 QDate curDate = QDate::currentDate();
59 m_start = m_comp = m_due = curDate;
60 QString curDateStr = TimeString::longDateString( curDate );
61
62 QVBoxLayout *vb = new QVBoxLayout( this ); 58 QVBoxLayout *vb = new QVBoxLayout( this );
63 59
64 QScrollView *sv = new QScrollView( this ); 60 QScrollView *sv = new QScrollView( this );
65 vb->addWidget( sv ); 61 vb->addWidget( sv );
66 sv->setResizePolicy( QScrollView::AutoOneFit ); 62 sv->setResizePolicy( QScrollView::AutoOneFit );
67 sv->setFrameStyle( QFrame::NoFrame ); 63 sv->setFrameStyle( QFrame::NoFrame );
68 64
69 QWidget *container = new QWidget( sv->viewport() ); 65 QWidget *container = new QWidget( sv->viewport() );
70 sv->addChild( container ); 66 sv->addChild( container );
71 67
72 QGridLayout *layout = new QGridLayout( container, 10, 2, 4, 4 ); 68 QGridLayout *layout = new QGridLayout( container, 7, 2, 4, 4 );
73 69
74 // Summary 70 // Description
75 QLabel *label = new QLabel( tr( "Summary:" ), container ); 71 QLabel *label = new QLabel( tr( "Description:" ), container );
76 layout->addWidget( label, 0, 0 ); 72 layout->addWidget( label, 0, 0 );
77 cmbSum = new QComboBox( TRUE, container ); 73 QWhatsThis::add( label, tr( "Enter brief description of the task here." ) );
78 cmbSum->insertItem( tr( "Complete " ) ); 74 cmbDesc = new QComboBox( TRUE, container );
79 cmbSum->insertItem( tr( "Work on " ) ); 75 cmbDesc->insertItem( tr( "Complete " ) );
80 cmbSum->insertItem( tr( "Buy " ) ); 76 cmbDesc->insertItem( tr( "Work on " ) );
81 cmbSum->insertItem( tr( "Organize " ) ); 77 cmbDesc->insertItem( tr( "Buy " ) );
82 cmbSum->insertItem( tr( "Get " ) ); 78 cmbDesc->insertItem( tr( "Organize " ) );
83 cmbSum->insertItem( tr( "Update " ) ); 79 cmbDesc->insertItem( tr( "Get " ) );
84 cmbSum->insertItem( tr( "Create " ) ); 80 cmbDesc->insertItem( tr( "Update " ) );
85 cmbSum->insertItem( tr( "Plan " ) ); 81 cmbDesc->insertItem( tr( "Create " ) );
86 cmbSum->insertItem( tr( "Call " ) ); 82 cmbDesc->insertItem( tr( "Plan " ) );
87 cmbSum->insertItem( tr( "Mail " ) ); 83 cmbDesc->insertItem( tr( "Call " ) );
88 cmbSum->clearEdit(); 84 cmbDesc->insertItem( tr( "Mail " ) );
89 layout->addMultiCellWidget( cmbSum, 1, 1, 0, 1 ); 85 cmbDesc->clearEdit();
86 layout->addMultiCellWidget( cmbDesc, 1, 1, 0, 1 );
87 QWhatsThis::add( cmbDesc, tr( "Enter brief description of the task here." ) );
90 88
91 // Priority 89 // Priority
92 label = new QLabel( tr( "Priority:" ), container ); 90 label = new QLabel( tr( "Priority:" ), container );
93 layout->addWidget( label, 2, 0 ); 91 layout->addWidget( label, 2, 0 );
94 cmbPrio = new QComboBox( FALSE, container ); 92 QWhatsThis::add( label, tr( "Select priority of task here." ) );
95 cmbPrio->setMinimumHeight( 26 ); 93 cmbPriority = new QComboBox( FALSE, container );
96 cmbPrio->insertItem( m_pic_priority[ 0 ], tr( "Very High" ) ); 94 cmbPriority->setMinimumHeight( 26 );
97 cmbPrio->insertItem( m_pic_priority[ 1 ], tr( "High" ) ); 95 cmbPriority->insertItem( m_pic_priority[ 0 ], tr( "Very High" ) );
98 cmbPrio->insertItem( m_pic_priority[ 2 ], tr( "Normal" ) ); 96 cmbPriority->insertItem( m_pic_priority[ 1 ], tr( "High" ) );
99 cmbPrio->insertItem( m_pic_priority[ 3 ], tr( "Low" ) ); 97 cmbPriority->insertItem( m_pic_priority[ 2 ], tr( "Normal" ) );
100 cmbPrio->insertItem( m_pic_priority[ 4 ], tr( "Very Low" ) ); 98 cmbPriority->insertItem( m_pic_priority[ 3 ], tr( "Low" ) );
101 cmbPrio->setCurrentItem( 2 ); 99 cmbPriority->insertItem( m_pic_priority[ 4 ], tr( "Very Low" ) );
102 layout->addWidget( cmbPrio, 2, 1 ); 100 cmbPriority->setCurrentItem( 2 );
101 layout->addWidget( cmbPriority, 2, 1 );
102 QWhatsThis::add( cmbPriority, tr( "Select priority of task here." ) );
103 103
104 // Category 104 // Category
105 label = new QLabel( tr( "Category:" ), container ); 105 label = new QLabel( tr( "Category:" ), container );
106 layout->addWidget( label, 3, 0 ); 106 layout->addWidget( label, 3, 0 );
107 comboCategory = new CategorySelect( container ); 107 QWhatsThis::add( label, tr( "Select category to organize this task with." ) );
108 layout->addWidget( comboCategory, 3, 1 ); 108 cmbCategory = new CategorySelect( container );
109 109 layout->addWidget( cmbCategory, 3, 1 );
110 // Recurrance 110 QWhatsThis::add( cmbCategory, tr( "Select category to organize this task with." ) );
111 CheckBox7 = new QCheckBox( tr( "Recurring task" ), container ); 111
112 layout->addMultiCellWidget( CheckBox7, 4, 4, 0, 1 ); 112 // Recurrence
113 connect( CheckBox7, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) ); 113 ckbRecurrence = new QCheckBox( tr( "Recurring task" ), container );
114 114 layout->addMultiCellWidget( ckbRecurrence, 4, 4, 0, 1 );
115 QSpacerItem *spacer = new QSpacerItem( 5, 5, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding ); 115 QWhatsThis::add( ckbRecurrence, tr( "Click here if task happens on a regular basis. If selected, frequency can be set on the Recurrence tab." ) );
116 layout->addItem( spacer, 5, 0 ); 116 connect( ckbRecurrence, SIGNAL(clicked() ), this, SLOT( slotRecClicked() ) );
117 117
118 // Start date 118 // Notes
119 ckbStart = new QCheckBox( tr( "Start Date:" ), container ); 119 label = new QLabel( tr( "Notes:" ), container );
120 layout->addWidget( ckbStart, 6, 0 ); 120 layout->addWidget( label, 5, 0 );
121 connect( ckbStart, SIGNAL( clicked() ), this, SLOT( slotStartChecked() ) ); 121 QWhatsThis::add( label, tr( "Enter any additional information about this task here." ) );
122 btnStart = new QPushButton( curDateStr, container ); 122 mleNotes = new QMultiLineEdit( this );
123 btnStart->setEnabled( FALSE ); 123 mleNotes->setWordWrap( QMultiLineEdit::WidgetWidth );
124 layout->addWidget( btnStart, 6, 1 ); 124 layout->addMultiCellWidget( mleNotes, 6, 6, 0, 1 );
125 125 QWhatsThis::add( mleNotes, tr( "Enter any additional information about this task here." ) );
126 QPopupMenu *popup = new QPopupMenu( this );
127 m_startBook = new DateBookMonth( popup, 0, TRUE );
128 popup->insertItem( m_startBook );
129 btnStart->setPopup( popup );
130 connect( m_startBook, SIGNAL( dateClicked( int, int, int ) ),
131 this, SLOT( slotStartChanged( int, int, int ) ) );
132
133 // Due date
134 ckbDue = new QCheckBox( tr( "Due Date:" ), container );
135 layout->addWidget( ckbDue, 7, 0 );
136 connect( ckbDue, SIGNAL( clicked() ), this, SLOT( slotDueChecked() ) );
137 btnDue = new QPushButton( curDateStr, container );
138 btnDue->setEnabled( FALSE );
139 layout->addWidget( btnDue, 7, 1 );
140
141 popup = new QPopupMenu( this );
142 m_dueBook = new DateBookMonth( popup, 0, TRUE );
143 popup->insertItem( m_dueBook );
144 btnDue->setPopup( popup );
145 connect( m_dueBook, SIGNAL( dateClicked( int, int, int ) ),
146 this, SLOT( slotDueChanged( int, int, int ) ) );
147
148 // Progress
149 label = new QLabel( tr( "Progress:" ), container );
150 layout->addWidget( label, 8, 0 );
151 cmbProgress = new QComboBox( FALSE, container );
152 cmbProgress->insertItem( tr( "0 %" ) );
153 cmbProgress->insertItem( tr( "20 %" ) );
154 cmbProgress->insertItem( tr( "40 %" ) );
155 cmbProgress->insertItem( tr( "60 %" ) );
156 cmbProgress->insertItem( tr( "80 %" ) );
157 cmbProgress->insertItem( tr( "100 %" ) );
158 layout->addWidget( cmbProgress, 8, 1 );
159
160 // Completed
161 ckbComp = new QCheckBox( tr( "Completed:" ), container );
162 layout->addWidget( ckbComp, 9, 0 );
163 connect( ckbComp, SIGNAL( clicked() ), this, SLOT( slotCompChecked() ) );
164 btnComp = new QPushButton( curDateStr, container );
165 btnComp->setEnabled( FALSE );
166 layout->addWidget( btnComp, 9, 1 );
167
168 popup = new QPopupMenu( this );
169 m_compBook = new DateBookMonth( popup, 0, TRUE );
170 popup->insertItem( m_compBook );
171 btnComp->setPopup( popup );
172 connect( m_compBook, SIGNAL( dateClicked( int, int, int ) ),
173 this, SLOT( slotCompChanged( int, int, int ) ) );
174} 126}
175 127
176TaskEditorOverView::~TaskEditorOverView() 128TaskEditorOverView::~TaskEditorOverView()
177{ 129{
178} 130}
179 131
180void TaskEditorOverView::load( const OTodo& todo ) 132void TaskEditorOverView::load( const OTodo& todo )
181{ 133{
182 /* 134 // Description
183 * now that we're 'preloaded' we 135 cmbDesc->insertItem( todo.summary(), 0 );
184 * need to disable the buttons 136 cmbDesc->setCurrentItem( 0 );
185 * holding the dat
186 */
187 btnDue->setEnabled( FALSE );
188 btnComp->setEnabled( FALSE );
189 btnStart->setEnabled( FALSE );
190
191 /*
192 * get some basic dateinfos for now
193 */
194 QDate date = QDate::currentDate();
195 QString str = TimeString::longDateString( date );
196
197 CheckBox7->setChecked( todo.recurrence().doesRecur() );
198 emit recurranceEnabled( todo.recurrence().doesRecur() );
199 137
200 ckbStart->setChecked( todo.hasStartDate() ); 138 // Priority
201 btnStart->setEnabled( todo.hasStartDate() ); 139 cmbPriority->setCurrentItem( todo.priority() - 1 );
202 if ( todo.hasStartDate() )
203 {
204 m_start = todo.startDate();
205 btnStart->setText( TimeString::longDateString( m_start ) );
206 }
207 else
208 btnStart->setText( str );
209
210 ckbComp->setChecked( todo.hasCompletedDate() );
211 btnComp->setEnabled( todo.hasCompletedDate() );
212 if ( todo.hasCompletedDate() )
213 {
214 m_comp = todo.completedDate();
215 btnComp->setText( TimeString::longDateString( m_comp ) );
216 }
217 else
218 btnComp->setText( str );
219 140
220 cmbProgress->setCurrentItem( todo.progress() / 20 ); 141 // Category
221 cmbSum->insertItem( todo.summary(), 0 ); 142 cmbCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) );
222 cmbSum->setCurrentItem( 0 );
223 143
224 ckbDue->setChecked( todo.hasDueDate() ); 144 // Recurrence
225 btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); 145 ckbRecurrence->setChecked( todo.recurrence().doesRecur() );
226 btnDue->setEnabled( todo.hasDueDate() ); 146 emit recurranceEnabled( todo.recurrence().doesRecur() );
227 m_due = todo.dueDate();
228 147
229 cmbPrio->setCurrentItem( todo.priority() - 1 ); 148 // Notes
230 ckbComp->setChecked( todo.isCompleted() ); 149 mleNotes->setText( todo.description() );
231 150
232 comboCategory->setCategories( todo.categories(), "Todo List", tr( "Todo List" ) );
233} 151}
234 152
235void TaskEditorOverView::save( OTodo &to ) 153void TaskEditorOverView::save( OTodo &todo )
236{ 154{
237 /* a invalid date */ 155 // Description
238 QDate inval; 156 todo.setSummary( cmbDesc->currentText() );
239 /* save our info back */
240 157
241 /* due date */ 158 // Priority
242 if ( ckbDue->isChecked() ) 159 todo.setPriority( cmbPriority->currentItem() + 1 );
243 {
244 to.setDueDate( m_due );
245 to.setHasDueDate( true );
246 }
247 else
248 to.setHasDueDate( false );
249
250 /* start date */
251 if ( ckbStart->isChecked() )
252 {
253 to.setStartDate( m_start );
254 }
255 else
256 to.setStartDate( inval );
257 160
258 /* comp date */ 161 // Category
259 if ( ckbComp->isChecked() ) 162 if ( cmbCategory->currentCategory() != -1 )
260 { 163 {
261 to.setCompletedDate( m_comp ); 164 QArray<int> arr = cmbCategory->currentCategories();
165 todo.setCategories( arr );
262 } 166 }
263 else
264 to.setCompletedDate( inval );
265 167
168 // Recurrence - don't need to save here...
266 169
267 if ( comboCategory->currentCategory() != -1 ) 170 // Notes
268 { 171 todo.setDescription( mleNotes->text() );
269 QArray<int> arr = comboCategory->currentCategories();
270 to.setCategories( arr );
271 }
272 to.setPriority( cmbPrio->currentItem() + 1 );
273 to.setCompleted( ckbComp->isChecked() );
274 to.setSummary( cmbSum->currentText() );
275 to.setProgress( cmbProgress->currentItem() * 20 );
276} 172}
277 173
278void TaskEditorOverView::slotRecClicked() 174void TaskEditorOverView::slotRecClicked()
279{ 175{
280 emit recurranceEnabled( CheckBox7->isChecked() ); 176 emit recurranceEnabled( ckbRecurrence->isChecked() );
281}
282
283void TaskEditorOverView::slotStartChecked()
284{
285 btnStart->setEnabled( ckbStart->isChecked() );
286}
287
288void TaskEditorOverView::slotCompChecked()
289{
290 btnComp->setEnabled( ckbComp->isChecked() );
291}
292
293void TaskEditorOverView::slotDueChecked()
294{
295 btnDue->setEnabled( ckbDue->isChecked() );
296}
297
298void TaskEditorOverView::slotStartChanged(int y, int m, int d)
299{
300 m_start.setYMD( y, m, d );
301 btnStart->setText( TimeString::longDateString( m_start ) );
302}
303
304void TaskEditorOverView::slotCompChanged(int y, int m, int d)
305{
306 m_comp.setYMD( y, m, d );
307 btnComp->setText( TimeString::longDateString( m_comp ) );
308}
309
310void TaskEditorOverView::slotDueChanged(int y, int m, int d)
311{
312 m_due.setYMD( y, m, d );
313 btnDue->setText( TimeString::longDateString( m_due ) );
314} 177}
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
@@ -22,71 +22,48 @@
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#ifndef TASKEDITOROVERVIEW_H 29#ifndef TASKEDITOROVERVIEW_H
30#define TASKEDITOROVERVIEW_H 30#define TASKEDITOROVERVIEW_H
31 31
32#include <opie/otodo.h> 32#include <opie/otodo.h>
33 33
34#include <qdatetime.h>
35#include <qpixmap.h> 34#include <qpixmap.h>
36#include <qwidget.h> 35#include <qwidget.h>
37 36
38class CategorySelect; 37class CategorySelect;
39class DateBookMonth;
40class QCheckBox; 38class QCheckBox;
41class QComboBox; 39class QComboBox;
42class QPushButton; 40class QMultiLineEdit;
43 41
44class TaskEditorOverView : public QWidget 42class TaskEditorOverView : public QWidget
45{ 43{
46 Q_OBJECT 44 Q_OBJECT
47 45
48public: 46public:
49 TaskEditorOverView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 47 TaskEditorOverView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
50 ~TaskEditorOverView(); 48 ~TaskEditorOverView();
51 49
52 QComboBox *cmbSum; 50 QComboBox *cmbDesc;
53 QComboBox *cmbPrio; 51 QComboBox *cmbPriority;
54 QComboBox *cmbProgress; 52 CategorySelect *cmbCategory;
55 QCheckBox *ckbDue; 53 QCheckBox *ckbRecurrence;
56 QPushButton *btnDue; 54 QMultiLineEdit *mleNotes;
57 QCheckBox *ckbStart;
58 QPushButton *btnStart;
59 QCheckBox *ckbComp;
60 QPushButton *btnComp;
61 CategorySelect *comboCategory;
62 QCheckBox *CheckBox7;
63 55
64 void load( const OTodo & ); 56 void load( const OTodo & );
65 void save( OTodo & ); 57 void save( OTodo & );
66 58
67signals: 59signals:
68 void recurranceEnabled( bool ); 60 void recurranceEnabled( bool );
69 void dueDateChanged( const QDate& date );
70 61
71protected: 62protected:
72 QPixmap m_pic_priority[ 5 ]; 63 QPixmap m_pic_priority[ 5 ];
73 64
74private:
75 QDate m_start;
76 QDate m_comp;
77 QDate m_due;
78 DateBookMonth *m_startBook;
79 DateBookMonth *m_compBook;
80 DateBookMonth *m_dueBook;
81
82protected slots: 65protected slots:
83 void slotRecClicked(); 66 void slotRecClicked();
84 void slotStartChecked();
85 void slotCompChecked();
86 void slotDueChecked();
87 void slotStartChanged( int, int, int );
88 void slotCompChanged( int, int, int );
89 void slotDueChanged( int, int, int );
90}; 67};
91 68
92#endif // TASKEDITOROVERVIEW_H 69#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
@@ -9,45 +9,45 @@ HEADERS = smalltodo.h \
9 tableview.h \ 9 tableview.h \
10 todotemplatemanager.h \ 10 todotemplatemanager.h \
11 todoeditor.h \ 11 todoeditor.h \
12 todoshow.h \ 12 todoshow.h \
13 textviewshow.h \ 13 textviewshow.h \
14 templateeditor.h \ 14 templateeditor.h \
15 templatedialog.h \ 15 templatedialog.h \
16 templatedialogimpl.h \ 16 templatedialogimpl.h \
17 quickedit.h \ 17 quickedit.h \
18 quickeditimpl.h \ 18 quickeditimpl.h \
19 otaskeditor.h \ 19 otaskeditor.h \
20 taskeditoroverview.h \ 20 taskeditoroverview.h \
21 taskeditoradvanced.h \ 21 taskeditorstatus.h \
22 taskeditoralarms.h 22 taskeditoralarms.h
23 23
24 SOURCES= smalltodo.cpp \ 24 SOURCES= smalltodo.cpp \
25 todomanager.cpp \ 25 todomanager.cpp \
26 mainwindow.cpp \ 26 mainwindow.cpp \
27 main.cpp \ 27 main.cpp \
28 tableview.cpp \ 28 tableview.cpp \
29 todoview.cpp \ 29 todoview.cpp \
30 todotemplatemanager.cpp \ 30 todotemplatemanager.cpp \
31 todoeditor.cpp \ 31 todoeditor.cpp \
32 todoshow.cpp \ 32 todoshow.cpp \
33 textviewshow.cpp \ 33 textviewshow.cpp \
34 templateeditor.cpp \ 34 templateeditor.cpp \
35 templatedialog.cpp \ 35 templatedialog.cpp \
36 templatedialogimpl.cpp \ 36 templatedialogimpl.cpp \
37 quickeditimpl.cpp \ 37 quickeditimpl.cpp \
38 quickedit.cpp \ 38 quickedit.cpp \
39 otaskeditor.cpp \ 39 otaskeditor.cpp \
40 taskeditoroverview.cpp \ 40 taskeditoroverview.cpp \
41 taskeditoradvanced.cpp \ 41 taskeditorstatus.cpp \
42 taskeditoralarms.cpp 42 taskeditoralarms.cpp
43 43
44 TARGET = todolist 44 TARGET = todolist
45INCLUDEPATH += $(OPIEDIR)/include 45INCLUDEPATH += $(OPIEDIR)/include
46 DEPENDPATH+= $(OPIEDIR)/include 46 DEPENDPATH+= $(OPIEDIR)/include
47LIBS += -lqpe -lopie 47LIBS += -lqpe -lopie
48 48
49TRANSLATIONS = ../../../i18n/de/todolist.ts \ 49TRANSLATIONS = ../../../i18n/de/todolist.ts \
50 ../../../i18n/da/todolist.ts \ 50 ../../../i18n/da/todolist.ts \
51 ../../../i18n/xx/todolist.ts \ 51 ../../../i18n/xx/todolist.ts \
52 ../../../i18n/en/todolist.ts \ 52 ../../../i18n/en/todolist.ts \
53 ../../../i18n/es/todolist.ts \ 53 ../../../i18n/es/todolist.ts \