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.
31 #include <libtorrent/config.hpp>
33 #include <QtSystemDetection>
38 #include <QTableWidget>
40 #include "guiapplicationcomponent.h"
42 class AdvancedSettings final
: public GUIApplicationComponent
<QTableWidget
>
45 Q_DISABLE_COPY_MOVE(AdvancedSettings
)
48 explicit AdvancedSettings(IGUIApplication
*app
, QWidget
*parent
= nullptr);
51 void saveAdvancedSettings() const;
54 void settingsChanged();
57 void updateInterfaceAddressCombo();
59 #ifndef QBT_USES_LIBTORRENT2
60 void updateCacheSpinSuffix(int value
);
64 void updateNotificationTimeoutSuffix(int value
);
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
;
91 QComboBox m_comboBoxDiskIOType
;
92 QSpinBox m_spinBoxHashingThreads
;
95 #if defined(QBT_USES_LIBTORRENT2) && !defined(Q_OS_MACOS)
96 QSpinBox m_spinBoxMemoryWorkingSetLimit
;
99 #if defined(QBT_USES_LIBTORRENT2) && TORRENT_USE_I2P
100 QSpinBox m_spinBoxI2PInboundQuantity
, m_spinBoxI2POutboundQuantity
, m_spinBoxI2PInboundLength
, m_spinBoxI2POutboundLength
;
103 // OS dependent settings
105 QComboBox m_comboBoxOSMemoryPriority
;
109 QCheckBox m_checkBoxIconsInMenusEnabled
;
112 #if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
113 QCheckBox m_checkBoxMarkOfTheWeb
;
114 #endif // Q_OS_MACOS || Q_OS_WIN
117 QSpinBox m_spinBoxNotificationTimeout
;