aboutsummaryrefslogtreecommitdiff
path: root/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui.cpp')
-rw-r--r--ui.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui.cpp b/ui.cpp
index 9ae19e8a6f..45e07d16ea 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -1665,6 +1665,10 @@ COptionsDialog::COptionsDialog(wxWindow* parent) : COptionsDialogBase(parent)
m_checkBoxStartOnSystemStartup->SetValue(fTmpStartOnSystemStartup = GetStartOnSystemStartup());
m_checkBoxMinimizeToTray->SetValue(fMinimizeToTray);
m_checkBoxMinimizeOnClose->SetValue(fMinimizeOnClose);
+ if (fHaveUPnP)
+ m_checkBoxUseUPnP->SetValue(fUseUPnP);
+ else
+ m_checkBoxUseUPnP->Enable(false);
m_checkBoxUseProxy->SetValue(fUseProxy);
m_textCtrlProxyIP->Enable(fUseProxy);
m_textCtrlProxyPort->Enable(fUseProxy);
@@ -1784,6 +1788,13 @@ void COptionsDialog::OnButtonApply(wxCommandEvent& event)
walletdb.WriteSetting("fMinimizeOnClose", fMinimizeOnClose);
}
+ if (fHaveUPnP && fUseUPnP != m_checkBoxUseUPnP->GetValue())
+ {
+ fUseUPnP = m_checkBoxUseUPnP->GetValue();
+ walletdb.WriteSetting("fUseUPnP", fUseUPnP);
+ MapPort(fUseUPnP);
+ }
+
fUseProxy = m_checkBoxUseProxy->GetValue();
walletdb.WriteSetting("fUseProxy", fUseProxy);