aboutsummaryrefslogtreecommitdiff
path: root/src/qt/optionsdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/optionsdialog.cpp')
-rw-r--r--src/qt/optionsdialog.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 03dcb0b538..4fa1f60922 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -10,8 +10,6 @@
#include <QIntValidator>
#include <QLocale>
#include <QMessageBox>
-#include <QRegExp>
-#include <QRegExpValidator>
OptionsDialog::OptionsDialog(QWidget *parent) :
QDialog(parent),
@@ -177,6 +175,33 @@ void OptionsDialog::setSaveButtonState(bool fState)
ui->okButton->setEnabled(fState);
}
+void OptionsDialog::on_resetButton_clicked()
+{
+ if(model)
+ {
+ // confirmation dialog
+ QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr("Confirm options reset"),
+ tr("Some settings may require a client restart to take effect.") + "<br><br>" + tr("Do you want to proceed?"),
+ QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
+
+ if(btnRetVal == QMessageBox::Cancel)
+ return;
+
+ disableApplyButton();
+
+ /* disable restart warning messages display */
+ fRestartWarningDisplayed_Lang = fRestartWarningDisplayed_Proxy = true;
+
+ /* reset all options and save the default values (QSettings) */
+ model->Reset();
+ mapper->toFirst();
+ mapper->submit();
+
+ /* re-enable restart warning messages display */
+ fRestartWarningDisplayed_Lang = fRestartWarningDisplayed_Proxy = false;
+ }
+}
+
void OptionsDialog::on_okButton_clicked()
{
mapper->submit();