]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #9898: inset info cannot show specified icon
authorEnrico Forestieri <forenr@lyx.org>
Fri, 11 Dec 2015 07:51:37 +0000 (08:51 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Fri, 11 Dec 2015 07:51:37 +0000 (08:51 +0100)
src/insets/InsetInfo.cpp
src/insets/InsetInfo.h

index 6e21d9b3231bef0b9afa09df56c3ecae122f8239..2f26c971f864b8293b3d146e59fb038d21775f23 100644 (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);
index 66f6a8634a7da29a29199d6f9d4b5abaf89a302d..12932025b08e57cb098305b68134ed37a86fea94 100644 (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.