mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-24 18:23:26 -03:00
qt: remove UPnP settings
This commit is contained in:
parent
dd92911732
commit
844770b05e
6 changed files with 3 additions and 37 deletions
|
@ -315,16 +315,6 @@
|
|||
<string>&Network</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_Network">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="mapPortUpnp">
|
||||
<property name="toolTip">
|
||||
<string>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Map port using &UPnP</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="mapPortNatpmp">
|
||||
<property name="toolTip">
|
||||
|
|
|
@ -105,10 +105,6 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
|
|||
connect(ui->prune, &QPushButton::toggled, ui->pruneSize, &QWidget::setEnabled);
|
||||
|
||||
/* Network elements init */
|
||||
#ifndef USE_UPNP
|
||||
ui->mapPortUpnp->setEnabled(false);
|
||||
#endif
|
||||
|
||||
ui->proxyIp->setEnabled(false);
|
||||
ui->proxyPort->setEnabled(false);
|
||||
ui->proxyPort->setValidator(new QIntValidator(1, 65535, this));
|
||||
|
@ -300,7 +296,6 @@ void OptionsDialog::setMapper()
|
|||
mapper->addMapping(ui->m_enable_psbt_controls, OptionsModel::EnablePSBTControls);
|
||||
|
||||
/* Network */
|
||||
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
|
||||
mapper->addMapping(ui->mapPortNatpmp, OptionsModel::MapPortNatpmp);
|
||||
mapper->addMapping(ui->allowIncoming, OptionsModel::Listen);
|
||||
mapper->addMapping(ui->enableServer, OptionsModel::Server);
|
||||
|
|
|
@ -41,7 +41,6 @@ static const char* SettingName(OptionsModel::OptionID option)
|
|||
case OptionsModel::ThreadsScriptVerif: return "par";
|
||||
case OptionsModel::SpendZeroConfChange: return "spendzeroconfchange";
|
||||
case OptionsModel::ExternalSignerPath: return "signer";
|
||||
case OptionsModel::MapPortUPnP: return "upnp";
|
||||
case OptionsModel::MapPortNatpmp: return "natpmp";
|
||||
case OptionsModel::Listen: return "listen";
|
||||
case OptionsModel::Server: return "server";
|
||||
|
@ -215,7 +214,7 @@ bool OptionsModel::Init(bilingual_str& error)
|
|||
|
||||
// These are shared with the core or have a command-line parameter
|
||||
// and we want command-line parameters to overwrite the GUI settings.
|
||||
for (OptionID option : {DatabaseCache, ThreadsScriptVerif, SpendZeroConfChange, ExternalSignerPath, MapPortUPnP,
|
||||
for (OptionID option : {DatabaseCache, ThreadsScriptVerif, SpendZeroConfChange, ExternalSignerPath,
|
||||
MapPortNatpmp, Listen, Server, Prune, ProxyUse, ProxyUseTor, Language}) {
|
||||
std::string setting = SettingName(option);
|
||||
if (node().isSettingIgnored(setting)) addOverriddenOption("-" + setting);
|
||||
|
@ -412,12 +411,6 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
|
|||
return m_show_tray_icon;
|
||||
case MinimizeToTray:
|
||||
return fMinimizeToTray;
|
||||
case MapPortUPnP:
|
||||
#ifdef USE_UPNP
|
||||
return SettingToBool(setting(), DEFAULT_UPNP);
|
||||
#else
|
||||
return false;
|
||||
#endif // USE_UPNP
|
||||
case MapPortNatpmp:
|
||||
return SettingToBool(setting(), DEFAULT_NATPMP);
|
||||
case MinimizeOnClose:
|
||||
|
@ -530,16 +523,10 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
|
|||
fMinimizeToTray = value.toBool();
|
||||
settings.setValue("fMinimizeToTray", fMinimizeToTray);
|
||||
break;
|
||||
case MapPortUPnP: // core option - can be changed on-the-fly
|
||||
if (changed()) {
|
||||
update(value.toBool());
|
||||
node().mapPort(value.toBool(), getOption(MapPortNatpmp).toBool());
|
||||
}
|
||||
break;
|
||||
case MapPortNatpmp: // core option - can be changed on-the-fly
|
||||
if (changed()) {
|
||||
update(value.toBool());
|
||||
node().mapPort(getOption(MapPortUPnP).toBool(), value.toBool());
|
||||
node().mapPort(false, value.toBool());
|
||||
}
|
||||
break;
|
||||
case MinimizeOnClose:
|
||||
|
@ -789,7 +776,6 @@ void OptionsModel::checkAndMigrate()
|
|||
migrate_setting(SpendZeroConfChange, "bSpendZeroConfChange");
|
||||
migrate_setting(ExternalSignerPath, "external_signer_path");
|
||||
#endif
|
||||
migrate_setting(MapPortUPnP, "fUseUPnP");
|
||||
migrate_setting(MapPortNatpmp, "fUseNatpmp");
|
||||
migrate_setting(Listen, "fListen");
|
||||
migrate_setting(Server, "server");
|
||||
|
@ -803,7 +789,7 @@ void OptionsModel::checkAndMigrate()
|
|||
|
||||
// In case migrating QSettings caused any settings value to change, rerun
|
||||
// parameter interaction code to update other settings. This is particularly
|
||||
// important for the -listen setting, which should cause -listenonion, -upnp,
|
||||
// important for the -listen setting, which should cause -listenonion
|
||||
// and other settings to default to false if it was set to false.
|
||||
// (https://github.com/bitcoin-core/gui/issues/567).
|
||||
node().initParameterInteraction();
|
||||
|
|
|
@ -50,7 +50,6 @@ public:
|
|||
StartAtStartup, // bool
|
||||
ShowTrayIcon, // bool
|
||||
MinimizeToTray, // bool
|
||||
MapPortUPnP, // bool
|
||||
MapPortNatpmp, // bool
|
||||
MinimizeOnClose, // bool
|
||||
ProxyUse, // bool
|
||||
|
|
|
@ -37,7 +37,6 @@ void OptionTests::migrateSettings()
|
|||
QSettings settings;
|
||||
settings.setValue("nDatabaseCache", 600);
|
||||
settings.setValue("nThreadsScriptVerif", 12);
|
||||
settings.setValue("fUseUPnP", false);
|
||||
settings.setValue("fListen", false);
|
||||
settings.setValue("bPrune", true);
|
||||
settings.setValue("nPruneSize", 3);
|
||||
|
@ -50,7 +49,6 @@ void OptionTests::migrateSettings()
|
|||
|
||||
QVERIFY(settings.contains("nDatabaseCache"));
|
||||
QVERIFY(settings.contains("nThreadsScriptVerif"));
|
||||
QVERIFY(settings.contains("fUseUPnP"));
|
||||
QVERIFY(settings.contains("fListen"));
|
||||
QVERIFY(settings.contains("bPrune"));
|
||||
QVERIFY(settings.contains("nPruneSize"));
|
||||
|
@ -64,7 +62,6 @@ void OptionTests::migrateSettings()
|
|||
QVERIFY(options.Init(error));
|
||||
QVERIFY(!settings.contains("nDatabaseCache"));
|
||||
QVERIFY(!settings.contains("nThreadsScriptVerif"));
|
||||
QVERIFY(!settings.contains("fUseUPnP"));
|
||||
QVERIFY(!settings.contains("fListen"));
|
||||
QVERIFY(!settings.contains("bPrune"));
|
||||
QVERIFY(!settings.contains("nPruneSize"));
|
||||
|
|
|
@ -54,7 +54,6 @@ int main(int argc, char* argv[])
|
|||
gArgs.ForceSetArg("-discover", "0");
|
||||
gArgs.ForceSetArg("-dnsseed", "0");
|
||||
gArgs.ForceSetArg("-fixedseeds", "0");
|
||||
gArgs.ForceSetArg("-upnp", "0");
|
||||
gArgs.ForceSetArg("-natpmp", "0");
|
||||
|
||||
std::string error;
|
||||
|
|
Loading…
Add table
Reference in a new issue