author | zecke <zecke> | 2002-10-21 13:45:10 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-21 13:45:10 (UTC) |
commit | 5e2e1e70e6cc7cadce96e42f83951b87e3f2209e (patch) (unidiff) | |
tree | 6350fbbaf5a4494817a133f46fea44baeb1e3098 /core | |
parent | 2c61d682a74f9ce2a216cf59c33c3dcecf00a213 (diff) | |
download | opie-5e2e1e70e6cc7cadce96e42f83951b87e3f2209e.zip opie-5e2e1e70e6cc7cadce96e42f83951b87e3f2209e.tar.gz opie-5e2e1e70e6cc7cadce96e42f83951b87e3f2209e.tar.bz2 |
Fix a bug where newly added items did not show up in the view
Now we add the Entry to the backend first and then update the view
next step is to make place for the new EditorWidget
It features
Completed/Start Date
State Began, Postponed...
Maintainer Mode: needs to be done by...
Maintainer: Choose a person who is responsible for ( once implemented I hope he master of our feeds is happy )
Recurrance Widget
Alarms + Reminders Widget
Parent to be added
Most of it is not implemented cause first of all OTodo does not know
anything about these attributes but this will change soon.
I'll start to implement it very soon
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 3 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.cpp | 83 | ||||
-rw-r--r-- | core/pim/todo/otaskeditor.h | 37 | ||||
-rw-r--r-- | core/pim/todo/taskeditoradvanced.ui | 222 | ||||
-rw-r--r-- | core/pim/todo/taskeditoralarms.ui | 148 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverview.ui | 542 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverviewimpl.cpp | 169 | ||||
-rw-r--r-- | core/pim/todo/taskeditoroverviewimpl.h | 54 | ||||
-rw-r--r-- | core/pim/todo/todo.pro | 12 | ||||
-rw-r--r-- | core/pim/todo/todoeditor.cpp | 12 | ||||
-rw-r--r-- | core/pim/todo/todoentry.ui | 481 | ||||
-rw-r--r-- | core/pim/todo/todoentryimpl.cpp | 189 | ||||
-rw-r--r-- | core/pim/todo/todoentryimpl.h | 65 |
13 files changed, 1271 insertions, 746 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 8377573..bf9fc23 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -423,14 +423,15 @@ void MainWindow::slotNew() { | |||
423 | 423 | ||
424 | OTodo todo = currentEditor()->newTodo( currentCatId(), | 424 | OTodo todo = currentEditor()->newTodo( currentCatId(), |
425 | this ); | 425 | this ); |
426 | 426 | ||
427 | if ( currentEditor()->accepted() ) { | 427 | if ( currentEditor()->accepted() ) { |
428 | //todo.assignUid(); | 428 | //todo.assignUid(); |
429 | currentView()->addEvent( todo ); | ||
430 | m_todoMgr.add( todo ); | 429 | m_todoMgr.add( todo ); |
430 | currentView()->addEvent( todo ); | ||
431 | |||
431 | 432 | ||
432 | // I'm afraid we must call this every time now, otherwise | 433 | // I'm afraid we must call this every time now, otherwise |
433 | // spend expensive time comparing all these strings... | 434 | // spend expensive time comparing all these strings... |
434 | // but only call if we changed something -zecke | 435 | // but only call if we changed something -zecke |
435 | populateCategories(); | 436 | populateCategories(); |
436 | } | 437 | } |
diff --git a/core/pim/todo/otaskeditor.cpp b/core/pim/todo/otaskeditor.cpp new file mode 100644 index 0000000..e8e922f --- a/dev/null +++ b/core/pim/todo/otaskeditor.cpp | |||
@@ -0,0 +1,83 @@ | |||
1 | #include <qdatetime.h> | ||
2 | #include <qlayout.h> | ||
3 | #include <qlabel.h> | ||
4 | #include <qmultilineedit.h> | ||
5 | |||
6 | #include <opie/orecurrancewidget.h> | ||
7 | |||
8 | #include "taskeditoroverviewimpl.h" | ||
9 | #include "taskeditoradvanced.h" | ||
10 | #include "taskeditoralarms.h" | ||
11 | |||
12 | #include "otaskeditor.h" | ||
13 | |||
14 | OTaskEditor::OTaskEditor(int cur) | ||
15 | : QDialog(0, 0, TRUE ) { | ||
16 | init(); | ||
17 | OTodo to; | ||
18 | to.setCategories( cur ); | ||
19 | load(to); | ||
20 | m_uid = 1; // generate a new one | ||
21 | } | ||
22 | OTaskEditor::OTaskEditor( const OTodo& to) | ||
23 | : QDialog(0, 0, TRUE ) { | ||
24 | init(); | ||
25 | load( to ); | ||
26 | m_uid = to.uid(); | ||
27 | } | ||
28 | OTaskEditor::~OTaskEditor() { | ||
29 | |||
30 | } | ||
31 | OTodo OTaskEditor::todo()const{ | ||
32 | qWarning("saving!"); | ||
33 | OTodo to; | ||
34 | to.setUid(m_uid ); | ||
35 | m_overView->save( to ); | ||
36 | to.setDescription( m_line->text() ); | ||
37 | |||
38 | return to; | ||
39 | } | ||
40 | void OTaskEditor::load(const OTodo& to) { | ||
41 | m_overView->load( to ); | ||
42 | m_line->setText( to.description() ); | ||
43 | } | ||
44 | void OTaskEditor::init() { | ||
45 | QVBoxLayout* lay = new QVBoxLayout(this); | ||
46 | setCaption("Task Editor"); | ||
47 | m_tab = new OTabWidget(this); | ||
48 | |||
49 | /* | ||
50 | * Add the Widgets | ||
51 | */ | ||
52 | m_overView = new TaskEditorOverViewImpl(m_tab ); | ||
53 | m_tab->addTab( m_overView, QString::null, tr("Overview") ); | ||
54 | |||
55 | m_adv = new TaskEditorAdvanced( m_tab ); | ||
56 | m_line = new QMultiLineEdit(m_adv ); | ||
57 | QLabel* label = new QLabel(m_adv ); | ||
58 | label->setText( tr("Description") ); | ||
59 | ((QGridLayout*) m_adv->layout() )->addWidget( label,3, 0 ); | ||
60 | ((QGridLayout*) m_adv->layout())->addWidget( m_line,4,0 ); | ||
61 | m_tab->addTab( m_adv, QString::null, tr("Advanced") ); | ||
62 | |||
63 | m_alarm = new TaskEditorAlarms( m_tab ); | ||
64 | m_tab->addTab( m_alarm, QString::null, tr("Alarms") ); | ||
65 | |||
66 | m_remind = new TaskEditorAlarms( m_tab ); | ||
67 | m_tab->addTab( m_remind, QString::null, tr("Reminders") ); | ||
68 | |||
69 | QLabel* lbl = new QLabel(m_tab ); | ||
70 | lbl->setText( tr("X-Ref") ); | ||
71 | m_tab->addTab( lbl, QString::null, tr("X-Ref") ); | ||
72 | |||
73 | m_rec = new ORecurranceWidget( true, QDate::currentDate(), this ); | ||
74 | m_tab->addTab( m_rec, QString::null, tr("Recurrance") ); | ||
75 | |||
76 | lay->addWidget(m_tab ); | ||
77 | |||
78 | /* signal and slots */ | ||
79 | connect(m_overView, SIGNAL(recurranceEnabled(bool) ), | ||
80 | m_rec, SLOT(setEnabled(bool) ) ); | ||
81 | |||
82 | m_tab->setCurrentTab( m_overView ); | ||
83 | } | ||
diff --git a/core/pim/todo/otaskeditor.h b/core/pim/todo/otaskeditor.h new file mode 100644 index 0000000..5842fdc --- a/dev/null +++ b/core/pim/todo/otaskeditor.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef OPIE_TASK_EDITOR_H | ||
2 | #define OPIE_TASK_EDITOR_H | ||
3 | |||
4 | #include <qdialog.h> | ||
5 | |||
6 | #include <opie/otodo.h> | ||
7 | #include <opie/otabwidget.h> | ||
8 | |||
9 | class TaskEditorOverViewImpl; | ||
10 | class TaskEditorAdvanced; | ||
11 | class TaskEditorAlarms; | ||
12 | class ORecurranceWidget; | ||
13 | class QMultiLineEdit; | ||
14 | class OTaskEditor : public QDialog { | ||
15 | Q_OBJECT | ||
16 | public: | ||
17 | OTaskEditor(int cur); | ||
18 | OTaskEditor( const OTodo& todo ); | ||
19 | ~OTaskEditor(); | ||
20 | |||
21 | OTodo todo()const; | ||
22 | private: | ||
23 | void load( const OTodo& ); | ||
24 | void init(); | ||
25 | |||
26 | OTabWidget *m_tab; | ||
27 | TaskEditorOverViewImpl* m_overView; | ||
28 | TaskEditorAdvanced *m_adv; | ||
29 | TaskEditorAlarms *m_alarm; | ||
30 | TaskEditorAlarms* m_remind; | ||
31 | ORecurranceWidget* m_rec; | ||
32 | QMultiLineEdit* m_line; | ||
33 | int m_uid; | ||
34 | |||
35 | }; | ||
36 | |||
37 | #endif | ||
diff --git a/core/pim/todo/taskeditoradvanced.ui b/core/pim/todo/taskeditoradvanced.ui new file mode 100644 index 0000000..3ea1346 --- a/dev/null +++ b/core/pim/todo/taskeditoradvanced.ui | |||
@@ -0,0 +1,222 @@ | |||
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>236</width> | ||
15 | <height>307</height> | ||
16 | </rect> | ||
17 | </property> | ||
18 | <property stdset="1"> | ||
19 | <name>caption</name> | ||
20 | <string>Form2</string> | ||
21 | </property> | ||
22 | <property> | ||
23 | <name>layoutMargin</name> | ||
24 | </property> | ||
25 | <property> | ||
26 | <name>layoutSpacing</name> | ||
27 | </property> | ||
28 | <grid> | ||
29 | <property stdset="1"> | ||
30 | <name>margin</name> | ||
31 | <number>8</number> | ||
32 | </property> | ||
33 | <property stdset="1"> | ||
34 | <name>spacing</name> | ||
35 | <number>6</number> | ||
36 | </property> | ||
37 | <widget row="0" column="0" > | ||
38 | <class>QLayoutWidget</class> | ||
39 | <property stdset="1"> | ||
40 | <name>name</name> | ||
41 | <cstring>Layout13</cstring> | ||
42 | </property> | ||
43 | <hbox> | ||
44 | <property stdset="1"> | ||
45 | <name>margin</name> | ||
46 | <number>0</number> | ||
47 | </property> | ||
48 | <property stdset="1"> | ||
49 | <name>spacing</name> | ||
50 | <number>6</number> | ||
51 | </property> | ||
52 | <widget> | ||
53 | <class>QLabel</class> | ||
54 | <property stdset="1"> | ||
55 | <name>name</name> | ||
56 | <cstring>lblState</cstring> | ||
57 | </property> | ||
58 | <property stdset="1"> | ||
59 | <name>text</name> | ||
60 | <string>State:</string> | ||
61 | </property> | ||
62 | </widget> | ||
63 | <widget> | ||
64 | <class>QComboBox</class> | ||
65 | <item> | ||
66 | <property> | ||
67 | <name>text</name> | ||
68 | <string>Started</string> | ||
69 | </property> | ||
70 | </item> | ||
71 | <item> | ||
72 | <property> | ||
73 | <name>text</name> | ||
74 | <string>Postponed</string> | ||
75 | </property> | ||
76 | </item> | ||
77 | <item> | ||
78 | <property> | ||
79 | <name>text</name> | ||
80 | <string>Finished</string> | ||
81 | </property> | ||
82 | </item> | ||
83 | <item> | ||
84 | <property> | ||
85 | <name>text</name> | ||
86 | <string>Not started</string> | ||
87 | </property> | ||
88 | </item> | ||
89 | <property stdset="1"> | ||
90 | <name>name</name> | ||
91 | <cstring>cmbState</cstring> | ||
92 | </property> | ||
93 | </widget> | ||
94 | </hbox> | ||
95 | </widget> | ||
96 | <widget row="2" column="0" > | ||
97 | <class>QLayoutWidget</class> | ||
98 | <property stdset="1"> | ||
99 | <name>name</name> | ||
100 | <cstring>Layout17</cstring> | ||
101 | </property> | ||
102 | <hbox> | ||
103 | <property stdset="1"> | ||
104 | <name>margin</name> | ||
105 | <number>0</number> | ||
106 | </property> | ||
107 | <property stdset="1"> | ||
108 | <name>spacing</name> | ||
109 | <number>6</number> | ||
110 | </property> | ||
111 | <widget> | ||
112 | <class>QLabel</class> | ||
113 | <property stdset="1"> | ||
114 | <name>name</name> | ||
115 | <cstring>lblMaintainer</cstring> | ||
116 | </property> | ||
117 | <property stdset="1"> | ||
118 | <name>text</name> | ||
119 | <string>Maintainer</string> | ||
120 | </property> | ||
121 | </widget> | ||
122 | <widget> | ||
123 | <class>QLabel</class> | ||
124 | <property stdset="1"> | ||
125 | <name>name</name> | ||
126 | <cstring>txtMaintainer</cstring> | ||
127 | </property> | ||
128 | <property stdset="1"> | ||
129 | <name>text</name> | ||
130 | <string>test</string> | ||
131 | </property> | ||
132 | <property stdset="1"> | ||
133 | <name>textFormat</name> | ||
134 | <enum>RichText</enum> | ||
135 | </property> | ||
136 | </widget> | ||
137 | <widget> | ||
138 | <class>QLayoutWidget</class> | ||
139 | <property stdset="1"> | ||
140 | <name>name</name> | ||
141 | <cstring>Layout16</cstring> | ||
142 | </property> | ||
143 | <vbox> | ||
144 | <property stdset="1"> | ||
145 | <name>margin</name> | ||
146 | <number>0</number> | ||
147 | </property> | ||
148 | <property stdset="1"> | ||
149 | <name>spacing</name> | ||
150 | <number>6</number> | ||
151 | </property> | ||
152 | <widget> | ||
153 | <class>QToolButton</class> | ||
154 | <property stdset="1"> | ||
155 | <name>name</name> | ||
156 | <cstring>tbtMaintainer</cstring> | ||
157 | </property> | ||
158 | <property stdset="1"> | ||
159 | <name>text</name> | ||
160 | <string>...</string> | ||
161 | </property> | ||
162 | </widget> | ||
163 | </vbox> | ||
164 | </widget> | ||
165 | </hbox> | ||
166 | </widget> | ||
167 | <widget row="1" column="0" > | ||
168 | <class>QLayoutWidget</class> | ||
169 | <property stdset="1"> | ||
170 | <name>name</name> | ||
171 | <cstring>Layout4</cstring> | ||
172 | </property> | ||
173 | <hbox> | ||
174 | <property stdset="1"> | ||
175 | <name>margin</name> | ||
176 | <number>0</number> | ||
177 | </property> | ||
178 | <property stdset="1"> | ||
179 | <name>spacing</name> | ||
180 | <number>6</number> | ||
181 | </property> | ||
182 | <widget> | ||
183 | <class>QLabel</class> | ||
184 | <property stdset="1"> | ||
185 | <name>name</name> | ||
186 | <cstring>txtMode</cstring> | ||
187 | </property> | ||
188 | <property stdset="1"> | ||
189 | <name>text</name> | ||
190 | <string>Maintain Mode:</string> | ||
191 | </property> | ||
192 | </widget> | ||
193 | <widget> | ||
194 | <class>QComboBox</class> | ||
195 | <item> | ||
196 | <property> | ||
197 | <name>text</name> | ||
198 | <string>Responsible</string> | ||
199 | </property> | ||
200 | </item> | ||
201 | <item> | ||
202 | <property> | ||
203 | <name>text</name> | ||
204 | <string>Done By</string> | ||
205 | </property> | ||
206 | </item> | ||
207 | <item> | ||
208 | <property> | ||
209 | <name>text</name> | ||
210 | <string>Coordinating</string> | ||
211 | </property> | ||
212 | </item> | ||
213 | <property stdset="1"> | ||
214 | <name>name</name> | ||
215 | <cstring>cmbMode</cstring> | ||
216 | </property> | ||
217 | </widget> | ||
218 | </hbox> | ||
219 | </widget> | ||
220 | </grid> | ||
221 | </widget> | ||
222 | </UI> | ||
diff --git a/core/pim/todo/taskeditoralarms.ui b/core/pim/todo/taskeditoralarms.ui new file mode 100644 index 0000000..ab21796 --- a/dev/null +++ b/core/pim/todo/taskeditoralarms.ui | |||
@@ -0,0 +1,148 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>TaskEditorAlarms</class> | ||
3 | <author>zecke</author> | ||
4 | <widget> | ||
5 | <class>QWidget</class> | ||
6 | <property stdset="1"> | ||
7 | <name>name</name> | ||
8 | <cstring>TaskEditorAlarms</cstring> | ||
9 | </property> | ||
10 | <property stdset="1"> | ||
11 | <name>geometry</name> | ||
12 | <rect> | ||
13 | <x>0</x> | ||
14 | <y>0</y> | ||
15 | <width>195</width> | ||
16 | <height>271</height> | ||
17 | </rect> | ||
18 | </property> | ||
19 | <property stdset="1"> | ||
20 | <name>caption</name> | ||
21 | <string>Form3</string> | ||
22 | </property> | ||
23 | <property> | ||
24 | <name>layoutMargin</name> | ||
25 | </property> | ||
26 | <grid> | ||
27 | <property stdset="1"> | ||
28 | <name>margin</name> | ||
29 | <number>8</number> | ||
30 | </property> | ||
31 | <property stdset="1"> | ||
32 | <name>spacing</name> | ||
33 | <number>6</number> | ||
34 | </property> | ||
35 | <widget row="0" column="0" > | ||
36 | <class>QLayoutWidget</class> | ||
37 | <property stdset="1"> | ||
38 | <name>name</name> | ||
39 | <cstring>Layout19</cstring> | ||
40 | </property> | ||
41 | <vbox> | ||
42 | <property stdset="1"> | ||
43 | <name>margin</name> | ||
44 | <number>0</number> | ||
45 | </property> | ||
46 | <property stdset="1"> | ||
47 | <name>spacing</name> | ||
48 | <number>6</number> | ||
49 | </property> | ||
50 | <widget> | ||
51 | <class>QLabel</class> | ||
52 | <property stdset="1"> | ||
53 | <name>name</name> | ||
54 | <cstring>txtAlarm</cstring> | ||
55 | </property> | ||
56 | <property stdset="1"> | ||
57 | <name>text</name> | ||
58 | <string>empty</string> | ||
59 | </property> | ||
60 | </widget> | ||
61 | <widget> | ||
62 | <class>QListView</class> | ||
63 | <property stdset="1"> | ||
64 | <name>name</name> | ||
65 | <cstring>lstAlarms</cstring> | ||
66 | </property> | ||
67 | </widget> | ||
68 | </vbox> | ||
69 | </widget> | ||
70 | <widget row="1" column="0" > | ||
71 | <class>QLayoutWidget</class> | ||
72 | <property stdset="1"> | ||
73 | <name>name</name> | ||
74 | <cstring>Layout23</cstring> | ||
75 | </property> | ||
76 | <hbox> | ||
77 | <property stdset="1"> | ||
78 | <name>margin</name> | ||
79 | <number>0</number> | ||
80 | </property> | ||
81 | <property stdset="1"> | ||
82 | <name>spacing</name> | ||
83 | <number>6</number> | ||
84 | </property> | ||
85 | <widget> | ||
86 | <class>QPushButton</class> | ||
87 | <property stdset="1"> | ||
88 | <name>name</name> | ||
89 | <cstring>alAdd</cstring> | ||
90 | </property> | ||
91 | <property stdset="1"> | ||
92 | <name>sizePolicy</name> | ||
93 | <sizepolicy> | ||
94 | <hsizetype>4</hsizetype> | ||
95 | <vsizetype>0</vsizetype> | ||
96 | </sizepolicy> | ||
97 | </property> | ||
98 | <property stdset="1"> | ||
99 | <name>text</name> | ||
100 | <string>&Add</string> | ||
101 | </property> | ||
102 | <property stdset="1"> | ||
103 | <name>autoResize</name> | ||
104 | <bool>true</bool> | ||
105 | </property> | ||
106 | </widget> | ||
107 | <widget> | ||
108 | <class>QPushButton</class> | ||
109 | <property stdset="1"> | ||
110 | <name>name</name> | ||
111 | <cstring>alEdit</cstring> | ||
112 | </property> | ||
113 | <property stdset="1"> | ||
114 | <name>sizePolicy</name> | ||
115 | <sizepolicy> | ||
116 | <hsizetype>4</hsizetype> | ||
117 | <vsizetype>0</vsizetype> | ||
118 | </sizepolicy> | ||
119 | </property> | ||
120 | <property stdset="1"> | ||
121 | <name>text</name> | ||
122 | <string>&Edit</string> | ||
123 | </property> | ||
124 | <property stdset="1"> | ||
125 | <name>autoResize</name> | ||
126 | <bool>true</bool> | ||
127 | </property> | ||
128 | </widget> | ||
129 | <widget> | ||
130 | <class>QPushButton</class> | ||
131 | <property stdset="1"> | ||
132 | <name>name</name> | ||
133 | <cstring>alRemove</cstring> | ||
134 | </property> | ||
135 | <property stdset="1"> | ||
136 | <name>text</name> | ||
137 | <string>&Remove</string> | ||
138 | </property> | ||
139 | <property stdset="1"> | ||
140 | <name>autoResize</name> | ||
141 | <bool>true</bool> | ||
142 | </property> | ||
143 | </widget> | ||
144 | </hbox> | ||
145 | </widget> | ||
146 | </grid> | ||
147 | </widget> | ||
148 | </UI> | ||
diff --git a/core/pim/todo/taskeditoroverview.ui b/core/pim/todo/taskeditoroverview.ui new file mode 100644 index 0000000..a6bf645 --- a/dev/null +++ b/core/pim/todo/taskeditoroverview.ui | |||
@@ -0,0 +1,542 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>TaskEditorOverView</class> | ||
3 | <author>zecke</author> | ||
4 | <widget> | ||
5 | <class>QWidget</class> | ||
6 | <property stdset="1"> | ||
7 | <name>name</name> | ||
8 | <cstring>TaskEditorOverView</cstring> | ||
9 | </property> | ||
10 | <property stdset="1"> | ||
11 | <name>geometry</name> | ||
12 | <rect> | ||
13 | <x>0</x> | ||
14 | <y>0</y> | ||
15 | <width>308</width> | ||
16 | <height>445</height> | ||
17 | </rect> | ||
18 | </property> | ||
19 | <property stdset="1"> | ||
20 | <name>caption</name> | ||
21 | <string>Form1</string> | ||
22 | </property> | ||
23 | <property> | ||
24 | <name>layoutMargin</name> | ||
25 | </property> | ||
26 | <grid> | ||
27 | <property stdset="1"> | ||
28 | <name>margin</name> | ||
29 | <number>4</number> | ||
30 | </property> | ||
31 | <property stdset="1"> | ||
32 | <name>spacing</name> | ||
33 | <number>6</number> | ||
34 | </property> | ||
35 | <widget row="5" column="0" rowspan="1" colspan="2" > | ||
36 | <class>QLayoutWidget</class> | ||
37 | <property stdset="1"> | ||
38 | <name>name</name> | ||
39 | <cstring>Layout11</cstring> | ||
40 | </property> | ||
41 | <hbox> | ||
42 | <property stdset="1"> | ||
43 | <name>margin</name> | ||
44 | <number>0</number> | ||
45 | </property> | ||
46 | <property stdset="1"> | ||
47 | <name>spacing</name> | ||
48 | <number>6</number> | ||
49 | </property> | ||
50 | <widget> | ||
51 | <class>QLabel</class> | ||
52 | <property stdset="1"> | ||
53 | <name>name</name> | ||
54 | <cstring>txtPrio</cstring> | ||
55 | </property> | ||
56 | <property stdset="1"> | ||
57 | <name>text</name> | ||
58 | <string>Priority</string> | ||
59 | </property> | ||
60 | </widget> | ||
61 | <widget> | ||
62 | <class>QComboBox</class> | ||
63 | <item> | ||
64 | <property> | ||
65 | <name>text</name> | ||
66 | <string>1 - Very High</string> | ||
67 | </property> | ||
68 | </item> | ||
69 | <item> | ||
70 | <property> | ||
71 | <name>text</name> | ||
72 | <string>2 - High</string> | ||
73 | </property> | ||
74 | </item> | ||
75 | <item> | ||
76 | <property> | ||
77 | <name>text</name> | ||
78 | <string>3 - Normal</string> | ||
79 | </property> | ||
80 | </item> | ||
81 | <item> | ||
82 | <property> | ||
83 | <name>text</name> | ||
84 | <string>4 - Low</string> | ||
85 | </property> | ||
86 | </item> | ||
87 | <item> | ||
88 | <property> | ||
89 | <name>text</name> | ||
90 | <string>5 - Very Low</string> | ||
91 | </property> | ||
92 | </item> | ||
93 | <property stdset="1"> | ||
94 | <name>name</name> | ||
95 | <cstring>cmbPrio</cstring> | ||
96 | </property> | ||
97 | </widget> | ||
98 | </hbox> | ||
99 | </widget> | ||
100 | <widget row="4" column="0" rowspan="1" colspan="2" > | ||
101 | <class>QLayoutWidget</class> | ||
102 | <property stdset="1"> | ||
103 | <name>name</name> | ||
104 | <cstring>Layout11</cstring> | ||
105 | </property> | ||
106 | <hbox> | ||
107 | <property stdset="1"> | ||
108 | <name>margin</name> | ||
109 | <number>0</number> | ||
110 | </property> | ||
111 | <property stdset="1"> | ||
112 | <name>spacing</name> | ||
113 | <number>6</number> | ||
114 | </property> | ||
115 | <widget> | ||
116 | <class>QLabel</class> | ||
117 | <property stdset="1"> | ||
118 | <name>name</name> | ||
119 | <cstring>txtProgress</cstring> | ||
120 | </property> | ||
121 | <property stdset="1"> | ||
122 | <name>text</name> | ||
123 | <string>Progress</string> | ||
124 | </property> | ||
125 | </widget> | ||
126 | <widget> | ||
127 | <class>QComboBox</class> | ||
128 | <item> | ||
129 | <property> | ||
130 | <name>text</name> | ||
131 | <string>0 %</string> | ||
132 | </property> | ||
133 | </item> | ||
134 | <item> | ||
135 | <property> | ||
136 | <name>text</name> | ||
137 | <string>20 %</string> | ||
138 | </property> | ||
139 | </item> | ||
140 | <item> | ||
141 | <property> | ||
142 | <name>text</name> | ||
143 | <string>40 %</string> | ||
144 | </property> | ||
145 | </item> | ||
146 | <item> | ||
147 | <property> | ||
148 | <name>text</name> | ||
149 | <string>60 %</string> | ||
150 | </property> | ||
151 | </item> | ||
152 | <item> | ||
153 | <property> | ||
154 | <name>text</name> | ||
155 | <string>80 %</string> | ||
156 | </property> | ||
157 | </item> | ||
158 | <item> | ||
159 | <property> | ||
160 | <name>text</name> | ||
161 | <string>100 %</string> | ||
162 | </property> | ||
163 | </item> | ||
164 | <property stdset="1"> | ||
165 | <name>name</name> | ||
166 | <cstring>cmbProgress</cstring> | ||
167 | </property> | ||
168 | </widget> | ||
169 | </hbox> | ||
170 | </widget> | ||
171 | <widget row="2" column="0" rowspan="1" colspan="2" > | ||
172 | <class>QLayoutWidget</class> | ||
173 | <property stdset="1"> | ||
174 | <name>name</name> | ||
175 | <cstring>Layout9</cstring> | ||
176 | </property> | ||
177 | <hbox> | ||
178 | <property stdset="1"> | ||
179 | <name>margin</name> | ||
180 | <number>0</number> | ||
181 | </property> | ||
182 | <property stdset="1"> | ||
183 | <name>spacing</name> | ||
184 | <number>6</number> | ||
185 | </property> | ||
186 | <widget> | ||
187 | <class>QCheckBox</class> | ||
188 | <property stdset="1"> | ||
189 | <name>name</name> | ||
190 | <cstring>ckbDue</cstring> | ||
191 | </property> | ||
192 | <property stdset="1"> | ||
193 | <name>text</name> | ||
194 | <string>Due Date:</string> | ||
195 | </property> | ||
196 | </widget> | ||
197 | <widget> | ||
198 | <class>QPushButton</class> | ||
199 | <property stdset="1"> | ||
200 | <name>name</name> | ||
201 | <cstring>btnDue</cstring> | ||
202 | </property> | ||
203 | <property stdset="1"> | ||
204 | <name>enabled</name> | ||
205 | <bool>false</bool> | ||
206 | </property> | ||
207 | <property stdset="1"> | ||
208 | <name>text</name> | ||
209 | <string>1 Januar 2002</string> | ||
210 | </property> | ||
211 | </widget> | ||
212 | </hbox> | ||
213 | </widget> | ||
214 | <widget row="1" column="0" rowspan="1" colspan="2" > | ||
215 | <class>QLayoutWidget</class> | ||
216 | <property stdset="1"> | ||
217 | <name>name</name> | ||
218 | <cstring>Layout8</cstring> | ||
219 | </property> | ||
220 | <hbox> | ||
221 | <property stdset="1"> | ||
222 | <name>margin</name> | ||
223 | <number>0</number> | ||
224 | </property> | ||
225 | <property stdset="1"> | ||
226 | <name>spacing</name> | ||
227 | <number>6</number> | ||
228 | </property> | ||
229 | <widget> | ||
230 | <class>QCheckBox</class> | ||
231 | <property stdset="1"> | ||
232 | <name>name</name> | ||
233 | <cstring>ckbStart</cstring> | ||
234 | </property> | ||
235 | <property stdset="1"> | ||
236 | <name>text</name> | ||
237 | <string>Start Date:</string> | ||
238 | </property> | ||
239 | </widget> | ||
240 | <widget> | ||
241 | <class>QPushButton</class> | ||
242 | <property stdset="1"> | ||
243 | <name>name</name> | ||
244 | <cstring>btnStart</cstring> | ||
245 | </property> | ||
246 | <property stdset="1"> | ||
247 | <name>enabled</name> | ||
248 | <bool>false</bool> | ||
249 | </property> | ||
250 | <property stdset="1"> | ||
251 | <name>text</name> | ||
252 | <string>1 Januar 2001</string> | ||
253 | </property> | ||
254 | </widget> | ||
255 | </hbox> | ||
256 | </widget> | ||
257 | <widget row="0" column="0" rowspan="1" colspan="2" > | ||
258 | <class>QLayoutWidget</class> | ||
259 | <property stdset="1"> | ||
260 | <name>name</name> | ||
261 | <cstring>Layout7</cstring> | ||
262 | </property> | ||
263 | <hbox> | ||
264 | <property stdset="1"> | ||
265 | <name>margin</name> | ||
266 | <number>0</number> | ||
267 | </property> | ||
268 | <property stdset="1"> | ||
269 | <name>spacing</name> | ||
270 | <number>6</number> | ||
271 | </property> | ||
272 | <widget> | ||
273 | <class>QLabel</class> | ||
274 | <property stdset="1"> | ||
275 | <name>name</name> | ||
276 | <cstring>lblSum</cstring> | ||
277 | </property> | ||
278 | <property stdset="1"> | ||
279 | <name>text</name> | ||
280 | <string>Summary</string> | ||
281 | </property> | ||
282 | </widget> | ||
283 | <widget> | ||
284 | <class>QComboBox</class> | ||
285 | <item> | ||
286 | <property> | ||
287 | <name>text</name> | ||
288 | <string>Complete</string> | ||
289 | </property> | ||
290 | </item> | ||
291 | <item> | ||
292 | <property> | ||
293 | <name>text</name> | ||
294 | <string>work on</string> | ||
295 | </property> | ||
296 | </item> | ||
297 | <item> | ||
298 | <property> | ||
299 | <name>text</name> | ||
300 | <string>buy</string> | ||
301 | </property> | ||
302 | </item> | ||
303 | <item> | ||
304 | <property> | ||
305 | <name>text</name> | ||
306 | <string>organize</string> | ||
307 | </property> | ||
308 | </item> | ||
309 | <item> | ||
310 | <property> | ||
311 | <name>text</name> | ||
312 | <string>get</string> | ||
313 | </property> | ||
314 | </item> | ||
315 | <item> | ||
316 | <property> | ||
317 | <name>text</name> | ||
318 | <string>Update</string> | ||
319 | </property> | ||
320 | </item> | ||
321 | <item> | ||
322 | <property> | ||
323 | <name>text</name> | ||
324 | <string>Create</string> | ||
325 | </property> | ||
326 | </item> | ||
327 | <item> | ||
328 | <property> | ||
329 | <name>text</name> | ||
330 | <string>Plan</string> | ||
331 | </property> | ||
332 | </item> | ||
333 | <item> | ||
334 | <property> | ||
335 | <name>text</name> | ||
336 | <string>Call</string> | ||
337 | </property> | ||
338 | </item> | ||
339 | <item> | ||
340 | <property> | ||
341 | <name>text</name> | ||
342 | <string>Mail</string> | ||
343 | </property> | ||
344 | </item> | ||
345 | <property stdset="1"> | ||
346 | <name>name</name> | ||
347 | <cstring>cmbSum</cstring> | ||
348 | </property> | ||
349 | <property stdset="1"> | ||
350 | <name>editable</name> | ||
351 | <bool>true</bool> | ||
352 | </property> | ||
353 | </widget> | ||
354 | </hbox> | ||
355 | </widget> | ||
356 | <widget row="3" column="0" rowspan="1" colspan="2" > | ||
357 | <class>QLayoutWidget</class> | ||
358 | <property stdset="1"> | ||
359 | <name>name</name> | ||
360 | <cstring>Layout10</cstring> | ||
361 | </property> | ||
362 | <hbox> | ||
363 | <property stdset="1"> | ||
364 | <name>margin</name> | ||
365 | <number>0</number> | ||
366 | </property> | ||
367 | <property stdset="1"> | ||
368 | <name>spacing</name> | ||
369 | <number>6</number> | ||
370 | </property> | ||
371 | <widget> | ||
372 | <class>QCheckBox</class> | ||
373 | <property stdset="1"> | ||
374 | <name>name</name> | ||
375 | <cstring>ckbComp</cstring> | ||
376 | </property> | ||
377 | <property stdset="1"> | ||
378 | <name>enabled</name> | ||
379 | <bool>true</bool> | ||
380 | </property> | ||
381 | <property stdset="1"> | ||
382 | <name>text</name> | ||
383 | <string>Completed Date</string> | ||
384 | </property> | ||
385 | </widget> | ||
386 | <widget> | ||
387 | <class>QPushButton</class> | ||
388 | <property stdset="1"> | ||
389 | <name>name</name> | ||
390 | <cstring>btnComp</cstring> | ||
391 | </property> | ||
392 | <property stdset="1"> | ||
393 | <name>enabled</name> | ||
394 | <bool>false</bool> | ||
395 | </property> | ||
396 | <property stdset="1"> | ||
397 | <name>text</name> | ||
398 | <string>1 Januar 2002</string> | ||
399 | </property> | ||
400 | </widget> | ||
401 | </hbox> | ||
402 | </widget> | ||
403 | <widget row="6" column="0" > | ||
404 | <class>QCheckBox</class> | ||
405 | <property stdset="1"> | ||
406 | <name>name</name> | ||
407 | <cstring>ckbCompleted</cstring> | ||
408 | </property> | ||
409 | <property stdset="1"> | ||
410 | <name>text</name> | ||
411 | <string>Completed</string> | ||
412 | </property> | ||
413 | </widget> | ||
414 | <widget row="7" column="0" rowspan="1" colspan="2" > | ||
415 | <class>QLayoutWidget</class> | ||
416 | <property stdset="1"> | ||
417 | <name>name</name> | ||
418 | <cstring>Layout12</cstring> | ||
419 | </property> | ||
420 | <hbox> | ||
421 | <property stdset="1"> | ||
422 | <name>margin</name> | ||
423 | <number>0</number> | ||
424 | </property> | ||
425 | <property stdset="1"> | ||
426 | <name>spacing</name> | ||
427 | <number>6</number> | ||
428 | </property> | ||
429 | <widget> | ||
430 | <class>QLabel</class> | ||
431 | <property stdset="1"> | ||
432 | <name>name</name> | ||
433 | <cstring>txtCategory</cstring> | ||
434 | </property> | ||
435 | <property stdset="1"> | ||
436 | <name>text</name> | ||
437 | <string>Category</string> | ||
438 | </property> | ||
439 | </widget> | ||
440 | <widget> | ||
441 | <class>CategorySelect</class> | ||
442 | <property stdset="1"> | ||
443 | <name>name</name> | ||
444 | <cstring>comboCategory</cstring> | ||
445 | </property> | ||
446 | <property stdset="1"> | ||
447 | <name>sizePolicy</name> | ||
448 | <sizepolicy> | ||
449 | <hsizetype>7</hsizetype> | ||
450 | <vsizetype>0</vsizetype> | ||
451 | </sizepolicy> | ||
452 | </property> | ||
453 | <property stdset="1"> | ||
454 | <name>minimumSize</name> | ||
455 | <size> | ||
456 | <width>60</width> | ||
457 | <height>20</height> | ||
458 | </size> | ||
459 | </property> | ||
460 | </widget> | ||
461 | </hbox> | ||
462 | </widget> | ||
463 | <widget row="8" column="0" rowspan="1" colspan="2" > | ||
464 | <class>QCheckBox</class> | ||
465 | <property stdset="1"> | ||
466 | <name>name</name> | ||
467 | <cstring>CheckBox7</cstring> | ||
468 | </property> | ||
469 | <property stdset="1"> | ||
470 | <name>text</name> | ||
471 | <string>Enable Recurrance</string> | ||
472 | </property> | ||
473 | </widget> | ||
474 | <spacer row="9" column="1" > | ||
475 | <property> | ||
476 | <name>name</name> | ||
477 | <cstring>Spacer1</cstring> | ||
478 | </property> | ||
479 | <property stdset="1"> | ||
480 | <name>orientation</name> | ||
481 | <enum>Vertical</enum> | ||
482 | </property> | ||
483 | <property stdset="1"> | ||
484 | <name>sizeType</name> | ||
485 | <enum>Expanding</enum> | ||
486 | </property> | ||
487 | <property> | ||
488 | <name>sizeHint</name> | ||
489 | <size> | ||
490 | <width>20</width> | ||
491 | <height>20</height> | ||
492 | </size> | ||
493 | </property> | ||
494 | </spacer> | ||
495 | </grid> | ||
496 | </widget> | ||
497 | <customwidgets> | ||
498 | <customwidget> | ||
499 | <class>CategorySelect</class> | ||
500 | <header location="global">qpe/categoryselect.h</header> | ||
501 | <sizehint> | ||
502 | <width>-1</width> | ||
503 | <height>-1</height> | ||
504 | </sizehint> | ||
505 | <container>0</container> | ||
506 | <sizepolicy> | ||
507 | <hordata>7</hordata> | ||
508 | <verdata>1</verdata> | ||
509 | </sizepolicy> | ||
510 | <pixmap>image0</pixmap> | ||
511 | </customwidget> | ||
512 | </customwidgets> | ||
513 | <images> | ||
514 | <image> | ||
515 | <name>image0</name> | ||
516 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> | ||
517 | </image> | ||
518 | </images> | ||
519 | <connections> | ||
520 | <connection> | ||
521 | <sender>ckbStart</sender> | ||
522 | <signal>clicked()</signal> | ||
523 | <receiver>TaskEditorOverView</receiver> | ||
524 | <slot>slotStartChecked()</slot> | ||
525 | </connection> | ||
526 | <connection> | ||
527 | <sender>ckbDue</sender> | ||
528 | <signal>clicked()</signal> | ||
529 | <receiver>TaskEditorOverView</receiver> | ||
530 | <slot>slotDueChecked()</slot> | ||
531 | </connection> | ||
532 | <connection> | ||
533 | <sender>ckbComp</sender> | ||
534 | <signal>clicked()</signal> | ||
535 | <receiver>TaskEditorOverView</receiver> | ||
536 | <slot>slotCompletedChecked()</slot> | ||
537 | </connection> | ||
538 | <slot access="protected">slotCompletedChecked()</slot> | ||
539 | <slot access="protected">slotDueChecked()</slot> | ||
540 | <slot access="protected">slotStartChecked()</slot> | ||
541 | </connections> | ||
542 | </UI> | ||
diff --git a/core/pim/todo/taskeditoroverviewimpl.cpp b/core/pim/todo/taskeditoroverviewimpl.cpp new file mode 100644 index 0000000..b9b2ae6 --- a/dev/null +++ b/core/pim/todo/taskeditoroverviewimpl.cpp | |||
@@ -0,0 +1,169 @@ | |||
1 | #include <qapplication.h> | ||
2 | #include <qcheckbox.h> | ||
3 | #include <qcombobox.h> | ||
4 | #include <qpopupmenu.h> | ||
5 | |||
6 | #include <qpe/datebookmonth.h> | ||
7 | #include <qpe/categoryselect.h> | ||
8 | #include <qpe/timestring.h> | ||
9 | |||
10 | #include "taskeditoroverviewimpl.h" | ||
11 | |||
12 | /* | ||
13 | * we need to hack | ||
14 | */ | ||
15 | |||
16 | TaskEditorOverViewImpl::TaskEditorOverViewImpl( QWidget* parent, const char* name ) | ||
17 | : TaskEditorOverView( parent, name ) { | ||
18 | init(); | ||
19 | } | ||
20 | TaskEditorOverViewImpl::~TaskEditorOverViewImpl() { | ||
21 | } | ||
22 | void TaskEditorOverViewImpl::load( const OTodo& todo) { | ||
23 | QDate date = QDate::currentDate(); | ||
24 | QString str = TimeString::longDateString( date ); | ||
25 | |||
26 | emit recurranceEnabled( FALSE ); | ||
27 | ckbStart->setChecked( FALSE ); | ||
28 | btnStart->setText( str ); | ||
29 | |||
30 | ckbComp->setChecked( FALSE ); | ||
31 | btnComp->setText( str ); | ||
32 | |||
33 | cmbProgress->setCurrentItem( todo.progress()/20 ); | ||
34 | cmbSum->insertItem( todo.summary(), 0 ); | ||
35 | cmbSum->setCurrentItem( 0 ); | ||
36 | |||
37 | ckbDue->setChecked( todo.hasDueDate() ); | ||
38 | btnDue->setText( TimeString::longDateString( todo.dueDate() ) ); | ||
39 | |||
40 | cmbPrio->setCurrentItem( todo.priority() -1 ); | ||
41 | ckbCompleted->setChecked( todo.isCompleted() ); | ||
42 | |||
43 | comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); | ||
44 | |||
45 | } | ||
46 | void TaskEditorOverViewImpl::save( OTodo& to) { | ||
47 | qWarning("save it now"); | ||
48 | if ( ckbDue->isChecked() ) { | ||
49 | to.setDueDate( m_due ); | ||
50 | to.setHasDueDate( true ); | ||
51 | }else | ||
52 | to.setHasDueDate( false ); | ||
53 | if ( comboCategory->currentCategory() != -1 ) { | ||
54 | QArray<int> arr = comboCategory->currentCategories(); | ||
55 | to.setCategories( arr ); | ||
56 | } | ||
57 | to.setPriority( cmbPrio->currentItem() + 1 ); | ||
58 | to.setCompleted( ckbCompleted->isChecked() ); | ||
59 | to.setSummary( cmbSum->currentText() ); | ||
60 | to.setProgress( cmbProgress->currentItem() * 20 ); | ||
61 | } | ||
62 | /* | ||
63 | * here we will init the basic view | ||
64 | * one Popup for each Date Button | ||
65 | * and some other signal and slots connection | ||
66 | */ | ||
67 | void TaskEditorOverViewImpl::init() { | ||
68 | QDate curDate = QDate::currentDate(); | ||
69 | m_start = m_comp = m_due = curDate; | ||
70 | QString str = TimeString::longDateString( curDate ); | ||
71 | |||
72 | /* Start Date Picker */ | ||
73 | m_startPop = new QPopupMenu(this); | ||
74 | m_startBook = new DateBookMonth(m_startPop, 0, TRUE ); | ||
75 | m_startPop->insertItem( m_startBook ); | ||
76 | connect( m_startBook, SIGNAL( dateClicked(int, int, int) ), | ||
77 | this, SLOT(slotStartChanged(int, int, int) ) ); | ||
78 | |||
79 | |||
80 | /* Due Date Picker */ | ||
81 | m_duePop = new QPopupMenu(this); | ||
82 | m_dueBook = new DateBookMonth(m_duePop, 0, TRUE ); | ||
83 | m_duePop->insertItem( m_dueBook ); | ||
84 | connect( m_dueBook, SIGNAL( dateClicked(int, int, int) ), | ||
85 | this, SLOT(slotDueChanged(int, int, int) ) ); | ||
86 | |||
87 | m_compPop = new QPopupMenu(this); | ||
88 | m_compBook = new DateBookMonth(m_compPop, 0, TRUE ); | ||
89 | m_compPop->insertItem(m_compBook ); | ||
90 | connect( m_compBook, SIGNAL(dateClicked(int, int, int) ), | ||
91 | this, SLOT(slotCompletedChanged(int, int, int) ) ); | ||
92 | |||
93 | |||
94 | /* | ||
95 | * another part of the hack | ||
96 | * it's deprecated in Qt2 but | ||
97 | * still available in my qt-copy of Qt3.1beta2 | ||
98 | */ | ||
99 | btnDue->setIsMenuButton( TRUE ); | ||
100 | btnStart->setIsMenuButton( TRUE ); | ||
101 | btnComp->setIsMenuButton( TRUE ); | ||
102 | |||
103 | /* now connect the hack */ | ||
104 | connect(btnDue, SIGNAL(clicked() ), | ||
105 | this, SLOT(hackySlotHack2() ) ); | ||
106 | connect(btnStart, SIGNAL(clicked() ), | ||
107 | this, SLOT(hackySlotHack1() ) ); | ||
108 | connect(btnComp, SIGNAL(clicked() ), | ||
109 | this, SLOT(hackySlotHack3() ) ); | ||
110 | |||
111 | /* recurrance */ | ||
112 | connect(CheckBox7, SIGNAL(clicked() ), | ||
113 | this, SLOT(slotRecClicked() ) ); | ||
114 | } | ||
115 | |||
116 | void TaskEditorOverViewImpl::slotStartChecked() { | ||
117 | qWarning("slotStartChecked"); | ||
118 | btnStart->setEnabled( ckbStart->isChecked() ); | ||
119 | } | ||
120 | void TaskEditorOverViewImpl::slotStartChanged(int y, int m, int d) { | ||
121 | m_start.setYMD( y, m, d ); | ||
122 | btnStart->setText( TimeString::longDateString( m_start ) ); | ||
123 | } | ||
124 | void TaskEditorOverViewImpl::slotDueChecked() { | ||
125 | btnDue->setEnabled( ckbDue->isChecked() ); | ||
126 | qWarning("slotDueChecked"); | ||
127 | } | ||
128 | void TaskEditorOverViewImpl::slotDueChanged(int y, int m, int d ) { | ||
129 | m_due.setYMD(y, m, d ); | ||
130 | btnDue->setText( TimeString::longDateString( m_due ) ); | ||
131 | } | ||
132 | void TaskEditorOverViewImpl::slotCompletedChecked() { | ||
133 | btnComp->setEnabled( ckbComp->isChecked() ); | ||
134 | qWarning("slotCompletedChecked"); | ||
135 | } | ||
136 | void TaskEditorOverViewImpl::slotCompletedChanged(int y, int m, int d) { | ||
137 | m_comp.setYMD( y, m, d ); | ||
138 | btnComp->setText( TimeString::longDateString( m_comp ) ); | ||
139 | } | ||
140 | /* | ||
141 | * called by a button pressed event... | ||
142 | * three slots to avoid ugly name() tests | ||
143 | * to sender() | ||
144 | */ | ||
145 | void TaskEditorOverViewImpl::hackySlotHack1() { | ||
146 | btnStart->setDown( FALSE ); | ||
147 | popup( btnStart, m_startPop ); | ||
148 | } | ||
149 | void TaskEditorOverViewImpl::hackySlotHack2() { | ||
150 | btnDue->setDown( FALSE ); | ||
151 | popup( btnDue, m_duePop ); | ||
152 | } | ||
153 | void TaskEditorOverViewImpl::hackySlotHack3() { | ||
154 | btnComp->setDown( FALSE ); | ||
155 | popup( btnComp, m_compPop ); | ||
156 | } | ||
157 | void TaskEditorOverViewImpl::slotRecClicked() { | ||
158 | qWarning("enabled recurrance"); | ||
159 | emit recurranceEnabled( CheckBox7->isChecked() ); | ||
160 | } | ||
161 | /* | ||
162 | * GPL from TT QPushButton code | ||
163 | */ | ||
164 | void TaskEditorOverViewImpl::popup( QPushButton* pu, QPopupMenu* pop) { | ||
165 | if ( pu->mapToGlobal( QPoint(0, pu->rect().bottom() ) ).y() + pop->sizeHint().height() <= qApp->desktop()->height() ) | ||
166 | pop->exec( pu->mapToGlobal( pu->rect().bottomLeft() ) ); | ||
167 | else | ||
168 | pop->exec( pu->mapToGlobal( pu->rect().topLeft() - QPoint(0, pu->sizeHint().height() ) ) ); | ||
169 | } | ||
diff --git a/core/pim/todo/taskeditoroverviewimpl.h b/core/pim/todo/taskeditoroverviewimpl.h new file mode 100644 index 0000000..4fab381 --- a/dev/null +++ b/core/pim/todo/taskeditoroverviewimpl.h | |||
@@ -0,0 +1,54 @@ | |||
1 | #ifndef OPIE_TASK_EDITOR_VIEW_IMPL_H | ||
2 | #define OPIE_TASK_EDITOR_VIEW_IMPL_H | ||
3 | |||
4 | #include <qsize.h> | ||
5 | |||
6 | #include <opie/otodo.h> | ||
7 | |||
8 | #include "taskeditoroverview.h" | ||
9 | |||
10 | class DateBookMonth; | ||
11 | class QPushButton; | ||
12 | class QPopupMenu; | ||
13 | class TaskEditorOverViewImpl : public TaskEditorOverView { | ||
14 | Q_OBJECT | ||
15 | public: | ||
16 | TaskEditorOverViewImpl(QWidget* parent, const char* name = 0); | ||
17 | ~TaskEditorOverViewImpl(); | ||
18 | |||
19 | void load( const OTodo& ); | ||
20 | void save( OTodo& ); | ||
21 | signals: | ||
22 | void recurranceEnabled( bool ); | ||
23 | |||
24 | private: | ||
25 | void init(); | ||
26 | void popup(QPushButton*, QPopupMenu*); | ||
27 | DateBookMonth* m_dueBook; | ||
28 | DateBookMonth* m_startBook; | ||
29 | DateBookMonth* m_compBook; | ||
30 | QDate m_start; | ||
31 | QDate m_comp; | ||
32 | QDate m_due; | ||
33 | QPopupMenu* m_startPop; | ||
34 | QPopupMenu* m_compPop; | ||
35 | QPopupMenu* m_duePop; | ||
36 | bool m_bDue : 1; | ||
37 | |||
38 | private slots: | ||
39 | void slotStartChecked(); | ||
40 | void slotStartChanged(int, int, int ); | ||
41 | void slotDueChecked(); | ||
42 | void slotDueChanged(int, int, int ); | ||
43 | void slotCompletedChecked(); | ||
44 | void slotCompletedChanged(int, int, int ); | ||
45 | |||
46 | void hackySlotHack1(); | ||
47 | void hackySlotHack2(); | ||
48 | void hackySlotHack3(); | ||
49 | |||
50 | void slotRecClicked(); | ||
51 | }; | ||
52 | |||
53 | |||
54 | #endif | ||
diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro index d432e78..8f21416 100644 --- a/core/pim/todo/todo.pro +++ b/core/pim/todo/todo.pro | |||
@@ -3,44 +3,46 @@ CONFIG = qt warn_on release | |||
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | 4 | ||
5 | HEADERS= smalltodo.h \ | 5 | HEADERS= smalltodo.h \ |
6 | todomanager.h \ | 6 | todomanager.h \ |
7 | mainwindow.h \ | 7 | mainwindow.h \ |
8 | todoview.h \ | 8 | todoview.h \ |
9 | todoentryimpl.h \ | ||
10 | tableview.h \ | 9 | tableview.h \ |
11 | tableitems.h \ | 10 | tableitems.h \ |
12 | todotemplatemanager.h \ | 11 | todotemplatemanager.h \ |
13 | todoeditor.h \ | 12 | todoeditor.h \ |
14 | todoshow.h \ | 13 | todoshow.h \ |
15 | textviewshow.h \ | 14 | textviewshow.h \ |
16 | templateeditor.h \ | 15 | templateeditor.h \ |
17 | templatedialog.h \ | 16 | templatedialog.h \ |
18 | templatedialogimpl.h \ | 17 | templatedialogimpl.h \ |
19 | quickedit.h \ | 18 | quickedit.h \ |
20 | quickeditimpl.h | 19 | quickeditimpl.h \ |
20 | otaskeditor.h \ | ||
21 | taskeditoroverviewimpl.h | ||
21 | 22 | ||
22 | SOURCES= smalltodo.cpp \ | 23 | SOURCES= smalltodo.cpp \ |
23 | todomanager.cpp \ | 24 | todomanager.cpp \ |
24 | mainwindow.cpp \ | 25 | mainwindow.cpp \ |
25 | main.cpp \ | 26 | main.cpp \ |
26 | todoentryimpl.cpp \ | ||
27 | tableview.cpp \ | 27 | tableview.cpp \ |
28 | tableitems.cpp \ | 28 | tableitems.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 \ | ||
40 | taskeditoroverviewimpl.cpp | ||
39 | 41 | ||
40 | INTERFACES= todoentry.ui | 42 | INTERFACES= taskeditoradvanced.ui taskeditoralarms.ui taskeditoroverview.ui |
41 | TARGET = todolist | 43 | TARGET = todolist |
42 | INCLUDEPATH += $(OPIEDIR)/include | 44 | INCLUDEPATH += $(OPIEDIR)/include |
43 | DEPENDPATH+= $(OPIEDIR)/include | 45 | DEPENDPATH+= $(OPIEDIR)/include |
44 | LIBS += -lqpe -lopie | 46 | LIBS += -lqpe -lopie |
45 | 47 | ||
46 | TRANSLATIONS = ../../../i18n/de/todolist.ts \ | 48 | TRANSLATIONS = ../../../i18n/de/todolist.ts \ |
diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp index c9ade20..e19ab8d 100644 --- a/core/pim/todo/todoeditor.cpp +++ b/core/pim/todo/todoeditor.cpp | |||
@@ -1,49 +1,51 @@ | |||
1 | 1 | ||
2 | #include "todoentryimpl.h" | 2 | #include "otaskeditor.h" |
3 | #include "todoeditor.h" | 3 | #include "todoeditor.h" |
4 | 4 | ||
5 | using namespace Todo; | 5 | using namespace Todo; |
6 | 6 | ||
7 | Editor::Editor() { | 7 | Editor::Editor() { |
8 | m_accepted = false; | 8 | m_accepted = false; |
9 | } | 9 | } |
10 | Editor::~Editor() { | 10 | Editor::~Editor() { |
11 | } | 11 | } |
12 | OTodo Editor::newTodo( int cur, | 12 | OTodo Editor::newTodo( int cur, |
13 | QWidget* par) { | 13 | QWidget* par) { |
14 | 14 | ||
15 | NewTaskDialog e( cur, par, 0, TRUE ); | 15 | OTaskEditor e( cur); |
16 | 16 | ||
17 | 17 | ||
18 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 18 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
19 | e.showMaximized(); | 19 | e.showMaximized(); |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | int ret = e.exec(); | 22 | int ret = e.exec(); |
23 | if ( QDialog::Accepted == ret ) { | 23 | if ( QDialog::Accepted == ret ) { |
24 | m_accepted = true; | 24 | m_accepted = true; |
25 | }else | 25 | }else |
26 | m_accepted = false; | 26 | m_accepted = false; |
27 | 27 | ||
28 | OTodo ev = e.todoEntry(); | 28 | OTodo ev = e.todo(); |
29 | qWarning("Todo uid"); | ||
30 | qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); | ||
29 | ev.setUid(1); | 31 | ev.setUid(1); |
30 | 32 | ||
31 | return ev; | 33 | return ev; |
32 | } | 34 | } |
33 | OTodo Editor::edit( QWidget *wid, | 35 | OTodo Editor::edit( QWidget *wid, |
34 | const OTodo& todo ) { | 36 | const OTodo& todo ) { |
35 | NewTaskDialog e( todo, wid, 0, TRUE ); | 37 | OTaskEditor e( todo ); |
36 | e.setCaption( QObject::tr( "Edit Task" ) ); | 38 | e.setCaption( QObject::tr( "Edit Task" ) ); |
37 | 39 | ||
38 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 40 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
39 | e.showMaximized(); | 41 | e.showMaximized(); |
40 | #endif | 42 | #endif |
41 | int ret = e.exec(); | 43 | int ret = e.exec(); |
42 | 44 | ||
43 | OTodo ev = e.todoEntry(); | 45 | OTodo ev = e.todo(); |
44 | if ( ret == QDialog::Accepted ) | 46 | if ( ret == QDialog::Accepted ) |
45 | m_accepted = true; | 47 | m_accepted = true; |
46 | else | 48 | else |
47 | m_accepted = false; | 49 | m_accepted = false; |
48 | 50 | ||
49 | return ev; | 51 | return ev; |
diff --git a/core/pim/todo/todoentry.ui b/core/pim/todo/todoentry.ui deleted file mode 100644 index 60547f2..0000000 --- a/core/pim/todo/todoentry.ui +++ b/dev/null | |||
@@ -1,481 +0,0 @@ | |||
1 | <!DOCTYPE UI><UI> | ||
2 | <class>NewTaskDialogBase</class> | ||
3 | <comment>********************************************************************* | ||
4 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
5 | ** | ||
6 | ** This file is part of Qtopia Environment. | ||
7 | ** | ||
8 | ** This file may be distributed and/or modified under the terms of the | ||
9 | ** GNU General Public License version 2 as published by the Free Software | ||
10 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
11 | ** packaging of this file. | ||
12 | ** | ||
13 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
14 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
15 | ** | ||
16 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
17 | ** | ||
18 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
19 | ** not clear to you. | ||
20 | ** | ||
21 | *********************************************************************</comment> | ||
22 | <widget> | ||
23 | <class>QDialog</class> | ||
24 | <property stdset="1"> | ||
25 | <name>name</name> | ||
26 | <cstring>NewTaskDialogBase</cstring> | ||
27 | </property> | ||
28 | <property stdset="1"> | ||
29 | <name>geometry</name> | ||
30 | <rect> | ||
31 | <x>0</x> | ||
32 | <y>0</y> | ||
33 | <width>239</width> | ||
34 | <height>320</height> | ||
35 | </rect> | ||
36 | </property> | ||
37 | <property stdset="1"> | ||
38 | <name>caption</name> | ||
39 | <string>New Task</string> | ||
40 | </property> | ||
41 | <property> | ||
42 | <name>layoutMargin</name> | ||
43 | </property> | ||
44 | <property> | ||
45 | <name>layoutSpacing</name> | ||
46 | </property> | ||
47 | <vbox> | ||
48 | <property stdset="1"> | ||
49 | <name>margin</name> | ||
50 | <number>4</number> | ||
51 | </property> | ||
52 | <property stdset="1"> | ||
53 | <name>spacing</name> | ||
54 | <number>4</number> | ||
55 | </property> | ||
56 | <widget> | ||
57 | <class>QLayoutWidget</class> | ||
58 | <property stdset="1"> | ||
59 | <name>name</name> | ||
60 | <cstring>Layout19</cstring> | ||
61 | </property> | ||
62 | <property> | ||
63 | <name>layoutSpacing</name> | ||
64 | </property> | ||
65 | <grid> | ||
66 | <property stdset="1"> | ||
67 | <name>margin</name> | ||
68 | <number>0</number> | ||
69 | </property> | ||
70 | <property stdset="1"> | ||
71 | <name>spacing</name> | ||
72 | <number>4</number> | ||
73 | </property> | ||
74 | <widget row="3" column="1" > | ||
75 | <class>QLayoutWidget</class> | ||
76 | <property stdset="1"> | ||
77 | <name>name</name> | ||
78 | <cstring>Layout6</cstring> | ||
79 | </property> | ||
80 | <property> | ||
81 | <name>layoutSpacing</name> | ||
82 | </property> | ||
83 | <hbox> | ||
84 | <property stdset="1"> | ||
85 | <name>margin</name> | ||
86 | <number>0</number> | ||
87 | </property> | ||
88 | <property stdset="1"> | ||
89 | <name>spacing</name> | ||
90 | <number>4</number> | ||
91 | </property> | ||
92 | <widget> | ||
93 | <class>QComboBox</class> | ||
94 | <item> | ||
95 | <property> | ||
96 | <name>text</name> | ||
97 | <string>0%</string> | ||
98 | </property> | ||
99 | </item> | ||
100 | <item> | ||
101 | <property> | ||
102 | <name>text</name> | ||
103 | <string>20%</string> | ||
104 | </property> | ||
105 | </item> | ||
106 | <item> | ||
107 | <property> | ||
108 | <name>text</name> | ||
109 | <string>40%</string> | ||
110 | </property> | ||
111 | </item> | ||
112 | <item> | ||
113 | <property> | ||
114 | <name>text</name> | ||
115 | <string>60%</string> | ||
116 | </property> | ||
117 | </item> | ||
118 | <item> | ||
119 | <property> | ||
120 | <name>text</name> | ||
121 | <string>80%</string> | ||
122 | </property> | ||
123 | </item> | ||
124 | <item> | ||
125 | <property> | ||
126 | <name>text</name> | ||
127 | <string>100%</string> | ||
128 | </property> | ||
129 | </item> | ||
130 | <property stdset="1"> | ||
131 | <name>name</name> | ||
132 | <cstring>cmbProg</cstring> | ||
133 | </property> | ||
134 | <property stdset="1"> | ||
135 | <name>sizePolicy</name> | ||
136 | <sizepolicy> | ||
137 | <hsizetype>7</hsizetype> | ||
138 | <vsizetype>0</vsizetype> | ||
139 | </sizepolicy> | ||
140 | </property> | ||
141 | <property stdset="1"> | ||
142 | <name>maximumSize</name> | ||
143 | <size> | ||
144 | <width>32767</width> | ||
145 | <height>32767</height> | ||
146 | </size> | ||
147 | </property> | ||
148 | </widget> | ||
149 | <widget> | ||
150 | <class>QCheckBox</class> | ||
151 | <property stdset="1"> | ||
152 | <name>name</name> | ||
153 | <cstring>checkCompleted</cstring> | ||
154 | </property> | ||
155 | <property stdset="1"> | ||
156 | <name>text</name> | ||
157 | <string>&Completed</string> | ||
158 | </property> | ||
159 | </widget> | ||
160 | </hbox> | ||
161 | </widget> | ||
162 | <widget row="0" column="0" > | ||
163 | <class>QLabel</class> | ||
164 | <property stdset="1"> | ||
165 | <name>name</name> | ||
166 | <cstring>TextLabel2</cstring> | ||
167 | </property> | ||
168 | <property stdset="1"> | ||
169 | <name>text</name> | ||
170 | <string>Priority:</string> | ||
171 | </property> | ||
172 | </widget> | ||
173 | <widget row="4" column="1" > | ||
174 | <class>QPushButton</class> | ||
175 | <property stdset="1"> | ||
176 | <name>name</name> | ||
177 | <cstring>buttonDate</cstring> | ||
178 | </property> | ||
179 | <property stdset="1"> | ||
180 | <name>enabled</name> | ||
181 | <bool>false</bool> | ||
182 | </property> | ||
183 | <property stdset="1"> | ||
184 | <name>text</name> | ||
185 | <string>1 Jan 2001</string> | ||
186 | </property> | ||
187 | </widget> | ||
188 | <widget row="3" column="0" > | ||
189 | <class>QLabel</class> | ||
190 | <property stdset="1"> | ||
191 | <name>name</name> | ||
192 | <cstring>txtProg</cstring> | ||
193 | </property> | ||
194 | <property stdset="1"> | ||
195 | <name>frameShape</name> | ||
196 | <enum>MShape</enum> | ||
197 | </property> | ||
198 | <property stdset="1"> | ||
199 | <name>frameShadow</name> | ||
200 | <enum>MShadow</enum> | ||
201 | </property> | ||
202 | <property stdset="1"> | ||
203 | <name>text</name> | ||
204 | <string>Progress:</string> | ||
205 | </property> | ||
206 | </widget> | ||
207 | <widget row="2" column="1" > | ||
208 | <class>QPushButton</class> | ||
209 | <property stdset="1"> | ||
210 | <name>name</name> | ||
211 | <cstring>selectGroupButton</cstring> | ||
212 | </property> | ||
213 | <property stdset="1"> | ||
214 | <name>text</name> | ||
215 | <string>Select</string> | ||
216 | </property> | ||
217 | </widget> | ||
218 | <widget row="2" column="0" > | ||
219 | <class>QLabel</class> | ||
220 | <property stdset="1"> | ||
221 | <name>name</name> | ||
222 | <cstring>txtProg_2</cstring> | ||
223 | </property> | ||
224 | <property stdset="1"> | ||
225 | <name>frameShape</name> | ||
226 | <enum>MShape</enum> | ||
227 | </property> | ||
228 | <property stdset="1"> | ||
229 | <name>frameShadow</name> | ||
230 | <enum>MShadow</enum> | ||
231 | </property> | ||
232 | <property stdset="1"> | ||
233 | <name>text</name> | ||
234 | <string>Group:</string> | ||
235 | </property> | ||
236 | </widget> | ||
237 | <widget row="4" column="0" > | ||
238 | <class>QCheckBox</class> | ||
239 | <property stdset="1"> | ||
240 | <name>name</name> | ||
241 | <cstring>checkDate</cstring> | ||
242 | </property> | ||
243 | <property stdset="1"> | ||
244 | <name>text</name> | ||
245 | <string>D&ue</string> | ||
246 | </property> | ||
247 | </widget> | ||
248 | <widget row="1" column="1" > | ||
249 | <class>CategorySelect</class> | ||
250 | <property stdset="1"> | ||
251 | <name>name</name> | ||
252 | <cstring>comboCategory</cstring> | ||
253 | </property> | ||
254 | <property stdset="1"> | ||
255 | <name>sizePolicy</name> | ||
256 | <sizepolicy> | ||
257 | <hsizetype>7</hsizetype> | ||
258 | <vsizetype>0</vsizetype> | ||
259 | </sizepolicy> | ||
260 | </property> | ||
261 | <property stdset="1"> | ||
262 | <name>minimumSize</name> | ||
263 | <size> | ||
264 | <width>60</width> | ||
265 | <height>20</height> | ||
266 | </size> | ||
267 | </property> | ||
268 | </widget> | ||
269 | <widget row="0" column="1" > | ||
270 | <class>QComboBox</class> | ||
271 | <item> | ||
272 | <property> | ||
273 | <name>text</name> | ||
274 | <string>1 - Very High</string> | ||
275 | </property> | ||
276 | </item> | ||
277 | <item> | ||
278 | <property> | ||
279 | <name>text</name> | ||
280 | <string>2 - High</string> | ||
281 | </property> | ||
282 | </item> | ||
283 | <item> | ||
284 | <property> | ||
285 | <name>text</name> | ||
286 | <string>3 - Normal</string> | ||
287 | </property> | ||
288 | </item> | ||
289 | <item> | ||
290 | <property> | ||
291 | <name>text</name> | ||
292 | <string>4 - Low</string> | ||
293 | </property> | ||
294 | </item> | ||
295 | <item> | ||
296 | <property> | ||
297 | <name>text</name> | ||
298 | <string>5 - Very Low</string> | ||
299 | </property> | ||
300 | </item> | ||
301 | <property stdset="1"> | ||
302 | <name>name</name> | ||
303 | <cstring>comboPriority</cstring> | ||
304 | </property> | ||
305 | <property stdset="1"> | ||
306 | <name>currentItem</name> | ||
307 | <number>2</number> | ||
308 | </property> | ||
309 | </widget> | ||
310 | <widget row="5" column="0" > | ||
311 | <class>QLabel</class> | ||
312 | <property stdset="1"> | ||
313 | <name>name</name> | ||
314 | <cstring>TextLabel1</cstring> | ||
315 | </property> | ||
316 | <property stdset="1"> | ||
317 | <name>text</name> | ||
318 | <string>Summary:</string> | ||
319 | </property> | ||
320 | </widget> | ||
321 | <widget row="1" column="0" > | ||
322 | <class>QLabel</class> | ||
323 | <property stdset="1"> | ||
324 | <name>name</name> | ||
325 | <cstring>TextLabel3</cstring> | ||
326 | </property> | ||
327 | <property stdset="1"> | ||
328 | <name>frameShape</name> | ||
329 | <enum>NoFrame</enum> | ||
330 | </property> | ||
331 | <property stdset="1"> | ||
332 | <name>text</name> | ||
333 | <string>Category:</string> | ||
334 | </property> | ||
335 | </widget> | ||
336 | <widget row="5" column="1" > | ||
337 | <class>QLayoutWidget</class> | ||
338 | <property stdset="1"> | ||
339 | <name>name</name> | ||
340 | <cstring>Layout8</cstring> | ||
341 | </property> | ||
342 | <property> | ||
343 | <name>layoutSpacing</name> | ||
344 | </property> | ||
345 | <hbox> | ||
346 | <property stdset="1"> | ||
347 | <name>margin</name> | ||
348 | <number>0</number> | ||
349 | </property> | ||
350 | <property stdset="1"> | ||
351 | <name>spacing</name> | ||
352 | <number>4</number> | ||
353 | </property> | ||
354 | <widget> | ||
355 | <class>QLineEdit</class> | ||
356 | <property stdset="1"> | ||
357 | <name>name</name> | ||
358 | <cstring>lneSum</cstring> | ||
359 | </property> | ||
360 | </widget> | ||
361 | <widget> | ||
362 | <class>OClickableLabel</class> | ||
363 | <property stdset="1"> | ||
364 | <name>name</name> | ||
365 | <cstring>lblDown</cstring> | ||
366 | </property> | ||
367 | <property stdset="1"> | ||
368 | <name>sizePolicy</name> | ||
369 | <sizepolicy> | ||
370 | <hsizetype>0</hsizetype> | ||
371 | <vsizetype>0</vsizetype> | ||
372 | </sizepolicy> | ||
373 | </property> | ||
374 | <property stdset="1"> | ||
375 | <name>minimumSize</name> | ||
376 | <size> | ||
377 | <width>20</width> | ||
378 | <height>20</height> | ||
379 | </size> | ||
380 | </property> | ||
381 | <property stdset="1"> | ||
382 | <name>maximumSize</name> | ||
383 | <size> | ||
384 | <width>20</width> | ||
385 | <height>20</height> | ||
386 | </size> | ||
387 | </property> | ||
388 | </widget> | ||
389 | </hbox> | ||
390 | </widget> | ||
391 | </grid> | ||
392 | </widget> | ||
393 | <widget> | ||
394 | <class>QMultiLineEdit</class> | ||
395 | <property stdset="1"> | ||
396 | <name>name</name> | ||
397 | <cstring>txtTodo</cstring> | ||
398 | </property> | ||
399 | <property stdset="1"> | ||
400 | <name>sizePolicy</name> | ||
401 | <sizepolicy> | ||
402 | <hsizetype>7</hsizetype> | ||
403 | <vsizetype>7</vsizetype> | ||
404 | </sizepolicy> | ||
405 | </property> | ||
406 | <property stdset="1"> | ||
407 | <name>wordWrap</name> | ||
408 | <enum>WidgetWidth</enum> | ||
409 | </property> | ||
410 | </widget> | ||
411 | </vbox> | ||
412 | </widget> | ||
413 | <customwidgets> | ||
414 | <customwidget> | ||
415 | <class>CategorySelect</class> | ||
416 | <header location="global">qpe/categoryselect.h</header> | ||
417 | <sizehint> | ||
418 | <width>-1</width> | ||
419 | <height>-1</height> | ||
420 | </sizehint> | ||
421 | <container>0</container> | ||
422 | <sizepolicy> | ||
423 | <hordata>7</hordata> | ||
424 | <verdata>1</verdata> | ||
425 | </sizepolicy> | ||
426 | <pixmap>image0</pixmap> | ||
427 | </customwidget> | ||
428 | <customwidget> | ||
429 | <class>OClickableLabel</class> | ||
430 | <header location="global">opie/oclickablelabel.h</header> | ||
431 | <sizehint> | ||
432 | <width>-1</width> | ||
433 | <height>-1</height> | ||
434 | </sizehint> | ||
435 | <container>0</container> | ||
436 | <sizepolicy> | ||
437 | <hordata>5</hordata> | ||
438 | <verdata>5</verdata> | ||
439 | </sizepolicy> | ||
440 | <pixmap>image0</pixmap> | ||
441 | <signal>clicked()</signal> | ||
442 | <signal>toggled(bool)</signal> | ||
443 | <slot access="public">slotOn(bool)</slot> | ||
444 | </customwidget> | ||
445 | </customwidgets> | ||
446 | <images> | ||
447 | <image> | ||
448 | <name>image0</name> | ||
449 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> | ||
450 | </image> | ||
451 | </images> | ||
452 | <connections> | ||
453 | <connection> | ||
454 | <sender>checkDate</sender> | ||
455 | <signal>toggled(bool)</signal> | ||
456 | <receiver>buttonDate</receiver> | ||
457 | <slot>setEnabled(bool)</slot> | ||
458 | </connection> | ||
459 | <connection> | ||
460 | <sender>lblDown</sender> | ||
461 | <signal>clicked()</signal> | ||
462 | <receiver>NewTaskDialogBase</receiver> | ||
463 | <slot>slotCopy()</slot> | ||
464 | </connection> | ||
465 | <slot access="protected">dateChanged( const QString & )</slot> | ||
466 | <slot access="protected">dateChanged( int, int, int )</slot> | ||
467 | <slot access="protected">slotCopy()</slot> | ||
468 | </connections> | ||
469 | <tabstops> | ||
470 | <tabstop>comboPriority</tabstop> | ||
471 | <tabstop>comboCategory</tabstop> | ||
472 | <tabstop>selectGroupButton</tabstop> | ||
473 | <tabstop>cmbProg</tabstop> | ||
474 | <tabstop>checkCompleted</tabstop> | ||
475 | <tabstop>checkDate</tabstop> | ||
476 | <tabstop>buttonDate</tabstop> | ||
477 | <tabstop>lneSum</tabstop> | ||
478 | <tabstop>lblDown</tabstop> | ||
479 | <tabstop>txtTodo</tabstop> | ||
480 | </tabstops> | ||
481 | </UI> | ||
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp deleted file mode 100644 index 4211ae2..0000000 --- a/core/pim/todo/todoentryimpl.cpp +++ b/dev/null | |||
@@ -1,189 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** Copyright (C) 2002 zecke | ||
4 | ** | ||
5 | ** This file is part of Qtopia Environment. | ||
6 | ** | ||
7 | ** This file may be distributed and/or modified under the terms of the | ||
8 | ** GNU General Public License version 2 as published by the Free Software | ||
9 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
10 | ** packaging of this file. | ||
11 | ** | ||
12 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
14 | ** | ||
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
16 | ** | ||
17 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
18 | ** not clear to you. | ||
19 | ** | ||
20 | **********************************************************************/ | ||
21 | |||
22 | #include "todoentryimpl.h" | ||
23 | |||
24 | #include <opie/oclickablelabel.h> | ||
25 | #include <opie/otodo.h> | ||
26 | |||
27 | #include <qpe/categoryselect.h> | ||
28 | #include <qpe/datebookmonth.h> | ||
29 | #include <qpe/global.h> | ||
30 | #include <qpe/resource.h> | ||
31 | #include <qpe/imageedit.h> | ||
32 | #include <qpe/timestring.h> | ||
33 | #include <qpe/palmtoprecord.h> | ||
34 | |||
35 | #include <qlayout.h> | ||
36 | #include <qmessagebox.h> | ||
37 | #include <qpopupmenu.h> | ||
38 | #include <qtoolbutton.h> | ||
39 | #include <qcombobox.h> | ||
40 | #include <qcheckbox.h> | ||
41 | #include <qlineedit.h> | ||
42 | #include <qmultilineedit.h> | ||
43 | #include <qlabel.h> | ||
44 | #include <qtimer.h> | ||
45 | #include <qapplication.h> | ||
46 | #include <qvaluelist.h> | ||
47 | |||
48 | NewTaskDialog::NewTaskDialog( const OTodo& task, QWidget *parent, | ||
49 | const char *name, bool modal, WFlags fl ) | ||
50 | : NewTaskDialogBase( parent, name, modal, fl ), | ||
51 | todo( task ) | ||
52 | { | ||
53 | todo.setCategories( task.categories() ); | ||
54 | if ( todo.hasDueDate() ) | ||
55 | date = todo.dueDate(); | ||
56 | else | ||
57 | date = QDate::currentDate(); | ||
58 | |||
59 | init(); | ||
60 | comboPriority->setCurrentItem( task.priority() - 1 ); | ||
61 | |||
62 | checkCompleted->setChecked( task.isCompleted() ); | ||
63 | checkDate->setChecked( task.hasDueDate() ); | ||
64 | buttonDate->setText( TimeString::longDateString( date ) ); | ||
65 | |||
66 | txtTodo->setText( task.description() ); | ||
67 | lneSum->setText( task.summary() ); | ||
68 | cmbProg->setCurrentItem( task.progress()/20 ); | ||
69 | } | ||
70 | |||
71 | /* | ||
72 | * Constructs a NewTaskDialog which is a child of 'parent', with the | ||
73 | * name 'name' and widget flags set to 'f' | ||
74 | * | ||
75 | * The dialog will by default be modeless, unless you set 'modal' to | ||
76 | * TRUE to construct a modal dialog. | ||
77 | */ | ||
78 | NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool modal, | ||
79 | WFlags fl ) | ||
80 | : NewTaskDialogBase( parent, name, modal, fl ), | ||
81 | date( QDate::currentDate() ) | ||
82 | { | ||
83 | if ( id != -1 ) | ||
84 | todo.setCategories( id ); | ||
85 | init(); | ||
86 | } | ||
87 | |||
88 | void NewTaskDialog::init() | ||
89 | { | ||
90 | if( layout() != 0 ){ | ||
91 | layout()->setMargin( 2 ); | ||
92 | } | ||
93 | QPopupMenu *m1 = new QPopupMenu( this ); | ||
94 | picker = new DateBookMonth( m1, 0, TRUE ); | ||
95 | m1->insertItem( picker ); | ||
96 | buttonDate->setPopup( m1 ); | ||
97 | comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); | ||
98 | |||
99 | connect( picker, SIGNAL( dateClicked( int, int, int ) ), | ||
100 | this, SLOT( dateChanged( int, int, int ) ) ); | ||
101 | |||
102 | connect ( selectGroupButton, SIGNAL( clicked() ), | ||
103 | this, SLOT( groupButtonClicked () ) ); | ||
104 | |||
105 | buttonDate->setText( TimeString::longDateString( date ) ); | ||
106 | picker->setDate( date.year(), date.month(), date.day() ); | ||
107 | lblDown->setPixmap(Resource::loadPixmap("down") ); | ||
108 | } | ||
109 | |||
110 | /* | ||
111 | * Destroys the object and frees any allocated resources | ||
112 | */ | ||
113 | NewTaskDialog::~NewTaskDialog() | ||
114 | { | ||
115 | // no need to delete child widgets, Qt does it all for us | ||
116 | } | ||
117 | void NewTaskDialog::dateChanged( int y, int m, int d ) | ||
118 | { | ||
119 | date = QDate( y, m, d ); | ||
120 | buttonDate->setText( TimeString::longDateString( date ) ); | ||
121 | } | ||
122 | void NewTaskDialog::groupButtonClicked () | ||
123 | { | ||
124 | /*OContactSelectorDialog cd( this ); | ||
125 | QArray<int> todo_relations = todo.relations ( "addressbook" ); | ||
126 | QValueList<int> selectedContacts; | ||
127 | |||
128 | for ( uint i=0; i < todo_relations.size(); i++ ){ | ||
129 | printf ("old: %d\n", todo_relations[i]); | ||
130 | selectedContacts.append( todo_relations[i] ); | ||
131 | } | ||
132 | cd.setSelected (selectedContacts); | ||
133 | cd.showMaximized(); | ||
134 | if ( cd.exec() == QDialog::Accepted ){ | ||
135 | selectedContacts = cd.selected (); | ||
136 | QValueListIterator<int> it; | ||
137 | todo.clearRelated("addressbook"); | ||
138 | for( it = selectedContacts.begin(); it != selectedContacts.end(); ++it ){ | ||
139 | printf ("Adding: %d\n", (*it)); | ||
140 | todo.addRelated( "addressbook", (*it) ); | ||
141 | } | ||
142 | |||
143 | } | ||
144 | */ | ||
145 | } | ||
146 | |||
147 | OTodo NewTaskDialog::todoEntry() | ||
148 | { | ||
149 | if( checkDate->isChecked() ){ | ||
150 | todo.setDueDate( date ); | ||
151 | todo.setHasDueDate( true ); | ||
152 | }else{ | ||
153 | todo.setHasDueDate( false ); | ||
154 | } | ||
155 | if ( comboCategory->currentCategory() != -1 ) { | ||
156 | QArray<int> arr = comboCategory->currentCategories(); | ||
157 | QStringList list; | ||
158 | todo.setCategories( arr ); | ||
159 | } | ||
160 | todo.setPriority( comboPriority->currentItem() + 1 ); | ||
161 | todo.setCompleted( checkCompleted->isChecked() ); | ||
162 | |||
163 | todo.setDescription( txtTodo->text() ); | ||
164 | todo.setSummary( lneSum->text() ); | ||
165 | QString text = cmbProg->currentText(); | ||
166 | todo.setProgress( text.remove( text.length()-1, 1 ).toUShort() ); | ||
167 | return todo; | ||
168 | } | ||
169 | void NewTaskDialog::slotCopy() | ||
170 | { | ||
171 | txtTodo->clear(); | ||
172 | txtTodo->setText( lneSum->text() ); | ||
173 | } | ||
174 | |||
175 | /*! | ||
176 | |||
177 | */ | ||
178 | |||
179 | void NewTaskDialog::accept() | ||
180 | { | ||
181 | QString strText = txtTodo->text(); | ||
182 | QString strSumm = lneSum->text(); | ||
183 | if ( strSumm.isEmpty() && strText.isEmpty() ) { | ||
184 | // hmm... just decline it then, the user obviously didn't care about it | ||
185 | QDialog::reject(); | ||
186 | return; | ||
187 | } | ||
188 | QDialog::accept(); | ||
189 | } | ||
diff --git a/core/pim/todo/todoentryimpl.h b/core/pim/todo/todoentryimpl.h deleted file mode 100644 index 2dfdd22..0000000 --- a/core/pim/todo/todoentryimpl.h +++ b/dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #ifndef NEWTASKDIALOG_H | ||
22 | #define NEWTASKDIALOG_H | ||
23 | |||
24 | #include "todoentry.h" | ||
25 | |||
26 | #include <opie/otodo.h> | ||
27 | //#include <opie/ocontactselector.h> | ||
28 | |||
29 | #include <qdatetime.h> | ||
30 | #include <qpalette.h> | ||
31 | |||
32 | class QLabel; | ||
33 | class QTimer; | ||
34 | class DateBookMonth; | ||
35 | |||
36 | |||
37 | |||
38 | class NewTaskDialog : public NewTaskDialogBase | ||
39 | { | ||
40 | Q_OBJECT | ||
41 | |||
42 | public: | ||
43 | NewTaskDialog( const OTodo& task, QWidget *parent = 0, const char* name = 0, | ||
44 | bool modal = FALSE, WFlags fl = 0 ); | ||
45 | NewTaskDialog( int id, QWidget* parent = 0, const char* name = 0, | ||
46 | bool modal = FALSE, WFlags fl = 0 ); | ||
47 | ~NewTaskDialog(); | ||
48 | |||
49 | OTodo todoEntry(); | ||
50 | |||
51 | protected slots: | ||
52 | void dateChanged( int y, int m, int d ); | ||
53 | void groupButtonClicked (); | ||
54 | void slotCopy(); | ||
55 | protected: | ||
56 | virtual void accept(); | ||
57 | |||
58 | private: | ||
59 | void init(); | ||
60 | OTodo todo; | ||
61 | QDate date; | ||
62 | DateBookMonth *picker; | ||
63 | }; | ||
64 | |||
65 | #endif // NEWTASKDIALOG_H | ||