Browse Source

Still improving program options

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
a993b2b3f1
  1. 28
      src/options_imp.cpp
  2. 3
      src/options_imp.h
  3. 269
      src/ui/options.ui

28
src/options_imp.cpp

@ -164,15 +164,12 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -164,15 +164,12 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// Connection tab
connect(checkUploadLimit, SIGNAL(toggled(bool)), this, SLOT(enableUploadLimit(bool)));
connect(checkDownloadLimit, SIGNAL(toggled(bool)), this, SLOT(enableDownloadLimit(bool)));
connect(check_schedule, SIGNAL(toggled(bool)), this, SLOT(enableSchedulerFields(bool)));
// Bittorrent tab
connect(checkMaxConnecs, SIGNAL(toggled(bool)), this, SLOT(enableMaxConnecsLimit(bool)));
connect(checkMaxConnecsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableMaxConnecsLimitPerTorrent(bool)));
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(checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableDHTSettings(bool)));
connect(checkDifferentDHTPort, SIGNAL(toggled(bool)), this, SLOT(enableDHTPortSettings(bool)));
connect(comboPeerID, SIGNAL(currentIndexChanged(int)), this, SLOT(enableSpoofingSettings(int)));
// Proxy tab
connect(comboProxyType_http, SIGNAL(currentIndexChanged(int)),this, SLOT(enableHTTPProxy(int)));
@ -683,7 +680,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -683,7 +680,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
spinDownloadLimitAlt->setValue(Preferences::getAltGlobalDownloadLimit());
// Scheduler
check_schedule->setChecked(Preferences::isSchedulerEnabled());
enableSchedulerFields(check_schedule->isChecked());
schedule_from->setTime(Preferences::getSchedulerStartTime());
schedule_to->setTime(Preferences::getSchedulerEndTime());
schedule_days->setCurrentIndex((int)Preferences::getSchedulerDays());
@ -771,9 +767,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -771,9 +767,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
spinMaxUploadsPerTorrent->setEnabled(false);
}
checkDHT->setChecked(Preferences::isDHTEnabled());
enableDHTSettings(checkDHT->isChecked());
checkDifferentDHTPort->setChecked(!Preferences::isDHTPortSameAsBT());
enableDHTPortSettings(checkDifferentDHTPort->isChecked());
spinDHTPort->setValue(Preferences::getDHTPort());
checkPeX->setChecked(Preferences::isPeXEnabled());
checkLSD->setChecked(Preferences::isLSDEnabled());
@ -1104,12 +1098,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -1104,12 +1098,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
return checkAdditionDialog->isChecked();
}
void options_imp::enableSchedulerFields(bool checked) {
schedule_from->setEnabled(checked);
schedule_to->setEnabled(checked);
schedule_days->setEnabled(checked);
}
void options_imp::enableMaxConnecsLimit(bool checked){
spinMaxConnec->setEnabled(checked);
}
@ -1166,22 +1154,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -1166,22 +1154,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
spinRatio->setEnabled(checked);
}
void options_imp::enableDHTPortSettings(bool checked) {
spinDHTPort->setEnabled(checked);
dh_port_lbl->setEnabled(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){
spinMaxRatio->setEnabled(checked);
}

3
src/options_imp.h

@ -137,13 +137,10 @@ protected slots: @@ -137,13 +137,10 @@ protected slots:
void enableMaxConnecsLimit(bool checked);
void enableMaxConnecsLimitPerTorrent(bool checked);
void enableMaxUploadsLimitPerTorrent(bool checked);
void enableSchedulerFields(bool checked);
void enableShareRatio(bool checked);
void enableDeleteRatio(bool checked);
void enableFilter(bool checked);
void enableRSS(bool checked);
void enableDHTSettings(bool checked);
void enableDHTPortSettings(bool checked);
void enableSpoofingSettings(int index);
void setStyle(QString style);
void on_buttonBox_accepted();

269
src/ui/options.ui

@ -1006,8 +1006,8 @@ QGroupBox { @@ -1006,8 +1006,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>447</width>
<height>288</height>
<width>524</width>
<height>398</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_28">
@ -1251,8 +1251,8 @@ QGroupBox { @@ -1251,8 +1251,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>364</width>
<height>328</height>
<width>524</width>
<height>406</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_33">
@ -1261,10 +1261,8 @@ QGroupBox { @@ -1261,10 +1261,8 @@ QGroupBox {
<property name="title">
<string>Global speed limits</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_18">
<item>
<layout class="QHBoxLayout" name="_3">
<item>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string notr="true"/>
@ -1274,16 +1272,10 @@ QGroupBox { @@ -1274,16 +1272,10 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="_5">
<item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QCheckBox" name="checkUploadLimit">
<property name="minimumSize">
<size>
<width>0</width>
<height>45</height>
</size>
</property>
<property name="text">
<string>Upload:</string>
</property>
@ -1292,36 +1284,11 @@ QGroupBox { @@ -1292,36 +1284,11 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkDownloadLimit">
<property name="minimumSize">
<size>
<width>0</width>
<height>37</height>
</size>
</property>
<property name="text">
<string>Download:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="_18">
<item>
<layout class="QHBoxLayout" name="_19">
<item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinUploadLimit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>27</height>
</size>
</property>
<property name="suffix">
<string/>
</property>
@ -1336,28 +1303,25 @@ QGroupBox { @@ -1336,28 +1303,25 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<item row="0" column="2">
<widget class="QLabel" name="label_10">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
</layout>
<item row="1" column="0">
<widget class="QCheckBox" name="checkDownloadLimit">
<property name="text">
<string>Download:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="_20">
<item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinDownloadLimit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>27</height>
</size>
</property>
<property name="suffix">
<string/>
</property>
@ -1372,7 +1336,7 @@ QGroupBox { @@ -1372,7 +1336,7 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<item row="1" column="2">
<widget class="QLabel" name="label_13">
<property name="text">
<string>KiB/s</string>
@ -1381,24 +1345,20 @@ QGroupBox { @@ -1381,24 +1345,20 @@ QGroupBox {
</item>
</layout>
</item>
</layout>
</item>
<item>
<item row="0" column="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>200</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
@ -1406,10 +1366,10 @@ QGroupBox { @@ -1406,10 +1366,10 @@ QGroupBox {
<property name="title">
<string>Alternative global speed limits</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_32">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="0">
<widget class="QLabel" name="label_16">
<property name="minimumSize">
<size>
@ -1434,27 +1394,16 @@ QGroupBox { @@ -1434,27 +1394,16 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_31">
<item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Upload:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>Download:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_30">
<item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinUploadLimitAlt">
<property name="minimum">
<number>1</number>
@ -1467,7 +1416,21 @@ QGroupBox { @@ -1467,7 +1416,21 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<item row="0" column="2">
<widget class="QLabel" name="label_14">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Download:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinDownloadLimitAlt">
<property name="minimum">
<number>1</number>
@ -1480,18 +1443,7 @@ QGroupBox { @@ -1480,18 +1443,7 @@ QGroupBox {
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_29">
<item>
<widget class="QLabel" name="label_14">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
<item>
<item row="1" column="2">
<widget class="QLabel" name="label_15">
<property name="text">
<string>KiB/s</string>
@ -1500,35 +1452,53 @@ QGroupBox { @@ -1500,35 +1452,53 @@ QGroupBox {
</item>
</layout>
</item>
<item>
<item row="0" column="2">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
<width>222</width>
<height>59</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="check_schedule">
<property name="styleSheet">
<string notr="true">QGroupBox::title {
font-weight: normal;
margin-left: 0px;
}
QGroupBox {
border-width: 0;
}</string>
</property>
<property name="title">
<string>Schedule alternative speed limits</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QCheckBox" name="check_schedule">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Scheduled times:</string>
<string extracomment="from (time1 to time2)">from</string>
</property>
</widget>
</item>
<item>
<widget class="QTimeEdit" name="schedule_from">
<property name="enabled">
<bool>false</bool>
</property>
<property name="displayFormat">
<string notr="true">hh:mm</string>
</property>
@ -1556,9 +1526,6 @@ QGroupBox { @@ -1556,9 +1526,6 @@ QGroupBox {
</item>
<item>
<widget class="QTimeEdit" name="schedule_to">
<property name="enabled">
<bool>false</bool>
</property>
<property name="displayFormat">
<string notr="true">hh:mm</string>
</property>
@ -1591,15 +1558,12 @@ QGroupBox { @@ -1591,15 +1558,12 @@ QGroupBox {
<item>
<widget class="QLabel" name="label_18">
<property name="text">
<string>On days:</string>
<string>When:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="schedule_days">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>Every day</string>
@ -1635,6 +1599,9 @@ QGroupBox { @@ -1635,6 +1599,9 @@ QGroupBox {
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
@ -1643,7 +1610,7 @@ QGroupBox { @@ -1643,7 +1610,7 @@ QGroupBox {
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>58</height>
<height>40</height>
</size>
</property>
</spacer>
@ -1666,8 +1633,8 @@ QGroupBox { @@ -1666,8 +1633,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>459</width>
<height>407</height>
<width>524</width>
<height>406</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_20">
@ -1678,48 +1645,54 @@ QGroupBox { @@ -1678,48 +1645,54 @@ QGroupBox {
</property>
<layout class="QVBoxLayout" name="verticalLayout_14">
<item>
<widget class="QCheckBox" name="checkDHT">
<property name="text">
<widget class="QGroupBox" name="checkDHT">
<property name="styleSheet">
<string notr="true">QGroupBox::title {
font-weight: normal;
margin-left: 0px;
}
QGroupBox {
border-width: 0;
}</string>
</property>
<property name="title">
<string>Enable DHT network (decentralized)</string>
</property>
<property name="checked">
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<layout class="QVBoxLayout" name="verticalLayout_18">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="checkDifferentDHTPort">
<property name="text">
<widget class="QGroupBox" name="checkDifferentDHTPort">
<property name="styleSheet">
<string notr="true">QGroupBox::title {
font-weight: normal;
margin-left: 0px;
}
QGroupBox {
border-width: 0;
}</string>
</property>
<property name="title">
<string>Use a different port for DHT and Bittorrent</string>
</property>
<property name="checked">
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
<property name="checked">
<bool>false</bool>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>20</height>
</size>
<layout class="QVBoxLayout" name="verticalLayout_17">
<property name="bottomMargin">
<number>0</number>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="dh_port_lbl">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>DHT port:</string>
</property>
@ -1727,9 +1700,6 @@ QGroupBox { @@ -1727,9 +1700,6 @@ QGroupBox {
</item>
<item>
<widget class="QSpinBox" name="spinDHTPort">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
@ -1756,8 +1726,17 @@ QGroupBox { @@ -1756,8 +1726,17 @@ QGroupBox {
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkPeX">
<property name="toolTip">
<string>Exchange peers without compatible Bittorrent clients (µTorrent, Vuze, ...)</string>
</property>
<property name="text">
<string>Enable Peer Exchange / PeX (requires restart)</string>
</property>
@ -1768,6 +1747,9 @@ QGroupBox { @@ -1768,6 +1747,9 @@ QGroupBox {
</item>
<item>
<widget class="QCheckBox" name="checkLSD">
<property name="toolTip">
<string>Look for peers on your local network</string>
</property>
<property name="text">
<string>Enable Local Peer Discovery</string>
</property>
@ -1781,7 +1763,7 @@ QGroupBox { @@ -1781,7 +1763,7 @@ QGroupBox {
<item>
<widget class="QLabel" name="lbl_encryption">
<property name="text">
<string>Encryption:</string>
<string>Protocol encryption:</string>
</property>
</widget>
</item>
@ -3014,7 +2996,6 @@ QGroupBox { @@ -3014,7 +2996,6 @@ QGroupBox {
<tabstop>spinPort</tabstop>
<tabstop>checkUPnP</tabstop>
<tabstop>checkNATPMP</tabstop>
<tabstop>checkDHT</tabstop>
<tabstop>checkLSD</tabstop>
<tabstop>comboEncryption</tabstop>
<tabstop>checkRatioLimit</tabstop>

Loading…
Cancel
Save