Skip to content

Commit

Permalink
- Fixed an error when disabling upnp
Browse files Browse the repository at this point in the history
- upnp is now disabled as a default
  • Loading branch information
Christophe Dumez committed Mar 29, 2007
1 parent 3ea7685 commit 3f01be8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
9 changes: 9 additions & 0 deletions src/options.ui
Original file line number Diff line number Diff line change
Expand Up @@ -635,13 +635,22 @@
</property>
<item>
<widget class="QCheckBox" name="disableUPnP" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="text" >
<string>Disable UPnP port forwarding</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupUPnP" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="title" >
<string>UPnP configuration</string>
</property>
Expand Down
4 changes: 3 additions & 1 deletion src/options_imp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3f01be8

Please sign in to comment.