author | tille <tille> | 2003-05-14 15:25:08 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-14 15:25:08 (UTC) |
commit | 0042c63bd72905598928621e6e849cd6303ddf27 (patch) (side-by-side diff) | |
tree | f56dc5935cc9a4ec0d4df46d219fd7fc29fe1526 /core/pim/osearch/todoitem.cpp | |
parent | dbda71abdc7c13ac0acde21320ee00726d95dec4 (diff) | |
download | opie-0042c63bd72905598928621e6e849cd6303ddf27.zip opie-0042c63bd72905598928621e6e849cd6303ddf27.tar.gz opie-0042c63bd72905598928621e6e849cd6303ddf27.tar.bz2 |
icons for todo, contact and event results indication the matching field
Diffstat (limited to 'core/pim/osearch/todoitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/todoitem.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/core/pim/osearch/todoitem.cpp b/core/pim/osearch/todoitem.cpp index 8b354f1..de4ea97 100644 --- a/core/pim/osearch/todoitem.cpp +++ b/core/pim/osearch/todoitem.cpp @@ -4,31 +4,34 @@ // // Description: // // // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 // // Copyright: See COPYING file that comes with this distribution // // #include "todoitem.h" #include <opie/otodo.h> +#include <qpixmap.h> +#include <qpe/resource.h> #include <qpe/qcopenvelope_qws.h> TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) : ResultItem(parent) { _todo = todo; setText( 0, todo->toShortText() ); + setIcon(); } TodoItem::~TodoItem() { delete _todo; } QString TodoItem::toRichText() { return _todo->toRichText(); } @@ -41,12 +44,36 @@ void TodoItem::action( int act ) QCopEnvelope e("QPE/Application/todolist", "edit(int)"); e << _todo->uid(); } } QIntDict<QString> TodoItem::actions() { QIntDict<QString> result; result.insert( 0, new QString( QObject::tr("show") ) ); result.insert( 1, new QString( QObject::tr("edit") ) ); return result; } + +void TodoItem::setIcon() +{ + QPixmap icon; + switch ( _todo->lastHitField() ) { + case -1: + icon = Resource::loadPixmap( "reset" ); + break; + case OTodo::Description: + case OTodo::Summary: + icon = Resource::loadPixmap( "osearch/personal" ); + break; + case OTodo::Priority: + icon = Resource::loadPixmap( "todo/priority1" ); + break; + case OTodo::HasDate: + icon = Resource::loadPixmap( "osearch/clock" ); + break; + default: + icon = Resource::loadPixmap( "DocsIcon" ); + break; + } + setPixmap( 0, icon ); +} |