diff --git a/src/GUI.cpp b/src/GUI.cpp
index 5fde3e21f..0b0957341 100644
--- a/src/GUI.cpp
+++ b/src/GUI.cpp
@@ -986,7 +986,7 @@ void GUI::configureSession(bool deleteOptions){
}
#ifndef NO_UPNP
// Upnp
- if(options->isDHTEnabled()){
+ if(options->isUPnPEnabled()){
BTSession.enableUPnP(options->getUPnPPort());
BTSession.setUPnPPort(options->getUPnPPort());
}else{
diff --git a/src/options.ui b/src/options.ui
index bd647c801..a3858eba8 100644
--- a/src/options.ui
+++ b/src/options.ui
@@ -635,13 +635,22 @@
-
+
+ true
+
Disable UPnP port forwarding
+
+ true
+
-
+
+ false
+
UPnP configuration
diff --git a/src/options_imp.cpp b/src/options_imp.cpp
index 6062f5072..dd30a6ec3 100644
--- a/src/options_imp.cpp
+++ b/src/options_imp.cpp
@@ -141,7 +141,9 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(enableScan_checkBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(disableMaxConnec, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(disableDHT, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
+#ifndef NO_UPNP
connect(disableUPnP, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
+#endif
connect(disablePeX, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(spin_dht_port, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(spin_upnp_port, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
@@ -384,7 +386,7 @@ void options_imp::loadOptions(){
spin_dht_port->setValue(value);
}
#ifndef NO_UPNP
- value = settings.value("UPnPPort", 50000).toInt();
+ value = settings.value("UPnPPort", -1).toInt();
if(value < 0){
disableUPnP->setChecked(true);
groupUPnP->setEnabled(false);