Mercurial > minori
comparison src/include/settings.h @ 7:07a9095eaeed
Update
Refactored some code, moved some around
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Thu, 24 Aug 2023 23:11:38 -0400 |
parents | 1d82f6e04d7d |
children |
comparison
equal
deleted
inserted
replaced
6:1d82f6e04d7d | 7:07a9095eaeed |
---|---|
6 #include <QLabel> | 6 #include <QLabel> |
7 #include <QLineEdit> | 7 #include <QLineEdit> |
8 #include <QComboBox> | 8 #include <QComboBox> |
9 #include <QHBoxLayout> | 9 #include <QHBoxLayout> |
10 #include "sidebar.h" | 10 #include "sidebar.h" |
11 #include "anime.h" | |
11 class SettingsPage : public QWidget { | 12 class SettingsPage : public QWidget { |
12 Q_OBJECT | 13 Q_OBJECT |
13 | 14 |
14 public: | 15 public: |
15 SettingsPage(QWidget* parent = nullptr, QString title = ""); | 16 SettingsPage(QWidget* parent = nullptr, QString title = ""); |
28 void SaveInfo() override; | 29 void SaveInfo() override; |
29 | 30 |
30 private: | 31 private: |
31 QWidget* CreateMainPage(); | 32 QWidget* CreateMainPage(); |
32 QWidget* CreateAniListPage(); | 33 QWidget* CreateAniListPage(); |
33 QLineEdit* username_entry; | 34 QString username; |
34 QComboBox* sync_combo_box; | 35 enum AnimeListServices service; |
35 }; | 36 }; |
36 | 37 |
37 class SettingsPageApplication : public SettingsPage { | 38 class SettingsPageApplication : public SettingsPage { |
38 public: | 39 public: |
39 SettingsPageApplication(QWidget* parent = nullptr); | 40 SettingsPageApplication(QWidget* parent = nullptr); |
40 void SaveInfo() override; | 41 void SaveInfo() override; |
41 | 42 |
42 private: | 43 private: |
43 QWidget* CreateAnimeListPage(); | 44 QWidget* CreateAnimeListWidget(); |
45 enum AnimeTitleLanguage language; | |
46 bool display_aired_episodes; | |
47 bool display_available_episodes; | |
48 bool highlight_anime_if_available; | |
49 bool highlighted_anime_above_others; | |
44 }; | 50 }; |
45 | 51 |
46 class SettingsDialog : public QDialog { | 52 class SettingsDialog : public QDialog { |
47 Q_OBJECT | 53 Q_OBJECT |
48 | 54 |
49 public: | 55 public: |
50 SettingsDialog(QWidget* parent = nullptr); | 56 SettingsDialog(QWidget* parent = nullptr); |
51 QWidget* CreateServicesMainPage(QWidget* parent); | 57 QWidget* CreateServicesMainPage(QWidget* parent); |
52 void OnSidebar(QListWidgetItem* item); | |
53 void OnOK(); | 58 void OnOK(); |
54 | 59 |
55 private: | 60 private: |
56 std::vector<SettingsPage*> pages; | |
57 QHBoxLayout* layout; | 61 QHBoxLayout* layout; |
58 SideBar* sidebar; | 62 SideBar* sidebar; |
59 }; | 63 }; |
60 #endif // __settings_h | 64 #endif // __settings_h |