mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 13:01:11 +02: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:
@@ -24,6 +24,7 @@
|
|||||||
#include <QIntValidator>
|
#include <QIntValidator>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QSettings>
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
@@ -50,6 +51,10 @@ OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
|
|||||||
#ifndef USE_UPNP
|
#ifndef USE_UPNP
|
||||||
ui->mapPortUpnp->setEnabled(false);
|
ui->mapPortUpnp->setEnabled(false);
|
||||||
#endif
|
#endif
|
||||||
|
connect(this, &QDialog::accepted, [this](){
|
||||||
|
QSettings settings;
|
||||||
|
model->node().mapPort(settings.value("fUseUPnP").toBool());
|
||||||
|
});
|
||||||
|
|
||||||
ui->proxyIp->setEnabled(false);
|
ui->proxyIp->setEnabled(false);
|
||||||
ui->proxyPort->setEnabled(false);
|
ui->proxyPort->setEnabled(false);
|
||||||
|
@@ -355,7 +355,6 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
|||||||
break;
|
break;
|
||||||
case MapPortUPnP: // core option - can be changed on-the-fly
|
case MapPortUPnP: // core option - can be changed on-the-fly
|
||||||
settings.setValue("fUseUPnP", value.toBool());
|
settings.setValue("fUseUPnP", value.toBool());
|
||||||
node().mapPort(value.toBool());
|
|
||||||
break;
|
break;
|
||||||
case MinimizeOnClose:
|
case MinimizeOnClose:
|
||||||
fMinimizeOnClose = value.toBool();
|
fMinimizeOnClose = value.toBool();
|
||||||
|
Reference in New Issue
Block a user