Mercurial > minori
annotate include/gui/dialog/settings.h @ 114:ab191e28e69d
*: add initial torrent stuff
WOAH!
these checkboxes are a pain in my fucking ass
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Tue, 07 Nov 2023 08:03:42 -0500 |
parents | 2004b41d4a59 |
children | 254b1d2b7096 |
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> |
108 | 8 #include <QLocale> |
9 | 9 |
68
2417121d894e
*: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents:
62
diff
changeset
|
10 class QLabel; |
2417121d894e
*: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents:
62
diff
changeset
|
11 class QTabWidget; |
69 | 12 class QStackedWidget; |
68
2417121d894e
*: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents:
62
diff
changeset
|
13 class SideBar; |
2417121d894e
*: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents:
62
diff
changeset
|
14 |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
15 class SettingsPage : public QWidget { |
9 | 16 Q_OBJECT |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
17 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
18 public: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
19 SettingsPage(QWidget* parent = nullptr, QString title = ""); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
20 void SetTitle(QString title); |
62 | 21 virtual void SaveInfo() = 0; |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
22 void AddTab(QWidget* tab, QString title = ""); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
23 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
24 private: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
25 QLabel* page_title; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
26 QTabWidget* tab_widget; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
27 }; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
28 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
29 class SettingsPageServices final : public SettingsPage { |
108 | 30 Q_OBJECT |
31 | |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
32 public: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
33 SettingsPageServices(QWidget* parent = nullptr); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
34 void SaveInfo() override; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
35 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
36 private: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
37 QWidget* CreateMainPage(); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
38 QWidget* CreateAniListPage(); |
7 | 39 QString username; |
9 | 40 Anime::Services service; |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
41 }; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
42 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
43 class SettingsPageApplication final : public SettingsPage { |
108 | 44 Q_OBJECT |
45 | |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
46 public: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
47 SettingsPageApplication(QWidget* parent = nullptr); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
48 void SaveInfo() override; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
49 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
50 private: |
7 | 51 QWidget* CreateAnimeListWidget(); |
101
c537996cf67b
*: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents:
95
diff
changeset
|
52 Themes theme; |
108 | 53 QLocale locale; |
9 | 54 Anime::TitleLanguage language; |
7 | 55 bool display_aired_episodes; |
56 bool display_available_episodes; | |
57 bool highlight_anime_if_available; | |
58 bool highlighted_anime_above_others; | |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
59 }; |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
60 |
95
8043152ef9d4
include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
61 class SettingsDialog final : public QDialog { |
9 | 62 Q_OBJECT |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
63 |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
64 public: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
65 SettingsDialog(QWidget* parent = nullptr); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
66 QWidget* CreateServicesMainPage(QWidget* parent); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
67 void OnOK(); |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
68 |
108 | 69 protected: |
70 void showEvent(QShowEvent* event) override; | |
71 | |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
72 private: |
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
73 SideBar* sidebar; |
69 | 74 QStackedWidget* stacked; |
6
1d82f6e04d7d
Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
75 }; |
85 | 76 |
46 | 77 #endif // __gui__dialog__settings_h |