Added new (dummy) SettingsWidget
[qcpufreq] / src / mainwindow.cpp
index 31d38d4..6fc41dc 100644 (file)
@@ -43,6 +43,8 @@ MainWindow::MainWindow(QWidget *parent) :
     refreshTimer( this ),
     //create a QGraphicsScene for the little chip icon
     scene( this ),
+    //the settings widget
+    settings(this),
     //show errors about the sudo setup only once
     showSudoError( true )
 {
@@ -71,6 +73,8 @@ MainWindow::MainWindow(QWidget *parent) :
     #endif
     helpWindow.setWindowFlags( windowFlags() | Qt::Window );
 
+    settings.hide();
+
     //connect signals and slots
     connect(ui->actionHelp, SIGNAL(triggered()), this, SLOT(showHelp()));
     connect( ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()) );
@@ -79,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->actionOverclocking, SIGNAL(toggled(bool)), this, SLOT(setOverclocking()));
+    connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(showSettings()));
 
 
     //disable overclocking button on vanilla kernels
@@ -501,6 +506,16 @@ void MainWindow::showHelp()
 
 
 /**
+  * SLOT: displays the settings widget
+  */
+void MainWindow::showSettings()
+{
+    settings.setWindowFlags(Qt::Popup);
+    settings.show();
+}
+
+
+/**
   * Returns true when the device is in portrait mode
   */
 bool MainWindow::usePortrait()