Gui: add ShortcutManager to unify shortcut handling

Support longest key sequence match with user defined delay (configurable
through 'Customize -> Keyboard -> Key sequence delay').

Support user defined priority to resolve shortcut conflict through
'Customize -> Keyboard')

Add 'All' category in 'Customize -> Keyboard' to list all command and
showing their shortcuts

Unify macro command shortcut setting (BaseApp/Preferences/Shortcut).
This commit is contained in:
Zheng, Lei
2022-02-28 15:32:49 +08:00
committed by wwmayer
parent 30fb0df729
commit 775452cbc0
17 changed files with 1782 additions and 763 deletions

View File

@@ -289,10 +289,13 @@ public:
const char* className() const override
{ return "StdCmdFreezeViews"; }
void setShortcut (const QString &) override;
QString getShortcut() const override;
protected:
void activated(int iMsg) override;
bool isActive() override;
Action * createAction() override;
Action * createAction(void) override;
void languageChange() override;
private:
@@ -356,6 +359,19 @@ Action * StdCmdFreezeViews::createAction()
return pcAction;
}
void StdCmdFreezeViews::setShortcut(const QString &shortcut)
{
if (freezeView)
freezeView->setShortcut(shortcut);
}
QString StdCmdFreezeViews::getShortcut() const
{
if (freezeView)
return freezeView->shortcut().toString();
return Command::getShortcut();
}
void StdCmdFreezeViews::activated(int iMsg)
{
auto pcAction = qobject_cast<ActionGroup*>(_pcAction);