diff --git a/Changelog b/Changelog index e66e61d27..3e5c5c997 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +* Unreleased - Christophe Dumez - v2.3.0 + - FEATURE: Max number of half-open connections can now be edited + * Sun Mar 14 2010 - Christophe Dumez - v2.2.0 - FEATURE: User can set alternative speed limits for fast toggling - FEATURE: Bandwidth scheduler (automatically use alternative speed limits for a given period) diff --git a/src/Icons/qBittorrent.desktop b/src/Icons/qBittorrent.desktop index b0768fea6..dda31ecbd 100644 --- a/src/Icons/qBittorrent.desktop +++ b/src/Icons/qBittorrent.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Categories=Qt;Network;P2P; -Comment=V2.2.0 +Comment=V2.3.0 Exec=qbittorrent %f GenericName=Bittorrent client GenericName[bg]=Торент клиент diff --git a/src/Icons/skin/splash.png b/src/Icons/skin/splash.png index cfc11493c..d77fd4c5e 100644 Binary files a/src/Icons/skin/splash.png and b/src/Icons/skin/splash.png differ diff --git a/src/advancedsettings.h b/src/advancedsettings.h index 261371e8f..d5cd0a8e0 100644 --- a/src/advancedsettings.h +++ b/src/advancedsettings.h @@ -8,14 +8,14 @@ #include "preferences.h" enum AdvSettingsCols {PROPERTY, VALUE}; -enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS }; -#define ROW_COUNT 9 +enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH, RESOLVE_COUNTRIES, RESOLVE_HOSTS, MAX_HALF_OPEN }; +#define ROW_COUNT 10 class AdvancedSettings: public QTableWidget { Q_OBJECT private: - QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh; + QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh, *spin_maxhalfopen; QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts; public: @@ -45,6 +45,7 @@ public: delete spin_list_refresh; delete cb_resolve_countries; delete cb_resolve_hosts; + delete spin_maxhalfopen; } public slots: @@ -65,6 +66,8 @@ public slots: // Peer resolution Preferences::resolvePeerCountries(cb_resolve_countries->isChecked()); Preferences::resolvePeerHostNames(cb_resolve_hosts->isChecked()); + // Max Half-Open connections + Preferences::setMaxHalfOpenConnections(spin_maxhalfopen->value()); } protected slots: @@ -133,6 +136,13 @@ protected slots: connect(cb_resolve_hosts, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged())); cb_resolve_hosts->setChecked(Preferences::resolvePeerHostNames()); setCellWidget(RESOLVE_HOSTS, VALUE, cb_resolve_hosts); + // Max Half Open connections + setItem(MAX_HALF_OPEN, PROPERTY, new QTableWidgetItem(tr("Maximum number of half-open connections [0: Disabled]"))); + spin_maxhalfopen = new QSpinBox(); + connect(spin_maxhalfopen, SIGNAL(valueChanged(int)), this, SLOT(emitSettingsChanged())); + spin_maxhalfopen->setMinimum(0); + spin_maxhalfopen->setMaximum(99999); + spin_maxhalfopen->setValue(Preferences::getMaxHalfOpenConnections()); } void emitSettingsChanged() { diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index c85818503..ec7bf9529 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -445,6 +445,8 @@ void Bittorrent::configureSession() { // Include overhead in transfer limits sessionSettings.rate_limit_ip_overhead = Preferences::includeOverheadInLimits(); // Bittorrent + // * Max Half-open connections + s->set_max_half_open_connections(Preferences::getMaxHalfOpenConnections()); // * Max connections limit setMaxConnections(Preferences::getMaxConnecs()); // * Max connections per torrent limit diff --git a/src/preferences.h b/src/preferences.h index fb7085671..aa0dc08cd 100644 --- a/src/preferences.h +++ b/src/preferences.h @@ -916,6 +916,19 @@ public: settings.setValue(QString::fromUtf8("Preferences/Connection/ResolvePeerHostNames"), resolve); } + static int getMaxHalfOpenConnections() { + QSettings settings("qBittorrent", "qBittorrent"); + const int val = settings.value(QString::fromUtf8("Preferences/Connection/MaxHalfOpenConnec"), 50).toInt(); + if(val <= 0) return -1; + return val; + } + + static void setMaxHalfOpenConnections(int value) { + QSettings settings("qBittorrent", "qBittorrent"); + if(value <= 0) value = -1; + settings.setValue(QString::fromUtf8("Preferences/Connection/MaxHalfOpenConnec"), value); + } + }; #endif // PREFERENCES_H