From: Daniel Klaffenbach Date: Sun, 7 Nov 2010 13:43:41 +0000 (+0100) Subject: Apply auto-rotate setting without restarting QCPUFreq X-Git-Tag: v0.4.0~9 X-Git-Url: https://vcs.maemo.org/git/?p=qcpufreq;a=commitdiff_plain;h=eb1a5ae41a6b840d332ad78bbc8b715e353f0c11 Apply auto-rotate setting without restarting QCPUFreq --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 022d628..318f471 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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())); } diff --git a/src/settings.cpp b/src/settings.cpp index 3762fd9..23eab34 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -112,6 +112,8 @@ void Settings::reset() /** * Saves the changes and hides the SettingsWidget. + * + * @emits: settingsChanged() */ void Settings::save() { @@ -127,6 +129,8 @@ void Settings::save() settings.sync(); hide(); + + emit settingsChanged(); } diff --git a/src/settings.h b/src/settings.h index 850192d..0ab3179 100644 --- a/src/settings.h +++ b/src/settings.h @@ -44,6 +44,9 @@ public slots: void save(); void showOverclockingWarning(); +signals: + void settingsChanged(); + private: bool advancedTemperature; bool autoRotate;