Remove deprecated feature of separate DHT port.

This commit is contained in:
sledgehammer999
2014-07-16 00:01:56 +03:00
parent 08e14cdc26
commit e2748ec3ac
7 changed files with 14 additions and 147 deletions

View File

@@ -1948,73 +1948,13 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_14">
<item>
<widget class="QGroupBox" name="checkDHT">
<property name="title">
<widget class="QCheckBox" name="checkDHT">
<property name="text">
<string>Enable DHT (decentralized network) to find more peers</string>
</property>
<property name="checkable">
<property name="checked">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_18">
<item>
<widget class="QGroupBox" name="checkDifferentDHTPort">
<property name="title">
<string>Use a different port for DHT and BitTorrent</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="leftMargin">
<number>5</number>
</property>
<item>
<widget class="QLabel" name="dh_port_lbl">
<property name="text">
<string>DHT port:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinDHTPort">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65525</number>
</property>
<property name="value">
<number>6881</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>

View File

@@ -206,8 +206,6 @@ options_imp::options_imp(QWidget *parent):
connect(checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkAnonymousMode, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkPeX, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkDifferentDHTPort, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(spinDHTPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(checkLSD, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(comboEncryption, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
connect(checkMaxRatio, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
@@ -432,8 +430,6 @@ void options_imp::saveOptions() {
pref.setMaxUploadsPerTorrent(getMaxUploadsPerTorrent());
pref.setDHTEnabled(isDHTEnabled());
pref.setPeXEnabled(checkPeX->isChecked());
pref.setDHTPortSameAsBT(isDHTPortSameAsBT());
pref.setDHTPort(getDHTPort());
pref.setLSDEnabled(isLSDEnabled());
pref.setEncryptionSetting(getEncryptionSetting());
pref.enableAnonymousMode(checkAnonymousMode->isChecked());
@@ -695,8 +691,6 @@ void options_imp::loadOptions() {
spinMaxUploadsPerTorrent->setEnabled(false);
}
checkDHT->setChecked(pref.isDHTEnabled());
checkDifferentDHTPort->setChecked(!pref.isDHTPortSameAsBT());
spinDHTPort->setValue(pref.getDHTPort());
checkPeX->setChecked(pref.isPeXEnabled());
checkLSD->setChecked(pref.isLSDEnabled());
comboEncryption->setCurrentIndex(pref.getEncryptionSetting());
@@ -825,10 +819,6 @@ bool options_imp::systrayIntegration() const {
return checkShowSystray->isChecked();
}
int options_imp::getDHTPort() const {
return spinDHTPort->value();
}
// Return Share ratio
qreal options_imp::getMaxRatio() const {
if (checkMaxRatio->isChecked()) {
@@ -979,10 +969,6 @@ bool options_imp::addTorrentsInPause() const {
return checkStartPaused->isChecked();
}
bool options_imp::isDHTPortSameAsBT() const {
return !checkDifferentDHTPort->isChecked();
}
// Proxy settings
bool options_imp::isProxyEnabled() const {
return comboProxyType->currentIndex();
@@ -1342,7 +1328,6 @@ void options_imp::toggleAnonymousMode(bool enabled)
if (enabled) {
// Disable DHT, LSD, UPnP / NAT-PMP
checkDHT->setEnabled(false);
checkDifferentDHTPort->setEnabled(false);
checkDHT->setChecked(false);
checkLSD->setEnabled(false);
checkLSD->setChecked(false);
@@ -1350,7 +1335,6 @@ void options_imp::toggleAnonymousMode(bool enabled)
checkUPnP->setChecked(false);
} else {
checkDHT->setEnabled(true);
checkDifferentDHTPort->setEnabled(true);
checkLSD->setEnabled(true);
checkUPnP->setEnabled(true);
}

View File

@@ -126,8 +126,6 @@ private:
int getMaxUploads() const;
int getMaxUploadsPerTorrent() const;
bool isDHTEnabled() const;
bool isDHTPortSameAsBT() const;
int getDHTPort() const;
bool isLSDEnabled() const;
int getEncryptionSetting() const;
qreal getMaxRatio() const;

View File

@@ -658,22 +658,6 @@ public:
setValue(QString::fromUtf8("Preferences/Bittorrent/PeX"), enabled);
}
bool isDHTPortSameAsBT() const {
return value(QString::fromUtf8("Preferences/Bittorrent/sameDHTPortAsBT"), true).toBool();
}
void setDHTPortSameAsBT(bool same) {
setValue(QString::fromUtf8("Preferences/Bittorrent/sameDHTPortAsBT"), same);
}
int getDHTPort() const {
return value(QString::fromUtf8("Preferences/Bittorrent/DHTPort"), 6881).toInt();
}
void setDHTPort(int port) {
setValue(QString::fromUtf8("Preferences/Bittorrent/DHTPort"), port);
}
bool isLSDEnabled() const {
return value(QString::fromUtf8("Preferences/Bittorrent/LSD"), true).toBool();
}