Make use of autoRotate setting in main application
[qcpufreq] / src / mainwindow.cpp
index 6fc41dc..8ea4a24 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * QCPUFreq - a simple cpufreq GUI
- * Copyright (C) 2010 Daniel Klaffenbach <daniel.klaffenbach@cs.tu-chemnitz.de>
+ * Copyright (C) 2010 Daniel Klaffenbach <danielklaffenbach@gmail.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -58,7 +58,7 @@ MainWindow::MainWindow(QWidget *parent) :
     init();
     refresh();
 
-    // enable auto rotation
+    // setup auto rotation
     setAutoRotation();
 
     //initialize orientation
@@ -73,6 +73,7 @@ MainWindow::MainWindow(QWidget *parent) :
     #endif
     helpWindow.setWindowFlags( windowFlags() | Qt::Window );
 
+    //Settings widget
     settings.hide();
 
     //connect signals and slots
@@ -450,12 +451,12 @@ void MainWindow::orientationChanged()
 
 
 /**
-  * Enables the auto-rotation feature of Maemo5 devices
+  * Enables or disables the auto-rotation feature of Maemo5 devices.
   */
 void MainWindow::setAutoRotation()
 {
 #if defined(Q_WS_MAEMO_5)
-    setAttribute(Qt::WA_Maemo5AutoOrientation, true);
+    setAttribute(Qt::WA_Maemo5AutoOrientation, settings.useAutoRotate());
 #endif
 }
 
@@ -510,7 +511,7 @@ void MainWindow::showHelp()
   */
 void MainWindow::showSettings()
 {
-    settings.setWindowFlags(Qt::Popup);
+    settings.reset();
     settings.show();
 }