Browse Source

Merge pull request #13895 from Chocobo1/improve

Improve advanced settings
adaptive-webui-19844
Mike Tzou 4 years ago committed by GitHub
parent
commit
e4e0a24416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      src/gui/advancedsettings.cpp
  2. 46
      src/webui/www/private/views/preferences.html

33
src/gui/advancedsettings.cpp

@ -82,6 +82,9 @@ namespace
DOWNLOAD_TRACKER_FAVICON, DOWNLOAD_TRACKER_FAVICON,
SAVE_PATH_HISTORY_LENGTH, SAVE_PATH_HISTORY_LENGTH,
ENABLE_SPEED_WIDGET, ENABLE_SPEED_WIDGET,
// embedded tracker
TRACKER_STATUS,
TRACKER_PORT,
// libtorrent section // libtorrent section
LIBTORRENT_HEADER, LIBTORRENT_HEADER,
ASYNC_IO_THREADS, ASYNC_IO_THREADS,
@ -119,9 +122,6 @@ namespace
VALIDATE_HTTPS_TRACKER_CERTIFICATE, VALIDATE_HTTPS_TRACKER_CERTIFICATE,
#endif #endif
BLOCK_PEERS_ON_PRIVILEGED_PORTS, BLOCK_PEERS_ON_PRIVILEGED_PORTS,
// embedded tracker
TRACKER_STATUS,
TRACKER_PORT,
// seeding // seeding
CHOKING_ALGORITHM, CHOKING_ALGORITHM,
SEED_CHOKING_ALGORITHM, SEED_CHOKING_ALGORITHM,
@ -383,7 +383,7 @@ void AdvancedSettings::loadAdvancedSettings()
static_cast<QLabel *>(cellWidget(QBITTORRENT_HEADER, PROPERTY))->setAlignment(Qt::AlignCenter | Qt::AlignVCenter); static_cast<QLabel *>(cellWidget(QBITTORRENT_HEADER, PROPERTY))->setAlignment(Qt::AlignCenter | Qt::AlignVCenter);
auto *labelLibtorrentLink = new QLabel( auto *labelLibtorrentLink = new QLabel(
makeLink(QLatin1String("https://www.libtorrent.org/reference.html") makeLink(QLatin1String("https://www.libtorrent.org/reference-Settings.html")
, tr("Open documentation")) , tr("Open documentation"))
, this); , this);
labelLibtorrentLink->setOpenExternalLinks(true); labelLibtorrentLink->setOpenExternalLinks(true);
@ -534,12 +534,16 @@ void AdvancedSettings::loadAdvancedSettings()
m_spinBoxOutgoingPortsMin.setMinimum(0); m_spinBoxOutgoingPortsMin.setMinimum(0);
m_spinBoxOutgoingPortsMin.setMaximum(65535); m_spinBoxOutgoingPortsMin.setMaximum(65535);
m_spinBoxOutgoingPortsMin.setValue(session->outgoingPortsMin()); m_spinBoxOutgoingPortsMin.setValue(session->outgoingPortsMin());
addRow(OUTGOING_PORT_MIN, tr("Outgoing ports (Min) [0: Disabled]"), &m_spinBoxOutgoingPortsMin); addRow(OUTGOING_PORT_MIN, (tr("Outgoing ports (Min) [0: Disabled]")
+ ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#outgoing_port", "(?)"))
, &m_spinBoxOutgoingPortsMin);
// Outgoing port Min // Outgoing port Min
m_spinBoxOutgoingPortsMax.setMinimum(0); m_spinBoxOutgoingPortsMax.setMinimum(0);
m_spinBoxOutgoingPortsMax.setMaximum(65535); m_spinBoxOutgoingPortsMax.setMaximum(65535);
m_spinBoxOutgoingPortsMax.setValue(session->outgoingPortsMax()); m_spinBoxOutgoingPortsMax.setValue(session->outgoingPortsMax());
addRow(OUTGOING_PORT_MAX, tr("Outgoing ports (Max) [0: Disabled]"), &m_spinBoxOutgoingPortsMax); addRow(OUTGOING_PORT_MAX, (tr("Outgoing ports (Max) [0: Disabled]")
+ ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#outgoing_port", "(?)"))
, &m_spinBoxOutgoingPortsMax);
#if (LIBTORRENT_VERSION_NUM >= 10206) #if (LIBTORRENT_VERSION_NUM >= 10206)
// UPnP lease duration // UPnP lease duration
m_spinBoxUPnPLeaseDuration.setMinimum(0); m_spinBoxUPnPLeaseDuration.setMinimum(0);
@ -557,7 +561,9 @@ void AdvancedSettings::loadAdvancedSettings()
, &m_comboBoxUtpMixedMode); , &m_comboBoxUtpMixedMode);
// multiple connections per IP // multiple connections per IP
m_checkBoxMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled()); m_checkBoxMultiConnectionsPerIp.setChecked(session->multiConnectionsPerIpEnabled());
addRow(MULTI_CONNECTIONS_PER_IP, tr("Allow multiple connections from the same IP address"), &m_checkBoxMultiConnectionsPerIp); addRow(MULTI_CONNECTIONS_PER_IP, (tr("Allow multiple connections from the same IP address")
+ ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#allow_multiple_connections_per_ip", "(?)"))
, &m_checkBoxMultiConnectionsPerIp);
#ifdef HAS_HTTPS_TRACKER_VALIDATION #ifdef HAS_HTTPS_TRACKER_VALIDATION
// Validate HTTPS tracker certificate // Validate HTTPS tracker certificate
m_checkBoxValidateHTTPSTrackerCertificate.setChecked(session->validateHTTPSTrackerCertificate()); m_checkBoxValidateHTTPSTrackerCertificate.setChecked(session->validateHTTPSTrackerCertificate());
@ -612,9 +618,12 @@ void AdvancedSettings::loadAdvancedSettings()
addRow(NETWORK_IFACE_ADDRESS, tr("Optional IP address to bind to"), &m_comboBoxInterfaceAddress); addRow(NETWORK_IFACE_ADDRESS, tr("Optional IP address to bind to"), &m_comboBoxInterfaceAddress);
// Announce IP // Announce IP
m_lineEditAnnounceIP.setText(session->announceIP()); m_lineEditAnnounceIP.setText(session->announceIP());
addRow(ANNOUNCE_IP, tr("IP Address to report to trackers (requires restart)"), &m_lineEditAnnounceIP); addRow(ANNOUNCE_IP, (tr("IP Address to report to trackers (requires restart)")
+ ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#announce_ip", "(?)"))
, &m_lineEditAnnounceIP);
#if (LIBTORRENT_VERSION_NUM >= 10207) #if (LIBTORRENT_VERSION_NUM >= 10207)
// Max concurrent HTTP announces // Max concurrent HTTP announces
m_spinBoxMaxConcurrentHTTPAnnounces.setMaximum(std::numeric_limits<int>::max());
m_spinBoxMaxConcurrentHTTPAnnounces.setValue(session->maxConcurrentHTTPAnnounces()); m_spinBoxMaxConcurrentHTTPAnnounces.setValue(session->maxConcurrentHTTPAnnounces());
addRow(MAX_CONCURRENT_HTTP_ANNOUNCES, (tr("Max concurrent HTTP announces") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#max_concurrent_http_announces", "(?)")) addRow(MAX_CONCURRENT_HTTP_ANNOUNCES, (tr("Max concurrent HTTP announces") + ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#max_concurrent_http_announces", "(?)"))
, &m_spinBoxMaxConcurrentHTTPAnnounces); , &m_spinBoxMaxConcurrentHTTPAnnounces);
@ -671,11 +680,15 @@ void AdvancedSettings::loadAdvancedSettings()
// Announce to all trackers in a tier // Announce to all trackers in a tier
m_checkBoxAnnounceAllTrackers.setChecked(session->announceToAllTrackers()); m_checkBoxAnnounceAllTrackers.setChecked(session->announceToAllTrackers());
addRow(ANNOUNCE_ALL_TRACKERS, tr("Always announce to all trackers in a tier"), &m_checkBoxAnnounceAllTrackers); addRow(ANNOUNCE_ALL_TRACKERS, (tr("Always announce to all trackers in a tier")
+ ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#announce_to_all_trackers", "(?)"))
, &m_checkBoxAnnounceAllTrackers);
// Announce to all tiers // Announce to all tiers
m_checkBoxAnnounceAllTiers.setChecked(session->announceToAllTiers()); m_checkBoxAnnounceAllTiers.setChecked(session->announceToAllTiers());
addRow(ANNOUNCE_ALL_TIERS, tr("Always announce to all tiers"), &m_checkBoxAnnounceAllTiers); addRow(ANNOUNCE_ALL_TIERS, (tr("Always announce to all tiers")
+ ' ' + makeLink("https://www.libtorrent.org/reference-Settings.html#announce_to_all_tiers", "(?)"))
, &m_checkBoxAnnounceAllTiers);
m_spinBoxPeerTurnover.setMinimum(0); m_spinBoxPeerTurnover.setMinimum(0);
m_spinBoxPeerTurnover.setMaximum(100); m_spinBoxPeerTurnover.setMaximum(100);

46
src/webui/www/private/views/preferences.html

@ -931,10 +931,26 @@
<input type="checkbox" id="resolvePeerCountries"> <input type="checkbox" id="resolvePeerCountries">
</td> </td>
</tr> </tr>
<tr>
<td>
<label for="enableEmbeddedTracker">QBT_TR(Enable embedded tracker:)QBT_TR[CONTEXT=OptionsDialog]</label>
</td>
<td>
<input type="checkbox" id="enableEmbeddedTracker" />
</td>
</tr>
<tr>
<td>
<label for="embeddedTrackerPort">QBT_TR(Embedded tracker port:)QBT_TR[CONTEXT=OptionsDialog]</label>
</td>
<td>
<input type="text" id="embeddedTrackerPort" style="width: 15em;" />
</td>
</tr>
</table> </table>
</fieldset> </fieldset>
<fieldset class="settings"> <fieldset class="settings">
<legend>QBT_TR(libtorrent Section)QBT_TR[CONTEXT=OptionsDialog]&nbsp;(<a href="https://www.libtorrent.org/reference.html" target="_blank">QBT_TR(Open documentation)QBT_TR[CONTEXT=HttpServer]</a>)</legend> <legend>QBT_TR(libtorrent Section)QBT_TR[CONTEXT=OptionsDialog]&nbsp;(<a href="https://www.libtorrent.org/reference-Settings.html" target="_blank">QBT_TR(Open documentation)QBT_TR[CONTEXT=HttpServer]</a>)</legend>
<table> <table>
<tr> <tr>
<td> <td>
@ -1050,7 +1066,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="outgoingPortsMin">QBT_TR(Outgoing ports (Min) [0: Disabled]:)QBT_TR[CONTEXT=OptionsDialog]</label> <label for="outgoingPortsMin">QBT_TR(Outgoing ports (Min) [0: Disabled]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#outgoing_port" target="_blank">(?)</a></label>
</td> </td>
<td> <td>
<input type="text" id="outgoingPortsMin" style="width: 15em;" /> <input type="text" id="outgoingPortsMin" style="width: 15em;" />
@ -1058,7 +1074,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="outgoingPortsMax">QBT_TR(Outgoing ports (Max) [0: Disabled]:)QBT_TR[CONTEXT=OptionsDialog]</label> <label for="outgoingPortsMax">QBT_TR(Outgoing ports (Max) [0: Disabled]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#outgoing_port" target="_blank">(?)</a></label>
</td> </td>
<td> <td>
<input type="text" id="outgoingPortsMax" style="width: 15em;" /> <input type="text" id="outgoingPortsMax" style="width: 15em;" />
@ -1085,7 +1101,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="allowMultipleConnectionsFromTheSameIPAddress">QBT_TR(Allow multiple connections from the same IP address:)QBT_TR[CONTEXT=OptionsDialog]</label> <label for="allowMultipleConnectionsFromTheSameIPAddress">QBT_TR(Allow multiple connections from the same IP address:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#allow_multiple_connections_per_ip" target="_blank">(?)</a></label>
</td> </td>
<td> <td>
<input type="checkbox" id="allowMultipleConnectionsFromTheSameIPAddress" /> <input type="checkbox" id="allowMultipleConnectionsFromTheSameIPAddress" />
@ -1107,22 +1123,6 @@
<input type="checkbox" id="blockPeersOnPrivilegedPorts" /> <input type="checkbox" id="blockPeersOnPrivilegedPorts" />
</td> </td>
</tr> </tr>
<tr>
<td>
<label for="enableEmbeddedTracker">QBT_TR(Enable embedded tracker:)QBT_TR[CONTEXT=OptionsDialog]</label>
</td>
<td>
<input type="checkbox" id="enableEmbeddedTracker" />
</td>
</tr>
<tr>
<td>
<label for="embeddedTrackerPort">QBT_TR(Embedded tracker port:)QBT_TR[CONTEXT=OptionsDialog]</label>
</td>
<td>
<input type="text" id="embeddedTrackerPort" style="width: 15em;" />
</td>
</tr>
<tr> <tr>
<td> <td>
<label for="uploadSlotsBehavior">QBT_TR(Upload slots behavior:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#choking_algorithm" target="_blank">(?)</a></label> <label for="uploadSlotsBehavior">QBT_TR(Upload slots behavior:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#choking_algorithm" target="_blank">(?)</a></label>
@ -1148,7 +1148,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="announceAllTrackers">QBT_TR(Always announce to all trackers in a tier:)QBT_TR[CONTEXT=OptionsDialog]</label> <label for="announceAllTrackers">QBT_TR(Always announce to all trackers in a tier:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#announce_to_all_trackers" target="_blank">(?)</a></label>
</td> </td>
<td> <td>
<input type="checkbox" id="announceAllTrackers" /> <input type="checkbox" id="announceAllTrackers" />
@ -1156,7 +1156,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="announceAllTiers">QBT_TR(Always announce to all tiers:)QBT_TR[CONTEXT=OptionsDialog]</label> <label for="announceAllTiers">QBT_TR(Always announce to all tiers:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#announce_to_all_tiers" target="_blank">(?)</a></label>
</td> </td>
<td> <td>
<input type="checkbox" id="announceAllTiers" /> <input type="checkbox" id="announceAllTiers" />
@ -1164,7 +1164,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<label for="announceIP">QBT_TR(IP Address to report to trackers (requires restart):)QBT_TR[CONTEXT=OptionsDialog]</label> <label for="announceIP">QBT_TR(IP Address to report to trackers (requires restart):)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#announce_ip" target="_blank">(?)</a></label>
</td> </td>
<td> <td>
<input type="text" id="announceIP" style="width: 15em;" /> <input type="text" id="announceIP" style="width: 15em;" />

Loading…
Cancel
Save