mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-18 08:32:30 +01:00
refactor: Pass interfaces::Node references to OptionsModel constructor
Will allow OptionsModel to read/write settings to the node settings.json file and share settings with the node, instead of storing them externally in QSettings. Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
This commit is contained in:
@@ -261,7 +261,7 @@ void BitcoinApplication::createPaymentServer()
|
||||
|
||||
void BitcoinApplication::createOptionsModel(bool resetSettings)
|
||||
{
|
||||
optionsModel = new OptionsModel(this, resetSettings);
|
||||
optionsModel = new OptionsModel(node(), this, resetSettings);
|
||||
}
|
||||
|
||||
void BitcoinApplication::createWindow(const NetworkStyle *networkStyle)
|
||||
@@ -292,7 +292,6 @@ void BitcoinApplication::createNode(interfaces::Init& init)
|
||||
{
|
||||
assert(!m_node);
|
||||
m_node = init.makeNode();
|
||||
if (optionsModel) optionsModel->setNode(*m_node);
|
||||
if (m_splash) m_splash->setNode(*m_node);
|
||||
}
|
||||
|
||||
@@ -633,6 +632,12 @@ int GuiMain(int argc, char* argv[])
|
||||
// Allow parameter interaction before we create the options model
|
||||
app.parameterSetup();
|
||||
GUIUtil::LogQtInfo();
|
||||
|
||||
if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false))
|
||||
app.createSplashScreen(networkStyle.data());
|
||||
|
||||
app.createNode(*init);
|
||||
|
||||
// Load GUI settings from QSettings
|
||||
app.createOptionsModel(gArgs.GetBoolArg("-resetguisettings", false));
|
||||
|
||||
@@ -641,11 +646,6 @@ int GuiMain(int argc, char* argv[])
|
||||
app.InitPruneSetting(prune_MiB);
|
||||
}
|
||||
|
||||
if (gArgs.GetBoolArg("-splash", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg("-min", false))
|
||||
app.createSplashScreen(networkStyle.data());
|
||||
|
||||
app.createNode(*init);
|
||||
|
||||
int rv = EXIT_SUCCESS;
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user