mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-07 20:34:14 +00:00
Added support for strict super seeding
This commit is contained in:
parent
63457c034f
commit
fb874695c9
@ -1,5 +1,6 @@
|
|||||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.3.0
|
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.3.0
|
||||||
- FEATURE: Max number of half-open connections can now be edited
|
- FEATURE: Max number of half-open connections can now be edited
|
||||||
|
- FEATURE: Added support for strict super seeding
|
||||||
|
|
||||||
* Sun Mar 14 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.0
|
* Sun Mar 14 2010 - Christophe Dumez <chris@qbittorrent.org> - v2.2.0
|
||||||
- FEATURE: User can set alternative speed limits for fast toggling
|
- FEATURE: User can set alternative speed limits for fast toggling
|
||||||
|
@ -8,15 +8,15 @@
|
|||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
|
|
||||||
enum AdvSettingsCols {PROPERTY, VALUE};
|
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, MAX_HALF_OPEN };
|
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, SUPER_SEEDING };
|
||||||
#define ROW_COUNT 10
|
#define ROW_COUNT 11
|
||||||
|
|
||||||
class AdvancedSettings: public QTableWidget {
|
class AdvancedSettings: public QTableWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh, *spin_maxhalfopen;
|
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;
|
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed, *cb_resolve_countries, *cb_resolve_hosts, *cb_super_seeding;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AdvancedSettings(QWidget *parent=0): QTableWidget(parent) {
|
AdvancedSettings(QWidget *parent=0): QTableWidget(parent) {
|
||||||
@ -46,6 +46,7 @@ public:
|
|||||||
delete cb_resolve_countries;
|
delete cb_resolve_countries;
|
||||||
delete cb_resolve_hosts;
|
delete cb_resolve_hosts;
|
||||||
delete spin_maxhalfopen;
|
delete spin_maxhalfopen;
|
||||||
|
delete cb_super_seeding;
|
||||||
}
|
}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@ -68,6 +69,10 @@ public slots:
|
|||||||
Preferences::resolvePeerHostNames(cb_resolve_hosts->isChecked());
|
Preferences::resolvePeerHostNames(cb_resolve_hosts->isChecked());
|
||||||
// Max Half-Open connections
|
// Max Half-Open connections
|
||||||
Preferences::setMaxHalfOpenConnections(spin_maxhalfopen->value());
|
Preferences::setMaxHalfOpenConnections(spin_maxhalfopen->value());
|
||||||
|
#ifdef LIBTORRENT_0_15
|
||||||
|
// Super seeding
|
||||||
|
Preferences::enableSuperSeeding(cb_super_seeding->isChecked());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
@ -143,6 +148,17 @@ protected slots:
|
|||||||
spin_maxhalfopen->setMinimum(0);
|
spin_maxhalfopen->setMinimum(0);
|
||||||
spin_maxhalfopen->setMaximum(99999);
|
spin_maxhalfopen->setMaximum(99999);
|
||||||
spin_maxhalfopen->setValue(Preferences::getMaxHalfOpenConnections());
|
spin_maxhalfopen->setValue(Preferences::getMaxHalfOpenConnections());
|
||||||
|
setCellWidget(MAX_HALF_OPEN, VALUE, spin_maxhalfopen);
|
||||||
|
// Super seeding
|
||||||
|
setItem(SUPER_SEEDING, PROPERTY, new QTableWidgetItem(tr("Strict super seeding")));
|
||||||
|
cb_super_seeding = new QCheckBox();
|
||||||
|
connect(cb_super_seeding, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
|
||||||
|
#ifdef LIBTORRENT_0_15
|
||||||
|
cb_super_seeding->setChecked(Preferences::isSuperSeedingEnabled());
|
||||||
|
#else
|
||||||
|
cb_super_seeding->setEnabled(false);
|
||||||
|
#endif
|
||||||
|
setCellWidget(SUPER_SEEDING, VALUE, cb_super_seeding);
|
||||||
}
|
}
|
||||||
|
|
||||||
void emitSettingsChanged() {
|
void emitSettingsChanged() {
|
||||||
|
@ -929,6 +929,18 @@ public:
|
|||||||
settings.setValue(QString::fromUtf8("Preferences/Connection/MaxHalfOpenConnec"), value);
|
settings.setValue(QString::fromUtf8("Preferences/Connection/MaxHalfOpenConnec"), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBTORRENT_0_15
|
||||||
|
static bool isSuperSeedingEnabled() {
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
return settings.value(QString::fromUtf8("Preferences/Advanced/SuperSeeding"), false).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void enableSuperSeeding(bool enabled) {
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
settings.setValue(QString::fromUtf8("Preferences/Advanced/SuperSeeding"), enabled);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PREFERENCES_H
|
#endif // PREFERENCES_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user