2 #include "ui_settings.h"
5 #if defined(Q_WS_MAEMO_5)
6 #include <QMaemo5InformationBox>
10 Settings::Settings(QWidget *parent) :
17 //read values from config file
18 autoRotate = settings.value("main/autorotate", true).toBool();
19 overclocking = settings.value("main/overclocking", false).toBool();
20 advancedTemperature = settings.value("main/advanced_temperature", true).toBool();
25 connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(save()));
26 connect(ui->checkBox_oc, SIGNAL(clicked()), this, SLOT(showOverclockingWarning()));
35 * Returns true if we are on a Maemo 5 OS.
37 bool Settings::platformMaemo()
39 #if defined(Q_WS_MAEMO_5)
48 * Resets the UI to the values stored by QSettings.
50 void Settings::reset()
52 ui->checkBox_rotate->setChecked(autoRotate);
53 ui->checkBox_oc->setChecked(overclocking);
54 ui->checkBox_temperature->setChecked(advancedTemperature);
59 * Saves the changes and hides the SettingsWidget.
63 autoRotate = ui->checkBox_rotate->isChecked();
64 overclocking = ui->checkBox_oc->isChecked();
65 advancedTemperature = ui->checkBox_temperature->isChecked();
67 settings.setValue("main/autorotate", autoRotate);
68 settings.setValue("main/overclocking", overclocking);
69 settings.setValue("main/advanced_temperature", advancedTemperature);
71 //save settings to file
79 * Displays a warning when overclocking is being enabled.
81 void Settings::showOverclockingWarning()
84 #if defined(Q_WS_MAEMO_5)
85 QMaemo5InformationBox::information(this, tr( "Please note that overclocking voids your warranty and may break your device! Be careful!"), 0);
87 QMessageBox::warning(this, tr("Warning"), tr("Please note that overclocking voids your warranty and may break your device! Be careful!"));