From 8a80270b3742a33d233376f0508749c556f840a0 Mon Sep 17 00:00:00 2001 From: Daniel Klaffenbach Date: Tue, 21 Dec 2010 13:55:59 +0100 Subject: [PATCH] Ask settings dialog about kernel-config --- src/mainwindow.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 75fa296..cf9f702 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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 } -- 1.7.9.5