-rw-r--r-- | core/pim/todo/otaskeditor.cpp | 22 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.h | 4 | ||||
-rw-r--r-- | core/pim/todo/taskeditoradvanced.cpp | 132 | ||||
-rw-r--r-- | core/pim/todo/taskeditoradvanced.h | 73 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverview.cpp | 285 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverview.h | 35 | ||||
-rw-r--r-- | core/pim/todo/todo.pro | 4 |
7 files changed, 95 insertions, 460 deletions
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp index bde25ef..68b315d 100644 --- a/core/pim/todo/otaskeditor.cpp +++ b/core/pim/todo/otaskeditor.cpp | |||
@@ -1,24 +1,24 @@ | |||
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 | ||
14 | OTaskEditor::OTaskEditor(int cur) | 14 | OTaskEditor::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 | } |
19 | OTaskEditor::OTaskEditor( const OTodo& to) | 19 | OTaskEditor::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 | } |
24 | OTaskEditor::~OTaskEditor() { | 24 | OTaskEditor::~OTaskEditor() { |
@@ -39,16 +39,16 @@ OTodo 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 | } |
48 | void OTaskEditor::load(const OTodo& to) { | 48 | void 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 | } |
53 | void OTaskEditor::init() { | 53 | void OTaskEditor::init() { |
54 | setCaption("Task Editor"); | 54 | setCaption("Task Editor"); |
@@ -60,12 +60,12 @@ void OTaskEditor::init() { | |||
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 | ||
@@ -76,17 +76,17 @@ void OTaskEditor::init() { | |||
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 ); |
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 | |||
@@ -6,9 +6,9 @@ | |||
6 | #include <opie/otodo.h> | 6 | #include <opie/otodo.h> |
7 | #include <opie/otabwidget.h> | 7 | #include <opie/otabwidget.h> |
8 | 8 | ||
9 | class TaskEditorOverView; | 9 | class TaskEditorOverView; |
10 | class TaskEditorAdvanced; | 10 | class TaskEditorStatus; |
11 | class TaskEditorAlarms; | 11 | class TaskEditorAlarms; |
12 | class ORecurranceWidget; | 12 | class ORecurranceWidget; |
13 | class QMultiLineEdit; | 13 | class QMultiLineEdit; |
14 | 14 | ||
@@ -32,9 +32,9 @@ private: | |||
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; |
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 | |||
45 | TaskEditorAdvanced::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 | |||
99 | TaskEditorAdvanced::~TaskEditorAdvanced() | ||
100 | { | ||
101 | } | ||
102 | |||
103 | void 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 | |||
124 | void 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 | |||
34 | class OTodo; | ||
35 | class QComboBox; | ||
36 | class QLabel; | ||
37 | class QMultiLineEdit; | ||
38 | class 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 | */ | ||
46 | class TaskEditorAdvanced : public QWidget | ||
47 | { | ||
48 | Q_OBJECT | ||
49 | |||
50 | public: | ||
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 | |||
@@ -38,9 +38,9 @@ | |||
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 | ||
45 | TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl ) | 45 | TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFlags fl ) |
46 | : QWidget( parent, name, fl ) | 46 | : QWidget( parent, name, fl ) |
@@ -54,12 +54,8 @@ TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFla | |||
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 ); |
@@ -68,247 +64,114 @@ TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFla | |||
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 | ||
176 | TaskEditorOverView::~TaskEditorOverView() | 128 | TaskEditorOverView::~TaskEditorOverView() |
177 | { | 129 | { |
178 | } | 130 | } |
179 | 131 | ||
180 | void TaskEditorOverView::load( const OTodo& todo ) | 132 | void 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 | ||
235 | void TaskEditorOverView::save( OTodo &to ) | 153 | void 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 | ||
278 | void TaskEditorOverView::slotRecClicked() | 174 | void TaskEditorOverView::slotRecClicked() |
279 | { | 175 | { |
280 | emit recurranceEnabled( CheckBox7->isChecked() ); | 176 | emit recurranceEnabled( ckbRecurrence->isChecked() ); |
281 | } | ||
282 | |||
283 | void TaskEditorOverView::slotStartChecked() | ||
284 | { | ||
285 | btnStart->setEnabled( ckbStart->isChecked() ); | ||
286 | } | ||
287 | |||
288 | void TaskEditorOverView::slotCompChecked() | ||
289 | { | ||
290 | btnComp->setEnabled( ckbComp->isChecked() ); | ||
291 | } | ||
292 | |||
293 | void TaskEditorOverView::slotDueChecked() | ||
294 | { | ||
295 | btnDue->setEnabled( ckbDue->isChecked() ); | ||
296 | } | ||
297 | |||
298 | void 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 | |||
304 | void 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 | |||
310 | void 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 | |||
@@ -30,17 +30,15 @@ | |||
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 | ||
38 | class CategorySelect; | 37 | class CategorySelect; |
39 | class DateBookMonth; | ||
40 | class QCheckBox; | 38 | class QCheckBox; |
41 | class QComboBox; | 39 | class QComboBox; |
42 | class QPushButton; | 40 | class QMultiLineEdit; |
43 | 41 | ||
44 | class TaskEditorOverView : public QWidget | 42 | class TaskEditorOverView : public QWidget |
45 | { | 43 | { |
46 | Q_OBJECT | 44 | Q_OBJECT |
@@ -48,45 +46,24 @@ class TaskEditorOverView : public QWidget | |||
48 | public: | 46 | public: |
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 | ||
67 | signals: | 59 | signals: |
68 | void recurranceEnabled( bool ); | 60 | void recurranceEnabled( bool ); |
69 | void dueDateChanged( const QDate& date ); | ||
70 | 61 | ||
71 | protected: | 62 | protected: |
72 | QPixmap m_pic_priority[ 5 ]; | 63 | QPixmap m_pic_priority[ 5 ]; |
73 | 64 | ||
74 | private: | ||
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 | |||
82 | protected slots: | 65 | protected 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 | |||
@@ -17,9 +17,9 @@ HEADERS = smalltodo.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 \ |
@@ -37,9 +37,9 @@ SOURCES = smalltodo.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 |
45 | INCLUDEPATH += $(OPIEDIR)/include | 45 | INCLUDEPATH += $(OPIEDIR)/include |