-rw-r--r-- | core/applets/rotateapplet/rotate.cpp | 25 | ||||
-rw-r--r-- | core/applets/rotateapplet/rotate.h | 16 |
2 files changed, 36 insertions, 5 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 | |||
@@ -43,2 +43,11 @@ RotateApplet::RotateApplet ( ) | |||
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 | } |
@@ -49,2 +58,14 @@ RotateApplet::~RotateApplet ( ) | |||
49 | 58 | ||
59 | |||
60 | /** | ||
61 | * Qcop receive method. | ||
62 | */ | ||
63 | void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) { | ||
64 | QDataStream stream( data, IO_ReadOnly ); | ||
65 | if ( msg == "flip()" ) { | ||
66 | activated ( ); | ||
67 | } | ||
68 | } | ||
69 | |||
70 | |||
50 | int RotateApplet::position ( ) const | 71 | int RotateApplet::position ( ) const |
@@ -64,3 +85,3 @@ QString RotateApplet::text ( ) const | |||
64 | 85 | ||
65 | QString RotateApplet::tr( const char* s ) const | 86 | /*QString RotateApplet::tr( const char* s ) const |
66 | { | 87 | { |
@@ -73,2 +94,3 @@ QString RotateApplet::tr( const char* s, const char* p ) const | |||
73 | } | 94 | } |
95 | */ | ||
74 | 96 | ||
@@ -91,2 +113,3 @@ void RotateApplet::activated ( ) | |||
91 | { | 113 | { |
114 | |||
92 | int defaultRotation = QPEApplication::defaultRotation(); | 115 | int defaultRotation = QPEApplication::defaultRotation(); |
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 | |||
@@ -34,2 +34,3 @@ | |||
34 | #include <qpe/menuappletinterface.h> | 34 | #include <qpe/menuappletinterface.h> |
35 | #include <qobject.h> | ||
35 | 36 | ||
@@ -37,2 +38,5 @@ class RotateApplet : public QObject, public MenuAppletInterface | |||
37 | { | 38 | { |
39 | |||
40 | Q_OBJECT | ||
41 | |||
38 | public: | 42 | public: |
@@ -49,11 +53,15 @@ public: | |||
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 | 58 | virtual void activated ( ); | |
54 | virtual void activated ( ); | 59 | |
60 | private slots: | ||
61 | void channelReceived( const QCString &msg, const QByteArray & data ); | ||
55 | 62 | ||
56 | private: | 63 | private: |
57 | bool m_flipped; | ||
58 | ulong ref; | 64 | ulong ref; |
65 | bool m_flipped; | ||
66 | |||
59 | }; | 67 | }; |