Merge pull request #14171 from sledgehammer999/copyright_attribution
[qBittorrent.git] / src / gui / torrentoptionsdialog.h
blobe5927cda41586166788fcd98a9190b4373390dd8
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/settingvalue.h"
37 namespace BitTorrent
39 class InfoHash;
40 class Torrent;
43 namespace Ui
45 class TorrentOptionsDialog;
48 class TorrentOptionsDialog final : public QDialog
50 Q_OBJECT
51 Q_DISABLE_COPY(TorrentOptionsDialog)
53 public:
54 explicit TorrentOptionsDialog(QWidget *parent, const QVector<BitTorrent::Torrent *> &torrents);
55 ~TorrentOptionsDialog() override;
57 public slots:
58 void accept() override;
60 private slots:
61 void handleUpSpeedLimitChanged();
62 void handleDownSpeedLimitChanged();
64 void handleRatioTypeChanged();
66 private:
67 qreal getRatio() const;
68 int getSeedingTime() const;
70 QVector<BitTorrent::InfoHash> m_torrentHashes;
71 Ui::TorrentOptionsDialog *m_ui;
72 SettingValue<QSize> m_storeDialogSize;
73 struct
75 qreal ratio;
76 int seedingTime;
77 int upSpeedLimit;
78 int downSpeedLimit;
79 Qt::CheckState disableDHT;
80 Qt::CheckState disablePEX;
81 Qt::CheckState disableLSD;
82 } m_initialValues;