mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
Second round of renaming
This commit is contained in:
parent
28900f3fb6
commit
7ae1a891a8
9 changed files with 104 additions and 104 deletions
|
@ -404,10 +404,10 @@ namespace BitTorrent
|
|||
virtual void setStopTrackerTimeout(int value) = 0;
|
||||
virtual int maxConnections() const = 0;
|
||||
virtual void setMaxConnections(int max) = 0;
|
||||
virtual int maxConnectionsPerTorrent() const = 0;
|
||||
virtual void setMaxConnectionsPerTorrent(int max) = 0;
|
||||
virtual int maxSeedConnectionsPerTorrent() const = 0;
|
||||
virtual void setMaxSeedConnectionsPerTorrent(int max) = 0;
|
||||
virtual int maxConnectionsPerDownloadingTorrent() const = 0;
|
||||
virtual void setMaxConnectionsPerDownloadingTorrent(int max) = 0;
|
||||
virtual int maxConnectionsPerSeedingTorrent() const = 0;
|
||||
virtual void setMaxConnectionsPerSeedingTorrent(int max) = 0;
|
||||
virtual int maxUploads() const = 0;
|
||||
virtual void setMaxUploads(int max) = 0;
|
||||
virtual int maxUploadsPerTorrent() const = 0;
|
||||
|
|
|
@ -494,8 +494,8 @@ SessionImpl::SessionImpl(QObject *parent)
|
|||
, m_stopTrackerTimeout(BITTORRENT_SESSION_KEY(u"StopTrackerTimeout"_s), 2)
|
||||
, m_maxConnections(BITTORRENT_SESSION_KEY(u"MaxConnections"_s), 500, lowerLimited(0, -1))
|
||||
, m_maxUploads(BITTORRENT_SESSION_KEY(u"MaxUploads"_s), 20, lowerLimited(0, -1))
|
||||
, m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxConnectionsPerTorrent"_s), 100, lowerLimited(0, -1))
|
||||
, m_maxSeedConnectionsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxSeedConnectionsPerTorrent"_s), 40, lowerLimited(0, -1))
|
||||
, m_maxConnectionsPerDownloadingTorrent(BITTORRENT_SESSION_KEY(u"MaxConnectionsPerDownloadingTorrent"_s), 100, lowerLimited(0, -1))
|
||||
, m_maxConnectionsPerSeedingTorrent(BITTORRENT_SESSION_KEY(u"MaxConnectionsPerSeedingTorrent"_s), 40, lowerLimited(0, -1))
|
||||
, m_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxUploadsPerTorrent"_s), 4, lowerLimited(0, -1))
|
||||
, m_btProtocol(BITTORRENT_SESSION_KEY(u"BTProtocol"_s), BTProtocol::Both
|
||||
, clampValue(BTProtocol::Both, BTProtocol::UTP))
|
||||
|
@ -2982,7 +2982,7 @@ bool SessionImpl::addTorrent_impl(const TorrentDescriptor &source, const AddTorr
|
|||
p.added_time = std::time(nullptr);
|
||||
|
||||
// Limits
|
||||
p.max_connections = maxConnectionsPerTorrent();
|
||||
p.max_connections = maxConnectionsPerDownloadingTorrent();
|
||||
p.max_uploads = maxUploadsPerTorrent();
|
||||
|
||||
p.userdata = LTClientData(new ExtensionData);
|
||||
|
@ -3180,7 +3180,7 @@ bool SessionImpl::downloadMetadata(const TorrentDescriptor &torrentDescr)
|
|||
p.storage_mode = lt::storage_mode_sparse;
|
||||
|
||||
// Limits
|
||||
p.max_connections = maxConnectionsPerTorrent();
|
||||
p.max_connections = maxConnectionsPerDownloadingTorrent();
|
||||
p.max_uploads = maxUploadsPerTorrent();
|
||||
|
||||
const auto id = TorrentID::fromInfoHash(infoHash);
|
||||
|
@ -4351,28 +4351,28 @@ void SessionImpl::resume()
|
|||
}
|
||||
}
|
||||
|
||||
int SessionImpl::maxConnectionsPerTorrent() const
|
||||
int SessionImpl::maxConnectionsPerDownloadingTorrent() const
|
||||
{
|
||||
return m_maxConnectionsPerTorrent;
|
||||
return m_maxConnectionsPerDownloadingTorrent;
|
||||
}
|
||||
|
||||
int SessionImpl::maxSeedConnectionsPerTorrent() const
|
||||
int SessionImpl::maxConnectionsPerSeedingTorrent() const
|
||||
{
|
||||
return m_maxSeedConnectionsPerTorrent;
|
||||
return m_maxConnectionsPerSeedingTorrent;
|
||||
}
|
||||
|
||||
void SessionImpl::setMaxConnectionsPerTorrent(int max)
|
||||
void SessionImpl::setMaxConnectionsPerDownloadingTorrent(int max)
|
||||
{
|
||||
max = (max > 0) ? max : -1;
|
||||
if (max != maxConnectionsPerTorrent())
|
||||
if (max != maxConnectionsPerDownloadingTorrent())
|
||||
{
|
||||
m_maxConnectionsPerTorrent = max;
|
||||
m_maxConnectionsPerDownloadingTorrent = max;
|
||||
|
||||
for (const TorrentImpl *torrent : asConst(m_torrents))
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_maxSeedConnectionsPerTorrent == -1 || !torrent->isUploading())
|
||||
if (m_maxConnectionsPerSeedingTorrent == -1 || !torrent->isUploading())
|
||||
{
|
||||
torrent->nativeHandle().set_max_connections(max);
|
||||
}
|
||||
|
@ -4382,12 +4382,12 @@ void SessionImpl::setMaxConnectionsPerTorrent(int max)
|
|||
}
|
||||
}
|
||||
|
||||
void SessionImpl::setMaxSeedConnectionsPerTorrent(int max)
|
||||
void SessionImpl::setMaxConnectionsPerSeedingTorrent(int max)
|
||||
{
|
||||
max = (max > 0) ? max : -1;
|
||||
if (max != maxSeedConnectionsPerTorrent())
|
||||
if (max != maxConnectionsPerSeedingTorrent())
|
||||
{
|
||||
m_maxSeedConnectionsPerTorrent = max;
|
||||
m_maxConnectionsPerSeedingTorrent = max;
|
||||
|
||||
for (const TorrentImpl *torrent : asConst(m_torrents))
|
||||
{
|
||||
|
|
|
@ -378,10 +378,10 @@ namespace BitTorrent
|
|||
void setStopTrackerTimeout(int value) override;
|
||||
int maxConnections() const override;
|
||||
void setMaxConnections(int max) override;
|
||||
int maxConnectionsPerTorrent() const override;
|
||||
void setMaxConnectionsPerTorrent(int max) override;
|
||||
int maxSeedConnectionsPerTorrent() const override;
|
||||
void setMaxSeedConnectionsPerTorrent(int max) override;
|
||||
int maxConnectionsPerDownloadingTorrent() const override;
|
||||
void setMaxConnectionsPerDownloadingTorrent(int max) override;
|
||||
int maxConnectionsPerSeedingTorrent() const override;
|
||||
void setMaxConnectionsPerSeedingTorrent(int max) override;
|
||||
int maxUploads() const override;
|
||||
void setMaxUploads(int max) override;
|
||||
int maxUploadsPerTorrent() const override;
|
||||
|
@ -700,8 +700,8 @@ namespace BitTorrent
|
|||
CachedSettingValue<int> m_stopTrackerTimeout;
|
||||
CachedSettingValue<int> m_maxConnections;
|
||||
CachedSettingValue<int> m_maxUploads;
|
||||
CachedSettingValue<int> m_maxConnectionsPerTorrent;
|
||||
CachedSettingValue<int> m_maxSeedConnectionsPerTorrent;
|
||||
CachedSettingValue<int> m_maxConnectionsPerDownloadingTorrent;
|
||||
CachedSettingValue<int> m_maxConnectionsPerSeedingTorrent;
|
||||
CachedSettingValue<int> m_maxUploadsPerTorrent;
|
||||
CachedSettingValue<BTProtocol> m_btProtocol;
|
||||
CachedSettingValue<bool> m_isUTPRateLimited;
|
||||
|
|
|
@ -2604,10 +2604,10 @@ void TorrentImpl::updateProgress()
|
|||
|
||||
void TorrentImpl::updateMaxConnections()
|
||||
{
|
||||
const int maxConnections = m_session->maxConnectionsPerTorrent();
|
||||
const int maxSeedConnections = m_session->maxSeedConnectionsPerTorrent();
|
||||
const bool useAltLimit = (maxSeedConnections != -1) && isUploading();
|
||||
const int max = useAltLimit ? maxSeedConnections : maxConnections;
|
||||
const int maxDownloadingConnections = m_session->maxConnectionsPerDownloadingTorrent();
|
||||
const int maxSeedingConnections = m_session->maxConnectionsPerSeedingTorrent();
|
||||
const bool useSeedingLimit = (maxSeedingConnections != -1) && isUploading();
|
||||
const int max = useSeedingLimit ? maxSeedingConnections : maxDownloadingConnections;
|
||||
|
||||
if (nativeHandle().max_connections() == max)
|
||||
return;
|
||||
|
|
|
@ -846,32 +846,32 @@ void OptionsDialog::loadConnectionTabOptions()
|
|||
m_ui->checkMaxConnections->setChecked(false);
|
||||
m_ui->spinMaxConnec->setEnabled(false);
|
||||
}
|
||||
intValue = session->maxConnectionsPerTorrent();
|
||||
intValue = session->maxConnectionsPerDownloadingTorrent();
|
||||
if (intValue > 0)
|
||||
{
|
||||
// enable
|
||||
m_ui->checkMaxConnectionsPerTorrent->setChecked(true);
|
||||
m_ui->spinMaxConnecPerTorrent->setEnabled(true);
|
||||
m_ui->spinMaxConnecPerTorrent->setValue(intValue);
|
||||
m_ui->checkMaxConnectionsPerDownloadingTorrent->setChecked(true);
|
||||
m_ui->spinMaxConnecPerDownloadingTorrent->setEnabled(true);
|
||||
m_ui->spinMaxConnecPerDownloadingTorrent->setValue(intValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
// disable
|
||||
m_ui->checkMaxConnectionsPerTorrent->setChecked(false);
|
||||
m_ui->spinMaxConnecPerTorrent->setEnabled(false);
|
||||
m_ui->checkMaxConnectionsPerDownloadingTorrent->setChecked(false);
|
||||
m_ui->spinMaxConnecPerDownloadingTorrent->setEnabled(false);
|
||||
}
|
||||
intValue = session->maxSeedConnectionsPerTorrent();
|
||||
intValue = session->maxConnectionsPerSeedingTorrent();
|
||||
if (intValue > 0)
|
||||
{
|
||||
// enable
|
||||
m_ui->checkMaxSeedConnectionsPerTorrent->setChecked(true);
|
||||
m_ui->spinMaxSeedConnecPerTorrent->setValue(intValue);
|
||||
m_ui->checkMaxConnectionsPerSeedingTorrent->setChecked(true);
|
||||
m_ui->spinMaxConnecPerSeedingTorrent->setValue(intValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
// disable
|
||||
m_ui->checkMaxSeedConnectionsPerTorrent->setChecked(false);
|
||||
m_ui->spinMaxSeedConnecPerTorrent->setEnabled(false);
|
||||
m_ui->checkMaxConnectionsPerSeedingTorrent->setChecked(false);
|
||||
m_ui->spinMaxConnecPerSeedingTorrent->setEnabled(false);
|
||||
}
|
||||
intValue = session->maxUploads();
|
||||
if (intValue > 0)
|
||||
|
@ -949,17 +949,17 @@ void OptionsDialog::loadConnectionTabOptions()
|
|||
|
||||
connect(m_ui->checkMaxConnections, &QAbstractButton::toggled, m_ui->spinMaxConnec, &QWidget::setEnabled);
|
||||
connect(m_ui->checkMaxConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkMaxConnectionsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxConnecPerTorrent, &QWidget::setEnabled);
|
||||
connect(m_ui->checkMaxConnectionsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkMaxSeedConnectionsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxSeedConnecPerTorrent, &QWidget::setEnabled);
|
||||
connect(m_ui->checkMaxSeedConnectionsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkMaxConnectionsPerDownloadingTorrent, &QAbstractButton::toggled, m_ui->spinMaxConnecPerDownloadingTorrent, &QWidget::setEnabled);
|
||||
connect(m_ui->checkMaxConnectionsPerDownloadingTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkMaxConnectionsPerSeedingTorrent, &QAbstractButton::toggled, m_ui->spinMaxConnecPerSeedingTorrent, &QWidget::setEnabled);
|
||||
connect(m_ui->checkMaxConnectionsPerSeedingTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkMaxUploads, &QAbstractButton::toggled, m_ui->spinMaxUploads, &QWidget::setEnabled);
|
||||
connect(m_ui->checkMaxUploads, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->checkMaxUploadsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxUploadsPerTorrent, &QWidget::setEnabled);
|
||||
connect(m_ui->checkMaxUploadsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->spinMaxConnec, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->spinMaxConnecPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->spinMaxSeedConnecPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->spinMaxConnecPerDownloadingTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->spinMaxConnecPerSeedingTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->spinMaxUploads, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||
connect(m_ui->spinMaxUploadsPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
|
||||
|
||||
|
@ -1002,8 +1002,8 @@ void OptionsDialog::saveConnectionTabOptions() const
|
|||
Net::PortForwarder::instance()->setEnabled(isUPnPEnabled());
|
||||
|
||||
session->setMaxConnections(getMaxConnections());
|
||||
session->setMaxConnectionsPerTorrent(getMaxConnectionsPerTorrent());
|
||||
session->setMaxSeedConnectionsPerTorrent(getMaxSeedConnectionsPerTorrent());
|
||||
session->setMaxConnectionsPerDownloadingTorrent(getMaxConnectionsPerDownloadingTorrent());
|
||||
session->setMaxConnectionsPerSeedingTorrent(getMaxConnectionsPerSeedingTorrent());
|
||||
session->setMaxUploads(getMaxUploads());
|
||||
session->setMaxUploadsPerTorrent(getMaxUploadsPerTorrent());
|
||||
|
||||
|
@ -1623,20 +1623,20 @@ int OptionsDialog::getMaxConnections() const
|
|||
return m_ui->spinMaxConnec->value();
|
||||
}
|
||||
|
||||
int OptionsDialog::getMaxConnectionsPerTorrent() const
|
||||
int OptionsDialog::getMaxConnectionsPerDownloadingTorrent() const
|
||||
{
|
||||
if (!m_ui->checkMaxConnectionsPerTorrent->isChecked())
|
||||
if (!m_ui->checkMaxConnectionsPerDownloadingTorrent->isChecked())
|
||||
return -1;
|
||||
|
||||
return m_ui->spinMaxConnecPerTorrent->value();
|
||||
return m_ui->spinMaxConnecPerDownloadingTorrent->value();
|
||||
}
|
||||
|
||||
int OptionsDialog::getMaxSeedConnectionsPerTorrent() const
|
||||
int OptionsDialog::getMaxConnectionsPerSeedingTorrent() const
|
||||
{
|
||||
if (!m_ui->checkMaxSeedConnectionsPerTorrent->isChecked())
|
||||
if (!m_ui->checkMaxConnectionsPerSeedingTorrent->isChecked())
|
||||
return -1;
|
||||
|
||||
return m_ui->spinMaxSeedConnecPerTorrent->value();
|
||||
return m_ui->spinMaxConnecPerSeedingTorrent->value();
|
||||
}
|
||||
|
||||
int OptionsDialog::getMaxUploads() const
|
||||
|
|
|
@ -165,8 +165,8 @@ private:
|
|||
bool isUPnPEnabled() const;
|
||||
// Bittorrent options
|
||||
int getMaxConnections() const;
|
||||
int getMaxConnectionsPerTorrent() const;
|
||||
int getMaxSeedConnectionsPerTorrent() const;
|
||||
int getMaxConnectionsPerDownloadingTorrent() const;
|
||||
int getMaxConnectionsPerSeedingTorrent() const;
|
||||
int getMaxUploads() const;
|
||||
int getMaxUploadsPerTorrent() const;
|
||||
bool isDHTEnabled() const;
|
||||
|
|
|
@ -1910,7 +1910,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st
|
|||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkMaxConnectionsPerTorrent">
|
||||
<widget class="QCheckBox" name="checkMaxConnectionsPerDownloadingTorrent">
|
||||
<property name="text">
|
||||
<string>Maximum number of connections per torrent:</string>
|
||||
</property>
|
||||
|
@ -1920,7 +1920,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st
|
|||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="spinMaxConnecPerTorrent">
|
||||
<widget class="QSpinBox" name="spinMaxConnecPerDownloadingTorrent">
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
</property>
|
||||
|
@ -1933,7 +1933,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st
|
|||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="checkMaxSeedConnectionsPerTorrent">
|
||||
<widget class="QCheckBox" name="checkMaxConnectionsPerSeedingTorrent">
|
||||
<property name="text">
|
||||
<string>Maximum number of connections per seeding torrent:</string>
|
||||
</property>
|
||||
|
@ -1943,7 +1943,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st
|
|||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="spinMaxSeedConnecPerTorrent">
|
||||
<widget class="QSpinBox" name="spinMaxConnecPerSeedingTorrent">
|
||||
<property name="minimum">
|
||||
<number>2</number>
|
||||
</property>
|
||||
|
|
|
@ -229,8 +229,8 @@ void AppController::preferencesAction()
|
|||
data[u"upnp"_s] = Net::PortForwarder::instance()->isEnabled();
|
||||
// Connections Limits
|
||||
data[u"max_connec"_s] = session->maxConnections();
|
||||
data[u"max_connec_per_torrent"_s] = session->maxConnectionsPerTorrent();
|
||||
data[u"max_seed_connec_per_torrent"_s] = session->maxSeedConnectionsPerTorrent();
|
||||
data[u"max_connec_per_downloading_torrent"_s] = session->maxConnectionsPerDownloadingTorrent();
|
||||
data[u"max_connec_per_seeding_torrent"_s] = session->maxConnectionsPerSeedingTorrent();
|
||||
data[u"max_uploads"_s] = session->maxUploads();
|
||||
data[u"max_uploads_per_torrent"_s] = session->maxUploadsPerTorrent();
|
||||
|
||||
|
@ -710,10 +710,10 @@ void AppController::setPreferencesAction()
|
|||
// Connections Limits
|
||||
if (hasKey(u"max_connec"_s))
|
||||
session->setMaxConnections(it.value().toInt());
|
||||
if (hasKey(u"max_connec_per_torrent"_s))
|
||||
session->setMaxConnectionsPerTorrent(it.value().toInt());
|
||||
if (hasKey(u"max_seed_connec_per_torrent"_s))
|
||||
session->setMaxSeedConnectionsPerTorrent(it.value().toInt());
|
||||
if (hasKey(u"max_connec_per_downloading_torrent"_s))
|
||||
session->setMaxConnectionsPerDownloadingTorrent(it.value().toInt());
|
||||
if (hasKey(u"max_connec_per_seeding_torrent"_s))
|
||||
session->setMaxConnectionsPerSeedingTorrent(it.value().toInt());
|
||||
if (hasKey(u"max_uploads"_s))
|
||||
session->setMaxUploads(it.value().toInt());
|
||||
if (hasKey(u"max_uploads_per_torrent"_s))
|
||||
|
|
|
@ -436,17 +436,17 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" id="maxConnectionsPerTorrentCheckbox" onclick="qBittorrent.Preferences.updateMaxConnecPerTorrentEnabled();">
|
||||
<label id="maxConnectionsPerTorrentLabel" for="maxConnectionsPerTorrentCheckbox">QBT_TR(Maximum number of connections per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||
<input type="checkbox" id="maxConnectionsPerDownloadingTorrentCheckbox" onclick="qBittorrent.Preferences.updateMaxConnecPerDownloadingTorrentEnabled();">
|
||||
<label id="maxConnectionsPerDownloadingTorrentLabel" for="maxConnectionsPerDownloadingTorrentCheckbox">QBT_TR(Maximum number of connections per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||
</td>
|
||||
<td><input type="text" id="maxConnectionsPerTorrentValue" aria-labelledby="maxConnectionsPerTorrentLabel" style="width: 6em;"></td>
|
||||
<td><input type="text" id="maxConnectionsPerDownloadingTorrentValue" aria-labelledby="maxConnectionsPerDownloadingTorrentLabel" style="width: 6em;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="checkbox" id="maxSeedConnectionsPerTorrentCheckbox" onclick="qBittorrent.Preferences.updateMaxSeedConnecPerTorrentEnabled();">
|
||||
<label id="maxSeedConnectionsPerTorrentLabel" for="maxSeedConnectionsPerTorrentCheckbox">QBT_TR(Maximum number of connections per seeding torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||
<input type="checkbox" id="maxConnectionsPerSeedingTorrentCheckbox" onclick="qBittorrent.Preferences.updateMaxConnecPerSeedingTorrentEnabled();">
|
||||
<label id="maxConnectionsPerSeedingTorrentLabel" for="maxConnectionsPerSeedingTorrentCheckbox">QBT_TR(Maximum number of connections per seeding torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||
</td>
|
||||
<td><input type="text" id="maxSeedConnectionsPerTorrentValue" aria-labelledby="maxSeedConnectionsPerTorrentLabel" style="width: 6em;"></td>
|
||||
<td><input type="text" id="maxConnectionsPerSeedingTorrentValue" aria-labelledby="maxConnectionsPerSeedingTorrentLabel" style="width: 6em;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -1778,8 +1778,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
|||
updateAutoRunOnTorrentAdded: updateAutoRunOnTorrentAdded,
|
||||
generateRandomPort: generateRandomPort,
|
||||
updateMaxConnecEnabled: updateMaxConnecEnabled,
|
||||
updateMaxConnecPerTorrentEnabled: updateMaxConnecPerTorrentEnabled,
|
||||
updateMaxSeedConnecPerTorrentEnabled: updateMaxSeedConnecPerTorrentEnabled,
|
||||
updateMaxConnecPerDownloadingTorrentEnabled: updateMaxConnecPerDownloadingTorrentEnabled,
|
||||
updateMaxConnecPerSeedingTorrentEnabled: updateMaxConnecPerSeedingTorrentEnabled,
|
||||
updateMaxUploadsEnabled: updateMaxUploadsEnabled,
|
||||
updateMaxUploadsPerTorrentEnabled: updateMaxUploadsPerTorrentEnabled,
|
||||
updateI2PSettingsEnabled: updateI2PSettingsEnabled,
|
||||
|
@ -1984,14 +1984,14 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
|||
document.getElementById("maxConnectionsValue").disabled = !isMaxConnecEnabled;
|
||||
};
|
||||
|
||||
const updateMaxConnecPerTorrentEnabled = () => {
|
||||
const isMaxConnecPerTorrentEnabled = document.getElementById("maxConnectionsPerTorrentCheckbox").checked;
|
||||
document.getElementById("maxConnectionsPerTorrentValue").disabled = !isMaxConnecPerTorrentEnabled;
|
||||
const updateMaxConnecPerDownloadingTorrentEnabled = () => {
|
||||
const isMaxConnecPerDownloadingTorrentEnabled = document.getElementById("maxConnectionsPerDownloadingTorrentCheckbox").checked;
|
||||
document.getElementById("maxConnectionsPerDownloadingTorrentValue").disabled = !isMaxConnecPerDownloadingTorrentEnabled;
|
||||
};
|
||||
|
||||
const updateMaxSeedConnecPerTorrentEnabled = () => {
|
||||
const isMaxSeedConnecPerTorrentEnabled = document.getElementById("maxSeedConnectionsPerTorrentCheckbox").checked;
|
||||
document.getElementById("maxSeedConnectionsPerTorrentValue").disabled = !isMaxSeedConnecPerTorrentEnabled;
|
||||
const updateMaxConnecPerSeedingTorrentEnabled = () => {
|
||||
const isMaxConnecPerSeedingTorrentEnabled = document.getElementById("maxConnectionsPerSeedingTorrentCheckbox").checked;
|
||||
document.getElementById("maxConnectionsPerSeedingTorrentValue").disabled = !isMaxConnecPerSeedingTorrentEnabled;
|
||||
};
|
||||
|
||||
const updateMaxUploadsEnabled = () => {
|
||||
|
@ -2390,27 +2390,27 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
|||
}
|
||||
updateMaxConnecEnabled();
|
||||
|
||||
const maxConnecPerTorrent = Number(pref.max_connec_per_torrent);
|
||||
if (maxConnecPerTorrent <= 0) {
|
||||
document.getElementById("maxConnectionsPerTorrentCheckbox").checked = false;
|
||||
document.getElementById("maxConnectionsPerTorrentValue").value = 100;
|
||||
const maxConnecPerDownloadingTorrent = Number(pref.max_connec_per_downloading_torrent);
|
||||
if (maxConnecPerDownloadingTorrent <= 0) {
|
||||
document.getElementById("maxConnectionsPerDownloadingTorrentCheckbox").checked = false;
|
||||
document.getElementById("maxConnectionsPerDownloadingTorrentValue").value = 100;
|
||||
}
|
||||
else {
|
||||
document.getElementById("maxConnectionsPerTorrentCheckbox").checked = true;
|
||||
document.getElementById("maxConnectionsPerTorrentValue").value = maxConnecPerTorrent;
|
||||
document.getElementById("maxConnectionsPerDownloadingTorrentCheckbox").checked = true;
|
||||
document.getElementById("maxConnectionsPerDownloadingTorrentValue").value = maxConnecPerDownloadingTorrent;
|
||||
}
|
||||
updateMaxConnecPerTorrentEnabled();
|
||||
updateMaxConnecPerDownloadingTorrentEnabled();
|
||||
|
||||
const maxSeedConnecPerTorrent = Number(pref.max_seed_connec_per_torrent);
|
||||
if (maxSeedConnecPerTorrent <= 0) {
|
||||
document.getElementById("maxSeedConnectionsPerTorrentCheckbox").checked = false;
|
||||
document.getElementById("maxSeedConnectionsPerTorrentValue").value = 100;
|
||||
const maxConnecPerSeedingTorrent = Number(pref.max_connec_per_seeding_torrent);
|
||||
if (maxConnecPerSeedingTorrent <= 0) {
|
||||
document.getElementById("maxConnectionsPerSeedingTorrentCheckbox").checked = false;
|
||||
document.getElementById("maxConnectionsPerSeedingTorrentValue").value = 100;
|
||||
}
|
||||
else {
|
||||
document.getElementById("maxSeedConnectionsPerTorrentCheckbox").checked = true;
|
||||
document.getElementById("maxSeedConnectionsPerTorrentValue").value = maxSeedConnecPerTorrent;
|
||||
document.getElementById("maxConnectionsPerSeedingTorrentCheckbox").checked = true;
|
||||
document.getElementById("maxConnectionsPerSeedingTorrentValue").value = maxConnecPerSeedingTorrent;
|
||||
}
|
||||
updateMaxSeedConnecPerTorrentEnabled();
|
||||
updateMaxConnecPerSeedingTorrentEnabled();
|
||||
|
||||
const maxUploads = Number(pref.max_uploads);
|
||||
if (maxUploads <= 0) {
|
||||
|
@ -2787,25 +2787,25 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
|||
}
|
||||
settings["max_connec"] = maxConnec;
|
||||
|
||||
let maxConnecPerTorrent = -1;
|
||||
if (document.getElementById("maxConnectionsPerTorrentCheckbox").checked) {
|
||||
maxConnecPerTorrent = Number(document.getElementById("maxConnectionsPerTorrentValue").value);
|
||||
if (Number.isNaN(maxConnecPerTorrent) || (maxConnecPerTorrent <= 0)) {
|
||||
let maxConnecPerDownloadingTorrent = -1;
|
||||
if (document.getElementById("maxConnectionsPerDownloadingTorrentCheckbox").checked) {
|
||||
maxConnecPerDownloadingTorrent = Number(document.getElementById("maxConnectionsPerDownloadingTorrentValue").value);
|
||||
if (Number.isNaN(maxConnecPerDownloadingTorrent) || (maxConnecPerDownloadingTorrent <= 0)) {
|
||||
alert("QBT_TR(Maximum number of connections per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
settings["max_connec_per_torrent"] = maxConnecPerTorrent;
|
||||
settings["max_connec_per_downloading_torrent"] = maxConnecPerDownloadingTorrent;
|
||||
|
||||
let maxSeedConnecPerTorrent = -1;
|
||||
if (document.getElementById("maxSeedConnectionsPerTorrentCheckbox").checked) {
|
||||
maxSeedConnecPerTorrent = Number(document.getElementById("maxSeedConnectionsPerTorrentValue").value);
|
||||
if (Number.isNaN(maxSeedConnecPerTorrent) || (maxSeedConnecPerTorrent <= 0)) {
|
||||
let maxConnecPerSeedingTorrent = -1;
|
||||
if (document.getElementById("maxConnectionsPerSeedingTorrentCheckbox").checked) {
|
||||
maxConnecPerSeedingTorrent = Number(document.getElementById("maxConnectionsPerSeedingTorrentValue").value);
|
||||
if (Number.isNaN(maxConnecPerSeedingTorrent) || (maxConnecPerSeedingTorrent <= 0)) {
|
||||
alert("QBT_TR(Maximum number of seed connections per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
settings["max_seed_connec_per_torrent"] = maxSeedConnecPerTorrent;
|
||||
settings["max_connec_per_seeding_torrent"] = maxConnecPerSeedingTorrent;
|
||||
|
||||
let maxUploads = -1;
|
||||
if (document.getElementById("maxUploadsCheckbox").checked) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue