Apply auto-rotate setting without restarting QCPUFreq
[qcpufreq] / src / mainwindow.cpp
index 022d628..318f471 100644 (file)
@@ -30,6 +30,7 @@
 #define APPNAME "QCPUFreq"
 #define APPVERSION "0.3.99"
 
+
 MainWindow::MainWindow(QWidget *parent) :
     QMainWindow(parent),
     ui(new Ui::MainWindow),
@@ -49,6 +50,10 @@ MainWindow::MainWindow(QWidget *parent) :
 
     ui->setupUi(this);
 
+    //Settings widget
+    settings = new Settings;
+    settings->hide();
+
     init();
     refresh();
 
@@ -67,10 +72,6 @@ MainWindow::MainWindow(QWidget *parent) :
     #endif
     helpWindow.setWindowFlags( windowFlags() | Qt::Window );
 
-    //Settings widget
-    settings = new Settings;
-    settings->hide();
-
     //show errors about the sudo setup only once
     showSudoError = true;
 
@@ -82,6 +83,7 @@ MainWindow::MainWindow(QWidget *parent) :
     connect(ui->sr_box, SIGNAL(clicked()), this, SLOT(setSmartReflex()));
     connect(&refreshTimer, SIGNAL(timeout()), this, SLOT(refresh()));
     connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(showSettings()));
+    connect(settings, SIGNAL(settingsChanged()), this, SLOT(setAutoRotation()));
 
 }