mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 18:43:37 +00:00
Better error message when try to bind a Hidden LFUN
This commit is contained in:
parent
eb8c5905f6
commit
1f2d7f4db9
@ -3163,6 +3163,15 @@ bool PrefShortcuts::validateNewShortcut(FuncRequest const & func,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// It is not currently possible to bind Hidden lfuns such as self-insert. In
|
||||||
|
// the future, to remove this limitation, see GuiPrefs::insertShortcutItem
|
||||||
|
// and how it is used in GuiPrefs::shortcutOkPressed.
|
||||||
|
if (lyxaction.getActionType(func.action()) == LyXAction::Hidden) {
|
||||||
|
Alert::error(_("Failed to create shortcut"),
|
||||||
|
_("This LyX function is hidden and cannot be bound."));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (k.length() == 0) {
|
if (k.length() == 0) {
|
||||||
Alert::error(_("Failed to create shortcut"),
|
Alert::error(_("Failed to create shortcut"),
|
||||||
_("Invalid or empty key sequence"));
|
_("Invalid or empty key sequence"));
|
||||||
@ -3227,9 +3236,6 @@ void PrefShortcuts::shortcutOkPressed()
|
|||||||
shortcutsTW->setCurrentItem(item);
|
shortcutsTW->setCurrentItem(item);
|
||||||
shortcutsTW->scrollToItem(item);
|
shortcutsTW->scrollToItem(item);
|
||||||
} else {
|
} else {
|
||||||
// FIXME: The error message could be more explicit. This can happen in
|
|
||||||
// particular if the user wants to introduce a LFUN which is Hidden such
|
|
||||||
// as self-insert.
|
|
||||||
Alert::error(_("Failed to create shortcut"),
|
Alert::error(_("Failed to create shortcut"),
|
||||||
_("Can not insert shortcut to the list"));
|
_("Can not insert shortcut to the list"));
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user