-rw-r--r-- | libopie/pim/otodo.cpp | 54 |
1 files changed, 44 insertions, 10 deletions
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp index e087a00..c84eeeb 100644 --- a/libopie/pim/otodo.cpp +++ b/libopie/pim/otodo.cpp | |||
@@ -275,7 +275,10 @@ QString OTodo::toRichText() const | |||
275 | 275 | ||
276 | // Description of the todo | 276 | // summary |
277 | text += "<b><h3><img src=\"todo/TodoList\">"; | ||
277 | if ( !summary().isEmpty() ) { | 278 | if ( !summary().isEmpty() ) { |
278 | text += "<b>" + QObject::tr( "Summary:") + "</b><br>"; | 279 | text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" ); |
279 | text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; | ||
280 | } | 280 | } |
281 | text += "</h3></b><br><hr><br>"; | ||
282 | |||
283 | // description | ||
281 | if( !description().isEmpty() ){ | 284 | if( !description().isEmpty() ){ |
@@ -284,14 +287,45 @@ QString OTodo::toRichText() const | |||
284 | } | 287 | } |
285 | text += "<br><br><br>"; | ||
286 | 288 | ||
287 | text += "<b>" + QObject::tr( "Priority:") +" </b>" | 289 | // priority |
288 | + QString::number( priority() ) + " <br>"; | 290 | int priorityval = priority(); |
291 | text += "<b>" + QObject::tr( "Priority:") +" </b><img src=\"todo/priority" + | ||
292 | QString::number( priorityval ) + "\">"; | ||
293 | // text += "<b>" + QObject::tr( "Priority:") +"</b><img src=\"todo/priority" + | ||
294 | // QString::number( priority() ) + "\"><br>"; | ||
295 | switch ( priorityval ) | ||
296 | { | ||
297 | case 1 : text += QObject::tr( "Very high" ); | ||
298 | break; | ||
299 | case 2 : text += QObject::tr( "High" ); | ||
300 | break; | ||
301 | case 3 : text += QObject::tr( "Normal" ); | ||
302 | break; | ||
303 | case 4 : text += QObject::tr( "Low" ); | ||
304 | break; | ||
305 | case 5 : text += QObject::tr( "Very low" ); | ||
306 | break; | ||
307 | }; | ||
308 | text += "<br>"; | ||
309 | |||
310 | // progress | ||
289 | text += "<b>" + QObject::tr( "Progress:") + " </b>" | 311 | text += "<b>" + QObject::tr( "Progress:") + " </b>" |
290 | + QString::number( progress() ) + " %<br>"; | 312 | + QString::number( progress() ) + " %<br>"; |
313 | |||
314 | // due date | ||
291 | if (hasDueDate() ){ | 315 | if (hasDueDate() ){ |
292 | text += "<b>" + QObject::tr( "Deadline:") + " </b>"; | 316 | QDate dd = dueDate(); |
293 | text += dueDate().toString(); | 317 | int off = QDate::currentDate().daysTo( dd ); |
294 | text += "<br>"; | 318 | |
319 | text += "<b>" + QObject::tr( "Deadline:" ) + " </b><font color=\""; | ||
320 | if ( off < 0 ) | ||
321 | text += "#FF0000"; | ||
322 | else if ( off == 0 ) | ||
323 | text += "#FFFF00"; | ||
324 | else if ( off > 0 ) | ||
325 | text += "#00FF00"; | ||
326 | |||
327 | text += "\">" + dd.toString() + "</font><br>"; | ||
295 | } | 328 | } |
296 | 329 | ||
330 | // categories | ||
297 | text += "<b>" + QObject::tr( "Category:") + "</b> "; | 331 | text += "<b>" + QObject::tr( "Category:") + "</b> "; |