2 * Bittorrent Client using Qt and libtorrent.
3 * Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
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.
33 #include "base/settingvalue.h"
36 class QListWidgetItem
;
38 class AdvancedSettings
;
40 // actions on double-click on torrents
41 enum DoubleClickAction
59 class OptionsDialog final
: public QDialog
62 Q_DISABLE_COPY_MOVE(OptionsDialog
)
64 using ThisType
= OptionsDialog
;
85 // Constructor / Destructor
86 OptionsDialog(QWidget
*parent
= nullptr);
87 ~OptionsDialog() override
;
90 void showConnectionTab();
93 void enableProxy(int index
);
94 void on_buttonBox_accepted();
95 void closeEvent(QCloseEvent
*e
) override
;
96 void on_buttonBox_rejected();
98 void enableApplyButton();
99 void toggleComboRatioLimitAct();
100 void changePage(QListWidgetItem
*, QListWidgetItem
*);
101 void loadSplitterState();
102 void handleWatchedFolderViewSelectionChanged();
103 void editWatchedFolderOptions(const QModelIndex
&index
);
104 void on_IpFilterRefreshBtn_clicked();
105 void handleIPFilterParsed(bool error
, int ruleCount
);
106 void on_banListButton_clicked();
107 void on_IPSubnetWhitelistButton_clicked();
108 void on_randomButton_clicked();
109 void on_addWatchedFolderButton_clicked();
110 void on_editWatchedFolderButton_clicked();
111 void on_removeWatchedFolderButton_clicked();
112 void on_registerDNSBtn_clicked();
113 void setLocale(const QString
&localeStr
);
114 void webUIHttpsCertChanged(const QString
&path
, ShowError showError
);
115 void webUIHttpsKeyChanged(const QString
&path
, ShowError showError
);
121 void initializeLanguageCombo();
123 QString
getLocale() const;
125 bool systrayIntegration() const;
126 bool minimizeToTray() const;
127 bool closeToTray() const;
129 bool startMinimized() const;
130 bool isSplashScreenDisabled() const;
132 bool WinStartup() const;
135 bool preAllocateAllFiles() const;
136 bool useAdditionDialog() const;
137 bool addTorrentsInPause() const;
138 QString
getTorrentExportDir() const;
139 QString
getFinishedTorrentExportDir() const;
140 QString
askForExportDir(const QString
¤tExportPath
);
141 int getActionOnDblClOnTorrentDl() const;
142 int getActionOnDblClOnTorrentFn() const;
143 // Connection options
145 bool isUPnPEnabled() const;
146 // Bittorrent options
147 int getMaxConnecs() const;
148 int getMaxConnecsPerTorrent() const;
149 int getMaxUploads() const;
150 int getMaxUploadsPerTorrent() const;
151 bool isDHTEnabled() const;
152 bool isLSDEnabled() const;
153 int getEncryptionSetting() const;
154 qreal
getMaxRatio() const;
155 int getMaxSeedingMinutes() const;
157 bool isProxyEnabled() const;
158 bool isProxyAuthEnabled() const;
159 QString
getProxyIp() const;
160 unsigned short getProxyPort() const;
161 QString
getProxyUsername() const;
162 QString
getProxyPassword() const;
163 Net::ProxyType
getProxyType() const;
165 bool isIPFilteringEnabled() const;
166 QString
getFilter() const;
168 bool isQueueingSystemEnabled() const;
169 int getMaxActiveDownloads() const;
170 int getMaxActiveUploads() const;
171 int getMaxActiveTorrents() const;
173 bool isWebUiEnabled() const;
174 QString
webUiUsername() const;
175 QString
webUiPassword() const;
176 bool webUIAuthenticationOk();
177 bool isAlternativeWebUIPathValid();
181 Ui::OptionsDialog
*m_ui
;
182 SettingValue
<QSize
> m_storeDialogSize
;
183 SettingValue
<QStringList
> m_storeHSplitterSize
;
184 SettingValue
<int> m_storeLastViewedPage
;
186 QPushButton
*m_applyButton
;
188 AdvancedSettings
*m_advancedSettings
;
190 bool m_refreshingIpFilter
= false;