Fix bug #9898: inset info cannot show specified icon

This commit is contained in:
Enrico Forestieri 2015-12-11 08:51:37 +01:00
parent 5fb0b17f02
commit b6880470b3
2 changed files with 12 additions and 3 deletions

View File

@ -169,12 +169,20 @@ bool InsetInfo::validateModifyArgument(docstring const & arg) const
case SHORTCUT_INFO:
case SHORTCUTS_INFO:
case MENU_INFO:
case ICON_INFO: {
case MENU_INFO: {
FuncRequest func = lyxaction.lookupFunc(name);
return func.action() != LFUN_UNKNOWN_ACTION;
}
case ICON_INFO: {
FuncCode const action = lyxaction.lookupFunc(name).action();
if (action == LFUN_UNKNOWN_ACTION) {
string dir = "images";
return !imageLibFileSearch(dir, name, "svgz,png").empty();
}
return true;
}
case LYXRC_INFO: {
ostringstream oss;
lyxrc.write(oss, true, name);

View File

@ -56,7 +56,8 @@ menu: argument is the name of the LFUN such as "paste". The syntax is the same
icon: argument is the name of the LFUN such as "paste". The syntax is the same
as what is used in the bind and ui files. The output is the icon use in
the toolbar for this LFUN.
the toolbar for this LFUN. Alternatively, argument can be the icon path
without extension specified with respect to the images directory.
buffer: argument can be one of "name", "path", "class". This inset output the
filename, path, and textclass of this buffer.