Add option to auto hide zero status filters
[qBittorrent.git] / src / gui / torrentoptionsdialog.h
blob3af01777f83c57dff5e433558f96f7c53b4d2534
1 /*
2 * Bittorrent Client using Qt and libtorrent.
3 * Copyright (C) 2020 thalieht
4 * Copyright (C) 2011 Christian Kandeler
5 * Copyright (C) 2011 Christophe Dumez <chris@qbittorrent.org>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * In addition, as a special exception, the copyright holders give permission to
22 * link this program with the OpenSSL project's "OpenSSL" library (or with
23 * modified versions of it that use the same license as the "OpenSSL" library),
24 * and distribute the linked executables. You must obey the GNU General Public
25 * License in all respects for all of the code used other than "OpenSSL". If you
26 * modify file(s), you may extend this exception to your version of the file(s),
27 * but you are not obligated to do so. If you do not wish to do so, delete this
28 * exception statement from your version.
31 #pragma once
33 #include <QDialog>
35 #include "base/path.h"
36 #include "base/settingvalue.h"
38 class QAbstractButton;
40 namespace BitTorrent
42 class Torrent;
43 class TorrentID;
46 namespace Ui
48 class TorrentOptionsDialog;
51 class TorrentOptionsDialog final : public QDialog
53 Q_OBJECT
54 Q_DISABLE_COPY_MOVE(TorrentOptionsDialog)
56 public:
57 explicit TorrentOptionsDialog(QWidget *parent, const QVector<BitTorrent::Torrent *> &torrents);
58 ~TorrentOptionsDialog() override;
60 public slots:
61 void accept() override;
63 private slots:
64 void handleCategoryChanged(int index);
65 void handleTMMChanged();
66 void handleUseDownloadPathChanged();
68 void handleUpSpeedLimitChanged();
69 void handleDownSpeedLimitChanged();
71 void handleRatioTypeChanged();
73 private:
74 qreal getRatio() const;
75 int getSeedingTime() const;
77 QVector<BitTorrent::TorrentID> m_torrentIDs;
78 Ui::TorrentOptionsDialog *m_ui = nullptr;
79 SettingValue<QSize> m_storeDialogSize;
80 QStringList m_categories;
81 QString m_currentCategoriesString;
82 bool m_allSameCategory = true;
83 QAbstractButton *m_previousRadio = nullptr;
84 struct
86 Path savePath;
87 Path downloadPath;
88 QString category;
89 qreal ratio;
90 int seedingTime;
91 int upSpeedLimit;
92 int downSpeedLimit;
93 Qt::CheckState autoTMM;
94 Qt::CheckState useDownloadPath;
95 Qt::CheckState disableDHT;
96 Qt::CheckState disablePEX;
97 Qt::CheckState disableLSD;
98 Qt::CheckState sequential;
99 Qt::CheckState firstLastPieces;
100 } m_initialValues;