mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
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
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user