-rw-r--r-- | core/applets/suspendapplet/suspend.cpp | 9 | ||||
-rw-r--r-- | core/applets/suspendapplet/suspendapplet.pro | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/core/applets/suspendapplet/suspend.cpp b/core/applets/suspendapplet/suspend.cpp index 4fbd704..f675766 100644 --- a/core/applets/suspendapplet/suspend.cpp +++ b/core/applets/suspendapplet/suspend.cpp | |||
@@ -1,20 +1,21 @@ | |||
1 | #include "suspend.h" | 1 | #include "suspend.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 | SuspendApplet::SuspendApplet ( ) | 10 | SuspendApplet::SuspendApplet ( ) |
10 | : QObject ( 0, "SuspendApplet" ) | 11 | : QObject ( 0, "SuspendApplet" ) |
11 | { | 12 | { |
12 | } | 13 | } |
13 | 14 | ||
14 | SuspendApplet::~SuspendApplet ( ) | 15 | SuspendApplet::~SuspendApplet ( ) |
15 | { | 16 | { |
16 | } | 17 | } |
17 | 18 | ||
18 | int SuspendApplet::position ( ) const | 19 | int SuspendApplet::position ( ) const |
19 | { | 20 | { |
20 | return 2; | 21 | return 2; |
@@ -29,37 +30,33 @@ QString SuspendApplet::text ( ) const | |||
29 | { | 30 | { |
30 | return tr( "Suspend" ); | 31 | return tr( "Suspend" ); |
31 | } | 32 | } |
32 | 33 | ||
33 | QString SuspendApplet::tr( const char* s ) const | 34 | QString SuspendApplet::tr( const char* s ) const |
34 | { | 35 | { |
35 | return qApp->translate( "SuspendApplet", s, 0 ); | 36 | return qApp->translate( "SuspendApplet", s, 0 ); |
36 | } | 37 | } |
37 | 38 | ||
38 | QString SuspendApplet::tr( const char* s, const char* p ) const | 39 | QString SuspendApplet::tr( const char* s, const char* p ) const |
39 | { | 40 | { |
40 | return qApp->translate( "SuspendApplet", s, p ); | 41 | return qApp->translate( "SuspendApplet", s, p ); |
41 | } | 42 | } |
42 | 43 | ||
43 | QIconSet SuspendApplet::icon ( ) const | 44 | QIconSet SuspendApplet::icon ( ) const |
44 | { | 45 | { |
45 | QPixmap pix; | 46 | QPixmap pix = Opie::Core::OResource::loadPixmap( "suspend", Opie::Core::OResource::SmallIcon ); |
46 | QImage img = Resource::loadImage ( "suspend" ); | ||
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 *SuspendApplet::popup ( QWidget * ) const | 50 | QPopupMenu *SuspendApplet::popup ( QWidget * ) const |
54 | { | 51 | { |
55 | return 0; | 52 | return 0; |
56 | } | 53 | } |
57 | 54 | ||
58 | void SuspendApplet::activated ( ) | 55 | void SuspendApplet::activated ( ) |
59 | { | 56 | { |
60 | // suspend | 57 | // suspend |
61 | QCopEnvelope ( "QPE/System", "suspend()" ); | 58 | QCopEnvelope ( "QPE/System", "suspend()" ); |
62 | } | 59 | } |
63 | 60 | ||
64 | 61 | ||
65 | QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 62 | QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
diff --git a/core/applets/suspendapplet/suspendapplet.pro b/core/applets/suspendapplet/suspendapplet.pro index 6607383..5f139df 100644 --- a/core/applets/suspendapplet/suspendapplet.pro +++ b/core/applets/suspendapplet/suspendapplet.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 = suspend.h | 3 | HEADERS = suspend.h |
4 | SOURCES = suspend.cpp | 4 | SOURCES = suspend.cpp |
5 | TARGET = suspendapplet | 5 | TARGET = suspendapplet |
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 |