1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 23:07:59 +00:00

- UPnP option should now be working

This commit is contained in:
Christophe Dumez 2007-03-27 21:08:07 +00:00
parent 371dcb0a45
commit d778766e29
4 changed files with 39 additions and 2 deletions

2
TODO
View File

@ -36,7 +36,7 @@
- Use a QListWidget to allow multiple input paths
- Possibility to add url seeds
- Add IPv6 support (at least start working on it)
- UPnP support (debug, sync with aMule CVS, option entry)
- UPnP support (debug, sync with aMule CVS)
- Allow user to change application style? (WinXP, MacOS, CleanLooks...) : app.setStyle(new QCleanlooksStyle());
- Update v0.9.0 changelog after its release
- Display Url seeds in torrent properties and allow to edit them

View File

@ -668,7 +668,7 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="spin_UPnP_port" >
<widget class="QSpinBox" name="spin_upnp_port" >
<property name="minimumSize" >
<size>
<width>6</width>

View File

@ -132,8 +132,10 @@ 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()));
connect(disableUPnP, 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_upnp_port, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
// Language
connect(combo_i18n, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
// IPFilter
@ -184,6 +186,9 @@ void options_imp::saveOptions(){
settings.setValue("PortRangeMax", getPorts().second);
settings.setValue("ShareRatio", getRatio());
settings.setValue("DHTPort", getDHTPort());
#ifndef NO_UPNP
settings.setValue("UPnPPort", getUPnPPort());
#endif
settings.setValue("PeXState", isPeXDisabled());
settings.setValue("ScanDir", getScanDir());
// End Main options
@ -316,6 +321,20 @@ void options_imp::loadOptions(){
}
spin_dht_port->setValue(value);
}
#ifndef NO_UPNP
value = settings.value("UPnPPort", 50000).toInt();
if(value < 0){
disableUPnP->setChecked(true);
groupUPnP->setEnabled(false);
}else{
disableUPnP->setChecked(false);
groupUPnP->setEnabled(true);
if(value < 1000){
value = 50000;
}
spin_upnp_port->setValue(value);
}
#endif
boolValue = settings.value("PeXState", 0).toBool();
if(boolValue){
// Pex disabled
@ -443,6 +462,20 @@ int options_imp::getDHTPort() const{
}
}
#ifndef NO_UPNP
int options_imp::getUPnPPort() const{
if(isUPnPEnabled()){
return spin_upnp_port->value();
}else{
return -1;
}
}
bool options_imp::isUPnPEnabled() const{
return !disableUPnP->isChecked();
}
#endif
QString options_imp::getPreviewProgram() const{
QString preview_txt = preview_program->text();
preview_txt.trimmed();

View File

@ -53,6 +53,10 @@ class options_imp : public QDialog, private Ui::Dialog{
QString getScanDir() const;
bool isDHTEnabled() const;
int getDHTPort() const;
#ifndef NO_UPNP
bool isUPnPEnabled() const;
int getUPnPPort() const;
#endif
bool isPeXDisabled() const;
// Filter Settings
bool isFilteringEnabled() const;