Mercurial > minori
comparison include/gui/window.h @ 250:c130f47f6f48
*: many many changes
e.g. the search page is actually implemented now!
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Sun, 04 Feb 2024 21:17:17 -0500 |
| parents | 4d461ef7d424 |
| children | 862d0d8619f6 |
comparison
equal
deleted
inserted
replaced
| 249:6b2441c776dd | 250:c130f47f6f48 |
|---|---|
| 10 #include <QWidget> | 10 #include <QWidget> |
| 11 #include <QStackedWidget> | 11 #include <QStackedWidget> |
| 12 #include <QCloseEvent> | 12 #include <QCloseEvent> |
| 13 #include <QThread> | 13 #include <QThread> |
| 14 #include "gui/widgets/sidebar.h" | 14 #include "gui/widgets/sidebar.h" |
| 15 | |
| 16 class QMenu; | |
| 15 | 17 |
| 16 Q_DECLARE_METATYPE(std::vector<std::string>); | 18 Q_DECLARE_METATYPE(std::vector<std::string>); |
| 17 | 19 |
| 18 class PlayingThread : public QThread { | 20 class PlayingThread : public QThread { |
| 19 Q_OBJECT | 21 Q_OBJECT |
| 30 | 32 |
| 31 class MainWindow final : public QMainWindow { | 33 class MainWindow final : public QMainWindow { |
| 32 Q_OBJECT | 34 Q_OBJECT |
| 33 | 35 |
| 34 public: | 36 public: |
| 37 enum class Pages { | |
| 38 NOW_PLAYING, | |
| 39 | |
| 40 ANIME_LIST, | |
| 41 HISTORY, | |
| 42 STATISTICS, | |
| 43 | |
| 44 SEARCH, | |
| 45 SEASONS, | |
| 46 TORRENTS | |
| 47 }; | |
| 48 | |
| 35 MainWindow(QWidget* parent = nullptr); | 49 MainWindow(QWidget* parent = nullptr); |
| 36 void SetActivePage(QWidget* page); | 50 void SetActivePage(QWidget* page); |
| 37 void CreateBars(); | 51 void CreateBars(); |
| 38 void AddMainWidgets(); | 52 void AddMainWidgets(); |
| 39 void RetranslateUI(); | 53 void RetranslateUI(); |
| 54 void UpdateFolderMenu(); | |
| 40 void AsyncSynchronize(QAction* action, QStackedWidget* stack); | 55 void AsyncSynchronize(QAction* action, QStackedWidget* stack); |
| 41 void changeEvent(QEvent* event) override; | 56 void changeEvent(QEvent* event) override; |
| 42 void showEvent(QShowEvent* event) override; | 57 void showEvent(QShowEvent* event) override; |
| 43 void closeEvent(QCloseEvent* event) override; | 58 void closeEvent(QCloseEvent* event) override; |
| 44 | 59 |
| 45 private: | 60 private: |
| 46 std::unique_ptr<QWidget> main_widget = nullptr; | 61 std::unique_ptr<QWidget> main_widget = nullptr; |
| 47 std::unique_ptr<QStackedWidget> stack = nullptr; | 62 std::unique_ptr<QStackedWidget> stack = nullptr; |
| 48 std::unique_ptr<SideBar> sidebar = nullptr; | 63 std::unique_ptr<SideBar> sidebar = nullptr; |
| 49 | 64 |
| 50 std::unique_ptr<PlayingThread> thread = nullptr; | 65 std::unique_ptr<PlayingThread> thread = nullptr; |
| 66 | |
| 67 QMenu* folder_menu = nullptr; | |
| 51 }; | 68 }; |
| 52 | 69 |
| 53 #endif // __window_h | 70 #endif // __window_h |
