Mercurial > minori
annotate include/gui/dialog/settings.h @ 101:c537996cf67b
*: multitude of config changes
1. theme is now configurable from the settings menu
(but you have to restart for it to apply)
2. config is now stored in an INI file, with no method of
conversion from json (this repo is private-ish anyway)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Fri, 03 Nov 2023 14:06:02 -0400 |
parents | 8043152ef9d4 |
children | 2004b41d4a59 |
rev | line source |
---|---|
9 | 1 #ifndef __gui__dialog__settings_h |
2 #define __gui__dialog__settings_h | |
85 | 3 |
9 | 4 #include "core/anime.h" |
101
c537996cf67b
*: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents:
95
diff
changeset
|
5 #include "core/config.h" |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
6 #include <QDialog> |
9 | 7 #include <QWidget> |
8 | |
68
2417121d894e
*: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents:
62
diff
changeset
|
9 class QLabel; |
2417121d894e
*: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents:
62
diff
changeset
|
10 class QTabWidget; |
69 | 11 class QStackedWidget; |
68
2417121d894e
*: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents:
62
diff
changeset
|
12 class SideBar; |
2417121d894e
*: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents:
62
diff
changeset
|
13 |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
14 class SettingsPage : public QWidget { |
9 | 15 Q_OBJECT |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
16 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
17 public: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
18 SettingsPage(QWidget* parent = nullptr, QString title = ""); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
19 void SetTitle(QString title); |
62 | 20 virtual void SaveInfo() = 0; |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
21 void AddTab(QWidget* tab, QString title = ""); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
22 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
23 private: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
24 QLabel* page_title; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
25 QTabWidget* tab_widget; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
26 }; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
27 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
28 class SettingsPageServices final : public SettingsPage { |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
29 public: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
30 SettingsPageServices(QWidget* parent = nullptr); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
31 void SaveInfo() override; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
32 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
33 private: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
34 QWidget* CreateMainPage(); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
35 QWidget* CreateAniListPage(); |
7 | 36 QString username; |
9 | 37 Anime::Services service; |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
38 }; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
39 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
40 class SettingsPageApplication final : public SettingsPage { |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
41 public: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
42 SettingsPageApplication(QWidget* parent = nullptr); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
43 void SaveInfo() override; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
44 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
45 private: |
7 | 46 QWidget* CreateAnimeListWidget(); |
101
c537996cf67b
*: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents:
95
diff
changeset
|
47 Themes theme; |
9 | 48 Anime::TitleLanguage language; |
7 | 49 bool display_aired_episodes; |
50 bool display_available_episodes; | |
51 bool highlight_anime_if_available; | |
52 bool highlighted_anime_above_others; | |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
53 }; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
54 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
55 class SettingsDialog final : public QDialog { |
9 | 56 Q_OBJECT |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
57 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
58 public: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
59 SettingsDialog(QWidget* parent = nullptr); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
60 QWidget* CreateServicesMainPage(QWidget* parent); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
61 void OnOK(); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
62 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
63 private: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
64 SideBar* sidebar; |
69 | 65 QStackedWidget* stacked; |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
66 }; |
85 | 67 |
46 | 68 #endif // __gui__dialog__settings_h |