diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-09-29 09:28:28 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-09-29 09:28:28 -0500 |
commit | 0e648c7c62944cd81aa57f10ac01cdabe2f2b7e0 (patch) | |
tree | a2a0912e33e7a18f6c9e32e5e4b5fb0a4ba622bc /src/main_window.hpp | |
parent | fa4b4097d3283e1d6e6376c70910e245f0b1f6ec (diff) |
Remember various settings.
Diffstat (limited to 'src/main_window.hpp')
-rw-r--r-- | src/main_window.hpp | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/src/main_window.hpp b/src/main_window.hpp index bc23b01..de1cb28 100644 --- a/src/main_window.hpp +++ b/src/main_window.hpp @@ -5,10 +5,14 @@ #include "getsuyomi.hpp" #include <QtWidgets> +#include <fud_status.hpp> namespace getsuyomi { -constexpr const char* AppName = "GetsuYomi"; +constexpr const char* AppVendor = "libfud"; + +constexpr const char* AppName = "getsuyomi"; + constexpr const char* AppVersionString = "1.0.0"; class GetsuyomiApp : public QMainWindow { @@ -16,29 +20,44 @@ class GetsuyomiApp : public QMainWindow { public: GetsuyomiApp(); + ~GetsuyomiApp() = default; + GetsuyomiApp(const GetsuyomiApp&) = delete; + GetsuyomiApp(GetsuyomiApp&&) = delete; + GetsuyomiApp& operator=(const GetsuyomiApp&) = delete; + GetsuyomiApp& operator=(GetsuyomiApp&&) = delete; + + fud::FudStatus setup(); private: - void setup(); + /* Private methods */ void createActions(); void createMenus(); void createToolBar(); - Getsuyomi* m_getsuyomi; + /* Private data */ + Getsuyomi* m_getsuyomi{nullptr}; - QAction* m_openFile; - QAction* m_openDirectory; - QAction* m_quitAction; - QAction* m_nextAction; - QAction* m_backAction; + QAction* m_openFile{nullptr}; + QAction* m_openDirectory{nullptr}; + QAction* m_quitAction{nullptr}; + QAction* m_nextAction{nullptr}; + QAction* m_backAction{nullptr}; - QMenu* m_menuBar; - QToolBar* m_toolBar; + QMenu* m_menuBar{nullptr}; + QToolBar* m_toolBar{nullptr}; + + QSettings* m_qtSettings{nullptr}; + QString m_lastOpenedDirectory{}; private slots: void openFile(); void openDirectory(); void quit(); + void readSettings(); + void writeSettings(); + void closeEvent(QCloseEvent* event) override; + void next(); void back(); }; |