summaryrefslogtreecommitdiff
authortreke <treke>2003-12-09 03:25:26 (UTC)
committer treke <treke>2003-12-09 03:25:26 (UTC)
commit1440000b373d624956f7cbc693ac67e248b7bdb3 (patch) (unidiff)
tree9c6cc91452b7a4ae9b122908c23a2588dc31f28e
parent1538a521b674d2eff02b926c0d82fa6184dd99db (diff)
downloadopie-1440000b373d624956f7cbc693ac67e248b7bdb3.zip
opie-1440000b373d624956f7cbc693ac67e248b7bdb3.tar.gz
opie-1440000b373d624956f7cbc693ac67e248b7bdb3.tar.bz2
Disabling the rotationw worked, but the code was horribly unobvious. Rewriting for clarity.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/rotateapplet/rotate.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index 0da2f0c..dd71cad 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -109,67 +109,67 @@ QIconSet RotateApplet::icon ( ) const
109} 109}
110 110
111QPopupMenu *RotateApplet::popup ( QWidget * ) const 111QPopupMenu *RotateApplet::popup ( QWidget * ) const
112{ 112{
113 return 0; 113 return 0;
114} 114}
115 115
116void RotateApplet::rotateDefault ( ) 116void RotateApplet::rotateDefault ( )
117{ 117{
118 118
119 int rot = ODevice::inst()->rotation(); 119 int rot = ODevice::inst()->rotation();
120 120
121 switch (rot) { 121 switch (rot) {
122 case Rot0: 122 case Rot0:
123 rot=0; 123 rot=0;
124 break; 124 break;
125 case Rot90: 125 case Rot90:
126 rot=90; 126 rot=90;
127 break; 127 break;
128 case Rot180: 128 case Rot180:
129 rot=180; 129 rot=180;
130 break; 130 break;
131 case Rot270: 131 case Rot270:
132 rot=270; 132 rot=270;
133 break; 133 break;
134 default: 134 default:
135 rot=0; 135 rot=0;
136 break; 136 break;
137 } 137 }
138 Config cfg( "qpe" ); 138 Config cfg( "qpe" );
139 cfg.setGroup( "Appearance" ); 139 cfg.setGroup( "Appearance" );
140 140
141 bool rotateDisabled = cfg.readBoolEntry( "rotateEnabled",false ); 141 bool rotateEnabled = cfg.readBoolEntry( "rotateEnabled",true );
142 142
143 if (rotateDisabled == true) 143 if (rotateEnabled == false)
144 return; 144 return;
145 145
146 // hide inputs methods before rotation 146 // hide inputs methods before rotation
147 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" ); 147 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" );
148 148
149 QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" ); 149 QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" );
150 env << rot; 150 env << rot;
151 151
152 m_flipped = false; 152 m_flipped = false;
153 153
154} 154}
155void RotateApplet::activated ( ) 155void RotateApplet::activated ( )
156{ 156{
157 157
158 int defaultRotation = QPEApplication::defaultRotation(); 158 int defaultRotation = QPEApplication::defaultRotation();
159 int newRotation = defaultRotation; 159 int newRotation = defaultRotation;
160 160
161 Config cfg( "qpe" ); 161 Config cfg( "qpe" );
162 cfg.setGroup( "Appearance" ); 162 cfg.setGroup( "Appearance" );
163 163
164 int rotDirection = cfg.readNumEntry( "rotatedir" ); 164 int rotDirection = cfg.readNumEntry( "rotatedir" );
165 ODirection rot = CW; 165 ODirection rot = CW;
166 166
167 if (rotDirection == -1) { 167 if (rotDirection == -1) {
168 rot = ODevice::inst ( )-> direction ( ); 168 rot = ODevice::inst ( )-> direction ( );
169 } else { 169 } else {
170 rot = (ODirection)rotDirection; 170 rot = (ODirection)rotDirection;
171 } 171 }
172 172
173 // hide inputs methods before rotation 173 // hide inputs methods before rotation
174 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" ); 174 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" );
175 175