Ask for confirmation before applying new maximum frequency.
[qcpufreq] / src / mainwindow.cpp
index 2d43625..e71837f 100644 (file)
@@ -146,9 +146,24 @@ void MainWindow::adjustFreq()
         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();
+
 }