annotate include/gui/widgets/anime_info.h @ 327:b5d6c27c308f

anime: refactor Anime::SeriesSeason to Season class ToLocalString has also been altered to take in both season and year because lots of locales actually treat formatting seasons differently! most notably is Russian which adds a suffix at the end to notate seasons(??)
author Paper <paper@paper.us.eu.org>
date Thu, 13 Jun 2024 01:49:18 -0400
parents 1b5c04268d6a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
1 #ifndef MINORI_GUI_WIDGETS_ANIME_INFO_H_
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
2 #define MINORI_GUI_WIDGETS_ANIME_INFO_H_
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
3
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
4 #include <QWidget>
320
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
5 #include <QThread>
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
6 #include "gui/widgets/text.h"
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
7
320
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
8 #include <mutex>
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
9 #include <queue>
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
10
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
11 namespace Anime {
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
12 class Anime;
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
13 }
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
14
320
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
15 class AnimeInfoWidgetGetMetadataThread final : public QThread {
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
16 Q_OBJECT
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
17
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
18 public:
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
19 AnimeInfoWidgetGetMetadataThread(QObject* parent = nullptr);
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
20
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
21 void AddToQueue(int id);
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
22
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
23 signals:
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
24 void NeedRefresh(int id);
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
25
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
26 protected:
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
27 void run() override;
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
28
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
29 private:
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
30 std::mutex queue_mutex_;
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
31 std::queue<int> queue_;
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
32 };
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
33
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
34 class AnimeInfoWidget final : public QWidget {
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
35 Q_OBJECT
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
36
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
37 public:
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
38 AnimeInfoWidget(QWidget* parent = nullptr);
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
39 AnimeInfoWidget(const Anime::Anime& anime, QWidget* parent = nullptr);
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
40 void SetAnime(const Anime::Anime& anime);
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
41
320
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
42 protected:
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
43 void RefreshGenres(const Anime::Anime& anime);
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
44
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
45 private:
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
46 TextWidgets::OneLineSection _title;
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
47 TextWidgets::LabelledSection _details;
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
48 TextWidgets::SelectableSection _synopsis;
320
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
49
1b5c04268d6a services/kitsu: ACTUALLY finish GetAnimeList
Paper <paper@paper.us.eu.org>
parents: 301
diff changeset
50 int id_ = 0;
301
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
51 };
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
52
b1f625b0227c *: convert all files CRLF -> LF
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
53 #endif // MINORI_GUI_WIDGETS_ANIME_INFO_H_