From 0e648c7c62944cd81aa57f10ac01cdabe2f2b7e0 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Sun, 29 Sep 2024 09:28:28 -0500 Subject: Remember various settings. --- src/main_window.hpp | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'src/main_window.hpp') 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 +#include 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(); }; -- cgit v1.2.3