summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/.cvsignore2
-rw-r--r--core/pim/todo/otaskeditor.cpp8
-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/taskeditoradvanced.ui224
-rw-r--r--core/pim/todo/taskeditoradvancedimpl.cpp63
-rw-r--r--core/pim/todo/taskeditoradvancedimpl.h37
-rw-r--r--core/pim/todo/taskeditoroverview.cpp3
-rw-r--r--core/pim/todo/todo.pro5
10 files changed, 213 insertions, 338 deletions
diff --git a/core/pim/todo/.cvsignore b/core/pim/todo/.cvsignore
index c212d11..77e97da 100644
--- a/core/pim/todo/.cvsignore
+++ b/core/pim/todo/.cvsignore
@@ -2,4 +2,2 @@ Makefile*
2moc_* 2moc_*
3taskeditoradvanced.cpp
4taskeditoradvanced.h
5todoentry.cpp 3todoentry.cpp
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp
index e6ebf60..bde25ef 100644
--- a/core/pim/todo/otaskeditor.cpp
+++ b/core/pim/todo/otaskeditor.cpp
@@ -8,3 +8,3 @@
8#include "taskeditoroverview.h" 8#include "taskeditoroverview.h"
9#include "taskeditoradvancedimpl.h" 9#include "taskeditoradvanced.h"
10#include "taskeditoralarms.h" 10#include "taskeditoralarms.h"
@@ -42,3 +42,3 @@ OTodo OTaskEditor::todo()const{
42 m_overView->save( to ); 42 m_overView->save( to );
43 //m_adv->save( to ); 43 m_adv->save( to );
44 to.setRecurrence( m_rec->recurrence() ); 44 to.setRecurrence( m_rec->recurrence() );
@@ -49,3 +49,3 @@ void OTaskEditor::load(const OTodo& to) {
49 m_overView->load( to ); 49 m_overView->load( to );
50 //m_adv->load( to ); 50 m_adv->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() );
@@ -65,3 +65,3 @@ void OTaskEditor::init() {
65 65
66 m_adv = new TaskEditorAdvancedImpl( m_tab ); 66 m_adv = new TaskEditorAdvanced( m_tab );
67 m_tab->addTab( m_adv, "todo/advanced", tr("Advanced") ); 67 m_tab->addTab( m_adv, "todo/advanced", tr("Advanced") );
diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h
index d13e157..8232886 100644
--- a/core/pim/todo/otaskeditor.h
+++ b/core/pim/todo/otaskeditor.h
@@ -9,3 +9,3 @@
9class TaskEditorOverView; 9class TaskEditorOverView;
10class TaskEditorAdvancedImpl; 10class TaskEditorAdvanced;
11class TaskEditorAlarms; 11class TaskEditorAlarms;
@@ -35,3 +35,3 @@ private:
35 TaskEditorOverView *m_overView; 35 TaskEditorOverView *m_overView;
36 TaskEditorAdvancedImpl *m_adv; 36 TaskEditorAdvanced *m_adv;
37 TaskEditorAlarms *m_alarm; 37 TaskEditorAlarms *m_alarm;
diff --git a/core/pim/todo/taskeditoradvanced.cpp b/core/pim/todo/taskeditoradvanced.cpp
new file mode 100644
index 0000000..a431d47
--- a/dev/null
+++ b/core/pim/todo/taskeditoradvanced.cpp
@@ -0,0 +1,132 @@
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
new file mode 100644
index 0000000..65359e9
--- a/dev/null
+++ b/core/pim/todo/taskeditoradvanced.h
@@ -0,0 +1,73 @@
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/taskeditoradvanced.ui b/core/pim/todo/taskeditoradvanced.ui
deleted file mode 100644
index 3aac216..0000000
--- a/core/pim/todo/taskeditoradvanced.ui
+++ b/dev/null
@@ -1,224 +0,0 @@
1<!DOCTYPE UI><UI>
2<class>TaskEditorAdvanced</class>
3<widget>
4 <class>QWidget</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>TaskEditorAdvanced</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>232</width>
15 <height>307</height>
16 </rect>
17 </property>
18 <property>
19 <name>layoutMargin</name>
20 </property>
21 <property>
22 <name>layoutSpacing</name>
23 </property>
24 <grid>
25 <property stdset="1">
26 <name>margin</name>
27 <number>8</number>
28 </property>
29 <property stdset="1">
30 <name>spacing</name>
31 <number>6</number>
32 </property>
33 <widget row="0" column="0" >
34 <class>QLayoutWidget</class>
35 <property stdset="1">
36 <name>name</name>
37 <cstring>Layout13</cstring>
38 </property>
39 <hbox>
40 <property stdset="1">
41 <name>margin</name>
42 <number>0</number>
43 </property>
44 <property stdset="1">
45 <name>spacing</name>
46 <number>6</number>
47 </property>
48 <widget>
49 <class>QLabel</class>
50 <property stdset="1">
51 <name>name</name>
52 <cstring>lblState</cstring>
53 </property>
54 <property stdset="1">
55 <name>text</name>
56 <string>State:</string>
57 </property>
58 </widget>
59 <widget>
60 <class>QComboBox</class>
61 <item>
62 <property>
63 <name>text</name>
64 <string>Started</string>
65 </property>
66 </item>
67 <item>
68 <property>
69 <name>text</name>
70 <string>Postponed</string>
71 </property>
72 </item>
73 <item>
74 <property>
75 <name>text</name>
76 <string>Finished</string>
77 </property>
78 </item>
79 <item>
80 <property>
81 <name>text</name>
82 <string>Not started</string>
83 </property>
84 </item>
85 <property stdset="1">
86 <name>name</name>
87 <cstring>cmbState</cstring>
88 </property>
89 </widget>
90 </hbox>
91 </widget>
92 <widget row="2" column="0" >
93 <class>QLayoutWidget</class>
94 <property stdset="1">
95 <name>name</name>
96 <cstring>Layout17</cstring>
97 </property>
98 <hbox>
99 <property stdset="1">
100 <name>margin</name>
101 <number>0</number>
102 </property>
103 <property stdset="1">
104 <name>spacing</name>
105 <number>6</number>
106 </property>
107 <widget>
108 <class>QLabel</class>
109 <property stdset="1">
110 <name>name</name>
111 <cstring>lblMaintainer</cstring>
112 </property>
113 <property stdset="1">
114 <name>text</name>
115 <string>Maintainer</string>
116 </property>
117 </widget>
118 <widget>
119 <class>QLabel</class>
120 <property stdset="1">
121 <name>name</name>
122 <cstring>txtMaintainer</cstring>
123 </property>
124 <property stdset="1">
125 <name>text</name>
126 <string>test</string>
127 </property>
128 <property stdset="1">
129 <name>textFormat</name>
130 <enum>RichText</enum>
131 </property>
132 </widget>
133 <widget>
134 <class>QLayoutWidget</class>
135 <property stdset="1">
136 <name>name</name>
137 <cstring>Layout16</cstring>
138 </property>
139 <vbox>
140 <property stdset="1">
141 <name>margin</name>
142 <number>0</number>
143 </property>
144 <property stdset="1">
145 <name>spacing</name>
146 <number>6</number>
147 </property>
148 <widget>
149 <class>QToolButton</class>
150 <property stdset="1">
151 <name>name</name>
152 <cstring>tbtMaintainer</cstring>
153 </property>
154 <property stdset="1">
155 <name>text</name>
156 <string>...</string>
157 </property>
158 </widget>
159 </vbox>
160 </widget>
161 </hbox>
162 </widget>
163 <widget row="1" column="0" >
164 <class>QLayoutWidget</class>
165 <property stdset="1">
166 <name>name</name>
167 <cstring>Layout4</cstring>
168 </property>
169 <hbox>
170 <property stdset="1">
171 <name>margin</name>
172 <number>0</number>
173 </property>
174 <property stdset="1">
175 <name>spacing</name>
176 <number>6</number>
177 </property>
178 <widget>
179 <class>QLabel</class>
180 <property stdset="1">
181 <name>name</name>
182 <cstring>txtMode</cstring>
183 </property>
184 <property stdset="1">
185 <name>text</name>
186 <string>Maintain Mode:</string>
187 </property>
188 </widget>
189 <widget>
190 <class>QComboBox</class>
191 <item>
192 <property>
193 <name>text</name>
194 <string>Nothing</string>
195 </property>
196 </item>
197 <item>
198 <property>
199 <name>text</name>
200 <string>Responsible</string>
201 </property>
202 </item>
203 <item>
204 <property>
205 <name>text</name>
206 <string>Done By</string>
207 </property>
208 </item>
209 <item>
210 <property>
211 <name>text</name>
212 <string>Coordinating</string>
213 </property>
214 </item>
215 <property stdset="1">
216 <name>name</name>
217 <cstring>cmbMode</cstring>
218 </property>
219 </widget>
220 </hbox>
221 </widget>
222 </grid>
223</widget>
224</UI>
diff --git a/core/pim/todo/taskeditoradvancedimpl.cpp b/core/pim/todo/taskeditoradvancedimpl.cpp
deleted file mode 100644
index 89f672c..0000000
--- a/core/pim/todo/taskeditoradvancedimpl.cpp
+++ b/dev/null
@@ -1,63 +0,0 @@
1#include <qmultilineedit.h>
2#include <qcombobox.h>
3#include <qlabel.h>
4#include <qlayout.h>
5
6
7#include <opie/otodo.h>
8#include <opie/opimmaintainer.h>
9#include <opie/opimstate.h>
10
11#include "taskeditoradvancedimpl.h"
12
13
14TaskEditorAdvancedImpl::TaskEditorAdvancedImpl( QWidget* parent, const char* name )
15 : TaskEditorAdvanced( parent, name ) {
16 initUI();
17}
18TaskEditorAdvancedImpl::~TaskEditorAdvancedImpl() {
19}
20void TaskEditorAdvancedImpl::load( const OTodo& todo) {
21 m_edit->setText( todo.description() );
22
23 /* OPimState */
24 int state = todo.state().state();
25
26 /* defualt to not started */
27 if ( state == OPimState::Undefined )
28 state = OPimState::NotStarted;
29
30 cmbState->setCurrentItem( state );
31
32 /* Maintainer Mode */
33 state = todo.maintainer().mode();
34 if ( state == OPimMaintainer::Undefined )
35 state = OPimMaintainer::Nothing;
36
37 cmbMode->setCurrentItem( state );
38
39}
40void TaskEditorAdvancedImpl::save( OTodo& todo) {
41 todo.setDescription( m_edit->text() );
42 todo.setState( OPimState( cmbState->currentItem() ) );
43
44 /* Fix me resolve name to uid.....*/
45 todo.setMaintainer( OPimMaintainer( cmbMode->currentItem(), -10 ) );
46 qWarning("save");
47}
48/*
49 * int the damn UI
50 */
51void TaskEditorAdvancedImpl::initUI() {
52 /* a MultiLineEdit */
53 m_edit = new QMultiLineEdit( this );
54 m_edit->setWordWrap( QMultiLineEdit::WidgetWidth );
55
56 /* a Label */
57 QLabel* lbl = new QLabel(this );
58 lbl->setText( tr("Description") );
59
60 /* add it to the QGridLayout of our base class */
61 static_cast<QGridLayout*>(layout() )->addWidget( lbl , 3, 0 );
62 static_cast<QGridLayout*>(layout() )->addWidget( m_edit, 4, 0 );
63}
diff --git a/core/pim/todo/taskeditoradvancedimpl.h b/core/pim/todo/taskeditoradvancedimpl.h
deleted file mode 100644
index 215d8cb..0000000
--- a/core/pim/todo/taskeditoradvancedimpl.h
+++ b/dev/null
@@ -1,37 +0,0 @@
1#ifndef OPIE_TASK_EDITOR_ADVANCED_IMPL_H
2#define OPIE_TASK_EDITOR_ADVANCED_IMPL_H
3
4#include "taskeditoradvanced.h"
5
6/**
7 * This is the implementation of the Opie Task Editor Advanced tab
8 * it features the State!
9 * MaintainerMode
10 * Description
11 */
12class QMultiLineEdit;
13class OTodo;
14class TaskEditorAdvancedImpl : public TaskEditorAdvanced {
15 Q_OBJECT
16public:
17 TaskEditorAdvancedImpl( QWidget* parent = 0, const char* name = 0 );
18 ~TaskEditorAdvancedImpl();
19
20 /*
21 * I could have a struct which returns a QWidget*
22 * load and save to a OTodo
23 * and use multiple inheretence with all other widgets
24 * and then simply iterate over the list of structs
25 * this way I could easily have plugins for the whole editor....
26 * but I do not do it -zecke
27 */
28 void load( const OTodo& );
29 void save( OTodo& );
30
31private:
32 void initUI();
33 QMultiLineEdit* m_edit;
34};
35
36
37#endif
diff --git a/core/pim/todo/taskeditoroverview.cpp b/core/pim/todo/taskeditoroverview.cpp
index 9aab76a..6906c26 100644
--- a/core/pim/todo/taskeditoroverview.cpp
+++ b/core/pim/todo/taskeditoroverview.cpp
@@ -42,4 +42,2 @@
42#include <qpushbutton.h> 42#include <qpushbutton.h>
43#include <qtooltip.h>
44#include <qvariant.h>
45#include <qwhatsthis.h> 43#include <qwhatsthis.h>
@@ -63,3 +61,2 @@ TaskEditorOverView::TaskEditorOverView( QWidget* parent, const char* name, WFla
63 61
64 // TODO - add QScrollView for contents
65 QVBoxLayout *vb = new QVBoxLayout( this ); 62 QVBoxLayout *vb = new QVBoxLayout( this );
diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro
index 9960c65..697c005 100644
--- a/core/pim/todo/todo.pro
+++ b/core/pim/todo/todo.pro
@@ -20,3 +20,3 @@ HEADERS = smalltodo.h \
20 taskeditoroverview.h \ 20 taskeditoroverview.h \
21 taskeditoradvancedimpl.h \ 21 taskeditoradvanced.h \
22 taskeditoralarms.h 22 taskeditoralarms.h
@@ -40,6 +40,5 @@ SOURCES = smalltodo.cpp \
40 taskeditoroverview.cpp \ 40 taskeditoroverview.cpp \
41 taskeditoradvancedimpl.cpp \ 41 taskeditoradvanced.cpp \
42 taskeditoralarms.cpp 42 taskeditoralarms.cpp
43 43
44 INTERFACES= taskeditoradvanced.ui
45 TARGET = todolist 44 TARGET = todolist