summaryrefslogtreecommitdiff
path: root/core/applets/suspendapplet/suspend.cpp
authormickeyl <mickeyl>2003-03-16 19:07:50 (UTC)
committer mickeyl <mickeyl>2003-03-16 19:07:50 (UTC)
commitae6b3de789726af3928664ef03eac81950e716e4 (patch) (unidiff)
tree687455725b5dafcfc7851563bf8203c25060e102 /core/applets/suspendapplet/suspend.cpp
parent917fb7d2dca76f5c2c5c86553be0fcc2832c3435 (diff)
downloadopie-ae6b3de789726af3928664ef03eac81950e716e4.zip
opie-ae6b3de789726af3928664ef03eac81950e716e4.tar.gz
opie-ae6b3de789726af3928664ef03eac81950e716e4.tar.bz2
Enable translations of startmenu-applets. Problem is, in Qt2, moc generates
the necessary tr() functions which adds the context (aka class name) and then calls translate(). The startmenu applets don't use moc and therefore don't get the appropriate tr() functions.
Diffstat (limited to 'core/applets/suspendapplet/suspend.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/suspendapplet/suspend.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/applets/suspendapplet/suspend.cpp b/core/applets/suspendapplet/suspend.cpp
index b502e87..4bdc8fb 100644
--- a/core/applets/suspendapplet/suspend.cpp
+++ b/core/applets/suspendapplet/suspend.cpp
@@ -1,15 +1,16 @@
1#include <qpe/resource.h> 1#include <qpe/resource.h>
2#include <qpe/qcopenvelope_qws.h> 2#include <qpe/qcopenvelope_qws.h>
3 3
4#include <qapplication.h>
4#include <qiconset.h> 5#include <qiconset.h>
5#include <qpopupmenu.h> 6#include <qpopupmenu.h>
6 7
7#include "suspend.h" 8#include "suspend.h"
8 9
9 10
10SuspendApplet::SuspendApplet ( ) 11SuspendApplet::SuspendApplet ( )
11 : QObject ( 0, "SuspendApplet" ), ref ( 0 ) 12 : QObject ( 0, "SuspendApplet" ), ref ( 0 )
12{ 13{
13} 14}
14 15
15SuspendApplet::~SuspendApplet ( ) 16SuspendApplet::~SuspendApplet ( )
@@ -22,24 +23,34 @@ int SuspendApplet::position ( ) const
22} 23}
23 24
24QString SuspendApplet::name ( ) const 25QString SuspendApplet::name ( ) const
25{ 26{
26 return tr( "Suspend shortcut" ); 27 return tr( "Suspend shortcut" );
27} 28}
28 29
29QString SuspendApplet::text ( ) const 30QString SuspendApplet::text ( ) const
30{ 31{
31 return tr( "Suspend" ); 32 return tr( "Suspend" );
32} 33}
33 34
35QString SuspendApplet::tr( const char* s ) const
36{
37 return qApp->translate( "SuspendApplet", s, 0 );
38}
39
40QString SuspendApplet::tr( const char* s, const char* p ) const
41{
42 return qApp->translate( "SuspendApplet", s, p );
43}
44
34QIconSet SuspendApplet::icon ( ) const 45QIconSet SuspendApplet::icon ( ) const
35{ 46{
36 QPixmap pix; 47 QPixmap pix;
37 QImage img = Resource::loadImage ( "suspend" ); 48 QImage img = Resource::loadImage ( "suspend" );
38 49
39 if ( !img. isNull ( )) 50 if ( !img. isNull ( ))
40 pix. convertFromImage ( img. smoothScale ( 14, 14 )); 51 pix. convertFromImage ( img. smoothScale ( 14, 14 ));
41 return pix; 52 return pix;
42} 53}
43 54
44QPopupMenu *SuspendApplet::popup ( QWidget * ) const 55QPopupMenu *SuspendApplet::popup ( QWidget * ) const
45{ 56{