mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
[Qt] allow setting listen via GUI
- add DEFAULT_LISTEN in net.h and use in the code (shared setting between core and GUI) Important: This makes it obvious, that we need to re-think the settings/options handling, as GUI settings are processed before any parameter-interaction (which is mostly important for network stuff) in AppInit2()!
This commit is contained in:
@@ -110,6 +110,11 @@ void OptionsModel::Init()
|
||||
if (!SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()))
|
||||
addOverriddenOption("-upnp");
|
||||
|
||||
if (!settings.contains("fListen"))
|
||||
settings.setValue("fListen", DEFAULT_LISTEN);
|
||||
if (!SoftSetBoolArg("-listen", settings.value("fListen").toBool()))
|
||||
addOverriddenOption("-listen");
|
||||
|
||||
if (!settings.contains("fUseProxy"))
|
||||
settings.setValue("fUseProxy", false);
|
||||
if (!settings.contains("addrProxy"))
|
||||
@@ -214,6 +219,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
||||
return settings.value("nDatabaseCache");
|
||||
case ThreadsScriptVerif:
|
||||
return settings.value("nThreadsScriptVerif");
|
||||
case Listen:
|
||||
return settings.value("fListen");
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
@@ -339,6 +346,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
||||
setRestartRequired(true);
|
||||
}
|
||||
break;
|
||||
case Listen:
|
||||
if (settings.value("fListen") != value) {
|
||||
settings.setValue("fListen", value);
|
||||
setRestartRequired(true);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user