gui: Apply port mapping changes on dialog exit

This commit does not change behavior. It is a prerequisite for NAT-PMP
support adding.
pull/18077/head
Hennadii Stepanov 5 years ago
parent cf151cc68c
commit 58e8364dcd
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F

@ -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…
Cancel
Save