From 586dea6e61c766da49ba6cb55dd71851c0fafad3 Mon Sep 17 00:00:00 2001 From: drw Date: Sun, 18 May 2003 23:20:25 +0000 Subject: Updates to ocontact, oevent & otodo's toRichText() implementations --- (limited to 'libopie2/opiepim/otodo.cpp') 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 QString text; QStringList catlist; - // Description of the todo + // summary + text += "

"; if ( !summary().isEmpty() ) { - text += "" + QObject::tr( "Summary:") + "
"; - text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "
" ) + "
"; + text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" ); } + text += "




"; + + // description if( !description().isEmpty() ){ text += "" + QObject::tr( "Description:" ) + "
"; text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "
" ) ; } - text += "


"; - text += "" + QObject::tr( "Priority:") +" " - + QString::number( priority() ) + "
"; + // priority + int priorityval = priority(); + text += "" + QObject::tr( "Priority:") +" "; +// text += "" + QObject::tr( "Priority:") +"
"; + switch ( priorityval ) + { + case 1 : text += QObject::tr( "Very high" ); + break; + case 2 : text += QObject::tr( "High" ); + break; + case 3 : text += QObject::tr( "Normal" ); + break; + case 4 : text += QObject::tr( "Low" ); + break; + case 5 : text += QObject::tr( "Very low" ); + break; + }; + text += "
"; + + // progress text += "" + QObject::tr( "Progress:") + " " + QString::number( progress() ) + " %
"; + + // due date if (hasDueDate() ){ - text += "" + QObject::tr( "Deadline:") + " "; - text += dueDate().toString(); - text += "
"; + QDate dd = dueDate(); + int off = QDate::currentDate().daysTo( dd ); + + text += "" + QObject::tr( "Deadline:" ) + " 0 ) + text += "#00FF00"; + + text += "\">" + dd.toString() + "
"; } - + + // categories text += "" + QObject::tr( "Category:") + " "; text += categoryNames( "Todo List" ).join(", "); text += "
"; -- cgit v0.9.0.2