Enable customizing the save statistics time interval
[qBittorrent.git] / src / gui / advancedsettings.h
blob8f99e92e352883a540609453576ef311f862df72
1 /*
2 * Bittorrent Client using Qt and libtorrent.
3 * Copyright (C) 2015-2024 qBittorrent project
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 * In addition, as a special exception, the copyright holders give permission to
20 * link this program with the OpenSSL project's "OpenSSL" library (or with
21 * modified versions of it that use the same license as the "OpenSSL" library),
22 * and distribute the linked executables. You must obey the GNU General Public
23 * License in all respects for all of the code used other than "OpenSSL". If you
24 * modify file(s), you may extend this exception to your version of the file(s),
25 * but you are not obligated to do so. If you do not wish to do so, delete this
26 * exception statement from your version.
29 #pragma once
31 #include <libtorrent/config.hpp>
33 #include <QtSystemDetection>
34 #include <QCheckBox>
35 #include <QComboBox>
36 #include <QLineEdit>
37 #include <QSpinBox>
38 #include <QTableWidget>
40 #include "guiapplicationcomponent.h"
42 class AdvancedSettings final : public GUIApplicationComponent<QTableWidget>
44 Q_OBJECT
45 Q_DISABLE_COPY_MOVE(AdvancedSettings)
47 public:
48 explicit AdvancedSettings(IGUIApplication *app, QWidget *parent = nullptr);
50 public slots:
51 void saveAdvancedSettings() const;
53 signals:
54 void settingsChanged();
56 private slots:
57 void updateInterfaceAddressCombo();
59 #ifndef QBT_USES_LIBTORRENT2
60 void updateCacheSpinSuffix(int value);
61 #endif
63 #ifdef QBT_USES_DBUS
64 void updateNotificationTimeoutSuffix(int value);
65 #endif
67 private:
68 void loadAdvancedSettings();
69 template <typename T> void addRow(int row, const QString &text, T *widget);
71 QSpinBox m_spinBoxSaveResumeDataInterval, m_spinBoxSaveStatisticsInterval, m_spinBoxTorrentFileSizeLimit, m_spinBoxBdecodeDepthLimit, m_spinBoxBdecodeTokenLimit,
72 m_spinBoxAsyncIOThreads, m_spinBoxFilePoolSize, m_spinBoxCheckingMemUsage, m_spinBoxDiskQueueSize,
73 m_spinBoxOutgoingPortsMin, m_spinBoxOutgoingPortsMax, m_spinBoxUPnPLeaseDuration, m_spinBoxPeerToS,
74 m_spinBoxListRefresh, m_spinBoxTrackerPort, m_spinBoxSendBufferWatermark, m_spinBoxSendBufferLowWatermark,
75 m_spinBoxSendBufferWatermarkFactor, m_spinBoxConnectionSpeed, m_spinBoxSocketSendBufferSize, m_spinBoxSocketReceiveBufferSize, m_spinBoxSocketBacklogSize,
76 m_spinBoxMaxConcurrentHTTPAnnounces, m_spinBoxStopTrackerTimeout, m_spinBoxSessionShutdownTimeout,
77 m_spinBoxSavePathHistoryLength, m_spinBoxPeerTurnover, m_spinBoxPeerTurnoverCutoff, m_spinBoxPeerTurnoverInterval, m_spinBoxRequestQueueSize;
78 QCheckBox m_checkBoxOsCache, m_checkBoxRecheckCompleted, m_checkBoxResolveCountries, m_checkBoxResolveHosts,
79 m_checkBoxProgramNotifications, m_checkBoxTorrentAddedNotifications, m_checkBoxReannounceWhenAddressChanged, m_checkBoxTrackerFavicon, m_checkBoxTrackerStatus,
80 m_checkBoxTrackerPortForwarding, m_checkBoxConfirmTorrentRecheck, m_checkBoxConfirmRemoveAllTags, m_checkBoxAnnounceAllTrackers, m_checkBoxAnnounceAllTiers,
81 m_checkBoxMultiConnectionsPerIp, m_checkBoxValidateHTTPSTrackerCertificate, m_checkBoxSSRFMitigation, m_checkBoxBlockPeersOnPrivilegedPorts, m_checkBoxPieceExtentAffinity,
82 m_checkBoxSuggestMode, m_checkBoxSpeedWidgetEnabled, m_checkBoxIDNSupport, m_checkBoxConfirmRemoveTrackerFromAllTorrents, m_checkBoxStartSessionPaused;
83 QComboBox m_comboBoxInterface, m_comboBoxInterfaceAddress, m_comboBoxDiskIOReadMode, m_comboBoxDiskIOWriteMode, m_comboBoxUtpMixedMode, m_comboBoxChokingAlgorithm,
84 m_comboBoxSeedChokingAlgorithm, m_comboBoxResumeDataStorage, m_comboBoxTorrentContentRemoveOption;
85 QLineEdit m_lineEditAppInstanceName, m_pythonExecutablePath, m_lineEditAnnounceIP, m_lineEditDHTBootstrapNodes;
87 #ifndef QBT_USES_LIBTORRENT2
88 QSpinBox m_spinBoxCache, m_spinBoxCacheTTL;
89 QCheckBox m_checkBoxCoalesceRW;
90 #else
91 QComboBox m_comboBoxDiskIOType;
92 QSpinBox m_spinBoxHashingThreads;
93 #endif
95 #if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
96 QSpinBox m_spinBoxMemoryWorkingSetLimit;
97 #endif
99 #if defined(QBT_USES_LIBTORRENT2) && TORRENT_USE_I2P
100 QSpinBox m_spinBoxI2PInboundQuantity, m_spinBoxI2POutboundQuantity, m_spinBoxI2PInboundLength, m_spinBoxI2POutboundLength;
101 #endif
103 // OS dependent settings
104 #ifdef Q_OS_WIN
105 QComboBox m_comboBoxOSMemoryPriority;
106 #endif
108 #ifndef Q_OS_MACOS
109 QCheckBox m_checkBoxIconsInMenusEnabled;
110 #endif
112 #if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
113 QCheckBox m_checkBoxMarkOfTheWeb;
114 #endif // Q_OS_MACOS || Q_OS_WIN
116 #ifdef QBT_USES_DBUS
117 QSpinBox m_spinBoxNotificationTimeout;
118 #endif