Browse Source

Move option "Ignore transfer limits on local network" to Speed page

adaptive-webui-19844
Chocobo1 9 years ago
parent
commit
bd657fe9ae
  1. 4
      src/core/bittorrent/session.cpp
  2. 4
      src/core/preferences.cpp
  3. 4
      src/core/preferences.h
  4. 9
      src/gui/advancedsettings.h
  5. 7
      src/gui/options.ui
  6. 3
      src/gui/options_imp.cpp

4
src/core/bittorrent/session.cpp

@ -415,8 +415,8 @@ void Session::setSessionSettings() @@ -415,8 +415,8 @@ void Session::setSessionSettings()
// Outgoing ports
sessionSettings.outgoing_ports = std::make_pair(pref->outgoingPortsMin(), pref->outgoingPortsMax());
// Ignore limits on LAN
qDebug() << "Ignore limits on LAN" << pref->ignoreLimitsOnLAN();
sessionSettings.ignore_limits_on_local_network = pref->ignoreLimitsOnLAN();
qDebug() << "Ignore limits on LAN" << pref->getIgnoreLimitsOnLAN();
sessionSettings.ignore_limits_on_local_network = pref->getIgnoreLimitsOnLAN();
// Include overhead in transfer limits
sessionSettings.rate_limit_ip_overhead = pref->includeOverheadInLimits();
// IP address to announce to trackers

4
src/core/preferences.cpp

@ -1420,12 +1420,12 @@ void Preferences::setOutgoingPortsMax(uint val) @@ -1420,12 +1420,12 @@ void Preferences::setOutgoingPortsMax(uint val)
setValue("Preferences/Advanced/OutgoingPortsMax", val);
}
bool Preferences::ignoreLimitsOnLAN() const
bool Preferences::getIgnoreLimitsOnLAN() const
{
return value("Preferences/Advanced/IgnoreLimitsLAN", true).toBool();
}
void Preferences::ignoreLimitsOnLAN(bool ignore)
void Preferences::setIgnoreLimitsOnLAN(bool ignore)
{
setValue("Preferences/Advanced/IgnoreLimitsLAN", ignore);
}

4
src/core/preferences.h

@ -365,8 +365,8 @@ public: @@ -365,8 +365,8 @@ public:
void setOutgoingPortsMin(uint val);
uint outgoingPortsMax() const;
void setOutgoingPortsMax(uint val);
bool ignoreLimitsOnLAN() const;
void ignoreLimitsOnLAN(bool ignore);
bool getIgnoreLimitsOnLAN() const;
void setIgnoreLimitsOnLAN(bool ignore);
bool includeOverheadInLimits() const;
void includeOverheadInLimits(bool include);
bool trackerExchangeEnabled() const;

9
src/gui/advancedsettings.h

