From 703eca76700970844831200834e1c619fc6bc6c4 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 26 May 2008 09:33:08 +0000 Subject: [PATCH] make display of group list only depend on existence of groups; move the addition of a separator to the ui file git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24941 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ui/stdcontext.inc | 1 + src/frontends/qt4/Menus.cpp | 16 +++++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index cf801ef70a..ef6ddba462 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -300,6 +300,7 @@ Menuset Item "Settings...|S" "next-inset-toggle" Separator Item "Edit externally...|x" "inset-edit" + Separator GraphicsGroups End diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index c8ee95464d..505167b805 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -639,21 +639,15 @@ void MenuDefinition::expandGraphicsGroups(BufferView const * bv) { if (!bv) return; - Cursor const & cur = bv->cursor(); - Buffer const & buf = bv->buffer(); set grp; - InsetGraphics::getGraphicsGroups(buf, grp); - set::const_iterator it = grp.begin(); - set::const_iterator end = grp.end(); + InsetGraphics::getGraphicsGroups(bv->buffer(), grp); if (grp.empty()) return; - InsetGraphics * ins = InsetGraphics::getCurrentGraphicsInset(cur); - if (!ins) - return; - add(MenuItem(MenuItem::Separator)); - if (!ins->getParams().groupId.empty()) - add(MenuItem(MenuItem::Command, qt_("Clear group"), FuncRequest(LFUN_SET_GRAPHICS_GROUP))); + set::const_iterator it = grp.begin(); + set::const_iterator end = grp.end(); + add(MenuItem(MenuItem::Command, qt_("No Group"), + FuncRequest(LFUN_SET_GRAPHICS_GROUP))); for (; it != end; it++) { addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(*it), FuncRequest(LFUN_SET_GRAPHICS_GROUP, *it))); -- 2.39.5