comparison src/include/settings.h @ 6:1d82f6e04d7d

Update: add first parts to the settings dialog
author Paper <mrpapersonic@gmail.com>
date Wed, 16 Aug 2023 00:49:17 -0400
parents
children 07a9095eaeed
comparison
equal deleted inserted replaced
5:51ae25154b70 6:1d82f6e04d7d
1 #ifndef __settings_h
2 #define __settings_h
3 #include <QWidget>
4 #include <QDialog>
5 #include <QTabWidget>
6 #include <QLabel>
7 #include <QLineEdit>
8 #include <QComboBox>
9 #include <QHBoxLayout>
10 #include "sidebar.h"
11 class SettingsPage : public QWidget {
12 Q_OBJECT
13
14 public:
15 SettingsPage(QWidget* parent = nullptr, QString title = "");
16 void SetTitle(QString title);
17 virtual void SaveInfo();
18 void AddTab(QWidget* tab, QString title = "");
19
20 private:
21 QLabel* page_title;
22 QTabWidget* tab_widget;
23 };
24
25 class SettingsPageServices : public SettingsPage {
26 public:
27 SettingsPageServices(QWidget* parent = nullptr);
28 void SaveInfo() override;
29
30 private:
31 QWidget* CreateMainPage();
32 QWidget* CreateAniListPage();
33 QLineEdit* username_entry;
34 QComboBox* sync_combo_box;
35 };
36
37 class SettingsPageApplication : public SettingsPage {
38 public:
39 SettingsPageApplication(QWidget* parent = nullptr);
40 void SaveInfo() override;
41
42 private:
43 QWidget* CreateAnimeListPage();
44 };
45
46 class SettingsDialog : public QDialog {
47 Q_OBJECT
48
49 public:
50 SettingsDialog(QWidget* parent = nullptr);
51 QWidget* CreateServicesMainPage(QWidget* parent);
52 void OnSidebar(QListWidgetItem* item);
53 void OnOK();
54
55 private:
56 std::vector<SettingsPage*> pages;
57 QHBoxLayout* layout;
58 SideBar* sidebar;
59 };
60 #endif // __settings_h