aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorAndrew Chow <achow101@gmail.com>2016-08-10 15:35:22 -0400
committerAndrew Chow <achow101@gmail.com>2016-08-24 09:40:48 -0400
commit57acb82e7014f3214229349485fa3f57842b10ae (patch)
tree74318638715861ecf66e5ff177b3b15ef717e422 /src/qt
parent15df3c196b2359505980a2b0217133e0bb550565 (diff)
Load choose datadir dialog after options reset
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/intro.cpp3
-rw-r--r--src/qt/optionsmodel.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp
index 6d6af54290..390bcd22fb 100644
--- a/src/qt/intro.cpp
+++ b/src/qt/intro.cpp
@@ -178,7 +178,7 @@ void Intro::pickDataDirectory()
/* 2) Allow QSettings to override default dir */
dataDir = settings.value("strDataDir", dataDir).toString();
- if(!fs::exists(GUIUtil::qstringToBoostPath(dataDir)) || GetBoolArg("-choosedatadir", DEFAULT_CHOOSE_DATADIR))
+ if(!fs::exists(GUIUtil::qstringToBoostPath(dataDir)) || GetBoolArg("-choosedatadir", DEFAULT_CHOOSE_DATADIR) || settings.value("fReset", false).toBool() || GetBoolArg("-resetguisettings", false))
{
/* If current default data directory does not exist, let the user choose one */
Intro intro;
@@ -204,6 +204,7 @@ void Intro::pickDataDirectory()
}
settings.setValue("strDataDir", dataDir);
+ settings.setValue("fReset", false);
}
/* Only override -datadir if different from the default, to make it possible to
* override -datadir in the bitcoin.conf file in the default data directory
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 7987d8e7ea..5538a28413 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -164,6 +164,9 @@ void OptionsModel::Reset()
// Set strDataDir
settings.setValue("strDataDir", dataDir);
+ // Set that this was reset
+ settings.setValue("fReset", true);
+
// default setting for OptionsModel::StartAtStartup - disabled
if (GUIUtil::GetStartOnSystemStartup())
GUIUtil::SetStartOnSystemStartup(false);