summaryrefslogtreecommitdiff
path: root/noncore/settings/appearance2
authorkergoth <kergoth>2003-04-18 22:17:38 (UTC)
committer kergoth <kergoth>2003-04-18 22:17:38 (UTC)
commit6e7112a3610c4e562f991ba6d6f33ca2fe0c605d (patch) (side-by-side diff)
treeae90d7b8c36c49f109e3c2f231a119fc7fd5b799 /noncore/settings/appearance2
parentd0852e67c15c5a973b7bc7f7bee238a6fd00dee6 (diff)
downloadopie-6e7112a3610c4e562f991ba6d6f33ca2fe0c605d.zip
opie-6e7112a3610c4e562f991ba6d6f33ca2fe0c605d.tar.gz
opie-6e7112a3610c4e562f991ba6d6f33ca2fe0c605d.tar.bz2
Make appearance and rotate applet use the new rotation method of odevice.
Diffstat (limited to 'noncore/settings/appearance2') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 83532de..c376ec7 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -429,10 +429,18 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
rotLay-> addWidget ( m_rotdir_ccw, 0 );
rotLay-> addWidget ( m_rotdir_flip, 0 );
- int rot = cfg. readNumEntry ( "rotatedir", 0 );
- m_rotdir_cw-> setChecked ( rot == 0 );
- m_rotdir_ccw-> setChecked ( rot == 1 );
- m_rotdir_flip-> setChecked ( rot == 2 );
+ int rotDirection = cfg.readNumEntry( "rotatedir" );
+ ODirection rot = CW;
+
+ if (rotDirection == -1) {
+ rot = ODevice::inst ( )-> direction ( );
+ } else {
+ rot = (ODirection)rotDirection;
+ }
+
+ m_rotdir_cw-> setChecked ( rot == CW );
+ m_rotdir_ccw-> setChecked ( rot == CCW );
+ m_rotdir_flip-> setChecked ( rot == Flip );
return tab;
}
@@ -526,16 +534,15 @@ void Appearance::accept ( )
item-> save ( config );
}
- bool is_rotdir_ccw = m_rotdir_ccw-> isChecked ( );
- int rotval;
+ ODirection rot;
if (m_rotdir_ccw-> isChecked ( )) {
- rotval = 1;
+ rot = CCW;
} else if (m_rotdir_cw-> isChecked ( )) {
- rotval = 0;
+ rot = CW;
} else {
- rotval = 2;
+ rot = Flip;
}
- config. writeEntry ( "rotatedir", rotval );
+ config. writeEntry ( "rotatedir", (int)rot );
m_except-> setFocus ( ); // if the focus was on the embedded line-edit, we have to move it away first, so the contents are updated