mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
gui: Apply port mapping changes on dialog exit
This commit does not change behavior. It is a prerequisite for NAT-PMP support adding.
This commit is contained in:
parent
cf151cc68c
commit
58e8364dcd
2 changed files with 5 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
|||
#include <QIntValidator>
|
||||
#include <QLocale>
|
||||
#include <QMessageBox>
|
||||
#include <QSettings>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTimer>
|
||||
|
||||
|
@ -50,6 +51,10 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
|
|||
#ifndef USE_UPNP
|
||||
ui->mapPortUpnp->setEnabled(false);
|
||||
#endif
|
||||
connect(this, &QDialog::accepted, [this](){
|
||||
QSettings settings;
|
||||
model->node().mapPort(settings.value("fUseUPnP").toBool());
|
||||
});
|
||||
|
||||
ui->proxyIp->setEnabled(false);
|
||||
ui->proxyPort->setEnabled(false);
|
||||
|
|
|
@ -355,7 +355,6 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
|||
break;
|
||||
case MapPortUPnP: // core option - can be changed on-the-fly
|
||||
settings.setValue("fUseUPnP", value.toBool());
|
||||
node().mapPort(value.toBool());
|
||||
break;
|
||||
case MinimizeOnClose:
|
||||
fMinimizeOnClose = value.toBool();
|
||||
|
|
Loading…
Add table
Reference in a new issue