7 #include <boost/optional.hpp> 8 #include <pajlada/signals/signal.hpp> 9 #include <pajlada/signals/signalholder.hpp> 26 using HotkeyMap = std::map<QString, HotkeyFunction>;
47 const std::optional<std::vector<QString>> &arguments = {})
const;
54 int replaceHotkey(QString oldName, std::shared_ptr<Hotkey> newHotkey);
66 [[nodiscard]]
bool isDuplicate(std::shared_ptr<Hotkey> hotkey,
86 [[nodiscard]]
const std::map<HotkeyCategory, HotkeyCategoryData>
110 void addDefaults(std::set<QString> &addedHotkeys);
115 void resetToDefaults();
120 void tryAddDefault(std::set<QString> &addedHotkeys,
HotkeyCategory category,
121 QKeySequence keySequence, QString action,
122 std::vector<QString> args, QString
name);
127 static void showHotkeyError(
const std::shared_ptr<Hotkey> &hotkey,
137 std::shared_ptr<Hotkey> findLike(
139 const std::optional<std::vector<QString>> &arguments = {})
const;
144 pajlada::Signals::SignalHolder signalHolder_;
146 const std::map<HotkeyCategory, HotkeyCategoryData> hotkeyCategories_ = {
pajlada::Signals::NoArgSignal onItemsUpdated
Definition: HotkeyController.hpp:89
Definition: SignalVector.hpp:21
int replaceHotkey(QString oldName, std::shared_ptr< Hotkey > newHotkey)
removes the hotkey with the oldName and inserts newHotkey at the end
Definition: HotkeyController.cpp:113
void save() override
Definition: HotkeyController.cpp:96
Definition: Singleton.hpp:10
HotkeyController()
Definition: HotkeyController.cpp:23
Definition: HotkeyModel.hpp:13
QString categoryName(HotkeyCategory category) const
Returns the name of the given hotkey category.
Definition: HotkeyController.cpp:177
Definition: Application.cpp:48
QKeySequence getDisplaySequence(HotkeyCategory category, const QString &action, const std::optional< std::vector< QString >> &arguments={}) const
returns a QKeySequence that perfoms the actions requested. Accepted if and only if the category match...
Definition: HotkeyController.cpp:551
QString categoryDisplayName(HotkeyCategory category) const
Returns the display name of the given hotkey category.
Definition: HotkeyController.cpp:163
std::map< QString, HotkeyFunction > HotkeyMap
Definition: HotkeyController.hpp:26
std::shared_ptr< Hotkey > getHotkeyByName(QString name)
Definition: HotkeyController.cpp:101
Definition: KeyboardSettingsPage.hpp:10
Definition: HotkeyController.hpp:22
HotkeyModel * createModel(QObject *parent)
Definition: HotkeyController.cpp:34
QString name
Definition: Credentials.cpp:94
bool isDuplicate(std::shared_ptr< Hotkey > hotkey, QString ignoreNamed)
checks if the hotkey is duplicate
Definition: HotkeyController.cpp:143
std::function< QString(std::vector< QString >)> HotkeyFunction
Definition: HotkeyController.hpp:25
const std::map< HotkeyCategory, HotkeyCategoryData > & categories() const
Definition: HotkeyController.cpp:192
std::vector< QShortcut * > shortcutsForCategory(HotkeyCategory category, HotkeyMap actionMap, QWidget *parent)
Definition: HotkeyController.cpp:41
boost::optional< HotkeyCategory > hotkeyCategoryFromName(QString categoryName)
Definition: HotkeyController.cpp:129
HotkeyCategory
Definition: HotkeyCategory.hpp:10