author | tille <tille> | 2003-05-14 15:25:08 (UTC) |
---|---|---|
committer | tille <tille> | 2003-05-14 15:25:08 (UTC) |
commit | 0042c63bd72905598928621e6e849cd6303ddf27 (patch) (unidiff) | |
tree | f56dc5935cc9a4ec0d4df46d219fd7fc29fe1526 | |
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
-rw-r--r-- | core/pim/osearch/contactitem.cpp | 87 | ||||
-rw-r--r-- | core/pim/osearch/contactitem.h | 1 | ||||
-rw-r--r-- | core/pim/osearch/eventitem.cpp | 28 | ||||
-rw-r--r-- | core/pim/osearch/eventitem.h | 1 | ||||
-rw-r--r-- | core/pim/osearch/todoitem.cpp | 27 | ||||
-rw-r--r-- | core/pim/osearch/todoitem.h | 1 |
6 files changed, 145 insertions, 0 deletions
diff --git a/core/pim/osearch/contactitem.cpp b/core/pim/osearch/contactitem.cpp index 7d8ecf1..3928b1f 100644 --- a/core/pim/osearch/contactitem.cpp +++ b/core/pim/osearch/contactitem.cpp | |||
@@ -14,3 +14,5 @@ | |||
14 | 14 | ||
15 | #include <qpixmap.h> | ||
15 | #include <opie/ocontact.h> | 16 | #include <opie/ocontact.h> |
17 | #include <qpe/resource.h> | ||
16 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
@@ -22,4 +24,89 @@ ContactItem::ContactItem(OListViewItem* parent, OContact *contact) | |||
22 | setText(0, _contact->toShortText()); | 24 | setText(0, _contact->toShortText()); |
25 | setIcon(); | ||
23 | } | 26 | } |
24 | 27 | ||
28 | void ContactItem::setIcon() | ||
29 | { | ||
30 | QPixmap icon; | ||
31 | switch ( _contact->lastHitField() ) { | ||
32 | case -1: | ||
33 | icon = Resource::loadPixmap( "reset" ); | ||
34 | break; | ||
35 | case Qtopia::BusinessPhone: | ||
36 | icon = Resource::loadPixmap( "addressbook/phonework" ); | ||
37 | break; | ||
38 | case Qtopia::BusinessFax: | ||
39 | icon = Resource::loadPixmap( "addressbook/faxwork" ); | ||
40 | break; | ||
41 | case Qtopia::BusinessMobile: | ||
42 | icon = Resource::loadPixmap( "addressbook/mobilework" ); | ||
43 | break; | ||
44 | case Qtopia::DefaultEmail: | ||
45 | icon = Resource::loadPixmap( "addressbook/email" ); | ||
46 | break; | ||
47 | case Qtopia::Emails: | ||
48 | icon = Resource::loadPixmap( "addressbook/email" ); | ||
49 | break; | ||
50 | case Qtopia::HomePhone: | ||
51 | qDebug("homephone"); | ||
52 | icon = Resource::loadPixmap( "addressbook/phonehome" ); | ||
53 | break; | ||
54 | case Qtopia::HomeFax: | ||
55 | icon = Resource::loadPixmap( "addressbook/faxhome" ); | ||
56 | break; | ||
57 | case Qtopia::HomeMobile: | ||
58 | icon = Resource::loadPixmap( "addressbook/mobilehome" ); | ||
59 | break; | ||
60 | case Qtopia::HomeWebPage: | ||
61 | icon = Resource::loadPixmap( "addressbook/webpagehome" ); | ||
62 | break; | ||
63 | case Qtopia::BusinessWebPage: | ||
64 | icon = Resource::loadPixmap( "addressbook/webpagework" ); | ||
65 | break; | ||
66 | case Qtopia::Title: | ||
67 | case Qtopia::FirstName: | ||
68 | case Qtopia::MiddleName: | ||
69 | case Qtopia::LastName: | ||
70 | case Qtopia::Suffix: | ||
71 | case Qtopia::Nickname: | ||
72 | case Qtopia::FileAs: | ||
73 | icon = Resource::loadPixmap( "addressbook/identity" ); | ||
74 | break; | ||
75 | case Qtopia::HomeStreet: | ||
76 | case Qtopia::HomeCity: | ||
77 | case Qtopia::HomeState: | ||
78 | case Qtopia::HomeZip: | ||
79 | case Qtopia::HomeCountry: | ||
80 | icon = Resource::loadPixmap( "addressbook/addresshome" ); | ||
81 | break; | ||
82 | case Qtopia::Company: | ||
83 | case Qtopia::BusinessCity: | ||
84 | case Qtopia::BusinessStreet: | ||
85 | case Qtopia::BusinessZip: | ||
86 | case Qtopia::BusinessCountry: | ||
87 | case Qtopia::JobTitle: | ||
88 | case Qtopia::Department: | ||
89 | case Qtopia::Office: | ||
90 | case Qtopia::Manager: | ||
91 | case Qtopia::BusinessPager: | ||
92 | case Qtopia::Profession: | ||
93 | icon = Resource::loadPixmap( "addressbook/addresshome" ); | ||
94 | break; | ||
95 | case Qtopia::Assistant: | ||
96 | case Qtopia::Spouse: | ||
97 | case Qtopia::Children: | ||
98 | icon = Resource::loadPixmap( "osearch/personal" ); | ||
99 | break; | ||
100 | case Qtopia::Birthday: | ||
101 | case Qtopia::Anniversary: | ||
102 | icon = Resource::loadPixmap( "osearch/clock" ); | ||
103 | break; | ||
104 | case Qtopia::Notes: | ||
105 | break; | ||
106 | default: | ||
107 | icon = Resource::loadPixmap( "DocsIcon" ); | ||
108 | break; | ||
109 | } | ||
110 | setPixmap( 0, icon ); | ||
111 | } | ||
25 | 112 | ||
diff --git a/core/pim/osearch/contactitem.h b/core/pim/osearch/contactitem.h index 5e0017d..d6303e2 100644 --- a/core/pim/osearch/contactitem.h +++ b/core/pim/osearch/contactitem.h | |||
@@ -35,2 +35,3 @@ public: | |||
35 | private: | 35 | private: |
36 | void setIcon(); | ||
36 | OContact *_contact; | 37 | OContact *_contact; |
diff --git a/core/pim/osearch/eventitem.cpp b/core/pim/osearch/eventitem.cpp index 3b84b42..5b7a840 100644 --- a/core/pim/osearch/eventitem.cpp +++ b/core/pim/osearch/eventitem.cpp | |||
@@ -15,2 +15,4 @@ | |||
15 | #include <qdatetime.h> | 15 | #include <qdatetime.h> |
16 | #include <qpixmap.h> | ||
17 | #include <qpe/resource.h> | ||
16 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
@@ -23,2 +25,3 @@ EventItem::EventItem(OListViewItem* parent, OEvent *event) | |||
23 | setText(0, _event->toShortText() ); | 25 | setText(0, _event->toShortText() ); |
26 | setIcon(); | ||
24 | } | 27 | } |
@@ -54 +57,26 @@ QIntDict<QString> EventItem::actions() | |||
54 | } | 57 | } |
58 | |||
59 | void EventItem::setIcon() | ||
60 | { | ||
61 | QPixmap icon; | ||
62 | switch ( _event->lastHitField() ) { | ||
63 | case -1: | ||
64 | icon = Resource::loadPixmap( "reset" ); | ||
65 | break; | ||
66 | case Qtopia::DatebookDescription: | ||
67 | case Qtopia::Notes: | ||
68 | icon = Resource::loadPixmap( "osearch/personal" ); | ||
69 | break; | ||
70 | case Qtopia::Location: | ||
71 | icon = Resource::loadPixmap( "home" ); | ||
72 | break; | ||
73 | case Qtopia::StartDateTime: | ||
74 | case Qtopia::EndDateTime: | ||
75 | icon = Resource::loadPixmap( "osearch/clock" ); | ||
76 | break; | ||
77 | default: | ||
78 | icon = Resource::loadPixmap( "DocsIcon" ); | ||
79 | break; | ||
80 | } | ||
81 | setPixmap( 0, icon ); | ||
82 | } | ||
diff --git a/core/pim/osearch/eventitem.h b/core/pim/osearch/eventitem.h index d0d45a8..5f9c9fc 100644 --- a/core/pim/osearch/eventitem.h +++ b/core/pim/osearch/eventitem.h | |||
@@ -34,2 +34,3 @@ public: | |||
34 | private: | 34 | private: |
35 | void setIcon(); | ||
35 | OEvent *_event; | 36 | OEvent *_event; |
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 | |||
@@ -15,2 +15,4 @@ | |||
15 | #include <opie/otodo.h> | 15 | #include <opie/otodo.h> |
16 | #include <qpixmap.h> | ||
17 | #include <qpe/resource.h> | ||
16 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
@@ -22,2 +24,3 @@ TodoItem::TodoItem(OListViewItem* parent, OTodo *todo) | |||
22 | setText( 0, todo->toShortText() ); | 24 | setText( 0, todo->toShortText() ); |
25 | setIcon(); | ||
23 | } | 26 | } |
@@ -52 +55,25 @@ QIntDict<QString> TodoItem::actions() | |||
52 | } | 55 | } |
56 | |||
57 | void TodoItem::setIcon() | ||
58 | { | ||
59 | QPixmap icon; | ||
60 | switch ( _todo->lastHitField() ) { | ||
61 | case -1: | ||
62 | icon = Resource::loadPixmap( "reset" ); | ||
63 | break; | ||
64 | case OTodo::Description: | ||
65 | case OTodo::Summary: | ||
66 | icon = Resource::loadPixmap( "osearch/personal" ); | ||
67 | break; | ||
68 | case OTodo::Priority: | ||
69 | icon = Resource::loadPixmap( "todo/priority1" ); | ||
70 | break; | ||
71 | case OTodo::HasDate: | ||
72 | icon = Resource::loadPixmap( "osearch/clock" ); | ||
73 | break; | ||
74 | default: | ||
75 | icon = Resource::loadPixmap( "DocsIcon" ); | ||
76 | break; | ||
77 | } | ||
78 | setPixmap( 0, icon ); | ||
79 | } | ||
diff --git a/core/pim/osearch/todoitem.h b/core/pim/osearch/todoitem.h index 9dfd4ff..cc78e57 100644 --- a/core/pim/osearch/todoitem.h +++ b/core/pim/osearch/todoitem.h | |||
@@ -32,2 +32,3 @@ public: | |||
32 | private: | 32 | private: |
33 | void setIcon(); | ||
33 | OTodo *_todo; | 34 | OTodo *_todo; |