diff options
author | Philip Kaufmann <phil.kaufmann@t-online.de> | 2012-08-18 15:54:39 +0200 |
---|---|---|
committer | Philip Kaufmann <phil.kaufmann@t-online.de> | 2013-01-05 13:51:36 +0100 |
commit | 5fb445b49e80812f004f00d5adf8fdd39bec557f (patch) | |
tree | ef1cf6ec492049daccaa4ce7b31d7f429d99317b /src/qt/optionsdialog.cpp | |
parent | ea9788517bfa3e53e192c5af9e64e73625f9db74 (diff) |
Bitcoin-Qt: add a Reset button to the options dialog
- a click on "Reset Options" sets all options to the default values by
removing all stored settings (QSettings), loading the defaults and
saving them as the new settings
- before the reset is executed the user is presented a confirmation dialog
- special casing was needed for StartAtStartup
Diffstat (limited to 'src/qt/optionsdialog.cpp')
-rw-r--r-- | src/qt/optionsdialog.cpp | 27 |
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(); |