|
|
@ -27,6 +27,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
#include "advancedsettings.h" |
|
|
|
#include "advancedsettings.h" |
|
|
|
|
|
|
|
#include <QFont> |
|
|
|
#include <QHeaderView> |
|
|
|
#include <QHeaderView> |
|
|
|
#include <QHostAddress> |
|
|
|
#include <QHostAddress> |
|
|
|
#include <QNetworkInterface> |
|
|
|
#include <QNetworkInterface> |
|
|
@ -35,37 +36,52 @@ |
|
|
|
enum AdvSettingsCols |
|
|
|
enum AdvSettingsCols |
|
|
|
{ |
|
|
|
{ |
|
|
|
PROPERTY, |
|
|
|
PROPERTY, |
|
|
|
VALUE |
|
|
|
VALUE, |
|
|
|
|
|
|
|
COL_COUNT |
|
|
|
}; |
|
|
|
}; |
|
|
|
enum AdvSettingsRows |
|
|
|
enum AdvSettingsRows |
|
|
|
{ |
|
|
|
{ |
|
|
|
DISK_CACHE, |
|
|
|
// qBittorrent section
|
|
|
|
DISK_CACHE_TTL, |
|
|
|
QBITTORRENT_HEADER, |
|
|
|
OS_CACHE, |
|
|
|
// network interface
|
|
|
|
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_IFACE, |
|
|
|
NETWORK_LISTEN_IPV6, |
|
|
|
NETWORK_LISTEN_IPV6, |
|
|
|
NETWORK_ADDRESS, |
|
|
|
// behavior
|
|
|
|
PROGRAM_NOTIFICATIONS, |
|
|
|
SAVE_RESUME_DATA_INTERVAL, |
|
|
|
TRACKER_STATUS, |
|
|
|
CONFIRM_RECHECK_TORRENT, |
|
|
|
TRACKER_PORT, |
|
|
|
RECHECK_COMPLETED, |
|
|
|
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) |
|
|
|
#if defined(Q_OS_WIN) || defined(Q_OS_MAC) |
|
|
|
UPDATE_CHECK, |
|
|
|
UPDATE_CHECK, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
// UI related
|
|
|
|
|
|
|
|
LIST_REFRESH, |
|
|
|
|
|
|
|
RESOLVE_HOSTS, |
|
|
|
|
|
|
|
RESOLVE_COUNTRIES, |
|
|
|
|
|
|
|
PROGRAM_NOTIFICATIONS, |
|
|
|
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) |
|
|
|
#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) |
|
|
|
USE_ICON_THEME, |
|
|
|
USE_ICON_THEME, |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
CONFIRM_RECHECK_TORRENT, |
|
|
|
|
|
|
|
|
|
|
|
// libtorrent section
|
|
|
|
|
|
|
|
LIBTORRENT_HEADER, |
|
|
|
|
|
|
|
// cache
|
|
|
|
|
|
|
|
DISK_CACHE, |
|
|
|
|
|
|
|
DISK_CACHE_TTL, |
|
|
|
|
|
|
|
OS_CACHE, |
|
|
|
|
|
|
|
// ports
|
|
|
|
|
|
|
|
MAX_HALF_OPEN, |
|
|
|
|
|
|
|
OUTGOING_PORT_MIN, |
|
|
|
|
|
|
|
OUTGOING_PORT_MAX, |
|
|
|
|
|
|
|
// embedded tracker
|
|
|
|
|
|
|
|
TRACKER_STATUS, |
|
|
|
|
|
|
|
TRACKER_PORT, |
|
|
|
|
|
|
|
// seeding
|
|
|
|
|
|
|
|
SUPER_SEEDING, |
|
|
|
|
|
|
|
// tracker
|
|
|
|
TRACKER_EXCHANGE, |
|
|
|
TRACKER_EXCHANGE, |
|
|
|
ANNOUNCE_ALL_TRACKERS, |
|
|
|
ANNOUNCE_ALL_TRACKERS, |
|
|
|
|
|
|
|
NETWORK_ADDRESS, |
|
|
|
|
|
|
|
|
|
|
|
ROW_COUNT |
|
|
|
ROW_COUNT |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -73,7 +89,7 @@ AdvancedSettings::AdvancedSettings(QWidget *parent) |
|
|
|
: QTableWidget(parent) |
|
|
|
: QTableWidget(parent) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// column
|
|
|
|
// column
|
|
|
|
setColumnCount(2); |
|
|
|
setColumnCount(COL_COUNT); |
|
|
|
QStringList header = { tr("Setting"), tr("Value", "Value set for this setting") }; |
|
|
|
QStringList header = { tr("Setting"), tr("Value", "Value set for this setting") }; |
|
|
|
setHorizontalHeaderLabels(header); |
|
|
|
setHorizontalHeaderLabels(header); |
|
|
|
// row
|
|
|
|
// row
|
|
|
@ -161,6 +177,18 @@ void AdvancedSettings::updateCacheSpinSuffix(int value) |
|
|
|
void AdvancedSettings::loadAdvancedSettings() |
|
|
|
void AdvancedSettings::loadAdvancedSettings() |
|
|
|
{ |
|
|
|
{ |
|
|
|
const Preferences* const pref = Preferences::instance(); |
|
|
|
const Preferences* const pref = Preferences::instance(); |
|
|
|
|
|
|
|
// add section headers
|
|
|
|
|
|
|
|
QFont boldFont; |
|
|
|
|
|
|
|
boldFont.setBold(true); |
|
|
|
|
|
|
|
addRow(QBITTORRENT_HEADER, tr("qBittorrent Section"), &labelQbtLink); |
|
|
|
|
|
|
|
item(QBITTORRENT_HEADER, PROPERTY)->setFont(boldFont); |
|
|
|
|
|
|
|
labelQbtLink.setText(QString("<a href=\"%1\">%2</a>").arg("https://github.com/qbittorrent/qBittorrent/wiki/Explanation-of-Options-in-qBittorrent#Advanced").arg(tr("Open documentation"))); |
|
|
|
|
|
|
|
labelQbtLink.setOpenExternalLinks(true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addRow(LIBTORRENT_HEADER, tr("libtorrent Section"), &labelLibtorrentLink); |
|
|
|
|
|
|
|
item(LIBTORRENT_HEADER, PROPERTY)->setFont(boldFont); |
|
|
|
|
|
|
|
labelLibtorrentLink.setText(QString("<a href=\"%1\">%2</a>").arg("http://www.libtorrent.org/reference.html").arg(tr("Open documentation"))); |
|
|
|
|
|
|
|
labelLibtorrentLink.setOpenExternalLinks(true); |
|
|
|
// Disk write cache
|
|
|
|
// Disk write cache
|
|
|
|
spin_cache.setMinimum(0); |
|
|
|
spin_cache.setMinimum(0); |
|
|
|
// When build as 32bit binary, set the maximum at less than 2GB to prevent crashes.
|
|
|
|
// When build as 32bit binary, set the maximum at less than 2GB to prevent crashes.
|
|
|
|