summaryrefslogtreecommitdiff
authordrw <drw>2005-04-24 21:58:21 (UTC)
committer drw <drw>2005-04-24 21:58:21 (UTC)
commitbebd0bb33ac2508bf8df37a1f20c7ec404bcbc2d (patch) (unidiff)
treeb730105ca766ff432d559957eadf8429d3094771
parentb513e26413e5b2aa7a52c23044e936a45b681f4b (diff)
downloadopie-bebd0bb33ac2508bf8df37a1f20c7ec404bcbc2d.zip
opie-bebd0bb33ac2508bf8df37a1f20c7ec404bcbc2d.tar.gz
opie-bebd0bb33ac2508bf8df37a1f20c7ec404bcbc2d.tar.bz2
Resource -> OResource
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/suspendapplet/suspend.cpp9
-rw-r--r--core/applets/suspendapplet/suspendapplet.pro2
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,85 +1,82 @@
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
9SuspendApplet::SuspendApplet ( ) 10SuspendApplet::SuspendApplet ( )
10 : QObject ( 0, "SuspendApplet" ) 11 : QObject ( 0, "SuspendApplet" )
11{ 12{
12} 13}
13 14
14SuspendApplet::~SuspendApplet ( ) 15SuspendApplet::~SuspendApplet ( )
15{ 16{
16} 17}
17 18
18int SuspendApplet::position ( ) const 19int SuspendApplet::position ( ) const
19{ 20{
20 return 2; 21 return 2;
21} 22}
22 23
23QString SuspendApplet::name ( ) const 24QString SuspendApplet::name ( ) const
24{ 25{
25 return tr( "Suspend shortcut" ); 26 return tr( "Suspend shortcut" );
26} 27}
27 28
28QString SuspendApplet::text ( ) const 29QString SuspendApplet::text ( ) const
29{ 30{
30 return tr( "Suspend" ); 31 return tr( "Suspend" );
31} 32}
32 33
33QString SuspendApplet::tr( const char* s ) const 34QString 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
38QString SuspendApplet::tr( const char* s, const char* p ) const 39QString 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
43QIconSet SuspendApplet::icon ( ) const 44QIconSet 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
53QPopupMenu *SuspendApplet::popup ( QWidget * ) const 50QPopupMenu *SuspendApplet::popup ( QWidget * ) const
54{ 51{
55 return 0; 52 return 0;
56} 53}
57 54
58void SuspendApplet::activated ( ) 55void SuspendApplet::activated ( )
59{ 56{
60 // suspend 57 // suspend
61 QCopEnvelope ( "QPE/System", "suspend()" ); 58 QCopEnvelope ( "QPE/System", "suspend()" );
62} 59}
63 60
64 61
65QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) 62QRESULT SuspendApplet::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
80Q_EXPORT_INTERFACE( ) 77Q_EXPORT_INTERFACE( )
81{ 78{
82 Q_CREATE_INSTANCE( SuspendApplet ) 79 Q_CREATE_INSTANCE( SuspendApplet )
83} 80}
84 81
85 82
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 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt plugin warn_on 2CONFIG += qt plugin warn_on
3HEADERS = suspend.h 3HEADERS = suspend.h
4SOURCES = suspend.cpp 4SOURCES = suspend.cpp
5TARGET = suspendapplet 5TARGET = suspendapplet
6DESTDIR = $(OPIEDIR)/plugins/applets 6DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe -lopiecore2
10VERSION = 1.0.0 10VERSION = 1.0.0
11 11
12include( $(OPIEDIR)/include.pro ) 12include( $(OPIEDIR)/include.pro )
13target.path = $$prefix/plugins/applets 13target.path = $$prefix/plugins/applets