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:
@@ -60,6 +60,24 @@ void OptionsModel::Init()
|
||||
SoftSetArg("-lang", language.toStdString());
|
||||
}
|
||||
|
||||
void OptionsModel::Reset()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
// Remove all entries in this QSettings object
|
||||
settings.clear();
|
||||
|
||||
// default setting for OptionsModel::StartAtStartup - disabled
|
||||
if (GUIUtil::GetStartOnSystemStartup())
|
||||
GUIUtil::SetStartOnSystemStartup(false);
|
||||
|
||||
// Re-Init to get default values
|
||||
Init();
|
||||
|
||||
// Ensure Upgrade() is not running again by setting the bImportFinished flag
|
||||
settings.setValue("bImportFinished", true);
|
||||
}
|
||||
|
||||
bool OptionsModel::Upgrade()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
Reference in New Issue
Block a user