Second round of renaming

This commit is contained in:
lstrsrt 2025-08-06 20:30:02 +02:00
commit 7ae1a891a8
9 changed files with 104 additions and 104 deletions

View file

@ -404,10 +404,10 @@ namespace BitTorrent
virtual void setStopTrackerTimeout(int value) = 0; virtual void setStopTrackerTimeout(int value) = 0;
virtual int maxConnections() const = 0; virtual int maxConnections() const = 0;
virtual void setMaxConnections(int max) = 0; virtual void setMaxConnections(int max) = 0;
virtual int maxConnectionsPerTorrent() const = 0; virtual int maxConnectionsPerDownloadingTorrent() const = 0;
virtual void setMaxConnectionsPerTorrent(int max) = 0; virtual void setMaxConnectionsPerDownloadingTorrent(int max) = 0;
virtual int maxSeedConnectionsPerTorrent() const = 0; virtual int maxConnectionsPerSeedingTorrent() const = 0;
virtual void setMaxSeedConnectionsPerTorrent(int max) = 0; virtual void setMaxConnectionsPerSeedingTorrent(int max) = 0;
virtual int maxUploads() const = 0; virtual int maxUploads() const = 0;
virtual void setMaxUploads(int max) = 0; virtual void setMaxUploads(int max) = 0;
virtual int maxUploadsPerTorrent() const = 0; virtual int maxUploadsPerTorrent() const = 0;

View file

