annotate include/gui/dialog/settings.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 b1f4d1867ab1
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: 258
diff changeset
1 #ifndef MINORI_GUI_DIALOG_SETTINGS_H_
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
2 #define MINORI_GUI_DIALOG_SETTINGS_H_
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
3
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
4 #include "core/anime.h"
101
c537996cf67b *: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents: 95
diff changeset
5 #include "core/config.h"
116
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
6 #include "core/session.h"
316
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
7 #include "gui/widgets/sidebar.h"
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 #include <QDialog>
316
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
9 #include <QDialogButtonBox>
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
10 #include <QLabel>
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
11 #include <QListWidget>
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
12 #include <QLocale>
316
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
13 #include <QStackedWidget>
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
14 #include <QTabWidget>
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
15 #include <QVBoxLayout>
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
16 #include <QWidget>
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
17
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18 class SettingsPage : public QWidget {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
19 Q_OBJECT
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
21 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
22 SettingsPage(QWidget* parent = nullptr, QString title = "");
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
23 void SetTitle(QString title);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
24 virtual void SaveInfo() = 0;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
25 void AddTab(QWidget* tab, QString title = "");
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
27 private:
316
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
28 QLabel page_title_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
29 QTabWidget tab_widget_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
30 QVBoxLayout layout_;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
31 };
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
32
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 85
diff changeset
33 class SettingsPageServices final : public SettingsPage {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
34 Q_OBJECT
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
35
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
36 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
37 SettingsPageServices(QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
38 void SaveInfo() override;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
40 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
41 QWidget* CreateMainPage();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
42 QWidget* CreateAniListPage();
317
b1f4d1867ab1 services: VERY initial Kitsu support
Paper <paper@paper.us.eu.org>
parents: 316
diff changeset
43 QWidget* CreateKitsuPage();
232
ff0061e75f0f theme: add OS detection with glib
Paper <mrpapersonic@gmail.com>
parents: 226
diff changeset
44
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
45 decltype(session.config.service) service;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
46 };
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
47
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 85
diff changeset
48 class SettingsPageApplication final : public SettingsPage {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
49 Q_OBJECT
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
50
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
51 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
52 SettingsPageApplication(QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
53 void SaveInfo() override;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
55 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
56 QWidget* CreateAnimeListWidget();
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
57 QWidget* CreateGeneralWidget();
232
ff0061e75f0f theme: add OS detection with glib
Paper <mrpapersonic@gmail.com>
parents: 226
diff changeset
58
279
657fda1b9cac *: clean up enums
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
59 Theme::Theme theme;
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
60 QLocale locale;
232
ff0061e75f0f theme: add OS detection with glib
Paper <mrpapersonic@gmail.com>
parents: 226
diff changeset
61
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
62 decltype(session.config.anime_list.score_format) format;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
63 decltype(session.config.anime_list.language) language;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
64 decltype(session.config.anime_list.display_aired_episodes) display_aired_episodes;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
65 decltype(session.config.anime_list.display_available_episodes) display_available_episodes;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
66 decltype(session.config.anime_list.highlight_anime_if_available) highlight_anime_if_available;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
67 decltype(session.config.anime_list.highlighted_anime_above_others) highlighted_anime_above_others;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
68 };
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
69
116
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
70 class SettingsPageTorrents final : public SettingsPage {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
71 Q_OBJECT
116
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
72
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
73 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
74 SettingsPageTorrents(QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
75 void SaveInfo() override;
116
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
76
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
77 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
78 QWidget* CreateGeneralWidget();
232
ff0061e75f0f theme: add OS detection with glib
Paper <mrpapersonic@gmail.com>
parents: 226
diff changeset
79
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
80 decltype(session.config.torrents.feed_link) feed_link;
116
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
81 };
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
82
119
4eae379cb1ff settings: add a very early recognition tab for configuring players and extensions
Paper <mrpapersonic@gmail.com>
parents: 116
diff changeset
83 class SettingsPageRecognition final : public SettingsPage {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
84 Q_OBJECT
119
4eae379cb1ff settings: add a very early recognition tab for configuring players and extensions
Paper <mrpapersonic@gmail.com>
parents: 116
diff changeset
85
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
86 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
87 SettingsPageRecognition(QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
88 void SaveInfo() override;
119
4eae379cb1ff settings: add a very early recognition tab for configuring players and extensions
Paper <mrpapersonic@gmail.com>
parents: 116
diff changeset
89
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
90 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
91 QWidget* CreatePlayersWidget();
232
ff0061e75f0f theme: add OS detection with glib
Paper <mrpapersonic@gmail.com>
parents: 226
diff changeset
92
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
93 decltype(session.config.recognition.detect_media_players) detect_media_players;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
94 decltype(session.config.recognition.players) players;
119
4eae379cb1ff settings: add a very early recognition tab for configuring players and extensions
Paper <mrpapersonic@gmail.com>
parents: 116
diff changeset
95 };
4eae379cb1ff settings: add a very early recognition tab for configuring players and extensions
Paper <mrpapersonic@gmail.com>
parents: 116
diff changeset
96
226
f784b5b1914c settings: add library page
Paper <mrpapersonic@gmail.com>
parents: 195
diff changeset
97 class SettingsPageLibrary final : public SettingsPage {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
98 Q_OBJECT
226
f784b5b1914c settings: add library page
Paper <mrpapersonic@gmail.com>
parents: 195
diff changeset
99
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
100 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
101 SettingsPageLibrary(QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
102 void SaveInfo() override;
226
f784b5b1914c settings: add library page
Paper <mrpapersonic@gmail.com>
parents: 195
diff changeset
103
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
104 private:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
105 QWidget* CreateFoldersWidget();
232
ff0061e75f0f theme: add OS detection with glib
Paper <mrpapersonic@gmail.com>
parents: 226
diff changeset
106
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
107 decltype(session.config.library.paths) paths;
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
108 decltype(session.config.library.real_time_monitor) real_time_monitor;
226
f784b5b1914c settings: add library page
Paper <mrpapersonic@gmail.com>
parents: 195
diff changeset
109 };
f784b5b1914c settings: add library page
Paper <mrpapersonic@gmail.com>
parents: 195
diff changeset
110
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 85
diff changeset
111 class SettingsDialog final : public QDialog {
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
112 Q_OBJECT
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
113
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
114 public:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
115 SettingsDialog(QWidget* parent = nullptr);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
116 QWidget* CreateServicesMainPage(QWidget* parent);
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
117 void OnOK();
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
118
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
119 protected:
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
120 void showEvent(QShowEvent* event) override;
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
121
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
122 private:
316
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
123 QVBoxLayout layout_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
124
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
125 QWidget widget_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
126 QHBoxLayout widget_layout_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
127
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
128 SideBar sidebar_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
129 QStackedWidget stacked_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
130
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
131 SettingsPageServices services_page_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
132 SettingsPageApplication application_page_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
133 SettingsPageTorrents torrents_page_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
134 SettingsPageRecognition recognition_page_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
135 SettingsPageLibrary library_page_;
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
136
180714442770 settings: clean up code
Paper <paper@paper.us.eu.org>
parents: 279
diff changeset
137 QDialogButtonBox button_box_;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
138 };
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
139
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
140 #endif // MINORI_GUI_DIALOG_SETTINGS_H_