Browse Source

- Fix DHT settings

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
f9399714cc
  1. 23
      src/options_imp.cpp
  2. 1
      src/options_imp.h
  3. 2
      src/statusbar.h
  4. 40
      src/ui/options.ui

23
src/options_imp.cpp

@ -158,7 +158,8 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -158,7 +158,8 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(checkMaxUploadsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableMaxUploadsLimitPerTorrent(bool)));
connect(checkRatioLimit, SIGNAL(toggled(bool)), this, SLOT(enableShareRatio(bool)));
connect(checkRatioRemove, SIGNAL(toggled(bool)), this, SLOT(enableDeleteRatio(bool)));
connect(checkSameDHTPort, SIGNAL(toggled(bool)), this, SLOT(enableDHTPortSettings(bool)));
connect(checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableDHTSettings(bool)));
connect(checkDifferentDHTPort, SIGNAL(toggled(bool)), this, SLOT(enableDHTPortSettings(bool)));
// Proxy tab
connect(comboProxyType_http, SIGNAL(currentIndexChanged(int)),this, SLOT(enableProxyHTTP(int)));
connect(checkProxyAuth_http, SIGNAL(toggled(bool)), this, SLOT(enableProxyAuthHTTP(bool)));
@ -210,7 +211,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -210,7 +211,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(spinMaxConnecPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(spinMaxUploadsPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkSameDHTPort, 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(checkAzureusSpoof, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
@ -702,8 +703,9 @@ void options_imp::loadOptions(){ @@ -702,8 +703,9 @@ void options_imp::loadOptions(){
spinMaxUploadsPerTorrent->setEnabled(false);
}
checkDHT->setChecked(Preferences::isDHTEnabled());
checkSameDHTPort->setChecked(Preferences::isDHTPortSameAsBT());
enableDHTPortSettings(checkSameDHTPort->isChecked());
enableDHTSettings(checkDHT->isChecked());
checkDifferentDHTPort->setChecked(!Preferences::isDHTPortSameAsBT());
enableDHTPortSettings(checkDifferentDHTPort->isChecked());
spinDHTPort->setValue(Preferences::getDHTPort());
checkLSD->setChecked(Preferences::isLSDEnabled());
checkAzureusSpoof->setChecked(Preferences::isUtorrentSpoofingEnabled());
@ -1097,6 +1099,17 @@ void options_imp::enableDHTPortSettings(bool checked) { @@ -1097,6 +1099,17 @@ void options_imp::enableDHTPortSettings(bool checked) {
}
}
void options_imp::enableDHTSettings(bool checked) {
if(checked){
checkDifferentDHTPort->setEnabled(true);
enableDHTPortSettings(checkDifferentDHTPort->isChecked());
}else{
checkDifferentDHTPort->setEnabled(false);
enableDHTPortSettings(false);
}
}
void options_imp::enableDeleteRatio(bool checked){
if(checked){
spinMaxRatio->setEnabled(true);
@ -1200,7 +1213,7 @@ bool options_imp::addTorrentsInPause() const { @@ -1200,7 +1213,7 @@ bool options_imp::addTorrentsInPause() const {
}
bool options_imp::isDHTPortSameAsBT() const {
return checkSameDHTPort->isChecked();
return !checkDifferentDHTPort->isChecked();
}
// Proxy settings

1
src/options_imp.h

@ -151,6 +151,7 @@ protected slots: @@ -151,6 +151,7 @@ protected slots:
void enableDeleteRatio(bool checked);
void enableFilter(bool checked);
void enableRSS(bool checked);
void enableDHTSettings(bool checked);
void enableDHTPortSettings(bool checked);
void enableQueueingSystem(bool checked);
void setStyle(int style);

2
src/statusbar.h

@ -118,6 +118,8 @@ public: @@ -118,6 +118,8 @@ public:
container->setFixedHeight(24);
bar->setContentsMargins(12, 0, 12, 0);
bar->setFixedHeight(26);
// Is DHT enabled
DHTLbl->setVisible(Preferences::isDHTEnabled());
refreshTimer = new QTimer(bar);
connect(refreshTimer, SIGNAL(timeout()), this, SLOT(refreshStatusBar()));
refreshTimer->start(1500);

40
src/ui/options.ui

@ -626,8 +626,8 @@ @@ -626,8 +626,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>216</width>
<height>147</height>
<width>620</width>
<height>149</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_17">
@ -1082,7 +1082,7 @@ @@ -1082,7 +1082,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>451</width>
<width>602</width>
<height>513</height>
</rect>
</property>
@ -1503,8 +1503,8 @@ @@ -1503,8 +1503,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>468</width>
<height>347</height>
<width>620</width>
<height>488</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_19">
@ -1525,9 +1525,9 @@ @@ -1525,9 +1525,9 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkSameDHTPort">
<widget class="QCheckBox" name="checkDifferentDHTPort">
<property name="text">
<string>Use the same port for DHT and Bittorrent</string>
<string>Use a different port for DHT and Bittorrent</string>
</property>
<property name="checked">
<bool>true</bool>
@ -2401,8 +2401,8 @@ @@ -2401,8 +2401,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>218</width>
<height>220</height>
<width>620</width>
<height>488</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23">
@ -2415,14 +2415,14 @@ @@ -2415,14 +2415,14 @@
<string>Enable Web User Interface</string>
</property>
<property name="checked">
<bool>true</bool>
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupWebUiServer">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="title">
<string>HTTP Server</string>
@ -2431,7 +2431,7 @@ @@ -2431,7 +2431,7 @@
<item>
<widget class="QLabel" name="lblWebUiPort">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string>Port:</string>
@ -2441,7 +2441,7 @@ @@ -2441,7 +2441,7 @@
<item>
<widget class="QSpinBox" name="spinWebUiPort">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="maximum">
<number>65535</number>
@ -2470,7 +2470,7 @@ @@ -2470,7 +2470,7 @@
<item>
<widget class="QGroupBox" name="groupWebUiAuth">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="title">
<string>Authentication</string>
@ -2481,7 +2481,7 @@ @@ -2481,7 +2481,7 @@
<item>
<widget class="QLabel" name="lblWebUiUsername">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string>Username:</string>
@ -2491,7 +2491,7 @@ @@ -2491,7 +2491,7 @@
<item>
<widget class="QLabel" name="lblWebUiPassword">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string>Password:</string>
@ -2505,7 +2505,7 @@ @@ -2505,7 +2505,7 @@
<item>
<widget class="QLineEdit" name="textWebUiUsername">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string/>
@ -2521,7 +2521,7 @@ @@ -2521,7 +2521,7 @@
<item>
<widget class="QLineEdit" name="textWebUiPassword">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string/>
@ -2583,8 +2583,8 @@ @@ -2583,8 +2583,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>451</width>
<height>195</height>
<width>620</width>
<height>488</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_24">

Loading…
Cancel
Save