Mercurial > minori
annotate include/gui/pages/seasons.h @ 362:433eeaca3baf
CI/linux: revert change to linuxdeployqt; add qt plugin
turns out I'm stupid and linuxdeployqt is insanely broken
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 15 Jul 2024 01:28:57 -0400 |
parents | 6b0768158dcd |
children |
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 | 3 |
295 | 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 | 37 class SeasonsPage final : public QFrame { |
255 | 38 Q_OBJECT |
54
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
39 |
255 | 40 public: |
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 | 45 protected: |
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_ |