Mercurial > minori
annotate src/gui/pages/torrents.cc @ 178:bc8d2ccff09c
win32/dark: use existing STL classes for dwmapi
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 04 Dec 2023 11:51:30 -0500 |
parents | d43d68408d3c |
children | 01d259b9c89f |
rev | line source |
---|---|
54
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
1 #include "gui/pages/torrents.h" |
114 | 2 #include "core/strings.h" |
3 #include "core/http.h" | |
4 #include "core/session.h" | |
5 #include "gui/widgets/text.h" | |
6 #include "track/media.h" | |
178
bc8d2ccff09c
win32/dark: use existing STL classes for dwmapi
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
7 |
114 | 8 #include <QVBoxLayout> |
9 #include <QToolBar> | |
10 #include <QTreeView> | |
11 #include <QMainWindow> | |
12 #include <QByteArray> | |
13 #include <QDataStream> | |
14 #include <QThreadPool> | |
15 #include <QDebug> | |
178
bc8d2ccff09c
win32/dark: use existing STL classes for dwmapi
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
16 |
114 | 17 #include <iostream> |
18 #include <sstream> | |
19 #include <algorithm> | |
20 | |
178
bc8d2ccff09c
win32/dark: use existing STL classes for dwmapi
Paper <mrpapersonic@gmail.com>
parents:
154
diff
changeset
|
21 #include "pugixml.hpp" |
154 | 22 #include "anitomy/anitomy.h" |
23 | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
24 /* This file is very, very similar to the anime list page. |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
25 |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
26 It differs from Taiga in that it uses tabs instead of |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
27 those "groups", but those are custom painted and a pain in the ass to |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
28 maintain over multiple platforms. */ |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
29 |
114 | 30 TorrentsPageListSortFilter::TorrentsPageListSortFilter(QObject* parent) : QSortFilterProxyModel(parent) { |
31 } | |
32 | |
33 bool TorrentsPageListSortFilter::lessThan(const QModelIndex& l, const QModelIndex& r) const { | |
34 QVariant left = sourceModel()->data(l, sortRole()); | |
35 QVariant right = sourceModel()->data(r, sortRole()); | |
36 | |
37 switch (left.userType()) { | |
38 case QMetaType::Int: | |
39 case QMetaType::UInt: | |
40 case QMetaType::LongLong: | |
41 case QMetaType::ULongLong: return left.toInt() < right.toInt(); | |
42 case QMetaType::QDate: return left.toDate() < right.toDate(); | |
43 case QMetaType::QString: | |
44 default: return QString::compare(left.toString(), right.toString(), Qt::CaseInsensitive) < 0; | |
45 } | |
46 } | |
47 | |
48 /* -------------------------------------------- */ | |
49 | |
50 TorrentsPageListModel::TorrentsPageListModel(QObject* parent) : QAbstractListModel(parent) { | |
51 } | |
52 | |
53 QByteArray TorrentsPageListModel::DownloadTorrentList() { | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
54 return HTTP::Get(session.config.torrents.feed_link); |
114 | 55 } |
56 | |
57 void TorrentsPageListModel::ParseTorrentList(const QByteArray& ba) { | |
58 std::istringstream stdstream(Strings::ToUtf8String(ba)); | |
59 | |
60 pugi::xml_document doc; | |
61 if (!doc.load(stdstream)) | |
62 return; // peace out | |
63 | |
64 /* my extra special dumb hack. */ | |
65 if (!rowCount(index(0))) { | |
66 beginInsertRows(QModelIndex(), 0, 0); | |
67 endInsertRows(); | |
68 } | |
69 | |
70 beginResetModel(); | |
71 | |
72 list.clear(); | |
73 /* this is just an rss parser; it should be in a separate class... */ | |
74 for (pugi::xml_node item : doc.child("rss").child("channel").children("item")) { | |
75 TorrentModelItem torrent; | |
76 torrent.SetFilename(item.child_value("title")); /* "title" == filename */ | |
77 { | |
154 | 78 anitomy::Anitomy anitomy; |
79 anitomy.Parse(Strings::ToWstring(torrent.GetFilename())); | |
80 | |
81 const auto& elements = anitomy.elements(); | |
82 | |
83 /* todo: patch Anitomy so that it doesn't use wide strings */ | |
84 torrent.SetTitle(Strings::ToUtf8String(elements.get(anitomy::kElementAnimeTitle))); | |
85 torrent.SetEpisode(Strings::RemoveLeadingChars(Strings::ToUtf8String(elements.get(anitomy::kElementEpisodeNumber)), '0')); | |
86 torrent.SetGroup(Strings::ToUtf8String(elements.get(anitomy::kElementReleaseGroup))); | |
87 torrent.SetResolution(Strings::ToUtf8String(elements.get(anitomy::kElementVideoResolution))); | |
114 | 88 } |
89 torrent.SetDescription(Strings::TextifySynopsis(item.child_value("description"))); | |
90 { | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
91 /* Parse description... */ |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
92 enum class Keys { SIZE, AUTHORIZED, SUBMITTER, COMMENT }; |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
93 |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
94 const std::unordered_map<std::string, Keys> KeyMap = { |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
95 {"Size", Keys::SIZE}, |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
96 {"Authorized", Keys::AUTHORIZED}, |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
97 {"Submitter", Keys::SUBMITTER}, |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
98 {"Comment", Keys::COMMENT} |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
99 }; |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
100 |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
101 const std::string description = Strings::TextifySynopsis(item.child_value("description")); |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
102 |
114 | 103 /* Parse size from description */ |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
104 std::istringstream descstream(description); |
114 | 105 |
106 for (std::string line; std::getline(descstream, line);) { | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
107 const size_t pos = line.find_first_of(':', 0); |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
108 if (pos == std::string::npos) |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
109 continue; |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
110 |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
111 const std::string key = line.substr(0, pos); |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
112 const std::string value = line.substr(line.find_first_not_of(": ", pos)); |
114 | 113 |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
114 switch (KeyMap.at(key)) { |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
115 case Keys::COMMENT: |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
116 torrent.SetDescription(value); |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
117 break; |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
118 case Keys::SIZE: |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
119 torrent.SetSize(Strings::HumanReadableSizeToBytes(value)); |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
120 break; |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
121 default: |
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
122 break; |
114 | 123 } |
124 } | |
125 } | |
126 torrent.SetLink(item.child_value("link")); | |
127 torrent.SetGuid(item.child_value("guid")); | |
128 { | |
129 const QString date_str = Strings::ToQString(item.child_value("pubDate")); | |
130 torrent.SetDate(QDateTime::fromString(date_str, "ddd, dd MMM yyyy HH:mm:ss t")); | |
131 } | |
132 list.push_back(torrent); | |
133 } | |
134 | |
135 endResetModel(); | |
136 } | |
137 | |
138 void TorrentsPageListModel::RefreshTorrentList() { | |
139 ParseTorrentList(DownloadTorrentList()); | |
140 } | |
141 | |
142 int TorrentsPageListModel::rowCount(const QModelIndex& parent) const { | |
143 return list.size(); | |
144 (void)(parent); | |
145 } | |
146 | |
147 int TorrentsPageListModel::columnCount(const QModelIndex& parent) const { | |
148 return NB_COLUMNS; | |
149 (void)(parent); | |
150 } | |
151 | |
152 QVariant TorrentsPageListModel::headerData(const int section, const Qt::Orientation orientation, const int role) const { | |
153 switch (role) { | |
154 case Qt::DisplayRole: { | |
155 switch (section) { | |
156 case TL_TITLE: return tr("Anime title"); | |
157 case TL_EPISODE: return tr("Episode"); | |
158 case TL_GROUP: return tr("Group"); | |
159 case TL_SIZE: return tr("Size"); | |
160 case TL_RESOLUTION: return tr("Resolution"); /* this is named "Video" in Taiga */ | |
161 case TL_SEEDERS: return tr("Seeding"); /* named "S" in Taiga */ | |
162 case TL_LEECHERS: return tr("Leeching"); /* named "L" in Taiga */ | |
163 case TL_DOWNLOADERS: return tr("Downloading"); /* named "D" in Taiga */ | |
164 case TL_DESCRIPTION: return tr("Description"); | |
165 case TL_FILENAME: return tr("Filename"); | |
166 case TL_RELEASEDATE: return tr("Release date"); | |
167 default: return {}; | |
168 } | |
169 break; | |
170 } | |
171 case Qt::TextAlignmentRole: { | |
172 switch (section) { | |
173 case TL_FILENAME: | |
174 case TL_GROUP: | |
175 case TL_DESCRIPTION: | |
176 case TL_RESOLUTION: | |
177 case TL_TITLE: return QVariant(Qt::AlignLeft | Qt::AlignVCenter); | |
178 case TL_SEEDERS: | |
179 case TL_LEECHERS: | |
180 case TL_DOWNLOADERS: | |
181 case TL_SIZE: | |
182 case TL_EPISODE: | |
183 case TL_RELEASEDATE: return QVariant(Qt::AlignRight | Qt::AlignVCenter); | |
184 default: return {}; | |
185 } | |
186 break; | |
187 } | |
188 } | |
189 return QAbstractListModel::headerData(section, orientation, role); | |
190 } | |
191 | |
192 bool TorrentsPageListModel::setData(const QModelIndex& index, const QVariant& value, int role) { | |
193 TorrentModelItem& item = list.at(index.row()); | |
54
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
194 |
114 | 195 if (index.column() == 0) { |
196 switch (role) { | |
197 case Qt::EditRole: | |
198 return false; | |
199 case Qt::CheckStateRole: | |
200 item.SetChecked(value.toBool()); | |
201 emit dataChanged(index, index); | |
202 return true; | |
203 } | |
204 } | |
205 | |
206 return QAbstractItemModel::setData(index, value, role); | |
207 } | |
208 | |
209 QVariant TorrentsPageListModel::data(const QModelIndex& index, int role) const { | |
210 if (!index.isValid()) | |
211 return QVariant(); | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
212 |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
213 const TorrentModelItem& item = list.at(index.row()); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
214 |
114 | 215 switch (role) { |
216 case Qt::DisplayRole: | |
217 switch (index.column()) { | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
218 case TL_TITLE: return Strings::ToQString(item.GetTitle()); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
219 case TL_EPISODE: return Strings::ToQString(item.GetEpisode()); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
220 case TL_GROUP: return Strings::ToQString(item.GetGroup()); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
221 case TL_SIZE: return session.config.locale.GetLocale().formattedDataSize(item.GetSize()); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
222 case TL_RESOLUTION: return Strings::ToQString(item.GetResolution()); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
223 case TL_SEEDERS: return item.GetSeeders(); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
224 case TL_LEECHERS: return item.GetLeechers(); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
225 case TL_DOWNLOADERS: return item.GetDownloaders(); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
226 case TL_DESCRIPTION: return Strings::ToQString(item.GetDescription()); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
227 case TL_FILENAME: return Strings::ToQString(item.GetFilename()); |
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
228 case TL_RELEASEDATE: return item.GetDate(); |
114 | 229 default: return ""; |
230 } | |
231 break; | |
232 case Qt::UserRole: | |
233 switch (index.column()) { | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
234 case TL_EPISODE: return Strings::ToInt(item.GetEpisode(), -1); |
117
2c1b6782e1d0
pages/torrents: work around conversion error on Linux
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
235 /* We have to use this to work around some stupid |
2c1b6782e1d0
pages/torrents: work around conversion error on Linux
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
236 "conversion ambiguous" error on Linux */ |
2c1b6782e1d0
pages/torrents: work around conversion error on Linux
Paper <mrpapersonic@gmail.com>
parents:
116
diff
changeset
|
237 case TL_SIZE: return QVariant::fromValue(item.GetSize()); |
114 | 238 default: return data(index, Qt::DisplayRole); |
239 } | |
240 break; | |
241 case Qt::SizeHintRole: { | |
242 switch (index.column()) { | |
243 default: { | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
244 /* max horizontal size of 100, height size = size of current font */ |
114 | 245 const QString d = data(index, Qt::DisplayRole).toString(); |
246 const QFontMetrics metric = QFontMetrics(QFont()); | |
247 | |
248 return QSize(std::max(metric.horizontalAdvance(d), 100), metric.height()); | |
249 } | |
250 } | |
251 break; | |
252 } | |
253 case Qt::TextAlignmentRole: | |
254 switch (index.column()) { | |
255 case TL_FILENAME: | |
256 case TL_GROUP: | |
257 case TL_DESCRIPTION: | |
258 case TL_RESOLUTION: | |
259 case TL_TITLE: return QVariant(Qt::AlignLeft | Qt::AlignVCenter); | |
260 case TL_SEEDERS: | |
261 case TL_LEECHERS: | |
262 case TL_DOWNLOADERS: | |
263 case TL_SIZE: | |
264 case TL_EPISODE: | |
265 case TL_RELEASEDATE: return QVariant(Qt::AlignRight | Qt::AlignVCenter); | |
266 default: return {}; | |
267 } | |
268 break; | |
269 } | |
270 return QVariant(); | |
271 } | |
272 | |
273 Qt::ItemFlags TorrentsPageListModel::flags(const QModelIndex& index) const { | |
274 if (!index.isValid()) | |
275 return Qt::NoItemFlags; | |
276 | |
118
39521c47c7a3
*: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents:
117
diff
changeset
|
277 return Qt::ItemIsEnabled | Qt::ItemIsSelectable; |
114 | 278 } |
279 | |
280 TorrentsPage::TorrentsPage(QWidget* parent) : QFrame(parent) { | |
281 setFrameShape(QFrame::Box); | |
282 setFrameShadow(QFrame::Sunken); | |
283 | |
284 QVBoxLayout* layout = new QVBoxLayout(this); | |
285 layout->setContentsMargins(0, 0, 0, 0); | |
286 layout->setSpacing(0); | |
287 | |
288 { | |
289 /* Toolbar */ | |
290 QToolBar* toolbar = new QToolBar(this); | |
291 toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); | |
292 toolbar->setIconSize(QSize(16, 16)); | |
293 toolbar->setMovable(false); | |
294 | |
295 { | |
296 /* this needs to be stored somewhere to replicate Taiga's | |
297 "timer" feature */ | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
298 toolbar->addAction(QIcon(":/icons/16x16/arrow-circle-315.png"), tr("&Check new torrents"), [this]{ |
114 | 299 QThreadPool::globalInstance()->start([this] { |
300 Refresh(); | |
301 }); | |
302 }); | |
303 } | |
304 | |
305 toolbar->addSeparator(); | |
306 | |
307 { | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
308 toolbar->addAction(QIcon(":/icons/16x16/navigation-270-button.png"), tr("Download &marked torrents")); |
114 | 309 } |
310 | |
311 { | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
312 toolbar->addAction(QIcon(":/icons/16x16/cross-button.png"), tr("&Discard all")); |
114 | 313 } |
314 | |
315 toolbar->addSeparator(); | |
316 | |
317 { | |
116
254b1d2b7096
settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents:
114
diff
changeset
|
318 toolbar->addAction(QIcon(":/icons/16x16/gear.png"), tr("&Settings")); |
114 | 319 } |
320 | |
321 layout->addWidget(toolbar); | |
322 } | |
323 | |
324 { | |
325 QFrame* line = new QFrame(this); | |
326 line->setFrameShape(QFrame::HLine); | |
327 line->setFrameShadow(QFrame::Sunken); | |
328 line->setLineWidth(1); | |
329 layout->addWidget(line); | |
330 } | |
331 | |
332 { | |
333 QTreeView* treeview = new QTreeView(this); | |
334 treeview->setUniformRowHeights(true); | |
335 treeview->setAllColumnsShowFocus(false); | |
336 treeview->setAlternatingRowColors(true); | |
337 treeview->setSortingEnabled(true); | |
338 treeview->setSelectionMode(QAbstractItemView::ExtendedSelection); | |
339 treeview->setItemsExpandable(false); | |
340 treeview->setRootIsDecorated(false); | |
341 treeview->setContextMenuPolicy(Qt::CustomContextMenu); | |
342 treeview->setFrameShape(QFrame::NoFrame); | |
343 | |
344 { | |
345 sort_model = new TorrentsPageListSortFilter(treeview); | |
346 model = new TorrentsPageListModel(treeview); | |
347 sort_model->setSourceModel(model); | |
348 sort_model->setSortRole(Qt::UserRole); | |
349 sort_model->setSortCaseSensitivity(Qt::CaseInsensitive); | |
350 treeview->setModel(sort_model); | |
351 } | |
352 | |
353 layout->addWidget(treeview); | |
354 } | |
355 } | |
356 | |
357 void TorrentsPage::Refresh() { | |
358 if (!model) | |
359 return; | |
360 model->RefreshTorrentList(); | |
54
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
361 } |
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
362 |
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
363 #include "gui/pages/moc_torrents.cpp" |