annotate include/gui/pages/seasons.h @ 367:8d45d892be88 default tip

*: instead of pugixml, use Qt XML features this means we have one extra Qt dependency though...
author Paper <paper@tflc.us>
date Sun, 17 Nov 2024 22:55:47 -0500
parents 6b0768158dcd
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 260
diff changeset
1 #ifndef MINORI_GUI_PAGES_SEASONS_H_
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 260
diff changeset
2 #define MINORI_GUI_PAGES_SEASONS_H_
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 64
diff changeset
3
295
b82841e76e79 *: better support on Windows
Paper <paper@paper.us.eu.org>
parents: 263
diff changeset
4 #include <QFrame>
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
5 #include <QThread>
348
6b0768158dcd text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents: 327
diff changeset
6 #include <QToolButton>
54
466ac9870df9 add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7
260
dd211ff68b36 pages/seasons: add initial functionality
Paper <paper@paper.us.eu.org>
parents: 255
diff changeset
8 #include "core/anime.h"
dd211ff68b36 pages/seasons: add initial functionality
Paper <paper@paper.us.eu.org>
parents: 255
diff changeset
9 #include "core/date.h"
dd211ff68b36 pages/seasons: add initial functionality
Paper <paper@paper.us.eu.org>
parents: 255
diff changeset
10
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
11 #include <utility>
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
12 #include <queue>
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
13
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
14 class QListWidget;
263
96416310ea14 pages/seasons: finish season menu implementation
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
15 class QToolButton;
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
16
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
17 Q_DECLARE_METATYPE(Anime::Season);
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
18
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
19 class SeasonsPageSearchThread : public QThread {
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
20 Q_OBJECT
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
21
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
22 public:
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
23 SeasonsPageSearchThread(QObject* parent = nullptr);
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
24 void AddToQueue(Anime::Season season);
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
25
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
26 protected:
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
27 void run() override;
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
28
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
29 private:
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
30 std::queue<Anime::Season> queue_;
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
31 std::mutex queue_mutex_;
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
32
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
33 signals:
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
34 void ReceivedSeason(Anime::Season season);
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
35 };
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
36
295
b82841e76e79 *: better support on Windows
Paper <paper@paper.us.eu.org>
parents: 263
diff changeset
37 class SeasonsPage final : public QFrame {
255
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
38 Q_OBJECT
54
466ac9870df9 add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39
255
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
40 public:
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
41 SeasonsPage(QWidget* parent = nullptr);
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
42 void SetSeason(Anime::Season season);
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
43 void Refresh();
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
44
255
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
45 protected:
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
46 QListWidget* buttons = nullptr;
348
6b0768158dcd text: redesign almost every widget
Paper <paper@paper.us.eu.org>
parents: 327
diff changeset
47 QToolButton season_button;
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
48
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
49 Anime::Season season_;
54
466ac9870df9 add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50 };
466ac9870df9 add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 260
diff changeset
52 #endif // MINORI_GUI_PAGES_SEASONS_H_