summaryrefslogtreecommitdiff
path: root/core
authorharlekin <harlekin>2003-04-18 21:20:04 (UTC)
committer harlekin <harlekin>2003-04-18 21:20:04 (UTC)
commit1cdd9c974e621f6992ddc6dfccbc815baebd19ee (patch) (unidiff)
treec479e851ffc9788e75d12be116fb0b44827a9b45 /core
parentc667951bfeaa17136bc828380e38062e150b2762 (diff)
downloadopie-1cdd9c974e621f6992ddc6dfccbc815baebd19ee.zip
opie-1cdd9c974e621f6992ddc6dfccbc815baebd19ee.tar.gz
opie-1cdd9c974e621f6992ddc6dfccbc815baebd19ee.tar.bz2
add a qcop channel
Diffstat (limited to 'core') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/rotateapplet/rotate.cpp25
-rw-r--r--core/applets/rotateapplet/rotate.h14
2 files changed, 35 insertions, 4 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index b490626..04270f1 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -41,12 +41,33 @@
41RotateApplet::RotateApplet ( ) 41RotateApplet::RotateApplet ( )
42 : QObject ( 0, "RotateApplet" ), ref ( 0 ), m_flipped( false ) 42 : QObject ( 0, "RotateApplet" ), ref ( 0 ), m_flipped( false )
43{ 43{
44
45#if defined(Q_WS_QWS)
46#if !defined(QT_NO_COP)
47 QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this );
48 connect ( rotateChannel, SIGNAL( received( const QCString &, const QByteArray &) ),
49 this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) );
50#endif
51#endif
52
44} 53}
45 54
46RotateApplet::~RotateApplet ( ) 55RotateApplet::~RotateApplet ( )
47{ 56{
48} 57}
49 58
59
60/**
61 * Qcop receive method.
62 */
63void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) {
64 QDataStream stream( data, IO_ReadOnly );
65 if ( msg == "flip()" ) {
66 activated ( );
67 }
68}
69
70
50int RotateApplet::position ( ) const 71int RotateApplet::position ( ) const
51{ 72{
52 return 3; 73 return 3;
@@ -62,7 +83,7 @@ QString RotateApplet::text ( ) const
62 return tr( "Rotate" ); 83 return tr( "Rotate" );
63} 84}
64 85
65QString RotateApplet::tr( const char* s ) const 86/*QString RotateApplet::tr( const char* s ) const
66{ 87{
67 return qApp->translate( "RotateApplet", s, 0 ); 88 return qApp->translate( "RotateApplet", s, 0 );
68} 89}
@@ -71,6 +92,7 @@ QString RotateApplet::tr( const char* s, const char* p ) const
71{ 92{
72 return qApp->translate( "RotateApplet", s, p ); 93 return qApp->translate( "RotateApplet", s, p );
73} 94}
95*/
74 96
75QIconSet RotateApplet::icon ( ) const 97QIconSet RotateApplet::icon ( ) const
76{ 98{
@@ -89,6 +111,7 @@ QPopupMenu *RotateApplet::popup ( QWidget * ) const
89 111
90void RotateApplet::activated ( ) 112void RotateApplet::activated ( )
91{ 113{
114
92 int defaultRotation = QPEApplication::defaultRotation(); 115 int defaultRotation = QPEApplication::defaultRotation();
93 116
94 int newRotation; 117 int newRotation;
diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h
index 57f9040..5ac7768 100644
--- a/core/applets/rotateapplet/rotate.h
+++ b/core/applets/rotateapplet/rotate.h
@@ -32,9 +32,13 @@
32#define __OPIE_ROTATE_APPLET_H__ 32#define __OPIE_ROTATE_APPLET_H__
33 33
34#include <qpe/menuappletinterface.h> 34#include <qpe/menuappletinterface.h>
35#include <qobject.h>
35 36
36class RotateApplet : public QObject, public MenuAppletInterface 37class RotateApplet : public QObject, public MenuAppletInterface
37{ 38{
39
40 Q_OBJECT
41
38public: 42public:
39 RotateApplet ( ); 43 RotateApplet ( );
40 virtual ~RotateApplet ( ); 44 virtual ~RotateApplet ( );
@@ -47,15 +51,19 @@ public:
47 virtual QString name ( ) const; 51 virtual QString name ( ) const;
48 virtual QIconSet icon ( ) const; 52 virtual QIconSet icon ( ) const;
49 virtual QString text ( ) const; 53 virtual QString text ( ) const;
50 virtual QString tr( const char* ) const; 54 /* virtual QString tr( const char* ) const;
51 virtual QString tr( const char*, const char* ) const; 55 virtual QString tr( const char*, const char* ) const;
56 */
52 virtual QPopupMenu *popup ( QWidget *parent ) const; 57 virtual QPopupMenu *popup ( QWidget *parent ) const;
53
54 virtual void activated ( ); 58 virtual void activated ( );
55 59
60private slots:
61 void channelReceived( const QCString &msg, const QByteArray & data );
62
56private: 63private:
57 bool m_flipped;
58 ulong ref; 64 ulong ref;
65 bool m_flipped;
66
59}; 67};
60 68
61#endif 69#endif