qBittorrent
propertieswidget.h
Go to the documentation of this file.
1 /*
2  * Bittorrent Client using Qt and libtorrent.
3  * Copyright (C) 2006 Christophe Dumez <[email protected]>
4  *
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.
9  *
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.
14  *
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.
18  *
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.
27  */
28 
29 #pragma once
30 
31 #include <QList>
32 #include <QWidget>
33 
34 class QPushButton;
35 class QTreeView;
36 
38 class LineEdit;
39 class PeerListWidget;
41 class PropListDelegate;
42 class PropTabBar;
44 class TrackerListWidget;
45 
46 namespace BitTorrent
47 {
48  class Torrent;
49 }
50 
51 namespace Ui
52 {
53  class PropertiesWidget;
54 }
55 
56 class PropertiesWidget : public QWidget
57 {
58  Q_OBJECT
59  Q_DISABLE_COPY_MOVE(PropertiesWidget)
60 
61 public:
63  {
65  VISIBLE
66  };
67 
68  explicit PropertiesWidget(QWidget *parent);
69  ~PropertiesWidget() override;
70 
73  PeerListWidget *getPeerList() const;
74  QTreeView *getFilesList() const;
75 
76 public slots:
77  void setVisibility(bool visible);
78  void loadTorrentInfos(BitTorrent::Torrent *const torrent);
79  void loadDynamicData();
80  void clear();
81  void readSettings();
82  void saveSettings();
83  void reloadPreferences();
85  void openItem(const QModelIndex &index) const;
86  void loadTrackers(BitTorrent::Torrent *const torrent);
87 
88 protected slots:
89  void updateTorrentInfos(BitTorrent::Torrent *const torrent);
90  void loadUrlSeeds();
91  void askWebSeed();
94  void editWebSeed();
95  void displayFilesListMenu(const QPoint &);
96  void displayWebSeedListMenu(const QPoint &);
97  void filteredFilesChanged();
98  void showPiecesDownloaded(bool show);
99  void showPiecesAvailability(bool show);
100  void openSelectedFile();
101 
102 private slots:
103  void configure();
104  void filterText(const QString &filter);
105  void updateSavePath(BitTorrent::Torrent *const torrent);
106 
107 private:
108  QPushButton *getButtonFromIndex(int index);
109  void applyPriorities();
110  void openParentFolder(const QModelIndex &index) const;
111  QString getFullPath(const QModelIndex &index) const;
112 
113  Ui::PropertiesWidget *m_ui;
120  QWidget *m_speedWidget = nullptr;
121  QList<int> m_slideSizes;
127 };
BitTorrent::Torrent * m_torrent
void openParentFolder(const QModelIndex &index) const
QList< int > m_slideSizes
DownloadedPiecesBar * m_downloadedPieces
void showPiecesAvailability(bool show)
QString getFullPath(const QModelIndex &index) const
void loadTorrentInfos(BitTorrent::Torrent *const torrent)
PeerListWidget * m_peerList
void displayWebSeedListMenu(const QPoint &)
TrackerListWidget * m_trackerList
PropertiesWidget(QWidget *parent)
TrackerListWidget * getTrackerList() const
void filterText(const QString &filter)
BitTorrent::Torrent * getCurrentTorrent() const
void loadTrackers(BitTorrent::Torrent *const torrent)
void showPiecesDownloaded(bool show)
PieceAvailabilityBar * m_piecesAvailability
LineEdit * m_contentFilterLine
QTreeView * getFilesList() const
void openItem(const QModelIndex &index) const
void setVisibility(bool visible)
void displayFilesListMenu(const QPoint &)
void updateTorrentInfos(BitTorrent::Torrent *const torrent)
Ui::PropertiesWidget * m_ui
PropListDelegate * m_propListDelegate
void updateSavePath(BitTorrent::Torrent *const torrent)
PeerListWidget * getPeerList() const
~PropertiesWidget() override
PropTabBar * m_tabBar
void copySelectedWebSeedsToClipboard() const
QPushButton * getButtonFromIndex(int index)
TorrentContentFilterModel * m_propListModel