mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 00:17:23 -06:00
- Started work on program preferences in Web UI
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <QSettings>
|
||||
#include <QPair>
|
||||
#include <QDir>
|
||||
|
||||
class Preferences {
|
||||
public:
|
||||
@@ -311,21 +312,41 @@ public:
|
||||
return settings.value(QString::fromUtf8("Preferences/Bittorrent/MaxConnecs"), 500).toInt();
|
||||
}
|
||||
|
||||
static void setMaxConnecs(int val) {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
settings.setValue(QString::fromUtf8("Preferences/Bittorrent/MaxConnecs"), val);
|
||||
}
|
||||
|
||||
static int getMaxConnecsPerTorrent() {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
return settings.value(QString::fromUtf8("Preferences/Bittorrent/MaxConnecsPerTorrent"), 100).toInt();
|
||||
}
|
||||
|
||||
static void setMaxConnecsPerTorrent(int val) {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
settings.setValue(QString::fromUtf8("Preferences/Bittorrent/MaxConnecsPerTorrent"), val);
|
||||
}
|
||||
|
||||
static int getMaxUploadsPerTorrent() {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
return settings.value(QString::fromUtf8("Preferences/Bittorrent/MaxUploadsPerTorrent"), 4).toInt();
|
||||
}
|
||||
|
||||
static void setMaxUploadsPerTorrent(int val) {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
settings.setValue(QString::fromUtf8("Preferences/Bittorrent/MaxUploadsPerTorrent"), val);
|
||||
}
|
||||
|
||||
static bool isDHTEnabled() {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
return settings.value(QString::fromUtf8("Preferences/Bittorrent/DHT"), true).toBool();
|
||||
}
|
||||
|
||||
static void setDHTEnabled(bool enabled) {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
settings.setValue(QString::fromUtf8("Preferences/Bittorrent/DHT"), enabled);
|
||||
}
|
||||
|
||||
static bool isDHTPortSameAsBT() {
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
return settings.value(QString::fromUtf8("Preferences/Bittorrent/sameDHTPortAsBT"), true).toBool();
|
||||
|
||||
Reference in New Issue
Block a user