Skip to content

Commit 58e8364

Browse files
committed
gui: Apply port mapping changes on dialog exit
This commit does not change behavior. It is a prerequisite for NAT-PMP support adding.
1 parent cf151cc commit 58e8364

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/qt/optionsdialog.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <QIntValidator>
2525
#include <QLocale>
2626
#include <QMessageBox>
27+
#include <QSettings>
2728
#include <QSystemTrayIcon>
2829
#include <QTimer>
2930

@@ -50,6 +51,10 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
5051
#ifndef USE_UPNP
5152
ui->mapPortUpnp->setEnabled(false);
5253
#endif
54+
connect(this, &QDialog::accepted, [this](){
55+
QSettings settings;
56+
model->node().mapPort(settings.value("fUseUPnP").toBool());
57+
});
5358

5459
ui->proxyIp->setEnabled(false);
5560
ui->proxyPort->setEnabled(false);

src/qt/optionsmodel.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
355355
break;
356356
case MapPortUPnP: // core option - can be changed on-the-fly
357357
settings.setValue("fUseUPnP", value.toBool());
358-
node().mapPort(value.toBool());
359358
break;
360359
case MinimizeOnClose:
361360
fMinimizeOnClose = value.toBool();

0 commit comments

Comments
 (0)