max = "599000";
}
- callHelper( "set_maxfreq", max );
+ if (settings->useConfirmation()) {
+ QMessageBox box;
+ box.setStandardButtons(QMessageBox::Apply | QMessageBox::Cancel);
+ box.setDefaultButton(QMessageBox::Apply);
+ box.setIcon(QMessageBox::Question);
+ box.setText(tr("The frequency changed."));
+ box.setInformativeText("Do you want to use ? as new default frequency?");
+ int ret = box.exec();
+
+ if (ret != QMessageBox::Apply) {
+ refresh();
+ return;
+ }
+ }
+ callHelper( "set_maxfreq", max );
refresh();
+
}
//read values from config file
autoRotate = settings.value("main/autorotate", true).toBool();
+ confirmApply = settings.value("main/confirm_apply", true).toBool();
overclocking = settings.value("main/overclocking", false).toBool();
advancedTemperature = settings.value("main/advanced_temperature", false).toBool();
void Settings::reset()
{
ui->checkBox_rotate->setChecked(autoRotate);
+ ui->checkBox_confirmapply->setChecked(confirmApply);
ui->checkBox_oc->setChecked(overclocking);
ui->checkBox_temperature->setChecked(advancedTemperature);
}
void Settings::save()
{
autoRotate = ui->checkBox_rotate->isChecked();
+ confirmApply = ui->checkBox_confirmapply->isChecked();
overclocking = ui->checkBox_oc->isChecked();
advancedTemperature = ui->checkBox_temperature->isChecked();
settings.setValue("main/autorotate", autoRotate);
+ settings.setValue("main/confirm_apply", confirmApply);
settings.setValue("main/overclocking", overclocking);
settings.setValue("main/advanced_temperature", advancedTemperature);
/**
+ * Do we need to display a confirmation dialog before applying new
+ * frequencies?
+ */
+bool Settings::useConfirmation()
+{
+ return confirmApply;
+}
+
+
+/**
* Returns true if auto-Rotate is enabled.
*/
bool Settings::useAutoRotate()
bool platformMaemo();
bool useAdvancedTemperature();
bool useAutoRotate();
+ bool useConfirmation();
bool useOverclocking();
bool usePowerKernel();
private:
bool advancedTemperature;
bool autoRotate;
+ bool confirmApply;
bool overclocking;
bool powerKernel;
bool kernelConfigInstalled;
<rect>
<x>0</x>
<y>0</y>
- <width>308</width>
- <height>134</height>
+ <width>364</width>
+ <height>183</height>
</rect>
</property>
<property name="windowTitle">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Please have a look at the QCPUFreq help for an explanation of these settings!</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QCheckBox" name="checkBox_rotate">
<property name="text">
<string>Enable auto-rotation</string>
</widget>
</item>
<item>
+ <widget class="QCheckBox" name="checkBox_confirmapply">
+ <property name="text">
+ <string>Confirm frequency before applying</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QCheckBox" name="checkBox_oc">
<property name="text">
<string>Enable overclocking</string>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Save</set>
</property>
#
#-------------------------------------------------
+QT -= gui dbus xml
QT += core gui maemo5
TARGET = QCPUFreq
TRANSLATIONS = de.ts zh.ts
-CONFIG += mobility
-MOBILITY =
+#CONFIG += mobility
+#MOBILITY =
symbian {
TARGET.UID3 = 0xeb3802d4