Browse Source

- Fixed an error when disabling upnp

- upnp is now disabled as a default
adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
3f01be8d6e
  1. 2
      src/GUI.cpp
  2. 9
      src/options.ui
  3. 4
      src/options_imp.cpp

2
src/GUI.cpp

@ -986,7 +986,7 @@ void GUI::configureSession(bool deleteOptions){
} }
#ifndef NO_UPNP #ifndef NO_UPNP
// Upnp // Upnp
if(options->isDHTEnabled()){ if(options->isUPnPEnabled()){
BTSession.enableUPnP(options->getUPnPPort()); BTSession.enableUPnP(options->getUPnPPort());
BTSession.setUPnPPort(options->getUPnPPort()); BTSession.setUPnPPort(options->getUPnPPort());
}else{ }else{

9
src/options.ui

@ -635,13 +635,22 @@
</property> </property>
<item> <item>
<widget class="QCheckBox" name="disableUPnP" > <widget class="QCheckBox" name="disableUPnP" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" > <property name="text" >
<string>Disable UPnP port forwarding</string> <string>Disable UPnP port forwarding</string>
</property> </property>
<property name="checked" >
<bool>true</bool>
</property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupUPnP" > <widget class="QGroupBox" name="groupUPnP" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="title" > <property name="title" >
<string>UPnP configuration</string> <string>UPnP configuration</string>
</property> </property>

4
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(enableScan_checkBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(disableMaxConnec, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(disableMaxConnec, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(disableDHT, 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())); connect(disableUPnP, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
#endif
connect(disablePeX, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(disablePeX, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(spin_dht_port, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); connect(spin_dht_port, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(spin_upnp_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); spin_dht_port->setValue(value);
} }
#ifndef NO_UPNP #ifndef NO_UPNP
value = settings.value("UPnPPort", 50000).toInt(); value = settings.value("UPnPPort", -1).toInt();
if(value < 0){ if(value < 0){
disableUPnP->setChecked(true); disableUPnP->setChecked(true);
groupUPnP->setEnabled(false); groupUPnP->setEnabled(false);

Loading…
Cancel
Save