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:
Jean-Marc Lasgouttes 2008-10-31 11:19:16 +00:00
parent 53fdda3e7a
commit adf48d1f51
4 changed files with 9 additions and 7 deletions

View File

@ -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();
}

View File

@ -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)

View File

@ -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;

View File

@ -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;
}