@ -494,8 +494,8 @@ SessionImpl::SessionImpl(QObject *parent)
, m_stopTrackerTimeout(BITTORRENT_SESSION_KEY(u"StopTrackerTimeout"_s), 2) , m_stopTrackerTimeout(BITTORRENT_SESSION_KEY(u"StopTrackerTimeout"_s), 2)
, m_maxConnections(BITTORRENT_SESSION_KEY(u"MaxConnections"_s), 500, lowerLimited(0, -1)) , 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_maxUploads(BITTORRENT_SESSION_KEY(u"MaxUploads"_s), 20, lowerLimited(0, -1))
, m_maxConnectionsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxConnectionsPerTorrent"_s), 100, lowerLimited(0, -1)) , m_maxConnectionsPerDownloadingTorrent(BITTORRENT_SESSION_KEY(u"MaxConnectionsPerDownloadingTorrent"_s), 100, lowerLimited(0, -1))
, m_maxSeedConnectionsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxSeedConnectionsPerTorrent"_s), 40, 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_maxUploadsPerTorrent(BITTORRENT_SESSION_KEY(u"MaxUploadsPerTorrent"_s), 4, lowerLimited(0, -1))
, m_btProtocol(BITTORRENT_SESSION_KEY(u"BTProtocol"_s), BTProtocol::Both , m_btProtocol(BITTORRENT_SESSION_KEY(u"BTProtocol"_s), BTProtocol::Both
, clampValue(BTProtocol::Both, BTProtocol::UTP)) , clampValue(BTProtocol::Both, BTProtocol::UTP))
@ -2982,7 +2982,7 @@ bool SessionImpl::addTorrent_impl(const TorrentDescriptor &source, const AddTorr
p.added_time = std::time(nullptr); p.added_time = std::time(nullptr);
// Limits // Limits
p.max_connections = maxConnectionsPerTorrent(); p.max_connections = maxConnectionsPerDownloadingTorrent();
p.max_uploads = maxUploadsPerTorrent(); p.max_uploads = maxUploadsPerTorrent();
p.userdata = LTClientData(new ExtensionData); p.userdata = LTClientData(new ExtensionData);
@ -3180,7 +3180,7 @@ bool SessionImpl::downloadMetadata(const TorrentDescriptor &torrentDescr)
p.storage_mode = lt::storage_mode_sparse; p.storage_mode = lt::storage_mode_sparse;
// Limits // Limits
p.max_connections = maxConnectionsPerTorrent(); p.max_connections = maxConnectionsPerDownloadingTorrent();
p.max_uploads = maxUploadsPerTorrent(); p.max_uploads = maxUploadsPerTorrent();
const auto id = TorrentID::fromInfoHash(infoHash); 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; max = (max > 0) ? max : -1;
if (max != maxConnectionsPerTorrent()) if (max != maxConnectionsPerDownloadingTorrent())
{ {
m_maxConnectionsPerTorrent = max; m_maxConnectionsPerDownloadingTorrent = max;
for (const TorrentImpl *torrent : asConst(m_torrents)) for (const TorrentImpl *torrent : asConst(m_torrents))
{ {
try try
{ {
if (m_maxSeedConnectionsPerTorrent == -1 || !torrent->isUploading()) if (m_maxConnectionsPerSeedingTorrent == -1 || !torrent->isUploading())
{ {
torrent->nativeHandle().set_max_connections(max); 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; max = (max > 0) ? max : -1;
if (max != maxSeedConnectionsPerTorrent()) if (max != maxConnectionsPerSeedingTorrent())
{ {
m_maxSeedConnectionsPerTorrent = max; m_maxConnectionsPerSeedingTorrent = max;
for (const TorrentImpl *torrent : asConst(m_torrents)) for (const TorrentImpl *torrent : asConst(m_torrents))
{ {

View file

@ -378,10 +378,10 @@ namespace BitTorrent
void setStopTrackerTimeout(int value) override; void setStopTrackerTimeout(int value) override;
int maxConnections() const override; int maxConnections() const override;
void setMaxConnections(int max) override; void setMaxConnections(int max) override;
int maxConnectionsPerTorrent() const override; int maxConnectionsPerDownloadingTorrent() const override;
void setMaxConnectionsPerTorrent(int max) override; void setMaxConnectionsPerDownloadingTorrent(int max) override;
int maxSeedConnectionsPerTorrent() const override; int maxConnectionsPerSeedingTorrent() const override;
void setMaxSeedConnectionsPerTorrent(int max) override; void setMaxConnectionsPerSeedingTorrent(int max) override;
int maxUploads() const override; int maxUploads() const override;
void setMaxUploads(int max) override; void setMaxUploads(int max) override;
int maxUploadsPerTorrent() const override; int maxUploadsPerTorrent() const override;
@ -700,8 +700,8 @@ namespace BitTorrent
CachedSettingValue<int> m_stopTrackerTimeout; CachedSettingValue<int> m_stopTrackerTimeout;
CachedSettingValue<int> m_maxConnections; CachedSettingValue<int> m_maxConnections;
CachedSettingValue<int> m_maxUploads; CachedSettingValue<int> m_maxUploads;
CachedSettingValue<int> m_maxConnectionsPerTorrent; CachedSettingValue<int> m_maxConnectionsPerDownloadingTorrent;
CachedSettingValue<int> m_maxSeedConnectionsPerTorrent; CachedSettingValue<int> m_maxConnectionsPerSeedingTorrent;
CachedSettingValue<int> m_maxUploadsPerTorrent; CachedSettingValue<int> m_maxUploadsPerTorrent;
CachedSettingValue<BTProtocol> m_btProtocol; CachedSettingValue<BTProtocol> m_btProtocol;
CachedSettingValue<bool> m_isUTPRateLimited; CachedSettingValue<bool> m_isUTPRateLimited;

View file

@ -2604,10 +2604,10 @@ void TorrentImpl::updateProgress()
void TorrentImpl::updateMaxConnections() void TorrentImpl::updateMaxConnections()
{ {
const int maxConnections = m_session->maxConnectionsPerTorrent(); const int maxDownloadingConnections = m_session->maxConnectionsPerDownloadingTorrent();
const int maxSeedConnections = m_session->maxSeedConnectionsPerTorrent(); const int maxSeedingConnections = m_session->maxConnectionsPerSeedingTorrent();
const bool useAltLimit = (maxSeedConnections != -1) && isUploading(); const bool useSeedingLimit = (maxSeedingConnections != -1) && isUploading();
const int max = useAltLimit ? maxSeedConnections : maxConnections; const int max = useSeedingLimit ? maxSeedingConnections : maxDownloadingConnections;
if (nativeHandle().max_connections() == max) if (nativeHandle().max_connections() == max)
return; return;

View file

@ -846,32 +846,32 @@ void OptionsDialog::loadConnectionTabOptions()
m_ui->checkMaxConnections->setChecked(false); m_ui->checkMaxConnections->setChecked(false);
m_ui->spinMaxConnec->setEnabled(false); m_ui->spinMaxConnec->setEnabled(false);
} }
intValue = session->maxConnectionsPerTorrent(); intValue = session->maxConnectionsPerDownloadingTorrent();
if (intValue > 0) if (intValue > 0)
{ {
// enable // enable
m_ui->checkMaxConnectionsPerTorrent->setChecked(true); m_ui->checkMaxConnectionsPerDownloadingTorrent->setChecked(true);
m_ui->spinMaxConnecPerTorrent->setEnabled(true); m_ui->spinMaxConnecPerDownloadingTorrent->setEnabled(true);
m_ui->spinMaxConnecPerTorrent->setValue(intValue); m_ui->spinMaxConnecPerDownloadingTorrent->setValue(intValue);
} }
else else
{ {
// disable // disable
m_ui->checkMaxConnectionsPerTorrent->setChecked(false); m_ui->checkMaxConnectionsPerDownloadingTorrent->setChecked(false);
m_ui->spinMaxConnecPerTorrent->setEnabled(false); m_ui->spinMaxConnecPerDownloadingTorrent->setEnabled(false);
} }
intValue = session->maxSeedConnectionsPerTorrent(); intValue = session->maxConnectionsPerSeedingTorrent();
if (intValue > 0) if (intValue > 0)
{ {
// enable // enable
m_ui->checkMaxSeedConnectionsPerTorrent->setChecked(true); m_ui->checkMaxConnectionsPerSeedingTorrent->setChecked(true);
m_ui->spinMaxSeedConnecPerTorrent->setValue(intValue); m_ui->spinMaxConnecPerSeedingTorrent->setValue(intValue);
} }
else else
{ {
// disable // disable
m_ui->checkMaxSeedConnectionsPerTorrent->setChecked(false); m_ui->checkMaxConnectionsPerSeedingTorrent->setChecked(false);
m_ui->spinMaxSeedConnecPerTorrent->setEnabled(false); m_ui->spinMaxConnecPerSeedingTorrent->setEnabled(false);
} }
intValue = session->maxUploads(); intValue = session->maxUploads();
if (intValue > 0) 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, m_ui->spinMaxConnec, &QWidget::setEnabled);
connect(m_ui->checkMaxConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxConnectionsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxConnecPerTorrent, &QWidget::setEnabled); connect(m_ui->checkMaxConnectionsPerDownloadingTorrent, &QAbstractButton::toggled, m_ui->spinMaxConnecPerDownloadingTorrent, &QWidget::setEnabled);
connect(m_ui->checkMaxConnectionsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxConnectionsPerDownloadingTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkMaxSeedConnectionsPerTorrent, &QAbstractButton::toggled, m_ui->spinMaxSeedConnecPerTorrent, &QWidget::setEnabled); connect(m_ui->checkMaxConnectionsPerSeedingTorrent, &QAbstractButton::toggled, m_ui->spinMaxConnecPerSeedingTorrent, &QWidget::setEnabled);
connect(m_ui->checkMaxSeedConnectionsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); 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, m_ui->spinMaxUploads, &QWidget::setEnabled);
connect(m_ui->checkMaxUploads, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); 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, m_ui->spinMaxUploadsPerTorrent, &QWidget::setEnabled);
connect(m_ui->checkMaxUploadsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxUploadsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->spinMaxConnec, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinMaxConnec, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinMaxConnecPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinMaxConnecPerDownloadingTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinMaxSeedConnecPerTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinMaxConnecPerSeedingTorrent, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinMaxUploads, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinMaxUploads, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinMaxUploadsPerTorrent, 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()); Net::PortForwarder::instance()->setEnabled(isUPnPEnabled());
session->setMaxConnections(getMaxConnections()); session->setMaxConnections(getMaxConnections());
session->setMaxConnectionsPerTorrent(getMaxConnectionsPerTorrent()); session->setMaxConnectionsPerDownloadingTorrent(getMaxConnectionsPerDownloadingTorrent());
session->setMaxSeedConnectionsPerTorrent(getMaxSeedConnectionsPerTorrent()); session->setMaxConnectionsPerSeedingTorrent(getMaxConnectionsPerSeedingTorrent());
session->setMaxUploads(getMaxUploads()); session->setMaxUploads(getMaxUploads());
session->setMaxUploadsPerTorrent(getMaxUploadsPerTorrent()); session->setMaxUploadsPerTorrent(getMaxUploadsPerTorrent());
@ -1623,20 +1623,20 @@ int OptionsDialog::getMaxConnections() const
return m_ui->spinMaxConnec->value(); 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 -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 -1;
return m_ui->spinMaxSeedConnecPerTorrent->value(); return m_ui->spinMaxConnecPerSeedingTorrent->value();
} }
int OptionsDialog::getMaxUploads() const int OptionsDialog::getMaxUploads() const

View file

@ -165,8 +165,8 @@ private:
bool isUPnPEnabled() const; bool isUPnPEnabled() const;
// Bittorrent options // Bittorrent options
int getMaxConnections() const; int getMaxConnections() const;
int getMaxConnectionsPerTorrent() const; int getMaxConnectionsPerDownloadingTorrent() const;
int getMaxSeedConnectionsPerTorrent() const; int getMaxConnectionsPerSeedingTorrent() const;
int getMaxUploads() const; int getMaxUploads() const;
int getMaxUploadsPerTorrent() const; int getMaxUploadsPerTorrent() const;
bool isDHTEnabled() const; bool isDHTEnabled() const;

View file

@ -1910,7 +1910,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st
</spacer> </spacer>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QCheckBox" name="checkMaxConnectionsPerTorrent"> <widget class="QCheckBox" name="checkMaxConnectionsPerDownloadingTorrent">
<property name="text"> <property name="text">
<string>Maximum number of connections per torrent:</string> <string>Maximum number of connections per torrent:</string>
</property> </property>
@ -1920,7 +1920,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="QSpinBox" name="spinMaxConnecPerTorrent"> <widget class="QSpinBox" name="spinMaxConnecPerDownloadingTorrent">
<property name="minimum"> <property name="minimum">
<number>2</number> <number>2</number>
</property> </property>
@ -1933,7 +1933,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QCheckBox" name="checkMaxSeedConnectionsPerTorrent"> <widget class="QCheckBox" name="checkMaxConnectionsPerSeedingTorrent">
<property name="text"> <property name="text">
<string>Maximum number of connections per seeding torrent:</string> <string>Maximum number of connections per seeding torrent:</string>
</property> </property>
@ -1943,7 +1943,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.</st
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="2" column="1">
<widget class="QSpinBox" name="spinMaxSeedConnecPerTorrent"> <widget class="QSpinBox" name="spinMaxConnecPerSeedingTorrent">
<property name="minimum"> <property name="minimum">
<number>2</number> <number>2</number>
</property> </property>

View file

@ -229,8 +229,8 @@ void AppController::preferencesAction()
data[u"upnp"_s] = Net::PortForwarder::instance()->isEnabled(); data[u"upnp"_s] = Net::PortForwarder::instance()->isEnabled();
// Connections Limits // Connections Limits
data[u"max_connec"_s] = session->maxConnections(); data[u"max_connec"_s] = session->maxConnections();
data[u"max_connec_per_torrent"_s] = session->maxConnectionsPerTorrent(); data[u"max_connec_per_downloading_torrent"_s] = session->maxConnectionsPerDownloadingTorrent();
data[u"max_seed_connec_per_torrent"_s] = session->maxSeedConnectionsPerTorrent(); data[u"max_connec_per_seeding_torrent"_s] = session->maxConnectionsPerSeedingTorrent();
data[u"max_uploads"_s] = session->maxUploads(); data[u"max_uploads"_s] = session->maxUploads();
data[u"max_uploads_per_torrent"_s] = session->maxUploadsPerTorrent(); data[u"max_uploads_per_torrent"_s] = session->maxUploadsPerTorrent();
@ -710,10 +710,10 @@ void AppController::setPreferencesAction()
// Connections Limits // Connections Limits
if (hasKey(u"max_connec"_s)) if (hasKey(u"max_connec"_s))
session->setMaxConnections(it.value().toInt()); session->setMaxConnections(it.value().toInt());
if (hasKey(u"max_connec_per_torrent"_s)) if (hasKey(u"max_connec_per_downloading_torrent"_s))
session->setMaxConnectionsPerTorrent(it.value().toInt()); session->setMaxConnectionsPerDownloadingTorrent(it.value().toInt());
if (hasKey(u"max_seed_connec_per_torrent"_s)) if (hasKey(u"max_connec_per_seeding_torrent"_s))
session->setMaxSeedConnectionsPerTorrent(it.value().toInt()); session->setMaxConnectionsPerSeedingTorrent(it.value().toInt());
if (hasKey(u"max_uploads"_s)) if (hasKey(u"max_uploads"_s))
session->setMaxUploads(it.value().toInt()); session->setMaxUploads(it.value().toInt());
if (hasKey(u"max_uploads_per_torrent"_s)) if (hasKey(u"max_uploads_per_torrent"_s))

View file

@ -436,17 +436,17 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<input type="checkbox" id="maxConnectionsPerTorrentCheckbox" onclick="qBittorrent.Preferences.updateMaxConnecPerTorrentEnabled();"> <input type="checkbox" id="maxConnectionsPerDownloadingTorrentCheckbox" onclick="qBittorrent.Preferences.updateMaxConnecPerDownloadingTorrentEnabled();">
<label id="maxConnectionsPerTorrentLabel" for="maxConnectionsPerTorrentCheckbox">QBT_TR(Maximum number of connections per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label> <label id="maxConnectionsPerDownloadingTorrentLabel" for="maxConnectionsPerDownloadingTorrentCheckbox">QBT_TR(Maximum number of connections per torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
</td> </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>
<tr> <tr>
<td> <td>
<input type="checkbox" id="maxSeedConnectionsPerTorrentCheckbox" onclick="qBittorrent.Preferences.updateMaxSeedConnecPerTorrentEnabled();"> <input type="checkbox" id="maxConnectionsPerSeedingTorrentCheckbox" onclick="qBittorrent.Preferences.updateMaxConnecPerSeedingTorrentEnabled();">
<label id="maxSeedConnectionsPerTorrentLabel" for="maxSeedConnectionsPerTorrentCheckbox">QBT_TR(Maximum number of connections per seeding torrent:)QBT_TR[CONTEXT=OptionsDialog]</label> <label id="maxConnectionsPerSeedingTorrentLabel" for="maxConnectionsPerSeedingTorrentCheckbox">QBT_TR(Maximum number of connections per seeding torrent:)QBT_TR[CONTEXT=OptionsDialog]</label>
</td> </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>
<tr> <tr>
<td> <td>
@ -1778,8 +1778,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
updateAutoRunOnTorrentAdded: updateAutoRunOnTorrentAdded, updateAutoRunOnTorrentAdded: updateAutoRunOnTorrentAdded,
generateRandomPort: generateRandomPort, generateRandomPort: generateRandomPort,
updateMaxConnecEnabled: updateMaxConnecEnabled, updateMaxConnecEnabled: updateMaxConnecEnabled,
updateMaxConnecPerTorrentEnabled: updateMaxConnecPerTorrentEnabled, updateMaxConnecPerDownloadingTorrentEnabled: updateMaxConnecPerDownloadingTorrentEnabled,
updateMaxSeedConnecPerTorrentEnabled: updateMaxSeedConnecPerTorrentEnabled, updateMaxConnecPerSeedingTorrentEnabled: updateMaxConnecPerSeedingTorrentEnabled,
updateMaxUploadsEnabled: updateMaxUploadsEnabled, updateMaxUploadsEnabled: updateMaxUploadsEnabled,
updateMaxUploadsPerTorrentEnabled: updateMaxUploadsPerTorrentEnabled, updateMaxUploadsPerTorrentEnabled: updateMaxUploadsPerTorrentEnabled,
updateI2PSettingsEnabled: updateI2PSettingsEnabled, updateI2PSettingsEnabled: updateI2PSettingsEnabled,
@ -1984,14 +1984,14 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
document.getElementById("maxConnectionsValue").disabled = !isMaxConnecEnabled; document.getElementById("maxConnectionsValue").disabled = !isMaxConnecEnabled;
}; };
const updateMaxConnecPerTorrentEnabled = () => { const updateMaxConnecPerDownloadingTorrentEnabled = () => {
const isMaxConnecPerTorrentEnabled = document.getElementById("maxConnectionsPerTorrentCheckbox").checked; const isMaxConnecPerDownloadingTorrentEnabled = document.getElementById("maxConnectionsPerDownloadingTorrentCheckbox").checked;
document.getElementById("maxConnectionsPerTorrentValue").disabled = !isMaxConnecPerTorrentEnabled; document.getElementById("maxConnectionsPerDownloadingTorrentValue").disabled = !isMaxConnecPerDownloadingTorrentEnabled;
}; };
const updateMaxSeedConnecPerTorrentEnabled = () => { const updateMaxConnecPerSeedingTorrentEnabled = () => {
const isMaxSeedConnecPerTorrentEnabled = document.getElementById("maxSeedConnectionsPerTorrentCheckbox").checked; const isMaxConnecPerSeedingTorrentEnabled = document.getElementById("maxConnectionsPerSeedingTorrentCheckbox").checked;
document.getElementById("maxSeedConnectionsPerTorrentValue").disabled = !isMaxSeedConnecPerTorrentEnabled; document.getElementById("maxConnectionsPerSeedingTorrentValue").disabled = !isMaxConnecPerSeedingTorrentEnabled;
}; };
const updateMaxUploadsEnabled = () => { const updateMaxUploadsEnabled = () => {
@ -2390,27 +2390,27 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
} }
updateMaxConnecEnabled(); updateMaxConnecEnabled();
const maxConnecPerTorrent = Number(pref.max_connec_per_torrent); const maxConnecPerDownloadingTorrent = Number(pref.max_connec_per_downloading_torrent);
if (maxConnecPerTorrent <= 0) { if (maxConnecPerDownloadingTorrent <= 0) {
document.getElementById("maxConnectionsPerTorrentCheckbox").checked = false; document.getElementById("maxConnectionsPerDownloadingTorrentCheckbox").checked = false;
document.getElementById("maxConnectionsPerTorrentValue").value = 100; document.getElementById("maxConnectionsPerDownloadingTorrentValue").value = 100;
} }
else { else {
document.getElementById("maxConnectionsPerTorrentCheckbox").checked = true; document.getElementById("maxConnectionsPerDownloadingTorrentCheckbox").checked = true;
document.getElementById("maxConnectionsPerTorrentValue").value = maxConnecPerTorrent; document.getElementById("maxConnectionsPerDownloadingTorrentValue").value = maxConnecPerDownloadingTorrent;
} }
updateMaxConnecPerTorrentEnabled(); updateMaxConnecPerDownloadingTorrentEnabled();
const maxSeedConnecPerTorrent = Number(pref.max_seed_connec_per_torrent); const maxConnecPerSeedingTorrent = Number(pref.max_connec_per_seeding_torrent);
if (maxSeedConnecPerTorrent <= 0) { if (maxConnecPerSeedingTorrent <= 0) {
document.getElementById("maxSeedConnectionsPerTorrentCheckbox").checked = false; document.getElementById("maxConnectionsPerSeedingTorrentCheckbox").checked = false;
document.getElementById("maxSeedConnectionsPerTorrentValue").value = 100; document.getElementById("maxConnectionsPerSeedingTorrentValue").value = 100;
} }
else { else {
document.getElementById("maxSeedConnectionsPerTorrentCheckbox").checked = true; document.getElementById("maxConnectionsPerSeedingTorrentCheckbox").checked = true;
document.getElementById("maxSeedConnectionsPerTorrentValue").value = maxSeedConnecPerTorrent; document.getElementById("maxConnectionsPerSeedingTorrentValue").value = maxConnecPerSeedingTorrent;
} }
updateMaxSeedConnecPerTorrentEnabled(); updateMaxConnecPerSeedingTorrentEnabled();
const maxUploads = Number(pref.max_uploads); const maxUploads = Number(pref.max_uploads);
if (maxUploads <= 0) { if (maxUploads <= 0) {
@ -2787,25 +2787,25 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
} }
settings["max_connec"] = maxConnec; settings["max_connec"] = maxConnec;
let maxConnecPerTorrent = -1; let maxConnecPerDownloadingTorrent = -1;
if (document.getElementById("maxConnectionsPerTorrentCheckbox").checked) { if (document.getElementById("maxConnectionsPerDownloadingTorrentCheckbox").checked) {
maxConnecPerTorrent = Number(document.getElementById("maxConnectionsPerTorrentValue").value); maxConnecPerDownloadingTorrent = Number(document.getElementById("maxConnectionsPerDownloadingTorrentValue").value);
if (Number.isNaN(maxConnecPerTorrent) || (maxConnecPerTorrent <= 0)) { 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]"); alert("QBT_TR(Maximum number of connections per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return; return;
} }
} }
settings["max_connec_per_torrent"] = maxConnecPerTorrent; settings["max_connec_per_downloading_torrent"] = maxConnecPerDownloadingTorrent;
let maxSeedConnecPerTorrent = -1; let maxConnecPerSeedingTorrent = -1;
if (document.getElementById("maxSeedConnectionsPerTorrentCheckbox").checked) { if (document.getElementById("maxConnectionsPerSeedingTorrentCheckbox").checked) {
maxSeedConnecPerTorrent = Number(document.getElementById("maxSeedConnectionsPerTorrentValue").value); maxConnecPerSeedingTorrent = Number(document.getElementById("maxConnectionsPerSeedingTorrentValue").value);
if (Number.isNaN(maxSeedConnecPerTorrent) || (maxSeedConnecPerTorrent <= 0)) { 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]"); alert("QBT_TR(Maximum number of seed connections per torrent limit must be greater than 0 or disabled.)QBT_TR[CONTEXT=HttpServer]");
return; return;
} }
} }
settings["max_seed_connec_per_torrent"] = maxSeedConnecPerTorrent; settings["max_connec_per_seeding_torrent"] = maxConnecPerSeedingTorrent;
let maxUploads = -1; let maxUploads = -1;
if (document.getElementById("maxUploadsCheckbox").checked) { if (document.getElementById("maxUploadsCheckbox").checked) {