Chocobo1 2 years ago
parent
commit
a9ab2d9b9e
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 18
      src/gui/advancedsettings.cpp
  2. 12
      src/webui/www/private/views/preferences.html

18
src/gui/advancedsettings.cpp

@ -231,9 +231,9 @@ void AdvancedSettings::saveAdvancedSettings() const @@ -231,9 +231,9 @@ void AdvancedSettings::saveAdvancedSettings() const
// Outgoing connections per second
session->setConnectionSpeed(m_spinBoxConnectionSpeed.value());
// Socket send buffer size
session->setSocketSendBufferSize(m_spinBoxSocketSendBufferSize.value());
session->setSocketSendBufferSize(m_spinBoxSocketSendBufferSize.value() * 1024);
// Socket receive buffer size
session->setSocketReceiveBufferSize(m_spinBoxSocketReceiveBufferSize.value());
session->setSocketReceiveBufferSize(m_spinBoxSocketReceiveBufferSize.value() * 1024);
// Socket listen backlog size
session->setSocketBacklogSize(m_spinBoxSocketBacklogSize.value());
// Save resume data interval
@ -506,7 +506,7 @@ void AdvancedSettings::loadAdvancedSettings() @@ -506,7 +506,7 @@ void AdvancedSettings::loadAdvancedSettings()
#endif
// Disk queue size
m_spinBoxDiskQueueSize.setMinimum(1);
m_spinBoxDiskQueueSize.setMaximum(std::numeric_limits<int>::max());
m_spinBoxDiskQueueSize.setMaximum(std::numeric_limits<int>::max() / 1024);
m_spinBoxDiskQueueSize.setValue(session->diskQueueSize() / 1024);
m_spinBoxDiskQueueSize.setSuffix(tr(" KiB"));
addRow(DISK_QUEUE_SIZE, (tr("Disk queue size") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#max_queued_disk_bytes", u"(?)"))
@ -575,17 +575,17 @@ void AdvancedSettings::loadAdvancedSettings() @@ -575,17 +575,17 @@ void AdvancedSettings::loadAdvancedSettings()
, &m_spinBoxConnectionSpeed);
// Socket send buffer size
m_spinBoxSocketSendBufferSize.setMinimum(0);
m_spinBoxSocketSendBufferSize.setMaximum(std::numeric_limits<int>::max());
m_spinBoxSocketSendBufferSize.setValue(session->socketSendBufferSize());
m_spinBoxSocketSendBufferSize.setSuffix(tr(" Bytes"));
m_spinBoxSocketSendBufferSize.setMaximum(std::numeric_limits<int>::max() / 1024);
m_spinBoxSocketSendBufferSize.setValue(session->socketSendBufferSize() / 1024);
m_spinBoxSocketSendBufferSize.setSuffix(tr(" KiB"));
m_spinBoxSocketSendBufferSize.setSpecialValueText(tr("System default"));
addRow(SOCKET_SEND_BUFFER_SIZE, (tr("Socket send buffer size") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#send_socket_buffer_size", u"(?)"))
, &m_spinBoxSocketSendBufferSize);
// Socket receive buffer size
m_spinBoxSocketReceiveBufferSize.setMinimum(0);
m_spinBoxSocketReceiveBufferSize.setMaximum(std::numeric_limits<int>::max());
m_spinBoxSocketReceiveBufferSize.setValue(session->socketReceiveBufferSize());
m_spinBoxSocketReceiveBufferSize.setSuffix(tr(" Bytes"));
m_spinBoxSocketReceiveBufferSize.setMaximum(std::numeric_limits<int>::max() / 1024);
m_spinBoxSocketReceiveBufferSize.setValue(session->socketReceiveBufferSize() / 1024);
m_spinBoxSocketReceiveBufferSize.setSuffix(tr(" KiB"));
m_spinBoxSocketReceiveBufferSize.setSpecialValueText(tr("System default"));
addRow(SOCKET_RECEIVE_BUFFER_SIZE, (tr("Socket receive buffer size") + u' ' + makeLink(u"https://www.libtorrent.org/reference-Settings.html#recv_socket_buffer_size", u"(?)"))
, &m_spinBoxSocketReceiveBufferSize);

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

@ -1189,7 +1189,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD @@ -1189,7 +1189,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
<label for="socketSendBufferSize">QBT_TR(Socket send buffer size [0: system default]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#send_socket_buffer_size" target="_blank">(?)</a></label>
</td>
<td>
<input type="text" id="socketSendBufferSize" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(Bytes)QBT_TR[CONTEXT=OptionsDialog]
<input type="text" id="socketSendBufferSize" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
</td>
</tr>
<tr>
@ -1197,7 +1197,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD @@ -1197,7 +1197,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
<label for="socketReceiveBufferSize">QBT_TR(Socket receive buffer size [0: system default]:)QBT_TR[CONTEXT=OptionsDialog]&nbsp;<a href="https://www.libtorrent.org/reference-Settings.html#recv_socket_buffer_size" target="_blank">(?)</a></label>
</td>
<td>
<input type="text" id="socketReceiveBufferSize" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(Bytes)QBT_TR[CONTEXT=OptionsDialog]
<input type="text" id="socketReceiveBufferSize" style="width: 15em;" />&nbsp;&nbsp;QBT_TR(KiB)QBT_TR[CONTEXT=OptionsDialog]
</td>
</tr>
<tr>
@ -2161,8 +2161,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD @@ -2161,8 +2161,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
$('sendBufferLowWatermark').setProperty('value', pref.send_buffer_low_watermark);
$('sendBufferWatermarkFactor').setProperty('value', pref.send_buffer_watermark_factor);
$('connectionSpeed').setProperty('value', pref.connection_speed);
$('socketSendBufferSize').setProperty('value', pref.socket_send_buffer_size);
$('socketReceiveBufferSize').setProperty('value', pref.socket_receive_buffer_size);
$('socketSendBufferSize').setProperty('value', (pref.socket_send_buffer_size / 1024));
$('socketReceiveBufferSize').setProperty('value', (pref.socket_receive_buffer_size / 1024));
$('socketBacklogSize').setProperty('value', pref.socket_backlog_size);
$('outgoingPortsMin').setProperty('value', pref.outgoing_ports_min);
$('outgoingPortsMax').setProperty('value', pref.outgoing_ports_max);
@ -2578,8 +2578,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD @@ -2578,8 +2578,8 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
settings.set('send_buffer_low_watermark', $('sendBufferLowWatermark').getProperty('value'));
settings.set('send_buffer_watermark_factor', $('sendBufferWatermarkFactor').getProperty('value'));
settings.set('connection_speed', $('connectionSpeed').getProperty('value'));
settings.set('socket_send_buffer_size', $('socketSendBufferSize').getProperty('value'));
settings.set('socket_receive_buffer_size', $('socketReceiveBufferSize').getProperty('value'));
settings.set('socket_send_buffer_size', ($('socketSendBufferSize').getProperty('value') * 1024));
settings.set('socket_receive_buffer_size', ($('socketReceiveBufferSize').getProperty('value') * 1024));
settings.set('socket_backlog_size', $('socketBacklogSize').getProperty('value'));
settings.set('outgoing_ports_min', $('outgoingPortsMin').getProperty('value'));
settings.set('outgoing_ports_max', $('outgoingPortsMax').getProperty('value'));

Loading…
Cancel
Save