author | drw <drw> | 2005-04-24 22:08:11 (UTC) |
---|---|---|
committer | drw <drw> | 2005-04-24 22:08:11 (UTC) |
commit | 98e94a485c456304d5f0b7a1f281470e2c0ac705 (patch) (unidiff) | |
tree | 0b3bb1d20111ed27d5ec215b37adb1b6eeefa076 | |
parent | bebd0bb33ac2508bf8df37a1f20c7ec404bcbc2d (diff) | |
download | opie-98e94a485c456304d5f0b7a1f281470e2c0ac705.zip opie-98e94a485c456304d5f0b7a1f281470e2c0ac705.tar.gz opie-98e94a485c456304d5f0b7a1f281470e2c0ac705.tar.bz2 |
Resource -> OResource
-rw-r--r-- | core/applets/homeapplet/home.cpp | 9 | ||||
-rw-r--r-- | core/applets/homeapplet/homeapplet.pro | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/core/applets/homeapplet/home.cpp b/core/applets/homeapplet/home.cpp index 02d1265..5a917ff 100644 --- a/core/applets/homeapplet/home.cpp +++ b/core/applets/homeapplet/home.cpp | |||
@@ -1,85 +1,82 @@ | |||
1 | #include "home.h" | 1 | #include "home.h" |
2 | 2 | ||
3 | #include <opie2/oresource.h> | ||
4 | |||
3 | #include <qpe/applnk.h> | 5 | #include <qpe/applnk.h> |
4 | #include <qpe/resource.h> | ||
5 | #include <qpe/qcopenvelope_qws.h> | 6 | #include <qpe/qcopenvelope_qws.h> |
6 | 7 | ||
7 | #include <qapplication.h> | 8 | #include <qapplication.h> |
8 | 9 | ||
9 | HomeApplet::HomeApplet ( ) | 10 | HomeApplet::HomeApplet ( ) |
10 | : QObject ( 0, "HomeApplet" ) | 11 | : QObject ( 0, "HomeApplet" ) |
11 | { | 12 | { |
12 | } | 13 | } |
13 | 14 | ||
14 | HomeApplet::~HomeApplet ( ) | 15 | HomeApplet::~HomeApplet ( ) |
15 | { | 16 | { |
16 | } | 17 | } |
17 | 18 | ||
18 | int HomeApplet::position ( ) const | 19 | int HomeApplet::position ( ) const |
19 | { | 20 | { |
20 | return 4; | 21 | return 4; |
21 | } | 22 | } |
22 | 23 | ||
23 | QString HomeApplet::name ( ) const | 24 | QString HomeApplet::name ( ) const |
24 | { | 25 | { |
25 | return tr( "Home shortcut" ); | 26 | return tr( "Home shortcut" ); |
26 | } | 27 | } |
27 | 28 | ||
28 | QString HomeApplet::text ( ) const | 29 | QString HomeApplet::text ( ) const |
29 | { | 30 | { |
30 | return tr( "Desktop" ); | 31 | return tr( "Desktop" ); |
31 | } | 32 | } |
32 | 33 | ||
33 | QString HomeApplet::tr( const char* s ) const | 34 | QString HomeApplet::tr( const char* s ) const |
34 | { | 35 | { |
35 | return qApp->translate( "HomeApplet", s, 0 ); | 36 | return qApp->translate( "HomeApplet", s, 0 ); |
36 | } | 37 | } |
37 | 38 | ||
38 | QString HomeApplet::tr( const char* s, const char* p ) const | 39 | QString HomeApplet::tr( const char* s, const char* p ) const |
39 | { | 40 | { |
40 | return qApp->translate( "HomeApplet", s, p ); | 41 | return qApp->translate( "HomeApplet", s, p ); |
41 | } | 42 | } |
42 | 43 | ||
43 | QIconSet HomeApplet::icon ( ) const | 44 | QIconSet HomeApplet::icon ( ) const |
44 | { | 45 | { |
45 | QPixmap pix; | 46 | QPixmap pix = Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ); |
46 | QImage img = Resource::loadImage ( "home" ); | ||
47 | |||
48 | if ( !img. isNull ( )) | ||
49 | pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
50 | return pix; | 47 | return pix; |
51 | } | 48 | } |
52 | 49 | ||
53 | QPopupMenu *HomeApplet::popup ( QWidget * ) const | 50 | QPopupMenu *HomeApplet::popup ( QWidget * ) const |
54 | { | 51 | { |
55 | return 0; | 52 | return 0; |
56 | } | 53 | } |
57 | 54 | ||
58 | void HomeApplet::activated ( ) | 55 | void HomeApplet::activated ( ) |
59 | { | 56 | { |
60 | // to desktop (home) | 57 | // to desktop (home) |
61 | QCopEnvelope ( "QPE/Application/qpe", "raise()" ); | 58 | QCopEnvelope ( "QPE/Application/qpe", "raise()" ); |
62 | } | 59 | } |
63 | 60 | ||
64 | 61 | ||
65 | QRESULT HomeApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 62 | QRESULT HomeApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
66 | { | 63 | { |
67 | *iface = 0; | 64 | *iface = 0; |
68 | if ( uuid == IID_QUnknown ) | 65 | if ( uuid == IID_QUnknown ) |
69 | *iface = this; | 66 | *iface = this; |
70 | else if ( uuid == IID_MenuApplet ) | 67 | else if ( uuid == IID_MenuApplet ) |
71 | *iface = this; | 68 | *iface = this; |
72 | else | 69 | else |
73 | return QS_FALSE; | 70 | return QS_FALSE; |
74 | 71 | ||
75 | if ( *iface ) | 72 | if ( *iface ) |
76 | (*iface)-> addRef ( ); | 73 | (*iface)-> addRef ( ); |
77 | return QS_OK; | 74 | return QS_OK; |
78 | } | 75 | } |
79 | 76 | ||
80 | Q_EXPORT_INTERFACE( ) | 77 | Q_EXPORT_INTERFACE( ) |
81 | { | 78 | { |
82 | Q_CREATE_INSTANCE( HomeApplet ) | 79 | Q_CREATE_INSTANCE( HomeApplet ) |
83 | } | 80 | } |
84 | 81 | ||
85 | 82 | ||
diff --git a/core/applets/homeapplet/homeapplet.pro b/core/applets/homeapplet/homeapplet.pro index a8db61f..e21e80f 100644 --- a/core/applets/homeapplet/homeapplet.pro +++ b/core/applets/homeapplet/homeapplet.pro | |||
@@ -1,13 +1,13 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt plugin warn_on | 2 | CONFIG += qt plugin warn_on |
3 | HEADERS = home.h | 3 | HEADERS = home.h |
4 | SOURCES = home.cpp | 4 | SOURCES = home.cpp |
5 | TARGET = homeapplet | 5 | TARGET = homeapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe | 9 | LIBS += -lqpe -lopiecore2 |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
11 | 11 | ||
12 | include( $(OPIEDIR)/include.pro ) | 12 | include( $(OPIEDIR)/include.pro ) |
13 | target.path = $$prefix/plugins/applets | 13 | target.path = $$prefix/plugins/applets |