Mercurial > minori
comparison include/gui/pages/torrents.h @ 230:2f5a9247e501
torrents: implement download button
erg
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sat, 13 Jan 2024 09:42:02 -0500 |
parents | 01d259b9c89f |
children | 4d461ef7d424 |
comparison
equal
deleted
inserted
replaced
229:adc20fa321c1 | 230:2f5a9247e501 |
---|---|
3 | 3 |
4 #include "core/torrent.h" | 4 #include "core/torrent.h" |
5 #include <QFrame> | 5 #include <QFrame> |
6 #include <QAbstractListModel> | 6 #include <QAbstractListModel> |
7 #include <QSortFilterProxyModel> | 7 #include <QSortFilterProxyModel> |
8 #include <QItemSelection> | |
9 | |
10 class QTreeView; | |
8 | 11 |
9 class TorrentsPageListSortFilter final : public QSortFilterProxyModel { | 12 class TorrentsPageListSortFilter final : public QSortFilterProxyModel { |
10 Q_OBJECT | 13 Q_OBJECT |
11 | 14 |
12 public: | 15 public: |
44 QVariant data(const QModelIndex& index, int role) const override; | 47 QVariant data(const QModelIndex& index, int role) const override; |
45 QVariant headerData(const int section, const Qt::Orientation orientation, const int role) const override; | 48 QVariant headerData(const int section, const Qt::Orientation orientation, const int role) const override; |
46 Qt::ItemFlags flags(const QModelIndex& index) const override; | 49 Qt::ItemFlags flags(const QModelIndex& index) const override; |
47 | 50 |
48 QByteArray DownloadTorrentList(); | 51 QByteArray DownloadTorrentList(); |
52 void DownloadTorrents(QItemSelection selection); | |
49 void ParseFeedDescription(const std::string& description, Torrent& torrent); | 53 void ParseFeedDescription(const std::string& description, Torrent& torrent); |
50 void ParseTorrentList(const QByteArray& ba); | 54 void ParseTorrentList(const QByteArray& ba); |
51 void RefreshTorrentList(); | 55 void RefreshTorrentList(); |
52 | 56 |
53 private: | 57 private: |
66 class TorrentsPage final : public QFrame { | 70 class TorrentsPage final : public QFrame { |
67 Q_OBJECT | 71 Q_OBJECT |
68 | 72 |
69 public: | 73 public: |
70 TorrentsPage(QWidget* parent = nullptr); | 74 TorrentsPage(QWidget* parent = nullptr); |
75 void DownloadSelection(); | |
71 void Refresh(); | 76 void Refresh(); |
72 | 77 |
73 private: | 78 private: |
74 TorrentsPageListModel* model = nullptr; | 79 TorrentsPageListModel* model = nullptr; |
75 TorrentsPageListSortFilter* sort_model = nullptr; | 80 TorrentsPageListSortFilter* sort_model = nullptr; |
81 QTreeView* treeview = nullptr; | |
76 }; | 82 }; |
77 | 83 |
78 #endif // __gui__pages__torrents_h | 84 #endif // __gui__pages__torrents_h |