summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/todoentry.ui193
-rw-r--r--core/pim/todo/todoentryimpl.cpp9
-rw-r--r--core/pim/todo/todoentryimpl.h2
3 files changed, 128 insertions, 76 deletions
diff --git a/core/pim/todo/todoentry.ui b/core/pim/todo/todoentry.ui
index 5da4bb7..9ffa89b 100644
--- a/core/pim/todo/todoentry.ui
+++ b/core/pim/todo/todoentry.ui
@@ -9,163 +9,206 @@
9** GNU General Public License version 2 as published by the Free Software 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 10** Foundation and appearing in the file LICENSE.GPL included in the
11** packaging of this file. 11** packaging of this file.
12** 12**
13** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 14** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15** 15**
16** See http://www.trolltech.com/gpl/ for GPL licensing information. 16** See http://www.trolltech.com/gpl/ for GPL licensing information.
17** 17**
18** Contact info@trolltech.com if any conditions of this licensing are 18** Contact info@trolltech.com if any conditions of this licensing are
19** not clear to you. 19** not clear to you.
20** 20**
21*********************************************************************</comment> 21*********************************************************************</comment>
22<widget> 22<widget>
23 <class>QDialog</class> 23 <class>QDialog</class>
24 <property stdset="1"> 24 <property stdset="1">
25 <name>name</name> 25 <name>name</name>
26 <cstring>NewTaskDialogBase</cstring> 26 <cstring>NewTaskDialogBase</cstring>
27 </property> 27 </property>
28 <property stdset="1"> 28 <property stdset="1">
29 <name>geometry</name> 29 <name>geometry</name>
30 <rect> 30 <rect>
31 <x>0</x> 31 <x>0</x>
32 <y>0</y> 32 <y>0</y>
33 <width>429</width> 33 <width>425</width>
34 <height>321</height> 34 <height>321</height>
35 </rect> 35 </rect>
36 </property> 36 </property>
37 <property stdset="1"> 37 <property stdset="1">
38 <name>caption</name> 38 <name>caption</name>
39 <string>New Task</string> 39 <string>New Task</string>
40 </property> 40 </property>
41 <property> 41 <property>
42 <name>layoutMargin</name> 42 <name>layoutMargin</name>
43 </property> 43 </property>
44 <property> 44 <property>
45 <name>layoutSpacing</name> 45 <name>layoutSpacing</name>
46 </property> 46 </property>
47 <widget> 47 <widget>
48 <class>QLayoutWidget</class> 48 <class>QLayoutWidget</class>
49 <property stdset="1"> 49 <property stdset="1">
50 <name>name</name> 50 <name>name</name>
51 <cstring>Layout22</cstring> 51 <cstring>Layout31</cstring>
52 </property> 52 </property>
53 <property stdset="1"> 53 <property stdset="1">
54 <name>geometry</name> 54 <name>geometry</name>
55 <rect> 55 <rect>
56 <x>0</x> 56 <x>1</x>
57 <y>5</y> 57 <y>6</y>
58 <width>240</width> 58 <width>240</width>
59 <height>310</height> 59 <height>310</height>
60 </rect> 60 </rect>
61 </property> 61 </property>
62 <grid> 62 <grid>
63 <property stdset="1"> 63 <property stdset="1">
64 <name>margin</name> 64 <name>margin</name>
65 <number>0</number> 65 <number>0</number>
66 </property> 66 </property>
67 <property stdset="1"> 67 <property stdset="1">
68 <name>spacing</name> 68 <name>spacing</name>
69 <number>6</number> 69 <number>6</number>
70 </property> 70 </property>
71 <widget row="3" column="0" > 71 <widget row="2" column="0" >
72 <class>QLayoutWidget</class> 72 <class>QLayoutWidget</class>
73 <property stdset="1"> 73 <property stdset="1">
74 <name>name</name> 74 <name>name</name>
75 <cstring>Layout18</cstring> 75 <cstring>Layout19</cstring>
76 </property> 76 </property>
77 <hbox> 77 <hbox>
78 <property stdset="1"> 78 <property stdset="1">
79 <name>margin</name> 79 <name>margin</name>
80 <number>0</number> 80 <number>0</number>
81 </property> 81 </property>
82 <property stdset="1"> 82 <property stdset="1">
83 <name>spacing</name> 83 <name>spacing</name>
84 <number>6</number> 84 <number>6</number>
85 </property> 85 </property>
86 <widget> 86 <widget>
87 <class>QLabel</class> 87 <class>QLabel</class>
88 <property stdset="1"> 88 <property stdset="1">
89 <name>name</name> 89 <name>name</name>
90 <cstring>TextLabel3</cstring> 90 <cstring>txtProg</cstring>
91 </property>
92 <property stdset="1">
93 <name>frameShape</name>
94 <enum>NoFrame</enum>
95 </property> 91 </property>
96 <property stdset="1"> 92 <property stdset="1">
97 <name>text</name> 93 <name>text</name>
98 <string>Category:</string> 94 <string>Progress:</string>
99 </property> 95 </property>
100 </widget> 96 </widget>
101 <widget> 97 <widget>
102 <class>CategorySelect</class> 98 <class>QComboBox</class>
99 <item>
100 <property>
101 <name>text</name>
102 <string>0%</string>
103 </property>
104 </item>
105 <item>
106 <property>
107 <name>text</name>
108 <string>20%</string>
109 </property>
110 </item>
111 <item>
112 <property>
113 <name>text</name>
114 <string>40%</string>
115 </property>
116 </item>
117 <item>
118 <property>
119 <name>text</name>
120 <string>60%</string>
121 </property>
122 </item>
123 <item>
124 <property>
125 <name>text</name>
126 <string>80%</string>
127 </property>
128 </item>
129 <item>
130 <property>
131 <name>text</name>
132 <string>100%</string>
133 </property>
134 </item>
103 <property stdset="1"> 135 <property stdset="1">
104 <name>name</name> 136 <name>name</name>
105 <cstring>comboCategory</cstring> 137 <cstring>cmbProg</cstring>
106 </property> 138 </property>
107 <property stdset="1"> 139 <property stdset="1">
108 <name>minimumSize</name> 140 <name>maximumSize</name>
109 <size> 141 <size>
110 <width>60</width> 142 <width>45</width>
111 <height>0</height> 143 <height>32767</height>
112 </size> 144 </size>
113 </property> 145 </property>
114 </widget> 146 </widget>
115 </hbox> 147 </hbox>
116 </widget> 148 </widget>
117 <widget row="4" column="0" > 149 <widget row="3" column="0" >
118 <class>QLayoutWidget</class> 150 <class>QLayoutWidget</class>
119 <property stdset="1"> 151 <property stdset="1">
120 <name>name</name> 152 <name>name</name>
121 <cstring>Layout4</cstring> 153 <cstring>Layout18</cstring>
122 </property> 154 </property>
123 <hbox> 155 <hbox>
124 <property stdset="1"> 156 <property stdset="1">
125 <name>margin</name> 157 <name>margin</name>
126 <number>0</number> 158 <number>0</number>
127 </property> 159 </property>
128 <property stdset="1"> 160 <property stdset="1">
129 <name>spacing</name> 161 <name>spacing</name>
130 <number>6</number> 162 <number>6</number>
131 </property> 163 </property>
132 <widget> 164 <widget>
133 <class>QLabel</class> 165 <class>QLabel</class>
134 <property stdset="1"> 166 <property stdset="1">
135 <name>name</name> 167 <name>name</name>
136 <cstring>TextLabel1</cstring> 168 <cstring>TextLabel3</cstring>
169 </property>
170 <property stdset="1">
171 <name>frameShape</name>
172 <enum>NoFrame</enum>
137 </property> 173 </property>
138 <property stdset="1"> 174 <property stdset="1">
139 <name>text</name> 175 <name>text</name>
140 <string>Summary:</string> 176 <string>Category:</string>
141 </property> 177 </property>
142 </widget> 178 </widget>
143 <widget> 179 <widget>
144 <class>QLineEdit</class> 180 <class>CategorySelect</class>
145 <property stdset="1"> 181 <property stdset="1">
146 <name>name</name> 182 <name>name</name>
147 <cstring>lneSum</cstring> 183 <cstring>comboCategory</cstring>
184 </property>
185 <property stdset="1">
186 <name>minimumSize</name>
187 <size>
188 <width>60</width>
189 <height>0</height>
190 </size>
148 </property> 191 </property>
149 </widget> 192 </widget>
150 </hbox> 193 </hbox>
151 </widget> 194 </widget>
152 <widget row="0" column="0" > 195 <widget row="0" column="0" >
153 <class>QLayoutWidget</class> 196 <class>QLayoutWidget</class>
154 <property stdset="1"> 197 <property stdset="1">
155 <name>name</name> 198 <name>name</name>
156 <cstring>Layout20</cstring> 199 <cstring>Layout20</cstring>
157 </property> 200 </property>
158 <hbox> 201 <hbox>
159 <property stdset="1"> 202 <property stdset="1">
160 <name>margin</name> 203 <name>margin</name>
161 <number>0</number> 204 <number>0</number>
162 </property> 205 </property>
163 <property stdset="1"> 206 <property stdset="1">
164 <name>spacing</name> 207 <name>spacing</name>
165 <number>6</number> 208 <number>6</number>
166 </property> 209 </property>
167 <widget> 210 <widget>
168 <class>QLabel</class> 211 <class>QLabel</class>
169 <property stdset="1"> 212 <property stdset="1">
170 <name>name</name> 213 <name>name</name>
171 <cstring>TextLabel2</cstring> 214 <cstring>TextLabel2</cstring>
@@ -204,48 +247,55 @@
204 <item> 247 <item>
205 <property> 248 <property>
206 <name>text</name> 249 <name>text</name>
207 <string>5 - Very Low</string> 250 <string>5 - Very Low</string>
208 </property> 251 </property>
209 </item> 252 </item>
210 <property stdset="1"> 253 <property stdset="1">
211 <name>name</name> 254 <name>name</name>
212 <cstring>comboPriority</cstring> 255 <cstring>comboPriority</cstring>
213 </property> 256 </property>
214 <property stdset="1"> 257 <property stdset="1">
215 <name>sizePolicy</name> 258 <name>sizePolicy</name>
216 <sizepolicy> 259 <sizepolicy>
217 <hsizetype>7</hsizetype> 260 <hsizetype>7</hsizetype>
218 <vsizetype>0</vsizetype> 261 <vsizetype>0</vsizetype>
219 </sizepolicy> 262 </sizepolicy>
220 </property> 263 </property>
221 <property stdset="1"> 264 <property stdset="1">
222 <name>currentItem</name> 265 <name>currentItem</name>
223 <number>2</number> 266 <number>2</number>
224 </property> 267 </property>
225 </widget> 268 </widget>
226 </hbox> 269 </hbox>
227 </widget> 270 </widget>
271 <widget row="5" column="0" >
272 <class>QMultiLineEdit</class>
273 <property stdset="1">
274 <name>name</name>
275 <cstring>txtTodo</cstring>
276 </property>
277 </widget>
228 <widget row="1" column="0" > 278 <widget row="1" column="0" >
229 <class>QLayoutWidget</class> 279 <class>QLayoutWidget</class>
230 <property stdset="1"> 280 <property stdset="1">
231 <name>name</name> 281 <name>name</name>
232 <cstring>Layout21</cstring> 282 <cstring>Layout21</cstring>
233 </property> 283 </property>
234 <hbox> 284 <hbox>
235 <property stdset="1"> 285 <property stdset="1">
236 <name>margin</name> 286 <name>margin</name>
237 <number>0</number> 287 <number>0</number>
238 </property> 288 </property>
239 <property stdset="1"> 289 <property stdset="1">
240 <name>spacing</name> 290 <name>spacing</name>
241 <number>6</number> 291 <number>6</number>
242 </property> 292 </property>
243 <widget> 293 <widget>
244 <class>QCheckBox</class> 294 <class>QCheckBox</class>
245 <property stdset="1"> 295 <property stdset="1">
246 <name>name</name> 296 <name>name</name>
247 <cstring>checkCompleted</cstring> 297 <cstring>checkCompleted</cstring>
248 </property> 298 </property>
249 <property stdset="1"> 299 <property stdset="1">
250 <name>text</name> 300 <name>text</name>
251 <string>&amp;Completed</string> 301 <string>&amp;Completed</string>
@@ -258,145 +308,140 @@
258 <cstring>checkDate</cstring> 308 <cstring>checkDate</cstring>
259 </property> 309 </property>
260 <property stdset="1"> 310 <property stdset="1">
261 <name>text</name> 311 <name>text</name>
262 <string>D&amp;ue</string> 312 <string>D&amp;ue</string>
263 </property> 313 </property>
264 </widget> 314 </widget>
265 <widget> 315 <widget>
266 <class>QPushButton</class> 316 <class>QPushButton</class>
267 <property stdset="1"> 317 <property stdset="1">
268 <name>name</name> 318 <name>name</name>
269 <cstring>buttonDate</cstring> 319 <cstring>buttonDate</cstring>
270 </property> 320 </property>
271 <property stdset="1"> 321 <property stdset="1">
272 <name>enabled</name> 322 <name>enabled</name>
273 <bool>false</bool> 323 <bool>false</bool>
274 </property> 324 </property>
275 <property stdset="1"> 325 <property stdset="1">
276 <name>text</name> 326 <name>text</name>
277 <string>1 Jan 2001</string> 327 <string>1 Jan 2001</string>
278 </property> 328 </property>
279 </widget> 329 </widget>
280 </hbox> 330 </hbox>
281 </widget> 331 </widget>
282 <widget row="2" column="0" > 332 <widget row="4" column="0" >
283 <class>QLayoutWidget</class> 333 <class>QLayoutWidget</class>
284 <property stdset="1"> 334 <property stdset="1">
285 <name>name</name> 335 <name>name</name>
286 <cstring>Layout19</cstring> 336 <cstring>Layout30</cstring>
287 </property> 337 </property>
288 <hbox> 338 <hbox>
289 <property stdset="1"> 339 <property stdset="1">
290 <name>margin</name> 340 <name>margin</name>
291 <number>0</number> 341 <number>0</number>
292 </property> 342 </property>
293 <property stdset="1"> 343 <property stdset="1">
294 <name>spacing</name> 344 <name>spacing</name>
295 <number>6</number> 345 <number>6</number>
296 </property> 346 </property>
297 <widget> 347 <widget>
298 <class>QLabel</class> 348 <class>QLabel</class>
299 <property stdset="1"> 349 <property stdset="1">
300 <name>name</name> 350 <name>name</name>
301 <cstring>txtProg</cstring> 351 <cstring>TextLabel1</cstring>
302 </property> 352 </property>
303 <property stdset="1"> 353 <property stdset="1">
304 <name>text</name> 354 <name>text</name>
305 <string>Progress:</string> 355 <string>Summary:</string>
306 </property> 356 </property>
307 </widget> 357 </widget>
308 <widget> 358 <widget>
309 <class>QComboBox</class> 359 <class>QLineEdit</class>
310 <item>
311 <property>
312 <name>text</name>
313 <string>0%</string>
314 </property>
315 </item>
316 <item>
317 <property>
318 <name>text</name>
319 <string>20%</string>
320 </property>
321 </item>
322 <item>
323 <property>
324 <name>text</name>
325 <string>40%</string>
326 </property>
327 </item>
328 <item>
329 <property>
330 <name>text</name>
331 <string>60%</string>
332 </property>
333 </item>
334 <item>
335 <property>
336 <name>text</name>
337 <string>80%</string>
338 </property>
339 </item>
340 <item>
341 <property>
342 <name>text</name>
343 <string>100%</string>
344 </property>
345 </item>
346 <property stdset="1"> 360 <property stdset="1">
347 <name>name</name> 361 <name>name</name>
348 <cstring>cmbProg</cstring> 362 <cstring>lneSum</cstring>
363 </property>
364 </widget>
365 <widget>
366 <class>OClickableLabel</class>
367 <property stdset="1">
368 <name>name</name>
369 <cstring>lblDown</cstring>
370 </property>
371 <property stdset="1">
372 <name>minimumSize</name>
373 <size>
374 <width>20</width>
375 <height>20</height>
376 </size>
349 </property> 377 </property>
350 <property stdset="1"> 378 <property stdset="1">
351 <name>maximumSize</name> 379 <name>maximumSize</name>
352 <size> 380 <size>
353 <width>45</width> 381 <width>20</width>
354 <height>32767</height> 382 <height>20</height>
355 </size> 383 </size>
356 </property> 384 </property>
357 </widget> 385 </widget>
358 </hbox> 386 </hbox>
359 </widget> 387 </widget>
360 <widget row="5" column="0" >
361 <class>QMultiLineEdit</class>
362 <property stdset="1">
363 <name>name</name>
364 <cstring>txtTodo</cstring>
365 </property>
366 </widget>
367 </grid> 388 </grid>
368 </widget> 389 </widget>
369</widget> 390</widget>
370<customwidgets> 391<customwidgets>
371 <customwidget> 392 <customwidget>
372 <class>CategorySelect</class> 393 <class>CategorySelect</class>
373 <header location="global">qpe/categoryselect.h</header> 394 <header location="global">qpe/categoryselect.h</header>
374 <sizehint> 395 <sizehint>
375 <width>-1</width> 396 <width>-1</width>
376 <height>-1</height> 397 <height>-1</height>
377 </sizehint> 398 </sizehint>
378 <container>0</container> 399 <container>0</container>
379 <sizepolicy> 400 <sizepolicy>
380 <hordata>7</hordata> 401 <hordata>7</hordata>
381 <verdata>1</verdata> 402 <verdata>1</verdata>
382 </sizepolicy> 403 </sizepolicy>
383 <pixmap>image0</pixmap> 404 <pixmap>image0</pixmap>
384 </customwidget> 405 </customwidget>
406 <customwidget>
407 <class>OClickableLabel</class>
408 <header location="global">opie/oclickablelabel.h</header>
409 <sizehint>
410 <width>-1</width>
411 <height>-1</height>
412 </sizehint>
413 <container>0</container>
414 <sizepolicy>
415 <hordata>5</hordata>
416 <verdata>5</verdata>
417 </sizepolicy>
418 <pixmap>image0</pixmap>
419 <signal>clicked()</signal>
420 <signal>toggled(bool)</signal>
421 <slot access="public">slotOn(bool)</slot>
422 </customwidget>
385</customwidgets> 423</customwidgets>
386<images> 424<images>
387 <image> 425 <image>
388 <name>image0</name> 426 <name>image0</name>
389 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> 427 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
390 </image> 428 </image>
391</images> 429</images>
392<connections> 430<connections>
393 <connection> 431 <connection>
394 <sender>checkDate</sender> 432 <sender>checkDate</sender>
395 <signal>toggled(bool)</signal> 433 <signal>toggled(bool)</signal>
396 <receiver>buttonDate</receiver> 434 <receiver>buttonDate</receiver>
397 <slot>setEnabled(bool)</slot> 435 <slot>setEnabled(bool)</slot>
398 </connection> 436 </connection>
437 <connection>
438 <sender>lblDown</sender>
439 <signal>clicked()</signal>
440 <receiver>NewTaskDialogBase</receiver>
441 <slot>slotCopy()</slot>
442 </connection>
399 <slot access="protected">dateChanged( const QString &amp; )</slot> 443 <slot access="protected">dateChanged( const QString &amp; )</slot>
400 <slot access="protected">dateChanged( int, int, int )</slot> 444 <slot access="protected">dateChanged( int, int, int )</slot>
445 <slot access="protected">slotCopy()</slot>
401</connections> 446</connections>
402</UI> 447</UI>
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp
index f8e2f4d..dd01130 100644
--- a/core/pim/todo/todoentryimpl.cpp
+++ b/core/pim/todo/todoentryimpl.cpp
@@ -1,53 +1,55 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** Copyright (C) 2002 zecke 3** Copyright (C) 2002 zecke
4** 4**
5** This file is part of Qtopia Environment. 5** This file is part of Qtopia Environment.
6** 6**
7** This file may be distributed and/or modified under the terms of the 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 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 9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file. 10** packaging of this file.
11** 11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14** 14**
15** See http://www.trolltech.com/gpl/ for GPL licensing information. 15** See http://www.trolltech.com/gpl/ for GPL licensing information.
16** 16**
17** Contact info@trolltech.com if any conditions of this licensing are 17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you. 18** not clear to you.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#include "todoentryimpl.h" 22#include "todoentryimpl.h"
23 23
24#include <opie/oclickablelabel.h>
24#include <opie/todoevent.h> 25#include <opie/todoevent.h>
25#include <opie/tododb.h> 26#include <opie/tododb.h>
26 27
27#include <qpe/categoryselect.h> 28#include <qpe/categoryselect.h>
28#include <qpe/datebookmonth.h> 29#include <qpe/datebookmonth.h>
29#include <qpe/global.h> 30#include <qpe/global.h>
31#include <qpe/resource.h>
30#include <qpe/imageedit.h> 32#include <qpe/imageedit.h>
31#include <qpe/timestring.h> 33#include <qpe/timestring.h>
32#include <qpe/palmtoprecord.h> 34#include <qpe/palmtoprecord.h>
33 35
34#include <qmessagebox.h> 36#include <qmessagebox.h>
35#include <qpopupmenu.h> 37#include <qpopupmenu.h>
36#include <qtoolbutton.h> 38#include <qtoolbutton.h>
37#include <qcombobox.h> 39#include <qcombobox.h>
38#include <qcheckbox.h> 40#include <qcheckbox.h>
39#include <qlineedit.h> 41#include <qlineedit.h>
40#include <qmultilineedit.h> 42#include <qmultilineedit.h>
41#include <qlabel.h> 43#include <qlabel.h>
42#include <qtimer.h> 44#include <qtimer.h>
43#include <qapplication.h> 45#include <qapplication.h>
44 46
45 47
46NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent, 48NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent,
47 const char *name, bool modal, WFlags fl ) 49 const char *name, bool modal, WFlags fl )
48 : NewTaskDialogBase( parent, name, modal, fl ), 50 : NewTaskDialogBase( parent, name, modal, fl ),
49 todo( task ) 51 todo( task )
50{ 52{
51 todo.setCategories( task.allCategories() ); 53 todo.setCategories( task.allCategories() );
52 if ( todo.hasDate() ) 54 if ( todo.hasDate() )
53 date = todo.date(); 55 date = todo.date();
@@ -78,81 +80,86 @@ NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool m
78 : NewTaskDialogBase( parent, name, modal, fl ), 80 : NewTaskDialogBase( parent, name, modal, fl ),
79 date( QDate::currentDate() ) 81 date( QDate::currentDate() )
80{ 82{
81 if ( id != -1 ) { 83 if ( id != -1 ) {
82 QArray<int> ids( 1 ); 84 QArray<int> ids( 1 );
83 ids[0] = id; 85 ids[0] = id;
84 todo.setCategory( Qtopia::Record::idsToString( ids ) ); 86 todo.setCategory( Qtopia::Record::idsToString( ids ) );
85 } 87 }
86 init(); 88 init();
87} 89}
88 90
89void NewTaskDialog::init() 91void NewTaskDialog::init()
90{ 92{
91 QPopupMenu *m1 = new QPopupMenu( this ); 93 QPopupMenu *m1 = new QPopupMenu( this );
92 picker = new DateBookMonth( m1, 0, TRUE ); 94 picker = new DateBookMonth( m1, 0, TRUE );
93 m1->insertItem( picker ); 95 m1->insertItem( picker );
94 buttonDate->setPopup( m1 ); 96 buttonDate->setPopup( m1 );
95 comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") ); 97 comboCategory->setCategories( todo.categories(), "Todo List", tr("Todo List") );
96 98
97 connect( picker, SIGNAL( dateClicked( int, int, int ) ), 99 connect( picker, SIGNAL( dateClicked( int, int, int ) ),
98 this, SLOT( dateChanged( int, int, int ) ) ); 100 this, SLOT( dateChanged( int, int, int ) ) );
99 101
100 buttonDate->setText( TimeString::longDateString( date ) ); 102 buttonDate->setText( TimeString::longDateString( date ) );
101 picker->setDate( date.year(), date.month(), date.day() ); 103 picker->setDate( date.year(), date.month(), date.day() );
104 lblDown->setPixmap(Resource::loadPixmap("down") );
102} 105}
103 106
104/* 107/*
105 * Destroys the object and frees any allocated resources 108 * Destroys the object and frees any allocated resources
106 */ 109 */
107NewTaskDialog::~NewTaskDialog() 110NewTaskDialog::~NewTaskDialog()
108{ 111{
109 // no need to delete child widgets, Qt does it all for us 112 // no need to delete child widgets, Qt does it all for us
110} 113}
111void NewTaskDialog::dateChanged( int y, int m, int d ) 114void NewTaskDialog::dateChanged( int y, int m, int d )
112{ 115{
113 date = QDate( y, m, d ); 116 date = QDate( y, m, d );
114 buttonDate->setText( TimeString::longDateString( date ) ); 117 buttonDate->setText( TimeString::longDateString( date ) );
115} 118}
116 119
117/*! 120/*!
118*/ 121*/
119 122
120ToDoEvent NewTaskDialog::todoEntry() 123ToDoEvent NewTaskDialog::todoEntry()
121{ 124{
122 if( checkDate->isChecked() ){ 125 if( checkDate->isChecked() ){
123 todo.setDate( date ); 126 todo.setDate( date );
124 todo.setHasDate( true ); 127 todo.setHasDate( true );
125 }else{ 128 }else{
126 todo.setHasDate( false ); 129 todo.setHasDate( false );
127 } 130 }
128 if ( comboCategory->currentCategory() != -1 ) { 131 if ( comboCategory->currentCategory() != -1 ) {
129 QArray<int> arr = comboCategory->currentCategories(); 132 QArray<int> arr = comboCategory->currentCategories();
130 QStringList list; 133 QStringList list;
131 list = QStringList::split(";", Qtopia::Record::idsToString( arr )) ; 134 list = QStringList::split(";", Qtopia::Record::idsToString( arr )) ;
132 todo.setCategories( list ); 135 todo.setCategories( list );
133 } 136 }
134 todo.setPriority( comboPriority->currentItem() + 1 ); 137 todo.setPriority( comboPriority->currentItem() + 1 );
135 todo.setCompleted( checkCompleted->isChecked() ); 138 todo.setCompleted( checkCompleted->isChecked() );
136 139
137 todo.setDescription( txtTodo->text() ); 140 todo.setDescription( txtTodo->text() );
138 todo.setSummary( lneSum->text() ); 141 todo.setSummary( lneSum->text() );
139 QString text = cmbProg->currentText(); 142 QString text = cmbProg->currentText();
140 todo.setProgress( text.remove( text.length()-1, 1 ).toUShort() ); 143 todo.setProgress( text.remove( text.length()-1, 1 ).toUShort() );
141 return todo; 144 return todo;
142} 145}
143 146void NewTaskDialog::slotCopy()
147{
148 txtTodo->clear();
149 txtTodo->setText( lneSum->text() );
150}
144 151
145/*! 152/*!
146 153
147*/ 154*/
148 155
149void NewTaskDialog::accept() 156void NewTaskDialog::accept()
150{ 157{
151 QString strText = txtTodo->text(); 158 QString strText = txtTodo->text();
152 if ( strText.isEmpty() ) { 159 if ( strText.isEmpty() ) {
153 // hmm... just decline it then, the user obviously didn't care about it 160 // hmm... just decline it then, the user obviously didn't care about it
154 QDialog::reject(); 161 QDialog::reject();
155 return; 162 return;
156 } 163 }
157 QDialog::accept(); 164 QDialog::accept();
158} 165}
diff --git a/core/pim/todo/todoentryimpl.h b/core/pim/todo/todoentryimpl.h
index 6407eb4..49d1274 100644
--- a/core/pim/todo/todoentryimpl.h
+++ b/core/pim/todo/todoentryimpl.h
@@ -26,36 +26,36 @@
26#include <opie/todoevent.h> 26#include <opie/todoevent.h>
27 27
28#include <qdatetime.h> 28#include <qdatetime.h>
29#include <qpalette.h> 29#include <qpalette.h>
30 30
31class QLabel; 31class QLabel;
32class QTimer; 32class QTimer;
33class DateBookMonth; 33class DateBookMonth;
34 34
35class NewTaskDialog : public NewTaskDialogBase 35class NewTaskDialog : public NewTaskDialogBase
36{ 36{
37 Q_OBJECT 37 Q_OBJECT
38 38
39public: 39public:
40 NewTaskDialog( const ToDoEvent &task, QWidget *parent = 0, const char* name = 0, 40 NewTaskDialog( const ToDoEvent &task, QWidget *parent = 0, const char* name = 0,
41 bool modal = FALSE, WFlags fl = 0 ); 41 bool modal = FALSE, WFlags fl = 0 );
42 NewTaskDialog( int id, QWidget* parent = 0, const char* name = 0, 42 NewTaskDialog( int id, QWidget* parent = 0, const char* name = 0,
43 bool modal = FALSE, WFlags fl = 0 ); 43 bool modal = FALSE, WFlags fl = 0 );
44 ~NewTaskDialog(); 44 ~NewTaskDialog();
45 45
46 ToDoEvent todoEntry(); 46 ToDoEvent todoEntry();
47 47
48protected slots: 48protected slots:
49 void dateChanged( int y, int m, int d ); 49 void dateChanged( int y, int m, int d );
50 50 void slotCopy();
51protected: 51protected:
52 virtual void accept(); 52 virtual void accept();
53 53
54private: 54private:
55 void init(); 55 void init();
56 ToDoEvent todo; 56 ToDoEvent todo;
57 QDate date; 57 QDate date;
58 DateBookMonth *picker; 58 DateBookMonth *picker;
59}; 59};
60 60
61#endif // NEWTASKDIALOG_H 61#endif // NEWTASKDIALOG_H