Diffstat (limited to 'core/pim/osearch/eventitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/eventitem.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/pim/osearch/eventitem.cpp b/core/pim/osearch/eventitem.cpp index 24ce8e8..3228093 100644 --- a/core/pim/osearch/eventitem.cpp +++ b/core/pim/osearch/eventitem.cpp | |||
@@ -1,84 +1,86 @@ | |||
1 | // | 1 | // |
2 | // | 2 | // |
3 | // C++ Implementation: $MODULE$ | 3 | // C++ Implementation: $MODULE$ |
4 | // | 4 | // |
5 | // Description: | 5 | // Description: |
6 | // | 6 | // |
7 | // | 7 | // |
8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 | 8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 |
9 | // | 9 | // |
10 | // Copyright: See COPYING file that comes with this distribution | 10 | // Copyright: See COPYING file that comes with this distribution |
11 | // | 11 | // |
12 | // | 12 | // |
13 | #include "eventitem.h" | 13 | #include "eventitem.h" |
14 | 14 | ||
15 | #include <qdatetime.h> | 15 | #include <qdatetime.h> |
16 | #include <qpixmap.h> | 16 | #include <qpixmap.h> |
17 | #include <qpe/resource.h> | 17 | #include <qpe/resource.h> |
18 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
19 | //#include <qwhatsthis.h> | ||
19 | #include <opie/oevent.h> | 20 | #include <opie/oevent.h> |
20 | 21 | ||
21 | EventItem::EventItem(OListViewItem* parent, OEvent *event) | 22 | EventItem::EventItem(OListViewItem* parent, OEvent *event) |
22 | : ResultItem(parent) | 23 | : ResultItem(parent) |
23 | { | 24 | { |
24 | _event = event; | 25 | _event = event; |
25 | setText(0, _event->toShortText() ); | 26 | setText(0, _event->toShortText() ); |
26 | setIcon(); | 27 | setIcon(); |
27 | } | 28 | } |
28 | 29 | ||
29 | 30 | ||
30 | EventItem::~EventItem() | 31 | EventItem::~EventItem() |
31 | { | 32 | { |
32 | } | 33 | } |
33 | 34 | ||
34 | 35 | ||
35 | QString EventItem::toRichText() | 36 | QString EventItem::toRichText() |
36 | { | 37 | { |
37 | return _event->toRichText(); | 38 | return _event->toRichText(); |
38 | } | 39 | } |
39 | 40 | ||
40 | void EventItem::action( int act ) | 41 | void EventItem::action( int act ) |
41 | { | 42 | { |
42 | if (act == 0){ | 43 | if (act == 0){ |
43 | QCopEnvelope e("QPE/Application/datebook", "viewDefault(QDate)"); | 44 | QCopEnvelope e("QPE/Application/datebook", "viewDefault(QDate)"); |
44 | e << _event->startDateTime().date(); | 45 | e << _event->startDateTime().date(); |
45 | }else if(act == 1){ | 46 | }else if(act == 1){ |
46 | QCopEnvelope e("QPE/Application/datebook", "editEvent(int)"); | 47 | QCopEnvelope e("QPE/Application/datebook", "editEvent(int)"); |
47 | e << _event->uid(); | 48 | e << _event->uid(); |
48 | } | 49 | } |
49 | } | 50 | } |
50 | 51 | ||
51 | QIntDict<QString> EventItem::actions() | 52 | QIntDict<QString> EventItem::actions() |
52 | { | 53 | { |
53 | QIntDict<QString> result; | 54 | QIntDict<QString> result; |
54 | result.insert( 0, new QString( QObject::tr("show") ) ); | 55 | result.insert( 0, new QString( QObject::tr("show") ) ); |
55 | result.insert( 1, new QString( QObject::tr("edit") ) ); | 56 | result.insert( 1, new QString( QObject::tr("edit") ) ); |
56 | return result; | 57 | return result; |
57 | } | 58 | } |
58 | 59 | ||
59 | void EventItem::setIcon() | 60 | void EventItem::setIcon() |
60 | { | 61 | { |
61 | QPixmap icon; | 62 | QPixmap icon; |
62 | switch ( _event->lastHitField() ) { | 63 | switch ( _event->lastHitField() ) { |
63 | case -1: | 64 | case -1: |
64 | icon = Resource::loadPixmap( "reset" ); | 65 | icon = Resource::loadPixmap( "reset" ); |
66 | // QWhatsThis::add( icon, QObject::tr("Enter your search terms here") ); | ||
65 | break; | 67 | break; |
66 | case Qtopia::DatebookDescription: | 68 | case Qtopia::DatebookDescription: |
67 | icon = Resource::loadPixmap( "osearch/summary" ); | 69 | icon = Resource::loadPixmap( "osearch/summary" ); |
68 | break; | 70 | break; |
69 | case Qtopia::Notes: | 71 | case Qtopia::Notes: |
70 | icon = Resource::loadPixmap( "txt" ); | 72 | icon = Resource::loadPixmap( "txt" ); |
71 | break; | 73 | break; |
72 | case Qtopia::Location: | 74 | case Qtopia::Location: |
73 | icon = Resource::loadPixmap( "home" ); | 75 | icon = Resource::loadPixmap( "home" ); |
74 | break; | 76 | break; |
75 | case Qtopia::StartDateTime: | 77 | case Qtopia::StartDateTime: |
76 | case Qtopia::EndDateTime: | 78 | case Qtopia::EndDateTime: |
77 | icon = Resource::loadPixmap( "osearch/clock" ); | 79 | icon = Resource::loadPixmap( "osearch/clock" ); |
78 | break; | 80 | break; |
79 | default: | 81 | default: |
80 | icon = Resource::loadPixmap( "DocsIcon" ); | 82 | icon = Resource::loadPixmap( "DocsIcon" ); |
81 | break; | 83 | break; |
82 | } | 84 | } |
83 | setPixmap( 0, icon ); | 85 | setPixmap( 0, icon ); |
84 | } | 86 | } |