diff options
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; }; |