Load choose datadir dialog after options reset

pull/308/head
Andrew Chow 8 years ago
parent 15df3c196b
commit 57acb82e70

@ -178,7 +178,7 @@ void Intro::pickDataDirectory()
/* 2) Allow QSettings to override default dir */ /* 2) Allow QSettings to override default dir */
dataDir = settings.value("strDataDir", dataDir).toString(); 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 */ /* If current default data directory does not exist, let the user choose one */
Intro intro; Intro intro;
@ -204,6 +204,7 @@ void Intro::pickDataDirectory()
} }
settings.setValue("strDataDir", dataDir); settings.setValue("strDataDir", dataDir);
settings.setValue("fReset", false);
} }
/* Only override -datadir if different from the default, to make it possible to /* 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 * override -datadir in the bitcoin.conf file in the default data directory

@ -164,6 +164,9 @@ void OptionsModel::Reset()
// Set strDataDir // Set strDataDir
settings.setValue("strDataDir", dataDir); settings.setValue("strDataDir", dataDir);
// Set that this was reset
settings.setValue("fReset", true);
// default setting for OptionsModel::StartAtStartup - disabled // default setting for OptionsModel::StartAtStartup - disabled
if (GUIUtil::GetStartOnSystemStartup()) if (GUIUtil::GetStartOnSystemStartup())
GUIUtil::SetStartOnSystemStartup(false); GUIUtil::SetStartOnSystemStartup(false);

Loading…
Cancel
Save