-rw-r--r-- | core/applets/rotateapplet/rotate.cpp | 6 | ||||
-rw-r--r-- | core/applets/rotateapplet/rotate.h | 1 |
2 files changed, 3 insertions, 4 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp index 8f323d6..653c61f 100644 --- a/core/applets/rotateapplet/rotate.cpp +++ b/core/applets/rotateapplet/rotate.cpp | |||
@@ -36,17 +36,16 @@ | |||
36 | 36 | ||
37 | #include "rotate.h" | 37 | #include "rotate.h" |
38 | 38 | ||
39 | 39 | ||
40 | RotateApplet::RotateApplet ( ) | 40 | RotateApplet::RotateApplet ( ) |
41 | : QObject ( 0, "RotateApplet" ), ref ( 0 ) | 41 | : QObject ( 0, "RotateApplet" ), ref ( 0 ) |
42 | { | 42 | { |
43 | m_native = true; | 43 | m_native = true; |
44 | m_startupRot = QPEApplication::defaultRotation(); | ||
45 | } | 44 | } |
46 | 45 | ||
47 | RotateApplet::~RotateApplet ( ) | 46 | RotateApplet::~RotateApplet ( ) |
48 | { | 47 | { |
49 | } | 48 | } |
50 | 49 | ||
51 | int RotateApplet::position ( ) const | 50 | int RotateApplet::position ( ) const |
52 | { | 51 | { |
@@ -85,21 +84,22 @@ QIconSet RotateApplet::icon ( ) const | |||
85 | 84 | ||
86 | QPopupMenu *RotateApplet::popup ( QWidget * ) const | 85 | QPopupMenu *RotateApplet::popup ( QWidget * ) const |
87 | { | 86 | { |
88 | return 0; | 87 | return 0; |
89 | } | 88 | } |
90 | 89 | ||
91 | void RotateApplet::activated ( ) | 90 | void RotateApplet::activated ( ) |
92 | { | 91 | { |
92 | int currentRotation = QPEApplication::defaultRotation(); | ||
93 | int newRotation; | 93 | int newRotation; |
94 | if ( m_native == true ) { | 94 | if ( m_native == true ) { |
95 | newRotation = m_startupRot + 90; | 95 | newRotation = currentRotation + 90; |
96 | } else { | 96 | } else { |
97 | newRotation = m_startupRot; | 97 | newRotation = currentRotation - 90; |
98 | } | 98 | } |
99 | QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" ); | 99 | QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" ); |
100 | env << newRotation; | 100 | env << newRotation; |
101 | QCopEnvelope env2( "QPE/System", "setDefaultRotation(int)" ); | 101 | QCopEnvelope env2( "QPE/System", "setDefaultRotation(int)" ); |
102 | env2 << newRotation; | 102 | env2 << newRotation; |
103 | 103 | ||
104 | m_native = !m_native; | 104 | m_native = !m_native; |
105 | 105 | ||
diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h index 11e2ec9..c4087f9 100644 --- a/core/applets/rotateapplet/rotate.h +++ b/core/applets/rotateapplet/rotate.h | |||
@@ -50,13 +50,12 @@ public: | |||
50 | virtual QString tr( const char* ) const; | 50 | virtual QString tr( const char* ) const; |
51 | virtual QString tr( const char*, const char* ) const; | 51 | virtual QString tr( const char*, const char* ) const; |
52 | virtual QPopupMenu *popup ( QWidget *parent ) const; | 52 | virtual QPopupMenu *popup ( QWidget *parent ) const; |
53 | 53 | ||
54 | virtual void activated ( ); | 54 | virtual void activated ( ); |
55 | 55 | ||
56 | private: | 56 | private: |
57 | bool m_native; | 57 | bool m_native; |
58 | int m_startupRot; | ||
59 | ulong ref; | 58 | ulong ref; |
60 | }; | 59 | }; |
61 | 60 | ||
62 | #endif | 61 | #endif |