author | sandman <sandman> | 2002-10-02 22:02:20 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-02 22:02:20 (UTC) |
commit | 8708473ed5d4c04007ad3caa00fc2e67e76da3fe (patch) (side-by-side diff) | |
tree | ce4e7c62e3b7d26a5d2a0c0af6913858abd0ce02 /core/applets/suspendapplet/suspend.cpp | |
parent | 608c4065319799edd2365a78790d5db1463a747d (diff) | |
download | opie-8708473ed5d4c04007ad3caa00fc2e67e76da3fe.zip opie-8708473ed5d4c04007ad3caa00fc2e67e76da3fe.tar.gz opie-8708473ed5d4c04007ad3caa00fc2e67e76da3fe.tar.bz2 |
New menubar applets for Home and Suspend -- replaces the __* entries
in OPIEDIR/apps/
Diffstat (limited to 'core/applets/suspendapplet/suspend.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/suspendapplet/suspend.cpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/core/applets/suspendapplet/suspend.cpp b/core/applets/suspendapplet/suspend.cpp new file mode 100644 index 0000000..5966a84 --- a/dev/null +++ b/core/applets/suspendapplet/suspend.cpp @@ -0,0 +1,74 @@ +#include <qpe/resource.h> +#include <qpe/qcopenvelope_qws.h> + +#include <qiconset.h> +#include <qpopupmenu.h> + +#include "suspend.h" + + +SuspendApplet::SuspendApplet ( ) + : QObject ( 0, "SuspendApplet" ), ref ( 0 ) +{ +} + +SuspendApplet::~SuspendApplet ( ) +{ +} + +int SuspendApplet::position ( ) const +{ + return 0; +} + +QString SuspendApplet::name ( ) const +{ + return tr( "Suspend shortcut" ); +} + +QString SuspendApplet::text ( ) const +{ + return tr( "Suspend" ); +} + +QIconSet SuspendApplet::icon ( ) const +{ + QPixmap pix; + QImage img = Resource::loadImage ( "Shutdown" ); + + if ( !img. isNull ( )) + pix. convertFromImage ( img. smoothScale ( 16, 16 )); + return pix; +} + +QPopupMenu *SuspendApplet::popup ( QWidget * ) const +{ + return 0; +} + +void SuspendApplet::activated ( ) +{ + // suspend + QCopEnvelope ( "QPE/Desktop", "suspend()" ); +} + + +QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) +{ + *iface = 0; + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_MenuApplet ) + *iface = this; + + if ( *iface ) + (*iface)-> addRef ( ); + return QS_OK; +} + +Q_EXPORT_INTERFACE( ) +{ + Q_CREATE_INSTANCE( SuspendApplet ) +} + + |