mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix part of http://bugzilla.lyx.org/show_bug.cgi?id=5421
Make InsetInfo shortcuts use Portable representation of KeySequence. * KeyMap.cpp (printBindings): add format parameter * LyXFunc.cpp (sendDispatchMessage): * insets/InsetInfo.cpp (updateInfo): adapt. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27208 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
53fdda3e7a
commit
adf48d1f51
@ -397,7 +397,8 @@ void KeyMap::unbind(KeySequence * seq, FuncRequest const & func, unsigned int r)
|
||||
}
|
||||
|
||||
|
||||
docstring KeyMap::printBindings(FuncRequest const & func) const
|
||||
docstring KeyMap::printBindings(FuncRequest const & func,
|
||||
KeySequence::outputFormat format) const
|
||||
{
|
||||
Bindings bindings = findBindings(func);
|
||||
if (bindings.empty())
|
||||
@ -406,11 +407,11 @@ docstring KeyMap::printBindings(FuncRequest const & func) const
|
||||
odocstringstream res;
|
||||
Bindings::const_iterator cit = bindings.begin();
|
||||
Bindings::const_iterator cit_end = bindings.end();
|
||||
// prin the first item
|
||||
res << cit->print(KeySequence::ForGui);
|
||||
// print the first item
|
||||
res << cit->print(format);
|
||||
// more than one shortcuts?
|
||||
for (++cit; cit != cit_end; ++cit)
|
||||
res << ", " << cit->print(KeySequence::ForGui);
|
||||
res << ", " << cit->print(format);
|
||||
return res.str();
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,8 @@ public:
|
||||
Bindings findBindings(FuncRequest const & func) const;
|
||||
|
||||
/// Given an action, print the keybindings.
|
||||
docstring printBindings(FuncRequest const & func) const;
|
||||
docstring printBindings(FuncRequest const & func,
|
||||
KeySequence::outputFormat format) const;
|
||||
|
||||
struct Binding {
|
||||
Binding(FuncRequest const & r, KeySequence const & s, ItemType t)
|
||||
|
@ -1706,7 +1706,7 @@ void LyXFunc::sendDispatchMessage(docstring const & msg, FuncRequest const & cmd
|
||||
}
|
||||
}
|
||||
|
||||
docstring const shortcuts = theTopLevelKeymap().printBindings(cmd);
|
||||
docstring const shortcuts = theTopLevelKeymap().printBindings(cmd, KeySequence::ForGui);
|
||||
|
||||
if (!shortcuts.empty())
|
||||
comname += ": " + shortcuts;
|
||||
|
@ -288,7 +288,7 @@ void InsetInfo::updateInfo()
|
||||
setText(bindings.rbegin()->print(KeySequence::Portable),
|
||||
Font(getLayout().font()), false);
|
||||
else
|
||||
setText(theTopLevelKeymap().printBindings(func),
|
||||
setText(theTopLevelKeymap().printBindings(func, KeySequence::Portable),
|
||||
Font(getLayout().font()), false);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user