Mercurial > minori
annotate include/gui/pages/seasons.h @ 337:a7d4e5107531
dep/animone: REFACTOR ALL THE THINGS
1: animone now has its own syntax divergent from anisthesia,
making different platforms actually have their own sections
2: process names in animone are now called `comm' (this will
probably break things). this is what its called in bsd/linux
so I'm just going to use it everywhere
3: the X11 code now checks for the existence of a UTF-8 window title
and passes it if available
4: ANYTHING THATS NOT LINUX IS 100% UNTESTED AND CAN AND WILL BREAK!
I still actually need to test the bsd code. to be honest I'm probably
going to move all of the bsds into separate files because they're
all essentially different operating systems at this point
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 19 Jun 2024 12:51:15 -0400 |
parents | b5d6c27c308f |
children | 6b0768158dcd |
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> |
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 | 36 class SeasonsPage final : public QFrame { |
255 | 37 Q_OBJECT |
54
466ac9870df9
add stub pages (to be implemented)
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
38 |
255 | 39 public: |
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 | 44 protected: |
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_ |