mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
Add comboBox for selecting BitTorrent protocol. Closes #6316.
Use unicode string C_UTP in place of "uTP"
This commit is contained in:
committed by
sledgehammer999
parent
91d41336a7
commit
a32c4aca92
@@ -36,6 +36,7 @@
|
||||
#include "app/application.h"
|
||||
#include "base/bittorrent/session.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/unicodestrings.h"
|
||||
#include "gui/mainwindow.h"
|
||||
|
||||
enum AdvSettingsCols
|
||||
@@ -345,7 +346,7 @@ void AdvancedSettings::loadAdvancedSettings()
|
||||
// uTP-TCP mixed mode
|
||||
comboUtpMixedMode.addItems({"Prefer TCP", "Peer proportional (throttles TCP)"});
|
||||
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
|
||||
cbMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
|
||||
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);
|
||||
|
||||
// Connection tab
|
||||
connect(m_ui->comboProtocol, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->spinPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkRandomPort, &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_to, &QDateTimeEdit::timeChanged, 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->checkLimitTransportOverhead, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkLimitLocalPeerRate, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
@@ -573,13 +572,13 @@ void OptionsDialog::saveOptions()
|
||||
// End Downloads preferences
|
||||
|
||||
// Connection preferences
|
||||
session->setBTProtocol(static_cast<BitTorrent::BTProtocol>(m_ui->comboProtocol->currentIndex()));
|
||||
session->setPort(getPort());
|
||||
session->setUseRandomPort(m_ui->checkRandomPort->isChecked());
|
||||
Net::PortForwarder::instance()->setEnabled(isUPnPEnabled());
|
||||
const QPair<int, int> down_up_limit = getGlobalBandwidthLimits();
|
||||
session->setGlobalDownloadSpeedLimit(down_up_limit.first);
|
||||
session->setGlobalUploadSpeedLimit(down_up_limit.second);
|
||||
session->setUTPEnabled(m_ui->checkuTP->isChecked());
|
||||
session->setUTPRateLimited(m_ui->checkLimituTPConnections->isChecked());
|
||||
session->setIncludeOverheadInLimits(m_ui->checkLimitTransportOverhead->isChecked());
|
||||
session->setIgnoreLimitsOnLAN(!m_ui->checkLimitLocalPeerRate->isChecked());
|
||||
@@ -824,6 +823,7 @@ void OptionsDialog::loadOptions()
|
||||
// End Downloads preferences
|
||||
|
||||
// Connection preferences
|
||||
m_ui->comboProtocol->setCurrentIndex(static_cast<int>(session->btProtocol()));
|
||||
m_ui->checkUPnP->setChecked(Net::PortForwarder::instance()->isEnabled());
|
||||
m_ui->checkRandomPort->setChecked(session->useRandomPort());
|
||||
m_ui->spinPort->setValue(session->port());
|
||||
@@ -973,8 +973,6 @@ void OptionsDialog::loadOptions()
|
||||
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->checkLimitTransportOverhead->setChecked(session->includeOverheadInLimits());
|
||||
m_ui->checkLimitLocalPeerRate->setChecked(!session->ignoreLimitsOnLAN());
|
||||
|
||||
@@ -1250,6 +1250,42 @@
|
||||
</rect>
|
||||
</property>
|
||||
<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>
|
||||
<widget class="QGroupBox" name="ListeningPortBox">
|
||||
<property name="title">
|
||||
@@ -2011,47 +2047,27 @@
|
||||
<property name="title">
|
||||
<string>Rate Limits Settings</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_8">
|
||||
<item row="4" column="0" colspan="3">
|
||||
<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">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_30">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkLimituTPConnections">
|
||||
<property name="text">
|
||||
<string>Apply rate limit to µTP protocol</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<spacer name="horizontalSpacer_9">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkLimitTransportOverhead">
|
||||
<property name="text">
|
||||
<string>Apply rate limit to transport overhead</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkLimitLocalPeerRate">
|
||||
<property name="text">
|
||||
<string>Apply rate limit to peers on LAN</string>
|
||||
</property>
|
||||
</spacer>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -3239,8 +3255,6 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string>
|
||||
<tabstop>spinDownloadLimitAlt</tabstop>
|
||||
<tabstop>checkLimitLocalPeerRate</tabstop>
|
||||
<tabstop>checkLimitTransportOverhead</tabstop>
|
||||
<tabstop>checkuTP</tabstop>
|
||||
<tabstop>checkLimituTPConnections</tabstop>
|
||||
<tabstop>scrollArea_4</tabstop>
|
||||
<tabstop>checkDHT</tabstop>
|
||||
<tabstop>checkPeX</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user