gui: Add NAT-PMP network option

This commit is contained in:
Hennadii Stepanov 2020-02-23 02:25:21 +02:00
parent a39f7336a3
commit 5a0185b6c9
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F
2 changed files with 14 additions and 0 deletions

View File

@ -259,6 +259,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mapPortNatpmp">
<property name="toolTip">
<string>Automatically open the Bitcoin client port on the router. This only works when your router supports NAT-PMP and it is enabled. The external port could be random.</string>
</property>
<property name="text">
<string>Map port using NA&amp;T-PMP</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="allowIncoming">
<property name="toolTip">

View File

@ -50,6 +50,9 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
/* Network elements init */
#ifndef USE_UPNP
ui->mapPortUpnp->setEnabled(false);
#endif
#ifndef USE_NATPMP
ui->mapPortNatpmp->setEnabled(false);
#endif
connect(this, &QDialog::accepted, [this](){
QSettings settings;
@ -219,6 +222,7 @@ void OptionsDialog::setMapper()
/* Network */
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
mapper->addMapping(ui->mapPortNatpmp, OptionsModel::MapPortNatpmp);
mapper->addMapping(ui->allowIncoming, OptionsModel::Listen);
mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);