Now remembers the display orientation so pressing Rotate button will change the orien...
authorWillem Liu <willem.liu@gmail.com>
Tue, 14 Sep 2010 16:31:19 +0000 (18:31 +0200)
committerWillem Liu <willem.liu@gmail.com>
Tue, 14 Sep 2010 16:31:19 +0000 (18:31 +0200)
src/mainwindow.cpp
src/mainwindow.h

index 991fefa..a68b9fd 100755 (executable)
@@ -243,7 +243,8 @@ void MainWindow::closeEvent(QCloseEvent *event)
 void MainWindow::slotActionRotate(QAction* action)\r
 {\r
     qDebug() << "Rotate" << action->text();\r
-    landscape = !landscape;\r
+\r
+    landscape = !tempLandscapeMode;\r
     settings->setValue("Landscape", landscape);\r
     setLandscapeMode(landscape);\r
 }\r
@@ -255,12 +256,14 @@ void MainWindow::setLandscapeMode(bool landscape)
 {\r
     if(landscape)\r
     {\r
+        tempLandscapeMode = true;\r
         qDebug() << "Landscape";\r
         setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);\r
         setAttribute(Qt::WA_Maemo5PortraitOrientation, false);\r
     }\r
     else\r
     {\r
+        tempLandscapeMode = false;\r
         qDebug() << "Portrait";\r
         setAttribute(Qt::WA_Maemo5PortraitOrientation, true);\r
         setAttribute(Qt::WA_Maemo5LandscapeOrientation, false);\r
index 7501ceb..076f50c 100755 (executable)
@@ -50,6 +50,7 @@ private:
     QVector<QCheckBox * > checkBoxes;
     QSettings *settings;
     bool landscape;
+    bool tempLandscapeMode;
 
     Ui::EditWindow *editUi;
     Ui::ListWindow *listUi;