X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmainwindow.cpp;fp=src%2Fmainwindow.cpp;h=cf9f702a3c695f076cdeedf91273a9a0948f5c3c;hb=8a80270b3742a33d233376f0508749c556f840a0;hp=75fa2963c3f60d5e2cdd834c4bbaeb202544733d;hpb=5c5e19a39099ab6ff7cb3f7ab65ef1d12c3f4e3b;p=qcpufreq 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 }