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", false).toBool();
25 connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(save()));
26 connect(ui->checkBox_oc, SIGNAL(clicked()), this, SLOT(showOverclockingWarning()));
36 * Returns true if we are on a Maemo 5 OS.
38 bool Settings::platformMaemo()
40 #if defined(Q_WS_MAEMO_5)
49 * Resets the UI to the values stored by QSettings.
51 void Settings::reset()
53 ui->checkBox_rotate->setChecked(autoRotate);
54 ui->checkBox_oc->setChecked(overclocking);
55 ui->checkBox_temperature->setChecked(advancedTemperature);
60 * Saves the changes and hides the SettingsWidget.
64 autoRotate = ui->checkBox_rotate->isChecked();
65 overclocking = ui->checkBox_oc->isChecked();
66 advancedTemperature = ui->checkBox_temperature->isChecked();
68 settings.setValue("main/autorotate", autoRotate);
69 settings.setValue("main/overclocking", overclocking);
70 settings.setValue("main/advanced_temperature", advancedTemperature);
72 //save settings to file
80 * Displays a warning when overclocking is being enabled.
82 void Settings::showOverclockingWarning()
85 #if defined(Q_WS_MAEMO_5)
86 QMaemo5InformationBox::information(this, tr( "Please note that overclocking voids your warranty and may break your device! Be careful!"), 0);
88 QMessageBox::warning(this, tr("Warning"), tr("Please note that overclocking voids your warranty and may break your device! Be careful!"));
95 * Returns true if the user wants to display a more
96 * accurate temperature.
98 bool Settings::useAdvancedTemperature()
100 return advancedTemperature;
105 * Returns true if auto-Rotate is enabled.
107 bool Settings::useAutoRotate()
114 * Returns true if the user enabled overclocking.
116 bool Settings::useOverclocking()