@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
#include "core/preferences.h"
enum AdvSettingsCols {PROPERTY, VALUE};
enum AdvSettingsRows {DISK_CACHE, DISK_CACHE_TTL, OS_CACHE, SAVE_RESUME_DATA_INTERVAL, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, NETWORK_LISTEN_IPV6, NETWORK_ADDRESS, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT,
enum AdvSettingsRows {DISK_CACHE, DISK_CACHE_TTL, OS_CACHE, SAVE_RESUME_DATA_INTERVAL, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN, SUPER_SEEDING, NETWORK_IFACE, NETWORK_LISTEN_IPV6, NETWORK_ADDRESS, PROGRAM_NOTIFICATIONS, TRACKER_STATUS, TRACKER_PORT,
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
UPDATE_CHECK,
#endif
@ -29,7 +29,7 @@ class AdvancedSettings: public QTableWidget { @@ -29,7 +29,7 @@ class AdvancedSettings: public QTableWidget {
private:
QSpinBox spin_cache, spin_save_resume_data_interval, outgoing_ports_min, outgoing_ports_max, spin_list_refresh, spin_maxhalfopen, spin_tracker_port;
QCheckBox cb_os_cache, cb_ignore_limits_lan, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts,
QCheckBox cb_os_cache, cb_recheck_completed, cb_resolve_countries, cb_resolve_hosts,
cb_super_seeding, cb_program_notifications, cb_tracker_status, cb_confirm_torrent_deletion,
cb_confirm_torrent_recheck, cb_enable_tracker_ext, cb_listen_ipv6;
QComboBox combo_iface;
@ -78,8 +78,6 @@ public slots: @@ -78,8 +78,6 @@ public slots:
// Outgoing ports
pref->setOutgoingPortsMin(outgoing_ports_min.value());
pref->setOutgoingPortsMax(outgoing_ports_max.value());
// Ignore limits on LAN
pref->ignoreLimitsOnLAN(cb_ignore_limits_lan.isChecked());
// Recheck torrents on completion
pref->recheckTorrentsOnCompletion(cb_recheck_completed.isChecked());
// Transfer list refresh interval
@ -214,9 +212,6 @@ private slots: @@ -214,9 +212,6 @@ private slots:
outgoing_ports_max.setMaximum(65535);
outgoing_ports_max.setValue(pref->outgoingPortsMax());
setRow(OUTGOING_PORT_MAX, tr("Outgoing ports (Max) [0: Disabled]"), &outgoing_ports_max);
// Ignore transfer limits on local network
cb_ignore_limits_lan.setChecked(pref->ignoreLimitsOnLAN());
setRow(IGNORE_LIMIT_LAN, tr("Ignore transfer limits on local network"), &cb_ignore_limits_lan);
// Recheck completed torrents
cb_recheck_completed.setChecked(pref->recheckTorrentsOnCompletion());
setRow(RECHECK_COMPLETED, tr("Recheck torrents on completion"), &cb_recheck_completed);

7
src/gui/options.ui

@ -1679,6 +1679,13 @@ @@ -1679,6 +1679,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkLimitLocalPeerRate">
<property name="text">
<string>Apply rate limit to peers on LAN</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

3
src/gui/options_imp.cpp

@ -199,6 +199,7 @@ options_imp::options_imp(QWidget *parent): @@ -199,6 +199,7 @@ options_imp::options_imp(QWidget *parent):
connect(checkuTP, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
connect(checkLimituTPConnections, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
connect(checkLimitTransportOverhead, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
connect(checkLimitLocalPeerRate, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
// Bittorrent tab
connect(checkMaxConnecs, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkMaxConnecsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
@ -425,6 +426,7 @@ void options_imp::saveOptions() { @@ -425,6 +426,7 @@ void options_imp::saveOptions() {
pref->setuTPEnabled(checkuTP->isChecked());
pref->setuTPRateLimited(checkLimituTPConnections->isChecked());
pref->includeOverheadInLimits(checkLimitTransportOverhead->isChecked());
pref->setIgnoreLimitsOnLAN(!checkLimitLocalPeerRate->isChecked());
const QPair<int, int> alt_down_up_limit = getAltGlobalBandwidthLimits();
pref->setAltGlobalDownloadLimit(alt_down_up_limit.first);
pref->setAltGlobalUploadLimit(alt_down_up_limit.second);
@ -663,6 +665,7 @@ void options_imp::loadOptions() { @@ -663,6 +665,7 @@ void options_imp::loadOptions() {
checkuTP->setChecked(pref->isuTPEnabled());
checkLimituTPConnections->setChecked(pref->isuTPRateLimited());
checkLimitTransportOverhead->setChecked(pref->includeOverheadInLimits());
checkLimitLocalPeerRate->setChecked(!pref->getIgnoreLimitsOnLAN());
// Scheduler
check_schedule->setChecked(pref->isSchedulerEnabled());
schedule_from->setTime(pref->getSchedulerStartTime());

Loading…
Cancel
Save