aboutsummaryrefslogtreecommitdiff
path: root/src/qt/optionsmodel.cpp
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2012-08-18 15:54:39 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2013-01-05 13:51:36 +0100
commit5fb445b49e80812f004f00d5adf8fdd39bec557f (patch)
treeef1cf6ec492049daccaa4ce7b31d7f429d99317b /src/qt/optionsmodel.cpp
parentea9788517bfa3e53e192c5af9e64e73625f9db74 (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/optionsmodel.cpp')
-rw-r--r--src/qt/optionsmodel.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 5dac5a6c45..2457e38742 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -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;