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.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 03dcb0b538..6b98ab1929 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -177,6 +177,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();