diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-09-30 08:37:38 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-09-30 08:37:38 -0500 |
commit | a6b4485ac5ea0673e0ce35dab14e2df26c27823e (patch) | |
tree | d46f099858ae81622be1e7a6f7b5bd47d4c1cf27 /src/config.hpp | |
parent | 6f2b61b676a16482fdac70a58a8e875c4d68e713 (diff) |
More setup to configurable controls.
Diffstat (limited to 'src/config.hpp')
-rw-r--r-- | src/config.hpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/config.hpp b/src/config.hpp index 81da2dc..95df6b6 100644 --- a/src/config.hpp +++ b/src/config.hpp @@ -3,6 +3,7 @@ #include <QtWidgets> #include <fud_status.hpp> +#include <fud_result.hpp> #include <map> #include <optional> #include <qkeysequence.h> @@ -69,6 +70,7 @@ using ShortcutMap = std::map<ActionType, ShortcutSet>; using ShortcutRevMap = std::map<QKeySequence, ActionType>; ShortcutSet shortcutSetFromList(const ShortcutList& shortcutList); +ShortcutList shortcutListFromSet(const ShortcutSet& shortcutList); class Shortcuts { public: @@ -91,12 +93,18 @@ class Shortcuts { const ShortcutMap& shortcutMap() const; + static ShortcutMap fromUserConfig(const std::filesystem::path& configFileName); + private: + Shortcuts() = default; + + static Shortcuts fromLuaConfig(const std::filesystem::path& configFileName); + bool m_valid{false}; - ShortcutMap m_actionToShortcuts; - ShortcutSet m_shortcuts; - ShortcutRevMap m_shortcutToAction; + ShortcutMap m_actionToShortcuts{}; + ShortcutSet m_shortcuts{}; + ShortcutRevMap m_shortcutToAction{}; }; struct GetsuyomiConfig { @@ -114,6 +122,10 @@ struct GetsuyomiConfig { ShortcutList nextShortcuts{}; ShortcutList backShortcuts{}; + ShortcutList singlePageShortcuts{}; + ShortcutList dualPageShortcuts{}; + ShortcutList mangaPageShortcuts{}; + ShortcutMap shortcuts() const; }; |