]> git.lyx.org Git - features.git/commitdiff
Disable custom insets insert menu if read only
authorScott Kostyshak <skostysh@lyx.org>
Wed, 19 Feb 2014 21:58:29 +0000 (16:58 -0500)
committerScott Kostyshak <skostysh@lyx.org>
Mon, 28 Jul 2014 16:59:34 +0000 (12:59 -0400)
Before, if a document was read only and had no custom insets
defined, the submenu would be enabled.

src/frontends/qt4/Menus.cpp

index 7fa219b394d93d3bfc5a3b53b3f54f8c87c7b9b2..eaf9f249174af12f7d3f5c41587094261184174f 100644 (file)
@@ -1214,7 +1214,7 @@ void MenuDefinition::expandFlexInsert(
                }
        }
        // FIXME This is a little clunky.
-       if (items_.empty() && type == InsetLayout::CUSTOM)
+       if (items_.empty() && type == InsetLayout::CUSTOM && !buf->isReadonly())
                add(MenuItem(MenuItem::Help, qt_("No Custom Insets Defined!")));
 }