Ask settings dialog about kernel-config
authorDaniel Klaffenbach <danielklaffenbach@gmail.com>
Tue, 21 Dec 2010 12:55:59 +0000 (13:55 +0100)
committerDaniel Klaffenbach <danielklaffenbach@gmail.com>
Tue, 21 Dec 2010 12:55:59 +0000 (13:55 +0100)
src/mainwindow.cpp

index 75fa296..cf9f702 100644 (file)
@@ -160,6 +160,13 @@ void MainWindow::applySettings()
     setAutoRotation();
     setAdvancedTemperature();
 
+    //if overclocking is/was enabled we can also enable the "Load preset" option
+    if (settings->useOverclocking() && settings->usePowerKernel() && settings->isKernelConfigInstalled()) {
+        ui->actionLoad->setEnabled(true);
+    } else {
+        ui->actionLoad->setEnabled(false);
+    }
+
     //refresh the GUI after applying the settings
     refresh();
 }
@@ -363,14 +370,13 @@ void MainWindow::init()
     } else {
         this->minFreq = min.toInt();
     }
+    file.close();
 
     //enable save and load option on power kernels
-    if (settings->usePowerKernel()) {
-        //only enable save if /usr/sbin/kernel-config is present
-        file.close();
-        file.setFileName("/usr/sbin/kernel-config");
-        if (file.exists()) {
-            ui->actionSave->setEnabled(true);
+    if (settings->usePowerKernel() && settings->isKernelConfigInstalled()) {
+        ui->actionSave->setEnabled(true);
+        //loading presets may cause overclocking - only enable it if overclokcing is enabled
+        if (settings->useOverclocking()) {
             ui->actionLoad->setEnabled(true);
         }
     }
@@ -392,7 +398,7 @@ void MainWindow::loadPreset(QString presetName)
 {
     #if defined(Q_WS_MAEMO_5)
         callHelper("loadpreset", presetName);
-        QMaemo5InformationBox::information(this, tr( "The preset %s was loaded." ), QMaemo5InformationBox::DefaultTimeout);
+        QMaemo5InformationBox::information(this, tr( "The preset was loaded." ), QMaemo5InformationBox::DefaultTimeout);
     #endif
 }