Mercurial > minori
comparison include/gui/window.h @ 369:47c9f8502269
*: clang-format all the things
I've edited the formatting a bit. Now pointer asterisks (and reference
ampersands) are on the variable instead of the type, as well as having
newlines for function braces (but nothing else)
| author | Paper <paper@tflc.us> |
|---|---|
| date | Fri, 25 Jul 2025 10:16:02 -0400 |
| parents | 34347fd2a2de |
| children |
comparison
equal
deleted
inserted
replaced
| 368:6d37a998cf91 | 369:47c9f8502269 |
|---|---|
| 11 #include "gui/pages/search.h" | 11 #include "gui/pages/search.h" |
| 12 #include "gui/pages/seasons.h" | 12 #include "gui/pages/seasons.h" |
| 13 #include "gui/pages/statistics.h" | 13 #include "gui/pages/statistics.h" |
| 14 #include "gui/pages/torrents.h" | 14 #include "gui/pages/torrents.h" |
| 15 | 15 |
| 16 #include <QCloseEvent> | |
| 16 #include <QMainWindow> | 17 #include <QMainWindow> |
| 17 #include <QCloseEvent> | |
| 18 #include <QStackedWidget> | 18 #include <QStackedWidget> |
| 19 #include <QThread> | 19 #include <QThread> |
| 20 #include <QTimer> | 20 #include <QTimer> |
| 21 #include <QWidget> | 21 #include <QWidget> |
| 22 | 22 |
| 31 | 31 |
| 32 class MainWindowPlayingThread final : public QThread { | 32 class MainWindowPlayingThread final : public QThread { |
| 33 Q_OBJECT | 33 Q_OBJECT |
| 34 | 34 |
| 35 public: | 35 public: |
| 36 MainWindowPlayingThread(QObject* object = nullptr) : QThread(object) {} | 36 MainWindowPlayingThread(QObject *object = nullptr) : QThread(object) {} |
| 37 | 37 |
| 38 protected: | 38 protected: |
| 39 void run() override; | 39 void run() override; |
| 40 | 40 |
| 41 signals: | 41 signals: |
| 42 void Done(const std::vector<std::string>& files); | 42 void Done(const std::vector<std::string> &files); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 class MainWindowAsyncSynchronizeThread final : public QThread { | 45 class MainWindowAsyncSynchronizeThread final : public QThread { |
| 46 Q_OBJECT | 46 Q_OBJECT |
| 47 | 47 |
| 48 public: | 48 public: |
| 49 MainWindowAsyncSynchronizeThread(QAction* action, AnimeListPage* page, QObject* object = nullptr); | 49 MainWindowAsyncSynchronizeThread(QAction *action, AnimeListPage *page, QObject *object = nullptr); |
| 50 void SetAction(QAction* action); | 50 void SetAction(QAction *action); |
| 51 void SetPage(AnimeListPage* page); | 51 void SetPage(AnimeListPage *page); |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 void run() override; | 54 void run() override; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 QAction* action_ = nullptr; | 57 QAction *action_ = nullptr; |
| 58 AnimeListPage* page_ = nullptr; | 58 AnimeListPage *page_ = nullptr; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class MainWindow final : public QMainWindow { | 61 class MainWindow final : public QMainWindow { |
| 62 Q_OBJECT | 62 Q_OBJECT |
| 63 | 63 |
| 72 SEARCH, | 72 SEARCH, |
| 73 SEASONS, | 73 SEASONS, |
| 74 TORRENTS | 74 TORRENTS |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 MainWindow(QWidget* parent = nullptr); | 77 MainWindow(QWidget *parent = nullptr); |
| 78 void SetActivePage(QWidget* page); | 78 void SetActivePage(QWidget *page); |
| 79 void CreateBars(); | 79 void CreateBars(); |
| 80 void AddMainWidgets(); | 80 void AddMainWidgets(); |
| 81 void RetranslateUI(); | 81 void RetranslateUI(); |
| 82 void UpdateFolderMenu(); | 82 void UpdateFolderMenu(); |
| 83 void AsyncSynchronize(QAction* action, QStackedWidget* stack); | 83 void AsyncSynchronize(QAction *action, QStackedWidget *stack); |
| 84 void changeEvent(QEvent* event) override; | 84 void changeEvent(QEvent *event) override; |
| 85 void showEvent(QShowEvent* event) override; | 85 void showEvent(QShowEvent *event) override; |
| 86 void closeEvent(QCloseEvent* event) override; | 86 void closeEvent(QCloseEvent *event) override; |
| 87 | 87 |
| 88 public slots: | 88 public slots: |
| 89 void SetStatusMessage(const std::string& message); | 89 void SetStatusMessage(const std::string &message); |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 QWidget main_widget_; | 92 QWidget main_widget_; |
| 93 QStackedWidget stack_; | 93 QStackedWidget stack_; |
| 94 SideBar sidebar_; | 94 SideBar sidebar_; |
| 104 MainWindowPlayingThread playing_thread_; | 104 MainWindowPlayingThread playing_thread_; |
| 105 QTimer playing_thread_timer_; | 105 QTimer playing_thread_timer_; |
| 106 | 106 |
| 107 MainWindowAsyncSynchronizeThread async_synchronize_thread_; | 107 MainWindowAsyncSynchronizeThread async_synchronize_thread_; |
| 108 | 108 |
| 109 QMenu* folder_menu = nullptr; | 109 QMenu *folder_menu = nullptr; |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 #endif // MINORI_WINDOW_H_ | 112 #endif // MINORI_WINDOW_H_ |
