From 3f01be8d6e066e4e093e862d1b9630a38dca3d12 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 29 Mar 2007 13:51:15 +0000 Subject: [PATCH] - Fixed an error when disabling upnp - upnp is now disabled as a default --- src/GUI.cpp | 2 +- src/options.ui | 9 +++++++++ src/options_imp.cpp | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) 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);