-rw-r--r-- | libopie2/opiepim/otodo.cpp | 54 |
1 files changed, 44 insertions, 10 deletions
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index e087a00..c84eeeb 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp | |||
@@ -273,27 +273,61 @@ QString OTodo::toRichText() const | |||
273 | QString text; | 273 | QString text; |
274 | QStringList catlist; | 274 | QStringList catlist; |
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() ){ |
282 | text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; | 285 | text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; |
283 | text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ; | 286 | text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ; |
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> "; |
298 | text += categoryNames( "Todo List" ).join(", "); | 332 | text += categoryNames( "Todo List" ).join(", "); |
299 | text += "<br>"; | 333 | text += "<br>"; |