annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 #ifndef __settings_h
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 #define __settings_h
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3 #include <QWidget>
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <QDialog>
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5 #include <QTabWidget>
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 #include <QLabel>
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 #include <QLineEdit>
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 #include <QComboBox>
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9 #include <QHBoxLayout>
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 #include "sidebar.h"
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11 class SettingsPage : public QWidget {
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12 Q_OBJECT
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 public:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 SettingsPage(QWidget* parent = nullptr, QString title = "");
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 void SetTitle(QString title);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
17 virtual void SaveInfo();
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18 void AddTab(QWidget* tab, QString title = "");
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 private:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 QLabel* page_title;
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 QTabWidget* tab_widget;
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
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 class SettingsPageServices : public SettingsPage {
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26 public:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27 SettingsPageServices(QWidget* parent = nullptr);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
28 void SaveInfo() override;
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
29
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
30 private:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
31 QWidget* CreateMainPage();
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
32 QWidget* CreateAniListPage();
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
33 QLineEdit* username_entry;
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
34 QComboBox* sync_combo_box;
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
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
37 class SettingsPageApplication : public SettingsPage {
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38 public:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39 SettingsPageApplication(QWidget* parent = nullptr);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
40 void SaveInfo() override;
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 private:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
43 QWidget* CreateAnimeListPage();
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
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
46 class SettingsDialog : public QDialog {
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
47 Q_OBJECT
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49 public:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50 SettingsDialog(QWidget* parent = nullptr);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51 QWidget* CreateServicesMainPage(QWidget* parent);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
52 void OnSidebar(QListWidgetItem* item);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
53 void OnOK();
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
55 private:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
56 std::vector<SettingsPage*> pages;
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
57 QHBoxLayout* layout;
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
58 SideBar* sidebar;
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 #endif // __settings_h