From: Willem Liu Date: Tue, 14 Sep 2010 16:31:19 +0000 (+0200) Subject: Now remembers the display orientation so pressing Rotate button will change the orien... X-Git-Tag: easylist-0.3.8~7 X-Git-Url: http://vcs.maemo.org/git/?p=easylist;a=commitdiff_plain;h=b53eae17251022f0fe02110014d85bb72c5be258 Now remembers the display orientation so pressing Rotate button will change the orientation no matter what iss saved in QSettings. --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 991fefa..a68b9fd 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -243,7 +243,8 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::slotActionRotate(QAction* action) { qDebug() << "Rotate" << action->text(); - landscape = !landscape; + + landscape = !tempLandscapeMode; settings->setValue("Landscape", landscape); setLandscapeMode(landscape); } @@ -255,12 +256,14 @@ void MainWindow::setLandscapeMode(bool landscape) { if(landscape) { + tempLandscapeMode = true; qDebug() << "Landscape"; setAttribute(Qt::WA_Maemo5LandscapeOrientation, true); setAttribute(Qt::WA_Maemo5PortraitOrientation, false); } else { + tempLandscapeMode = false; qDebug() << "Portrait"; setAttribute(Qt::WA_Maemo5PortraitOrientation, true); setAttribute(Qt::WA_Maemo5LandscapeOrientation, false); diff --git a/src/mainwindow.h b/src/mainwindow.h index 7501ceb..076f50c 100755 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -50,6 +50,7 @@ private: QVector checkBoxes; QSettings *settings; bool landscape; + bool tempLandscapeMode; Ui::EditWindow *editUi; Ui::ListWindow *listUi;