annotate include/gui/pages/seasons.h @ 333:5980a960f3e1

translate/anime: use fmt for translating anime seasons
author Paper <paper@paper.us.eu.org>
date Mon, 17 Jun 2024 20:03:58 -0400
parents b5d6c27c308f
children 6b0768158dcd
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>
54
466ac9870df9 add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6
260
dd211ff68b36 pages/seasons: add initial functionality
Paper <paper@paper.us.eu.org>
parents: 255
diff changeset
7 #include "core/anime.h"
dd211ff68b36 pages/seasons: add initial functionality
Paper <paper@paper.us.eu.org>
parents: 255
diff changeset
8 #include "core/date.h"
dd211ff68b36 pages/seasons: add initial functionality
Paper <paper@paper.us.eu.org>
parents: 255
diff changeset
9
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
10 #include <utility>
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
11 #include <queue>
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
12
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
13 class QListWidget;
263
96416310ea14 pages/seasons: finish season menu implementation
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
14 class QToolButton;
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
15
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
16 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
17
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
18 class SeasonsPageSearchThread : public QThread {
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
19 Q_OBJECT
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
20
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
21 public:
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
22 SeasonsPageSearchThread(QObject* parent = nullptr);
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
23 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
24
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
25 protected:
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
26 void run() override;
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
27
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
28 private:
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
29 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
30 std::mutex queue_mutex_;
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
31
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
32 signals:
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
33 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
34 };
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
35
295
b82841e76e79 *: better support on Windows
Paper <paper@paper.us.eu.org>
parents: 263
diff changeset
36 class SeasonsPage final : public QFrame {
255
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
37 Q_OBJECT
54
466ac9870df9 add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38
255
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
39 public:
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
40 SeasonsPage(QWidget* parent = nullptr);
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
41 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
42 void Refresh();
254
d14f8e0e40c3 [UNFINISHED] *: update anime button
Paper <paper@paper.us.eu.org>
parents: 95
diff changeset
43
255
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
44 protected:
fe702c8f161f *: whatever
Paper <paper@paper.us.eu.org>
parents: 254
diff changeset
45 QListWidget* buttons = nullptr;
263
96416310ea14 pages/seasons: finish season menu implementation
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
46 QToolButton* season_button = nullptr;
325
78929794e7d8 pages/seasons: run seasons search in a separate thread
Paper <paper@paper.us.eu.org>
parents: 295
diff changeset
47
327
b5d6c27c308f anime: refactor Anime::SeriesSeason to Season class
Paper <paper@paper.us.eu.org>
parents: 325
diff changeset
48 Anime::Season season_;
54
466ac9870df9 add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49 };
466ac9870df9 add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 260
diff changeset
51 #endif // MINORI_GUI_PAGES_SEASONS_H_