mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 21:14:33 +00:00
Add comboBox for selecting BitTorrent protocol. Closes #6316.
Use unicode string C_UTP in place of "uTP"
This commit is contained in:
parent
c6cf3a98a4
commit
45a0c5558a
@ -299,7 +299,8 @@ Session::Session(QObject *parent)
|
|||||||
, m_maxUploads(BITTORRENT_SESSION_KEY("MaxUploads"), -1, lowerLimited(0, -1))
|
, m_maxUploads(BITTORRENT_SESSION_KEY("MaxUploads"), -1, lowerLimited(0, -1))
|
||||||
, m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY("MaxConnectionsPerTorrent"), 100, lowerLimited(0, -1))
|
, m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY("MaxConnectionsPerTorrent"), 100, lowerLimited(0, -1))
|
||||||
, m_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY("MaxUploadsPerTorrent"), -1, lowerLimited(0, -1))
|
, m_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY("MaxUploadsPerTorrent"), -1, lowerLimited(0, -1))
|
||||||
, m_isUTPEnabled(BITTORRENT_SESSION_KEY("uTPEnabled"), true)
|
, m_btProtocol(BITTORRENT_SESSION_KEY("BTProtocol"), BTProtocol::Both
|
||||||
|
, clampValue(BTProtocol::Both, BTProtocol::UTP))
|
||||||
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY("uTPRateLimited"), true)
|
, m_isUTPRateLimited(BITTORRENT_SESSION_KEY("uTPRateLimited"), true)
|
||||||
, m_utpMixedMode(BITTORRENT_SESSION_KEY("uTPMixedMode"), MixedModeAlgorithm::Proportional
|
, m_utpMixedMode(BITTORRENT_SESSION_KEY("uTPMixedMode"), MixedModeAlgorithm::Proportional
|
||||||
, clampValue(MixedModeAlgorithm::TCP, MixedModeAlgorithm::Proportional))
|
, clampValue(MixedModeAlgorithm::TCP, MixedModeAlgorithm::Proportional))
|
||||||
@ -1342,8 +1343,30 @@ void Session::configure(libtorrent::settings_pack &settingsPack)
|
|||||||
// * Global max upload slots
|
// * Global max upload slots
|
||||||
settingsPack.set_int(libt::settings_pack::unchoke_slots_limit, maxUploads());
|
settingsPack.set_int(libt::settings_pack::unchoke_slots_limit, maxUploads());
|
||||||
// uTP
|
// uTP
|
||||||
settingsPack.set_bool(libt::settings_pack::enable_incoming_utp, isUTPEnabled());
|
switch (btProtocol()) {
|
||||||
settingsPack.set_bool(libt::settings_pack::enable_outgoing_utp, isUTPEnabled());
|
case BTProtocol::Both:
|
||||||
|
default:
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_incoming_tcp, true);
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_outgoing_tcp, true);
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_incoming_utp, true);
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_outgoing_utp, true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BTProtocol::TCP:
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_incoming_tcp, true);
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_outgoing_tcp, true);
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_incoming_utp, false);
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_outgoing_utp, false);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BTProtocol::UTP:
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_incoming_tcp, false);
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_outgoing_tcp, false);
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_incoming_utp, true);
|
||||||
|
settingsPack.set_bool(libt::settings_pack::enable_outgoing_utp, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (utpMixedMode()) {
|
switch (utpMixedMode()) {
|
||||||
case MixedModeAlgorithm::TCP:
|
case MixedModeAlgorithm::TCP:
|
||||||
default:
|
default:
|
||||||
@ -1604,8 +1627,30 @@ void Session::configure(libtorrent::session_settings &sessionSettings)
|
|||||||
// * Global max upload slots
|
// * Global max upload slots
|
||||||
sessionSettings.unchoke_slots_limit = maxUploads();
|
sessionSettings.unchoke_slots_limit = maxUploads();
|
||||||
// uTP
|
// uTP
|
||||||
sessionSettings.enable_incoming_utp = isUTPEnabled();
|
switch (btProtocol()) {
|
||||||
sessionSettings.enable_outgoing_utp = isUTPEnabled();
|
case BTProtocol::Both:
|
||||||
|
default:
|
||||||
|
sessionSettings.enable_incoming_tcp = true;
|
||||||
|
sessionSettings.enable_outgoing_tcp = true;
|
||||||
|
sessionSettings.enable_incoming_utp = true;
|
||||||
|
sessionSettings.enable_outgoing_utp = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BTProtocol::TCP:
|
||||||
|
sessionSettings.enable_incoming_tcp = true;
|
||||||
|
sessionSettings.enable_outgoing_tcp = true;
|
||||||
|
sessionSettings.enable_incoming_utp = false;
|
||||||
|
sessionSettings.enable_outgoing_utp = false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BTProtocol::UTP:
|
||||||
|
sessionSettings.enable_incoming_tcp = false;
|
||||||
|
sessionSettings.enable_outgoing_tcp = false;
|
||||||
|
sessionSettings.enable_incoming_utp = true;
|
||||||
|
sessionSettings.enable_outgoing_utp = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// uTP rate limiting
|
// uTP rate limiting
|
||||||
sessionSettings.rate_limit_utp = isUTPRateLimited();
|
sessionSettings.rate_limit_utp = isUTPRateLimited();
|
||||||
switch (utpMixedMode()) {
|
switch (utpMixedMode()) {
|
||||||
@ -3246,17 +3291,20 @@ void Session::setMaxUploads(int max)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Session::isUTPEnabled() const
|
BTProtocol Session::btProtocol() const
|
||||||
{
|
{
|
||||||
return m_isUTPEnabled;
|
return m_btProtocol;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::setUTPEnabled(bool enabled)
|
void Session::setBTProtocol(BTProtocol protocol)
|
||||||
{
|
{
|
||||||
if (enabled != m_isUTPEnabled) {
|
if ((protocol < BTProtocol::Both) || (BTProtocol::UTP < protocol))
|
||||||
m_isUTPEnabled = enabled;
|
return;
|
||||||
configureDeferred();
|
|
||||||
}
|
if (protocol == m_btProtocol) return;
|
||||||
|
|
||||||
|
m_btProtocol = protocol;
|
||||||
|
configureDeferred();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Session::isUTPRateLimited() const
|
bool Session::isUTPRateLimited() const
|
||||||
|
@ -178,10 +178,19 @@ namespace BitTorrent
|
|||||||
Proportional = 1
|
Proportional = 1
|
||||||
};
|
};
|
||||||
Q_ENUM(MixedModeAlgorithm)
|
Q_ENUM(MixedModeAlgorithm)
|
||||||
|
|
||||||
|
enum class BTProtocol : int
|
||||||
|
{
|
||||||
|
Both = 0,
|
||||||
|
TCP = 1,
|
||||||
|
UTP = 2
|
||||||
|
};
|
||||||
|
Q_ENUM(BTProtocol)
|
||||||
};
|
};
|
||||||
using ChokingAlgorithm = SessionSettingsEnums::ChokingAlgorithm;
|
using ChokingAlgorithm = SessionSettingsEnums::ChokingAlgorithm;
|
||||||
using SeedChokingAlgorithm = SessionSettingsEnums::SeedChokingAlgorithm;
|
using SeedChokingAlgorithm = SessionSettingsEnums::SeedChokingAlgorithm;
|
||||||
using MixedModeAlgorithm = SessionSettingsEnums::MixedModeAlgorithm;
|
using MixedModeAlgorithm = SessionSettingsEnums::MixedModeAlgorithm;
|
||||||
|
using BTProtocol = SessionSettingsEnums::BTProtocol;
|
||||||
|
|
||||||
#if LIBTORRENT_VERSION_NUM >= 10100
|
#if LIBTORRENT_VERSION_NUM >= 10100
|
||||||
struct SessionMetricIndices
|
struct SessionMetricIndices
|
||||||
@ -413,8 +422,8 @@ namespace BitTorrent
|
|||||||
void setMaxActiveUploads(int max);
|
void setMaxActiveUploads(int max);
|
||||||
int maxActiveTorrents() const;
|
int maxActiveTorrents() const;
|
||||||
void setMaxActiveTorrents(int max);
|
void setMaxActiveTorrents(int max);
|
||||||
bool isUTPEnabled() const;
|
BTProtocol btProtocol() const;
|
||||||
void setUTPEnabled(bool enabled);
|
void setBTProtocol(BTProtocol protocol);
|
||||||
bool isUTPRateLimited() const;
|
bool isUTPRateLimited() const;
|
||||||
void setUTPRateLimited(bool limited);
|
void setUTPRateLimited(bool limited);
|
||||||
MixedModeAlgorithm utpMixedMode() const;
|
MixedModeAlgorithm utpMixedMode() const;
|
||||||
@ -648,7 +657,7 @@ namespace BitTorrent
|
|||||||
CachedSettingValue<int> m_maxUploads;
|
CachedSettingValue<int> m_maxUploads;
|
||||||
CachedSettingValue<int> m_maxConnectionsPerTorrent;
|
CachedSettingValue<int> m_maxConnectionsPerTorrent;
|
||||||
CachedSettingValue<int> m_maxUploadsPerTorrent;
|
CachedSettingValue<int> m_maxUploadsPerTorrent;
|
||||||
CachedSettingValue<bool> m_isUTPEnabled;
|
CachedSettingValue<BTProtocol> m_btProtocol;
|
||||||
CachedSettingValue<bool> m_isUTPRateLimited;
|
CachedSettingValue<bool> m_isUTPRateLimited;
|
||||||
CachedSettingValue<MixedModeAlgorithm> m_utpMixedMode;
|
CachedSettingValue<MixedModeAlgorithm> m_utpMixedMode;
|
||||||
CachedSettingValue<bool> m_multiConnectionsPerIpEnabled;
|
CachedSettingValue<bool> m_multiConnectionsPerIpEnabled;
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "app/application.h"
|
#include "app/application.h"
|
||||||
#include "base/bittorrent/session.h"
|
#include "base/bittorrent/session.h"
|
||||||
#include "base/preferences.h"
|
#include "base/preferences.h"
|
||||||
|
#include "base/unicodestrings.h"
|
||||||
#include "gui/mainwindow.h"
|
#include "gui/mainwindow.h"
|
||||||
|
|
||||||
enum AdvSettingsCols
|
enum AdvSettingsCols
|
||||||
@ -345,7 +346,7 @@ void AdvancedSettings::loadAdvancedSettings()
|
|||||||
// uTP-TCP mixed mode
|
// uTP-TCP mixed mode
|
||||||
comboUtpMixedMode.addItems({"Prefer TCP", "Peer proportional (throttles TCP)"});
|
comboUtpMixedMode.addItems({"Prefer TCP", "Peer proportional (throttles TCP)"});
|
||||||
comboUtpMixedMode.setCurrentIndex(static_cast<int>(session->utpMixedMode()));
|
comboUtpMixedMode.setCurrentIndex(static_cast<int>(session->utpMixedMode()));
|
||||||
addRow(UTP_MIX_MODE, tr("uTP-TCP mixed mode algorithm"), &comboUtpMixedMode);
|
addRow(UTP_MIX_MODE, tr("%1-TCP mixed mode algorithm", "uTP-TCP mixed mode algorithm").arg(C_UTP), &comboUtpMixedMode);
|
||||||
// multiple connections per IP
|
// multiple connections per IP
|
||||||
cbMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
|
cbMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
|
||||||
addRow(MULTI_CONNECTIONS_PER_IP, tr("Allow multiple connections from the same IP address"), &cbMultiConnectionsPerIp);
|
addRow(MULTI_CONNECTIONS_PER_IP, tr("Allow multiple connections from the same IP address"), &cbMultiConnectionsPerIp);
|
||||||
|
@ -272,6 +272,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
|||||||
m_ui->autoRun_param->setText(autoRunStr);
|
m_ui->autoRun_param->setText(autoRunStr);
|
||||||
|
|
||||||
// Connection tab
|
// Connection tab
|
||||||
|
connect(m_ui->comboProtocol, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
|
||||||
connect(m_ui->spinPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
connect(m_ui->spinPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||||
connect(m_ui->checkRandomPort, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
connect(m_ui->checkRandomPort, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||||
connect(m_ui->checkUPnP, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
connect(m_ui->checkUPnP, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||||
@ -287,8 +288,6 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
|||||||
connect(m_ui->schedule_from, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
|
connect(m_ui->schedule_from, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
|
||||||
connect(m_ui->schedule_to, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
|
connect(m_ui->schedule_to, &QDateTimeEdit::timeChanged, this, &ThisType::enableApplyButton);
|
||||||
connect(m_ui->schedule_days, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
|
connect(m_ui->schedule_days, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
|
||||||
connect(m_ui->checkuTP, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
|
||||||
connect(m_ui->checkuTP, &QAbstractButton::toggled, m_ui->checkLimituTPConnections, &QWidget::setEnabled);
|
|
||||||
connect(m_ui->checkLimituTPConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
connect(m_ui->checkLimituTPConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||||
connect(m_ui->checkLimitTransportOverhead, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
connect(m_ui->checkLimitTransportOverhead, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||||
connect(m_ui->checkLimitLocalPeerRate, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
connect(m_ui->checkLimitLocalPeerRate, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||||
@ -573,13 +572,13 @@ void OptionsDialog::saveOptions()
|
|||||||
// End Downloads preferences
|
// End Downloads preferences
|
||||||
|
|
||||||
// Connection preferences
|
// Connection preferences
|
||||||
|
session->setBTProtocol(static_cast<BitTorrent::BTProtocol>(m_ui->comboProtocol->currentIndex()));
|
||||||
session->setPort(getPort());
|
session->setPort(getPort());
|
||||||
session->setUseRandomPort(m_ui->checkRandomPort->isChecked());
|
session->setUseRandomPort(m_ui->checkRandomPort->isChecked());
|
||||||
Net::PortForwarder::instance()->setEnabled(isUPnPEnabled());
|
Net::PortForwarder::instance()->setEnabled(isUPnPEnabled());
|
||||||
const QPair<int, int> down_up_limit = getGlobalBandwidthLimits();
|
const QPair<int, int> down_up_limit = getGlobalBandwidthLimits();
|
||||||
session->setGlobalDownloadSpeedLimit(down_up_limit.first);
|
session->setGlobalDownloadSpeedLimit(down_up_limit.first);
|
||||||
session->setGlobalUploadSpeedLimit(down_up_limit.second);
|
session->setGlobalUploadSpeedLimit(down_up_limit.second);
|
||||||
session->setUTPEnabled(m_ui->checkuTP->isChecked());
|
|
||||||
session->setUTPRateLimited(m_ui->checkLimituTPConnections->isChecked());
|
session->setUTPRateLimited(m_ui->checkLimituTPConnections->isChecked());
|
||||||
session->setIncludeOverheadInLimits(m_ui->checkLimitTransportOverhead->isChecked());
|
session->setIncludeOverheadInLimits(m_ui->checkLimitTransportOverhead->isChecked());
|
||||||
session->setIgnoreLimitsOnLAN(!m_ui->checkLimitLocalPeerRate->isChecked());
|
session->setIgnoreLimitsOnLAN(!m_ui->checkLimitLocalPeerRate->isChecked());
|
||||||
@ -824,6 +823,7 @@ void OptionsDialog::loadOptions()
|
|||||||
// End Downloads preferences
|
// End Downloads preferences
|
||||||
|
|
||||||
// Connection preferences
|
// Connection preferences
|
||||||
|
m_ui->comboProtocol->setCurrentIndex(static_cast<int>(session->btProtocol()));
|
||||||
m_ui->checkUPnP->setChecked(Net::PortForwarder::instance()->isEnabled());
|
m_ui->checkUPnP->setChecked(Net::PortForwarder::instance()->isEnabled());
|
||||||
m_ui->checkRandomPort->setChecked(session->useRandomPort());
|
m_ui->checkRandomPort->setChecked(session->useRandomPort());
|
||||||
m_ui->spinPort->setValue(session->port());
|
m_ui->spinPort->setValue(session->port());
|
||||||
@ -973,8 +973,6 @@ void OptionsDialog::loadOptions()
|
|||||||
m_ui->spinUploadLimitAlt->setEnabled(false);
|
m_ui->spinUploadLimitAlt->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->checkuTP->setChecked(session->isUTPEnabled());
|
|
||||||
m_ui->checkLimituTPConnections->setEnabled(m_ui->checkuTP->isChecked());
|
|
||||||
m_ui->checkLimituTPConnections->setChecked(session->isUTPRateLimited());
|
m_ui->checkLimituTPConnections->setChecked(session->isUTPRateLimited());
|
||||||
m_ui->checkLimitTransportOverhead->setChecked(session->includeOverheadInLimits());
|
m_ui->checkLimitTransportOverhead->setChecked(session->includeOverheadInLimits());
|
||||||
m_ui->checkLimitLocalPeerRate->setChecked(!session->ignoreLimitsOnLAN());
|
m_ui->checkLimitLocalPeerRate->setChecked(!session->ignoreLimitsOnLAN());
|
||||||
|
@ -1250,6 +1250,42 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_20">
|
<layout class="QVBoxLayout" name="verticalLayout_20">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_24">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Enabled protocol:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboProtocol">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>TCP and μTP</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">TCP</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">μTP</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="ListeningPortBox">
|
<widget class="QGroupBox" name="ListeningPortBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
@ -2011,47 +2047,27 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Rate Limits Settings</string>
|
<string>Rate Limits Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_8">
|
<layout class="QVBoxLayout" name="verticalLayout_30">
|
||||||
<item row="4" column="0" colspan="3">
|
<item>
|
||||||
<widget class="QCheckBox" name="checkLimitLocalPeerRate">
|
|
||||||
<property name="text">
|
|
||||||
<string>Apply rate limit to peers on LAN</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="3">
|
|
||||||
<widget class="QCheckBox" name="checkLimitTransportOverhead">
|
|
||||||
<property name="text">
|
|
||||||
<string>Apply rate limit to transport overhead</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="3">
|
|
||||||
<widget class="QCheckBox" name="checkuTP">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enable µTP protocol</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QCheckBox" name="checkLimituTPConnections">
|
<widget class="QCheckBox" name="checkLimituTPConnections">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Apply rate limit to µTP protocol</string>
|
<string>Apply rate limit to µTP protocol</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2">
|
<item>
|
||||||
<spacer name="horizontalSpacer_9">
|
<widget class="QCheckBox" name="checkLimitTransportOverhead">
|
||||||
<property name="orientation">
|
<property name="text">
|
||||||
<enum>Qt::Horizontal</enum>
|
<string>Apply rate limit to transport overhead</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
</widget>
|
||||||
<size>
|
</item>
|
||||||
<width>40</width>
|
<item>
|
||||||
<height>20</height>
|
<widget class="QCheckBox" name="checkLimitLocalPeerRate">
|
||||||
</size>
|
<property name="text">
|
||||||
|
<string>Apply rate limit to peers on LAN</string>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -3239,8 +3255,6 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string>
|
|||||||
<tabstop>spinDownloadLimitAlt</tabstop>
|
<tabstop>spinDownloadLimitAlt</tabstop>
|
||||||
<tabstop>checkLimitLocalPeerRate</tabstop>
|
<tabstop>checkLimitLocalPeerRate</tabstop>
|
||||||
<tabstop>checkLimitTransportOverhead</tabstop>
|
<tabstop>checkLimitTransportOverhead</tabstop>
|
||||||
<tabstop>checkuTP</tabstop>
|
|
||||||
<tabstop>checkLimituTPConnections</tabstop>
|
|
||||||
<tabstop>scrollArea_4</tabstop>
|
<tabstop>scrollArea_4</tabstop>
|
||||||
<tabstop>checkDHT</tabstop>
|
<tabstop>checkDHT</tabstop>
|
||||||
<tabstop>checkPeX</tabstop>
|
<tabstop>checkPeX</tabstop>
|
||||||
|
@ -120,7 +120,7 @@ QByteArray prefjson::getPreferences()
|
|||||||
// Global Rate Limits
|
// Global Rate Limits
|
||||||
data["dl_limit"] = session->globalDownloadSpeedLimit();
|
data["dl_limit"] = session->globalDownloadSpeedLimit();
|
||||||
data["up_limit"] = session->globalUploadSpeedLimit();
|
data["up_limit"] = session->globalUploadSpeedLimit();
|
||||||
data["enable_utp"] = session->isUTPEnabled();
|
data["bittorrent_protocol"] = static_cast<int>(session->btProtocol());
|
||||||
data["limit_utp_rate"] = session->isUTPRateLimited();
|
data["limit_utp_rate"] = session->isUTPRateLimited();
|
||||||
data["limit_tcp_overhead"] = session->includeOverheadInLimits();
|
data["limit_tcp_overhead"] = session->includeOverheadInLimits();
|
||||||
data["alt_dl_limit"] = session->altGlobalDownloadSpeedLimit();
|
data["alt_dl_limit"] = session->altGlobalDownloadSpeedLimit();
|
||||||
@ -322,8 +322,8 @@ void prefjson::setPreferences(const QString& json)
|
|||||||
session->setGlobalDownloadSpeedLimit(m["dl_limit"].toInt());
|
session->setGlobalDownloadSpeedLimit(m["dl_limit"].toInt());
|
||||||
if (m.contains("up_limit"))
|
if (m.contains("up_limit"))
|
||||||
session->setGlobalUploadSpeedLimit(m["up_limit"].toInt());
|
session->setGlobalUploadSpeedLimit(m["up_limit"].toInt());
|
||||||
if (m.contains("enable_utp"))
|
if (m.contains("bittorrent_protocol"))
|
||||||
session->setUTPEnabled(m["enable_utp"].toBool());
|
session->setBTProtocol(static_cast<BitTorrent::BTProtocol>(m["bittorrent_protocol"].toInt()));
|
||||||
if (m.contains("limit_utp_rate"))
|
if (m.contains("limit_utp_rate"))
|
||||||
session->setUTPRateLimited(m["limit_utp_rate"].toBool());
|
session->setUTPRateLimited(m["limit_utp_rate"].toBool());
|
||||||
if (m.contains("limit_tcp_overhead"))
|
if (m.contains("limit_tcp_overhead"))
|
||||||
|
@ -88,6 +88,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="ConnectionTab" class="PrefTab invisible">
|
<div id="ConnectionTab" class="PrefTab invisible">
|
||||||
|
<label>QBT_TR(Enabled protocol:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||||
|
<select id="enable_protocol_combobox">
|
||||||
|
<option value="0" selected>QBT_TR(TCP and μTP)QBT_TR[CONTEXT=OptionsDialog]</option>
|
||||||
|
<option value="1">TCP</option>
|
||||||
|
<option value="2">μTP</option>
|
||||||
|
</select><br/>
|
||||||
<fieldset class="settings">
|
<fieldset class="settings">
|
||||||
<legend>QBT_TR(Listening Port)QBT_TR[CONTEXT=OptionsDialog]</legend>
|
<legend>QBT_TR(Listening Port)QBT_TR[CONTEXT=OptionsDialog]</legend>
|
||||||
<label for="port_value">QBT_TR(Port used for incoming connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
<label for="port_value">QBT_TR(Port used for incoming connections:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||||
@ -256,8 +262,6 @@
|
|||||||
|
|
||||||
<fieldset class="settings">
|
<fieldset class="settings">
|
||||||
<legend>QBT_TR(Rate Limits Settings)QBT_TR[CONTEXT=OptionsDialog]</legend>
|
<legend>QBT_TR(Rate Limits Settings)QBT_TR[CONTEXT=OptionsDialog]</legend>
|
||||||
<input type="checkbox" id="enable_utp_checkbox" onClick="updateUTPEnabled();"/>
|
|
||||||
<label for="enable_utp_checkbox">QBT_TR(Enable µTP protocol)QBT_TR[CONTEXT=OptionsDialog]</label><br/>
|
|
||||||
<input type="checkbox" id="limit_utp_rate_checkbox"/>
|
<input type="checkbox" id="limit_utp_rate_checkbox"/>
|
||||||
<label for="limit_utp_rate_checkbox">QBT_TR(Apply rate limit to µTP protocol)QBT_TR[CONTEXT=OptionsDialog]</label><br/>
|
<label for="limit_utp_rate_checkbox">QBT_TR(Apply rate limit to µTP protocol)QBT_TR[CONTEXT=OptionsDialog]</label><br/>
|
||||||
<input type="checkbox" id="limit_tcp_overhead_checkbox"/>
|
<input type="checkbox" id="limit_tcp_overhead_checkbox"/>
|
||||||
@ -692,14 +696,6 @@ updateDlLimitEnabled = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUTPEnabled = function() {
|
|
||||||
if($('enable_utp_checkbox').getProperty('checked')) {
|
|
||||||
$('limit_utp_rate_checkbox').setProperty('disabled', false);
|
|
||||||
} else {
|
|
||||||
$('limit_utp_rate_checkbox').setProperty('disabled', true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateAltUpLimitEnabled = function() {
|
updateAltUpLimitEnabled = function() {
|
||||||
if($('alt_up_limit_checkbox').getProperty('checked')) {
|
if($('alt_up_limit_checkbox').getProperty('checked')) {
|
||||||
$('alt_up_limit_value').setProperty('disabled', false);
|
$('alt_up_limit_value').setProperty('disabled', false);
|
||||||
@ -974,10 +970,9 @@ loadPreferences = function() {
|
|||||||
$('dl_limit_value').setProperty('value', dl_limit);
|
$('dl_limit_value').setProperty('value', dl_limit);
|
||||||
}
|
}
|
||||||
updateDlLimitEnabled();
|
updateDlLimitEnabled();
|
||||||
$('enable_utp_checkbox').setProperty('checked', pref.enable_utp);
|
$('enable_protocol_combobox').setProperty('value', pref.bittorrent_protocol);
|
||||||
$('limit_utp_rate_checkbox').setProperty('checked', pref.limit_utp_rate);
|
$('limit_utp_rate_checkbox').setProperty('checked', pref.limit_utp_rate);
|
||||||
$('limit_tcp_overhead_checkbox').setProperty('checked', pref.limit_tcp_overhead);
|
$('limit_tcp_overhead_checkbox').setProperty('checked', pref.limit_tcp_overhead);
|
||||||
updateUTPEnabled();
|
|
||||||
|
|
||||||
// Alternative Global Rate Limits
|
// Alternative Global Rate Limits
|
||||||
var alt_up_limit = pref.alt_up_limit.toInt() / 1024;
|
var alt_up_limit = pref.alt_up_limit.toInt() / 1024;
|
||||||
@ -1217,7 +1212,7 @@ applyPreferences = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
settings.set('dl_limit', dl_limit);
|
settings.set('dl_limit', dl_limit);
|
||||||
settings.set('enable_utp', $('enable_utp_checkbox').getProperty('checked'));
|
settings.set('bittorrent_protocol', $('enable_protocol_combobox').getProperty('value'));
|
||||||
settings.set('limit_utp_rate', $('limit_utp_rate_checkbox').getProperty('checked'));
|
settings.set('limit_utp_rate', $('limit_utp_rate_checkbox').getProperty('checked'));
|
||||||
settings.set('limit_tcp_overhead', $('limit_tcp_overhead_checkbox').getProperty('checked'));
|
settings.set('limit_tcp_overhead', $('limit_tcp_overhead_checkbox').getProperty('checked'));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user