annotate include/gui/dialog/settings.h @ 116:254b1d2b7096

settings: add torrents page, make rss feed configurable
author Paper <mrpapersonic@gmail.com>
date Tue, 07 Nov 2023 13:52:13 -0500
parents 2004b41d4a59
children 4eae379cb1ff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
1 #ifndef __gui__dialog__settings_h
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
2 #define __gui__dialog__settings_h
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
3
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
4 #include "core/anime.h"
101
c537996cf67b *: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents: 95
diff changeset
5 #include "core/config.h"
116
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
6 #include "core/session.h"
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 #include <QDialog>
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
8 #include <QWidget>
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
9 #include <QLocale>
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
10
68
2417121d894e *: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents: 62
diff changeset
11 class QLabel;
2417121d894e *: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents: 62
diff changeset
12 class QTabWidget;
69
27a19dd6cba1 *: fix up some stuff
Paper <mrpapersonic@gmail.com>
parents: 68
diff changeset
13 class QStackedWidget;
68
2417121d894e *: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents: 62
diff changeset
14 class SideBar;
2417121d894e *: normalize usage of layouts
Paper <mrpapersonic@gmail.com>
parents: 62
diff changeset
15
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 class SettingsPage : public QWidget {
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
17 Q_OBJECT
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19 public:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 SettingsPage(QWidget* parent = nullptr, QString title = "");
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 void SetTitle(QString title);
62
4c6dd5999b39 *: update
Paper <mrpapersonic@gmail.com>
parents: 46
diff changeset
22 virtual void SaveInfo() = 0;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 void AddTab(QWidget* tab, QString title = "");
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 private:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26 QLabel* page_title;
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27 QTabWidget* tab_widget;
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
28 };
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
29
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 85
diff changeset
30 class SettingsPageServices final : public SettingsPage {
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
31 Q_OBJECT
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
32
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
33 public:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
34 SettingsPageServices(QWidget* parent = nullptr);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
35 void SaveInfo() override;
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 private:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38 QWidget* CreateMainPage();
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39 QWidget* CreateAniListPage();
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
40 QString username;
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
41 Anime::Services service;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
42 };
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
43
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 85
diff changeset
44 class SettingsPageApplication final : public SettingsPage {
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
45 Q_OBJECT
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
46
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
47 public:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48 SettingsPageApplication(QWidget* parent = nullptr);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49 void SaveInfo() override;
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51 private:
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
52 QWidget* CreateAnimeListWidget();
101
c537996cf67b *: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents: 95
diff changeset
53 Themes theme;
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
54 QLocale locale;
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
55 Anime::TitleLanguage language;
7
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
56 bool display_aired_episodes;
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
57 bool display_available_episodes;
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
58 bool highlight_anime_if_available;
Paper <mrpapersonic@gmail.com>
parents: 6
diff changeset
59 bool highlighted_anime_above_others;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
60 };
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
61
116
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
62 class SettingsPageTorrents final : public SettingsPage {
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
63 Q_OBJECT
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
64
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
65 public:
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
66 SettingsPageTorrents(QWidget* parent = nullptr);
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
67 void SaveInfo() override;
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
68
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
69 private:
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
70 QWidget* CreateGeneralWidget();
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
71 decltype(session.config.torrents.feed_link) feed_link;
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
72 };
254b1d2b7096 settings: add torrents page, make rss feed configurable
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
73
95
8043152ef9d4 include: set classes as final where appropriate
Paper <mrpapersonic@gmail.com>
parents: 85
diff changeset
74 class SettingsDialog final : public QDialog {
9
5c0397762b53 INCOMPLETE: megacommit :)
Paper <mrpapersonic@gmail.com>
parents: 7
diff changeset
75 Q_OBJECT
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
76
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
77 public:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
78 SettingsDialog(QWidget* parent = nullptr);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
79 QWidget* CreateServicesMainPage(QWidget* parent);
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
80 void OnOK();
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
81
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
82 protected:
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
83 void showEvent(QShowEvent* event) override;
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 101
diff changeset
84
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
85 private:
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
86 SideBar* sidebar;
69
27a19dd6cba1 *: fix up some stuff
Paper <mrpapersonic@gmail.com>
parents: 68
diff changeset
87 QStackedWidget* stacked;
6
1d82f6e04d7d Update: add first parts to the settings dialog
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
88 };
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 69
diff changeset
89
46
d0adc4aedfc8 *: update...
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
90 #endif // __gui__dialog__settings_h