comparison include/gui/dialog/settings.h @ 316:180714442770

settings: clean up code
author Paper <paper@paper.us.eu.org>
date Tue, 11 Jun 2024 15:11:09 -0400
parents 657fda1b9cac
children b1f4d1867ab1
comparison
equal deleted inserted replaced
315:34347fd2a2de 316:180714442770
2 #define MINORI_GUI_DIALOG_SETTINGS_H_ 2 #define MINORI_GUI_DIALOG_SETTINGS_H_
3 3
4 #include "core/anime.h" 4 #include "core/anime.h"
5 #include "core/config.h" 5 #include "core/config.h"
6 #include "core/session.h" 6 #include "core/session.h"
7 #include "gui/widgets/sidebar.h"
7 #include <QDialog> 8 #include <QDialog>
9 #include <QDialogButtonBox>
10 #include <QLabel>
8 #include <QListWidget> 11 #include <QListWidget>
9 #include <QLocale> 12 #include <QLocale>
13 #include <QStackedWidget>
14 #include <QTabWidget>
15 #include <QVBoxLayout>
10 #include <QWidget> 16 #include <QWidget>
11
12 class QLabel;
13 class QTabWidget;
14 class QStackedWidget;
15 class SideBar;
16 17
17 /* !!! MOVE THIS ELSEWHERE! */ 18 /* !!! MOVE THIS ELSEWHERE! */
18 class DroppableListWidget : public QListWidget { 19 class DroppableListWidget : public QListWidget {
19 Q_OBJECT 20 Q_OBJECT
20 21
38 void SetTitle(QString title); 39 void SetTitle(QString title);
39 virtual void SaveInfo() = 0; 40 virtual void SaveInfo() = 0;
40 void AddTab(QWidget* tab, QString title = ""); 41 void AddTab(QWidget* tab, QString title = "");
41 42
42 private: 43 private:
43 QLabel* page_title; 44 QLabel page_title_;
44 QTabWidget* tab_widget; 45 QTabWidget tab_widget_;
46 QVBoxLayout layout_;
45 }; 47 };
46 48
47 class SettingsPageServices final : public SettingsPage { 49 class SettingsPageServices final : public SettingsPage {
48 Q_OBJECT 50 Q_OBJECT
49 51
131 133
132 protected: 134 protected:
133 void showEvent(QShowEvent* event) override; 135 void showEvent(QShowEvent* event) override;
134 136
135 private: 137 private:
136 SideBar* sidebar; 138 QVBoxLayout layout_;
137 QStackedWidget* stacked; 139
140 QWidget widget_;
141 QHBoxLayout widget_layout_;
142
143 SideBar sidebar_;
144 QStackedWidget stacked_;
145
146 SettingsPageServices services_page_;
147 SettingsPageApplication application_page_;
148 SettingsPageTorrents torrents_page_;
149 SettingsPageRecognition recognition_page_;
150 SettingsPageLibrary library_page_;
151
152 QDialogButtonBox button_box_;
138 }; 153 };
139 154
140 #endif // MINORI_GUI_DIALOG_SETTINGS_H_ 155 #endif // MINORI_GUI_DIALOG_SETTINGS_H_