-rw-r--r-- | core/pim/todo/mainwindow.cpp | 2 | ||||
-rw-r--r-- | core/pim/todo/todoentry.ui | 196 | ||||
-rw-r--r-- | core/pim/todo/todoentryimpl.cpp | 3 | ||||
-rw-r--r-- | core/pim/todo/todotable.cpp | 9 | ||||
-rw-r--r-- | core/pim/todo/todotable.h | 3 |
5 files changed, 142 insertions, 71 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index b7b1da0..1358f1c 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -585,25 +585,25 @@ void TodoWindow::setDocument( const QString &filename ) | |||
585 | static const char * beamfile = "/tmp/obex/todo.vcs"; | 585 | static const char * beamfile = "/tmp/obex/todo.vcs"; |
586 | 586 | ||
587 | void TodoWindow::slotBeam() | 587 | void TodoWindow::slotBeam() |
588 | { | 588 | { |
589 | unlink( beamfile ); // delete if exists | 589 | unlink( beamfile ); // delete if exists |
590 | ToDoEvent c = table->currentEntry(); | 590 | ToDoEvent c = table->currentEntry(); |
591 | mkdir("/tmp/obex/", 0755); | 591 | mkdir("/tmp/obex/", 0755); |
592 | ToDoDB todoDB( beamfile, new ToDoVCalResource() ); | 592 | ToDoDB todoDB( beamfile, new ToDoVCalResource() ); |
593 | todoDB.addEvent( c ); | 593 | todoDB.addEvent( c ); |
594 | todoDB.save(); | 594 | todoDB.save(); |
595 | Ir *ir = new Ir( this ); | 595 | Ir *ir = new Ir( this ); |
596 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 596 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
597 | QString description = c.description(); | 597 | QString description = c.summary(); |
598 | ir->send( beamfile, description, "text/x-vCalendar" ); | 598 | ir->send( beamfile, description, "text/x-vCalendar" ); |
599 | } | 599 | } |
600 | 600 | ||
601 | void TodoWindow::beamDone( Ir *ir ) | 601 | void TodoWindow::beamDone( Ir *ir ) |
602 | { | 602 | { |
603 | delete ir; | 603 | delete ir; |
604 | unlink( beamfile ); | 604 | unlink( beamfile ); |
605 | } | 605 | } |
606 | 606 | ||
607 | void TodoWindow::showDeadline( bool s ) | 607 | void TodoWindow::showDeadline( bool s ) |
608 | { | 608 | { |
609 | table->setPaintingEnabled( false ); | 609 | table->setPaintingEnabled( false ); |
diff --git a/core/pim/todo/todoentry.ui b/core/pim/todo/todoentry.ui index c735e76..87ee68c 100644 --- a/core/pim/todo/todoentry.ui +++ b/core/pim/todo/todoentry.ui | |||
@@ -21,163 +21,153 @@ | |||
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>249</width> | 33 | <width>245</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 | <vbox> | ||
48 | <property stdset="1"> | ||
49 | <name>margin</name> | ||
50 | <number>0</number> | ||
51 | </property> | ||
52 | <property stdset="1"> | ||
53 | <name>spacing</name> | ||
54 | <number>0</number> | ||
55 | </property> | ||
56 | <widget> | 47 | <widget> |
57 | <class>QLayoutWidget</class> | 48 | <class>QLayoutWidget</class> |
58 | <property stdset="1"> | 49 | <property stdset="1"> |
59 | <name>name</name> | 50 | <name>name</name> |
60 | <cstring>Layout4</cstring> | 51 | <cstring>Layout3</cstring> |
52 | </property> | ||
53 | <property stdset="1"> | ||
54 | <name>geometry</name> | ||
55 | <rect> | ||
56 | <x>1</x> | ||
57 | <y>25</y> | ||
58 | <width>243</width> | ||
59 | <height>17</height> | ||
60 | </rect> | ||
61 | </property> | 61 | </property> |
62 | <hbox> | 62 | <hbox> |
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> | 71 | <widget> |
72 | <class>QLabel</class> | 72 | <class>QLabel</class> |
73 | <property stdset="1"> | 73 | <property stdset="1"> |
74 | <name>name</name> | 74 | <name>name</name> |
75 | <cstring>TextLabel2</cstring> | 75 | <cstring>TextLabel3</cstring> |
76 | </property> | ||
77 | <property stdset="1"> | ||
78 | <name>frameShape</name> | ||
79 | <enum>NoFrame</enum> | ||
76 | </property> | 80 | </property> |
77 | <property stdset="1"> | 81 | <property stdset="1"> |
78 | <name>text</name> | 82 | <name>text</name> |
79 | <string>Priority:</string> | 83 | <string>Category:</string> |
80 | </property> | 84 | </property> |
81 | </widget> | 85 | </widget> |
82 | <widget> | 86 | <widget> |
83 | <class>QComboBox</class> | 87 | <class>CategorySelect</class> |
84 | <item> | 88 | <property stdset="1"> |
85 | <property> | 89 | <name>name</name> |
86 | <name>text</name> | 90 | <cstring>comboCategory</cstring> |
87 | <string>1 - Very High</string> | ||
88 | </property> | ||
89 | </item> | ||
90 | <item> | ||
91 | <property> | ||
92 | <name>text</name> | ||
93 | <string>2 - High</string> | ||
94 | </property> | ||
95 | </item> | ||
96 | <item> | ||
97 | <property> | ||
98 | <name>text</name> | ||
99 | <string>3 - Normal</string> | ||
100 | </property> | ||
101 | </item> | ||
102 | <item> | ||
103 | <property> | ||
104 | <name>text</name> | ||
105 | <string>4 - Low</string> | ||
106 | </property> | ||
107 | </item> | ||
108 | <item> | ||
109 | <property> | ||
110 | <name>text</name> | ||
111 | <string>5 - Very Low</string> | ||
112 | </property> | 91 | </property> |
113 | </item> | 92 | </widget> |
93 | </hbox> | ||
94 | </widget> | ||
95 | <widget> | ||
96 | <class>QLayoutWidget</class> | ||
114 | <property stdset="1"> | 97 | <property stdset="1"> |
115 | <name>name</name> | 98 | <name>name</name> |
116 | <cstring>comboPriority</cstring> | 99 | <cstring>Layout6</cstring> |
117 | </property> | 100 | </property> |
118 | <property stdset="1"> | 101 | <property stdset="1"> |
119 | <name>sizePolicy</name> | 102 | <name>geometry</name> |
120 | <sizepolicy> | 103 | <rect> |
121 | <hsizetype>7</hsizetype> | 104 | <x>0</x> |
122 | <vsizetype>0</vsizetype> | 105 | <y>0</y> |
123 | </sizepolicy> | 106 | <width>240</width> |
107 | <height>320</height> | ||
108 | </rect> | ||
124 | </property> | 109 | </property> |
110 | <grid> | ||
125 | <property stdset="1"> | 111 | <property stdset="1"> |
126 | <name>currentItem</name> | 112 | <name>margin</name> |
127 | <number>2</number> | 113 | <number>0</number> |
128 | </property> | 114 | </property> |
129 | </widget> | 115 | <property stdset="1"> |
130 | </hbox> | 116 | <name>spacing</name> |
131 | </widget> | 117 | <number>6</number> |
132 | <widget> | 118 | </property> |
119 | <widget row="2" column="0" > | ||
133 | <class>QLayoutWidget</class> | 120 | <class>QLayoutWidget</class> |
134 | <property stdset="1"> | 121 | <property stdset="1"> |
135 | <name>name</name> | 122 | <name>name</name> |
136 | <cstring>Layout3</cstring> | 123 | <cstring>Layout4</cstring> |
137 | </property> | 124 | </property> |
138 | <hbox> | 125 | <hbox> |
139 | <property stdset="1"> | 126 | <property stdset="1"> |
140 | <name>margin</name> | 127 | <name>margin</name> |
141 | <number>0</number> | 128 | <number>0</number> |
142 | </property> | 129 | </property> |
143 | <property stdset="1"> | 130 | <property stdset="1"> |
144 | <name>spacing</name> | 131 | <name>spacing</name> |
145 | <number>6</number> | 132 | <number>6</number> |
146 | </property> | 133 | </property> |
147 | <widget> | 134 | <widget> |
148 | <class>QLabel</class> | 135 | <class>QLabel</class> |
149 | <property stdset="1"> | 136 | <property stdset="1"> |
150 | <name>name</name> | 137 | <name>name</name> |
151 | <cstring>TextLabel3</cstring> | 138 | <cstring>TextLabel1</cstring> |
152 | </property> | ||
153 | <property stdset="1"> | ||
154 | <name>frameShape</name> | ||
155 | <enum>NoFrame</enum> | ||
156 | </property> | 139 | </property> |
157 | <property stdset="1"> | 140 | <property stdset="1"> |
158 | <name>text</name> | 141 | <name>text</name> |
159 | <string>Category:</string> | 142 | <string>Summary:</string> |
160 | </property> | 143 | </property> |
161 | </widget> | 144 | </widget> |
162 | <widget> | 145 | <widget> |
163 | <class>CategorySelect</class> | 146 | <class>QLineEdit</class> |
164 | <property stdset="1"> | 147 | <property stdset="1"> |
165 | <name>name</name> | 148 | <name>name</name> |
166 | <cstring>comboCategory</cstring> | 149 | <cstring>lneSum</cstring> |
167 | </property> | 150 | </property> |
168 | </widget> | 151 | </widget> |
169 | </hbox> | 152 | </hbox> |
170 | </widget> | 153 | </widget> |
171 | <widget> | 154 | <widget row="3" column="0" > |
155 | <class>QMultiLineEdit</class> | ||
156 | <property stdset="1"> | ||
157 | <name>name</name> | ||
158 | <cstring>txtTodo</cstring> | ||
159 | </property> | ||
160 | </widget> | ||
161 | <widget row="1" column="0" > | ||
172 | <class>QLayoutWidget</class> | 162 | <class>QLayoutWidget</class> |
173 | <property stdset="1"> | 163 | <property stdset="1"> |
174 | <name>name</name> | 164 | <name>name</name> |
175 | <cstring>Layout4</cstring> | 165 | <cstring>Layout4</cstring> |
176 | </property> | 166 | </property> |
177 | <hbox> | 167 | <hbox> |
178 | <property stdset="1"> | 168 | <property stdset="1"> |
179 | <name>margin</name> | 169 | <name>margin</name> |
180 | <number>0</number> | 170 | <number>0</number> |
181 | </property> | 171 | </property> |
182 | <property stdset="1"> | 172 | <property stdset="1"> |
183 | <name>spacing</name> | 173 | <name>spacing</name> |
@@ -213,32 +203,102 @@ | |||
213 | </property> | 203 | </property> |
214 | <property stdset="1"> | 204 | <property stdset="1"> |
215 | <name>enabled</name> | 205 | <name>enabled</name> |
216 | <bool>false</bool> | 206 | <bool>false</bool> |
217 | </property> | 207 | </property> |
218 | <property stdset="1"> | 208 | <property stdset="1"> |
219 | <name>text</name> | 209 | <name>text</name> |
220 | <string>1 Jan 2001</string> | 210 | <string>1 Jan 2001</string> |
221 | </property> | 211 | </property> |
222 | </widget> | 212 | </widget> |
223 | </hbox> | 213 | </hbox> |
224 | </widget> | 214 | </widget> |
215 | <widget row="0" column="0" > | ||
216 | <class>QLayoutWidget</class> | ||
217 | <property stdset="1"> | ||
218 | <name>name</name> | ||
219 | <cstring>Layout4</cstring> | ||
220 | </property> | ||
221 | <hbox> | ||
222 | <property stdset="1"> | ||
223 | <name>margin</name> | ||
224 | <number>0</number> | ||
225 | </property> | ||
226 | <property stdset="1"> | ||
227 | <name>spacing</name> | ||
228 | <number>6</number> | ||
229 | </property> | ||
225 | <widget> | 230 | <widget> |
226 | <class>QMultiLineEdit</class> | 231 | <class>QLabel</class> |
227 | <property stdset="1"> | 232 | <property stdset="1"> |
228 | <name>name</name> | 233 | <name>name</name> |
229 | <cstring>txtTodo</cstring> | 234 | <cstring>TextLabel2</cstring> |
235 | </property> | ||
236 | <property stdset="1"> | ||
237 | <name>text</name> | ||
238 | <string>Priority:</string> | ||
239 | </property> | ||
240 | </widget> | ||
241 | <widget> | ||
242 | <class>QComboBox</class> | ||
243 | <item> | ||
244 | <property> | ||
245 | <name>text</name> | ||
246 | <string>1 - Very High</string> | ||
230 | </property> | 247 | </property> |
248 | </item> | ||
249 | <item> | ||
250 | <property> | ||
251 | <name>text</name> | ||
252 | <string>2 - High</string> | ||
253 | </property> | ||
254 | </item> | ||
255 | <item> | ||
256 | <property> | ||
257 | <name>text</name> | ||
258 | <string>3 - Normal</string> | ||
259 | </property> | ||
260 | </item> | ||
261 | <item> | ||
262 | <property> | ||
263 | <name>text</name> | ||
264 | <string>4 - Low</string> | ||
265 | </property> | ||
266 | </item> | ||
267 | <item> | ||
268 | <property> | ||
269 | <name>text</name> | ||
270 | <string>5 - Very Low</string> | ||
271 | </property> | ||
272 | </item> | ||
273 | <property stdset="1"> | ||
274 | <name>name</name> | ||
275 | <cstring>comboPriority</cstring> | ||
276 | </property> | ||
277 | <property stdset="1"> | ||
278 | <name>sizePolicy</name> | ||
279 | <sizepolicy> | ||
280 | <hsizetype>7</hsizetype> | ||
281 | <vsizetype>0</vsizetype> | ||
282 | </sizepolicy> | ||
283 | </property> | ||
284 | <property stdset="1"> | ||
285 | <name>currentItem</name> | ||
286 | <number>2</number> | ||
287 | </property> | ||
288 | </widget> | ||
289 | </hbox> | ||
290 | </widget> | ||
291 | </grid> | ||
231 | </widget> | 292 | </widget> |
232 | </vbox> | ||
233 | </widget> | 293 | </widget> |
234 | <customwidgets> | 294 | <customwidgets> |
235 | <customwidget> | 295 | <customwidget> |
236 | <class>CategorySelect</class> | 296 | <class>CategorySelect</class> |
237 | <header location="global">qpe/categoryselect.h</header> | 297 | <header location="global">qpe/categoryselect.h</header> |
238 | <sizehint> | 298 | <sizehint> |
239 | <width>-1</width> | 299 | <width>-1</width> |
240 | <height>-1</height> | 300 | <height>-1</height> |
241 | </sizehint> | 301 | </sizehint> |
242 | <container>0</container> | 302 | <container>0</container> |
243 | <sizepolicy> | 303 | <sizepolicy> |
244 | <hordata>7</hordata> | 304 | <hordata>7</hordata> |
diff --git a/core/pim/todo/todoentryimpl.cpp b/core/pim/todo/todoentryimpl.cpp index 26a685c..dfaf9b4 100644 --- a/core/pim/todo/todoentryimpl.cpp +++ b/core/pim/todo/todoentryimpl.cpp | |||
@@ -1,14 +1,15 @@ | |||
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 | ** | 4 | ** |
4 | ** This file is part of Qtopia Environment. | 5 | ** This file is part of Qtopia Environment. |
5 | ** | 6 | ** |
6 | ** 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 |
7 | ** 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 |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 9 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 10 | ** packaging of this file. |
10 | ** | 11 | ** |
11 | ** 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 |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 14 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
@@ -52,24 +53,25 @@ NewTaskDialog::NewTaskDialog( const ToDoEvent& task, QWidget *parent, | |||
52 | date = todo.date(); | 53 | date = todo.date(); |
53 | else | 54 | else |
54 | date = QDate::currentDate(); | 55 | date = QDate::currentDate(); |
55 | 56 | ||
56 | init(); | 57 | init(); |
57 | comboPriority->setCurrentItem( task.priority() - 1 ); | 58 | comboPriority->setCurrentItem( task.priority() - 1 ); |
58 | 59 | ||
59 | checkCompleted->setChecked( task.isCompleted() ); | 60 | checkCompleted->setChecked( task.isCompleted() ); |
60 | checkDate->setChecked( task.hasDate() ); | 61 | checkDate->setChecked( task.hasDate() ); |
61 | buttonDate->setText( TimeString::longDateString( date ) ); | 62 | buttonDate->setText( TimeString::longDateString( date ) ); |
62 | 63 | ||
63 | txtTodo->setText( task.description() ); | 64 | txtTodo->setText( task.description() ); |
65 | lneSum->setText( task.summary() ); | ||
64 | } | 66 | } |
65 | 67 | ||
66 | /* | 68 | /* |
67 | * Constructs a NewTaskDialog which is a child of 'parent', with the | 69 | * Constructs a NewTaskDialog which is a child of 'parent', with the |
68 | * name 'name' and widget flags set to 'f' | 70 | * name 'name' and widget flags set to 'f' |
69 | * | 71 | * |
70 | * The dialog will by default be modeless, unless you set 'modal' to | 72 | * The dialog will by default be modeless, unless you set 'modal' to |
71 | * TRUE to construct a modal dialog. | 73 | * TRUE to construct a modal dialog. |
72 | */ | 74 | */ |
73 | NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool modal, | 75 | NewTaskDialog::NewTaskDialog( int id, QWidget* parent, const char* name, bool modal, |
74 | WFlags fl ) | 76 | WFlags fl ) |
75 | : NewTaskDialogBase( parent, name, modal, fl ), | 77 | : NewTaskDialogBase( parent, name, modal, fl ), |
@@ -123,24 +125,25 @@ ToDoEvent NewTaskDialog::todoEntry() | |||
123 | todo.setHasDate( false ); | 125 | todo.setHasDate( false ); |
124 | } | 126 | } |
125 | if ( comboCategory->currentCategory() != -1 ) { | 127 | if ( comboCategory->currentCategory() != -1 ) { |
126 | QArray<int> arr = comboCategory->currentCategories(); | 128 | QArray<int> arr = comboCategory->currentCategories(); |
127 | QStringList list; | 129 | QStringList list; |
128 | list = QStringList::split(";", Qtopia::Record::idsToString( arr )) ; | 130 | list = QStringList::split(";", Qtopia::Record::idsToString( arr )) ; |
129 | todo.setCategories( list ); | 131 | todo.setCategories( list ); |
130 | } | 132 | } |
131 | todo.setPriority( comboPriority->currentItem() + 1 ); | 133 | todo.setPriority( comboPriority->currentItem() + 1 ); |
132 | todo.setCompleted( checkCompleted->isChecked() ); | 134 | todo.setCompleted( checkCompleted->isChecked() ); |
133 | 135 | ||
134 | todo.setDescription( txtTodo->text() ); | 136 | todo.setDescription( txtTodo->text() ); |
137 | todo.setSummary( lneSum->text() ); | ||
135 | 138 | ||
136 | return todo; | 139 | return todo; |
137 | } | 140 | } |
138 | 141 | ||
139 | 142 | ||
140 | /*! | 143 | /*! |
141 | 144 | ||
142 | */ | 145 | */ |
143 | 146 | ||
144 | void NewTaskDialog::accept() | 147 | void NewTaskDialog::accept() |
145 | { | 148 | { |
146 | QString strText = txtTodo->text(); | 149 | QString strText = txtTodo->text(); |
diff --git a/core/pim/todo/todotable.cpp b/core/pim/todo/todotable.cpp index 52a3087..779b28c 100644 --- a/core/pim/todo/todotable.cpp +++ b/core/pim/todo/todotable.cpp | |||
@@ -563,24 +563,25 @@ void TodoTable::updateJournal( const ToDoEvent &todo, journal_action action ) | |||
563 | buf += " Completed=\""+ QString::number((int)todo.isCompleted() ) + "\""; | 563 | buf += " Completed=\""+ QString::number((int)todo.isCompleted() ) + "\""; |
564 | buf += " HasDate=\""+ QString::number((int)todo.hasDate() ) +"\""; | 564 | buf += " HasDate=\""+ QString::number((int)todo.hasDate() ) +"\""; |
565 | buf += " Priority=\"" + QString::number( todo.priority() ) + "\""; | 565 | buf += " Priority=\"" + QString::number( todo.priority() ) + "\""; |
566 | QArray<int> arrat = todo.categories(); | 566 | QArray<int> arrat = todo.categories(); |
567 | QString attr; | 567 | QString attr; |
568 | for(uint i=0; i < arrat.count(); i++ ){ | 568 | for(uint i=0; i < arrat.count(); i++ ){ |
569 | attr.append(QString::number(arrat[i])+";" ); | 569 | attr.append(QString::number(arrat[i])+";" ); |
570 | } | 570 | } |
571 | if(!attr.isEmpty() ) // remove the last ; | 571 | if(!attr.isEmpty() ) // remove the last ; |
572 | attr.remove(attr.length()-1, 1 ); | 572 | attr.remove(attr.length()-1, 1 ); |
573 | buf += " Categories=\"" + attr + "\""; | 573 | buf += " Categories=\"" + attr + "\""; |
574 | buf += " Description=\"" + todo.description() + "\""; | 574 | buf += " Description=\"" + todo.description() + "\""; |
575 | buf += " Summary=\"" + todo.summary() + "\""; | ||
575 | if(todo.hasDate() ) { | 576 | if(todo.hasDate() ) { |
576 | buf += " DateYear=\""+QString::number( todo.date().year() ) + "\""; | 577 | buf += " DateYear=\""+QString::number( todo.date().year() ) + "\""; |
577 | buf += " DateMonth=\"" + QString::number( todo.date().month() ) + "\""; | 578 | buf += " DateMonth=\"" + QString::number( todo.date().month() ) + "\""; |
578 | buf += " DateDay=\"" + QString::number( todo.date().day() ) + "\""; | 579 | buf += " DateDay=\"" + QString::number( todo.date().day() ) + "\""; |
579 | } | 580 | } |
580 | buf += "/>\n"; | 581 | buf += "/>\n"; |
581 | str = buf.utf8(); | 582 | str = buf.utf8(); |
582 | f.writeBlock( str.data(), str.length() ); | 583 | f.writeBlock( str.data(), str.length() ); |
583 | f.close(); | 584 | f.close(); |
584 | } | 585 | } |
585 | 586 | ||
586 | void TodoTable::rowHeightChanged( int row ) | 587 | void TodoTable::rowHeightChanged( int row ) |
@@ -601,26 +602,29 @@ void TodoTable::loadFile( const QString &/*we use the standard*/ ) | |||
601 | } | 602 | } |
602 | vaList.clear(); | 603 | vaList.clear(); |
603 | // qDebug("parsing done=%d", t.elapsed() ); | 604 | // qDebug("parsing done=%d", t.elapsed() ); |
604 | if ( list.count() > 0 ) { | 605 | if ( list.count() > 0 ) { |
605 | internalAddEntries( list ); | 606 | internalAddEntries( list ); |
606 | list.clear(); | 607 | list.clear(); |
607 | } | 608 | } |
608 | // qDebug("loading done: t=%d", t.elapsed() ); | 609 | // qDebug("loading done: t=%d", t.elapsed() ); |
609 | } | 610 | } |
610 | 611 | ||
611 | void TodoTable::journalFreeReplaceEntry( const ToDoEvent &todo, int row ) | 612 | void TodoTable::journalFreeReplaceEntry( const ToDoEvent &todo, int row ) |
612 | { | 613 | { |
613 | QString strTodo; | 614 | QString strTodo = todo.summary(); |
615 | if( strTodo.isEmpty() ){ | ||
614 | strTodo = todo.description().left(40).simplifyWhiteSpace(); | 616 | strTodo = todo.description().left(40).simplifyWhiteSpace(); |
617 | //todo.setSummary(strTodo ); | ||
618 | } | ||
615 | if ( row == -1 ) { | 619 | if ( row == -1 ) { |
616 | QMapIterator<CheckItem*, ToDoEvent *> it; | 620 | QMapIterator<CheckItem*, ToDoEvent *> it; |
617 | for ( it = todoList.begin(); it != todoList.end(); ++it ) { | 621 | for ( it = todoList.begin(); it != todoList.end(); ++it ) { |
618 | if ( *(*it) == todo ) { | 622 | if ( *(*it) == todo ) { |
619 | row = it.key()->row(); | 623 | row = it.key()->row(); |
620 | it.key()->setChecked( todo.isCompleted() ); | 624 | it.key()->setChecked( todo.isCompleted() ); |
621 | static_cast<ComboItem*>(item(row, 1))->setText( QString::number(todo.priority()) ); | 625 | static_cast<ComboItem*>(item(row, 1))->setText( QString::number(todo.priority()) ); |
622 | item( row, 2 )->setText( strTodo ); | 626 | item( row, 2 )->setText( strTodo ); |
623 | 627 | ||
624 | if (showDeadl){ | 628 | if (showDeadl){ |
625 | static_cast<DueTextItem*>(item(row,3))->setToDoEvent(&todo ); | 629 | static_cast<DueTextItem*>(item(row,3))->setToDoEvent(&todo ); |
626 | } | 630 | } |
@@ -899,24 +903,27 @@ static ToDoEvent xmlToEvent( XMLElement *element ) | |||
899 | if(ok ) day = dumInt; | 903 | if(ok ) day = dumInt; |
900 | // set the date | 904 | // set the date |
901 | QDate date( year, month, day ); | 905 | QDate date( year, month, day ); |
902 | event.setDate( date); | 906 | event.setDate( date); |
903 | } | 907 | } |
904 | dummy = element->attribute("Priority" ); | 908 | dummy = element->attribute("Priority" ); |
905 | dumInt = dummy.toInt(&ok ); | 909 | dumInt = dummy.toInt(&ok ); |
906 | if(!ok ) dumInt = ToDoEvent::NORMAL; | 910 | if(!ok ) dumInt = ToDoEvent::NORMAL; |
907 | event.setPriority( dumInt ); | 911 | event.setPriority( dumInt ); |
908 | //description | 912 | //description |
909 | dummy = element->attribute("Description" ); | 913 | dummy = element->attribute("Description" ); |
910 | event.setDescription( dummy ); | 914 | event.setDescription( dummy ); |
915 | // summary | ||
916 | dummy = element->attribute("Summary" ); | ||
917 | event.setSummary( dummy ); | ||
911 | // category | 918 | // category |
912 | dummy = element->attribute("Categories" ); | 919 | dummy = element->attribute("Categories" ); |
913 | QStringList ids = QStringList::split(";", dummy ); | 920 | QStringList ids = QStringList::split(";", dummy ); |
914 | event.setCategories( ids ); | 921 | event.setCategories( ids ); |
915 | 922 | ||
916 | //uid | 923 | //uid |
917 | dummy = element->attribute("Uid" ); | 924 | dummy = element->attribute("Uid" ); |
918 | dumInt = dummy.toInt(&ok ); | 925 | dumInt = dummy.toInt(&ok ); |
919 | if(ok ) event.setUid( dumInt ); | 926 | if(ok ) event.setUid( dumInt ); |
920 | return event; | 927 | return event; |
921 | } | 928 | } |
922 | 929 | ||
diff --git a/core/pim/todo/todotable.h b/core/pim/todo/todotable.h index 7672f21..39e00d1 100644 --- a/core/pim/todo/todotable.h +++ b/core/pim/todo/todotable.h | |||
@@ -190,25 +190,26 @@ private: | |||
190 | }; | 190 | }; |
191 | 191 | ||
192 | 192 | ||
193 | inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) | 193 | inline void TodoTable::insertIntoTable( ToDoEvent *todo, int row ) |
194 | { | 194 | { |
195 | QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') | 195 | QString sortKey = (char) ((todo->isCompleted() ? 'a' : 'A') |
196 | + todo->priority() ) | 196 | + todo->priority() ) |
197 | + Qtopia::buildSortKey( todo->description() ); | 197 | + Qtopia::buildSortKey( todo->description() ); |
198 | CheckItem *chk = new CheckItem( this, sortKey ); | 198 | CheckItem *chk = new CheckItem( this, sortKey ); |
199 | chk->setChecked( todo->isCompleted() ); | 199 | chk->setChecked( todo->isCompleted() ); |
200 | ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent ); | 200 | ComboItem *cmb = new ComboItem( this, QTableItem::WhenCurrent ); |
201 | cmb->setText( QString::number( todo->priority() ) ); | 201 | cmb->setText( QString::number( todo->priority() ) ); |
202 | QTableItem *ti = new TodoTextItem( this, todo->description().left(40).simplifyWhiteSpace() ); | 202 | QString sum = todo->summary(); |
203 | QTableItem *ti = new TodoTextItem( this, sum.isEmpty() ? todo->description().left(40).simplifyWhiteSpace() : sum ); | ||
203 | ti->setReplaceable( false ); | 204 | ti->setReplaceable( false ); |
204 | 205 | ||
205 | DueTextItem *due = new DueTextItem(this, todo ); | 206 | DueTextItem *due = new DueTextItem(this, todo ); |
206 | setItem( row, 3, due); | 207 | setItem( row, 3, due); |
207 | 208 | ||
208 | setItem( row, 0, chk ); | 209 | setItem( row, 0, chk ); |
209 | setItem( row, 1, cmb ); | 210 | setItem( row, 1, cmb ); |
210 | setItem( row, 2, ti ); | 211 | setItem( row, 2, ti ); |
211 | 212 | ||
212 | 213 | ||
213 | todoList.insert( chk, todo ); | 214 | todoList.insert( chk, todo ); |
214 | } | 215 | } |