}
if (enabled || !i.optional()) {
items_.push_back(i);
- items_.back().status().enabled(enabled);
+ items_.back().status().setEnabled(enabled);
}
}
else
{
if (!bv)
return;
- Cursor const & cur = bv->cursor();
- Buffer const & buf = bv->buffer();
set<string> grp;
- InsetGraphics::getGraphicsGroups(buf, grp);
- set<string>::const_iterator it = grp.begin();
- set<string>::const_iterator end = grp.end();
+ graphics::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<string>::const_iterator it = grp.begin();
+ set<string>::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)));
for (; cit != end; ++cit) {
addWithStatusCheck(MenuItem(MenuItem::Command,
qt_(cit->second.listName()),
- FuncRequest(LFUN_FLOAT_LIST,
+ FuncRequest(LFUN_FLOAT_LIST_INSERT,
cit->second.type())));
}
}
void MenuDefinition::expandToolbars()
{
- //
+ MenuDefinition other_lists;
// extracts the toolbars from the backend
Toolbars::Infos::const_iterator cit = guiApp->toolbars().begin();
Toolbars::Infos::const_iterator end = guiApp->toolbars().end();
-
for (; cit != end; ++cit) {
- QString label = qt_(cit->gui_name);
- // frontends are not supposed to turn on/off toolbars,
- // if they cannot update Toolbars::flags. That
- // is to say, ToolbarsBackend::flags should reflect
- // the true state of toolbars.
- //
- // menu is displayed as
- // on/off review
- // and
- // review (auto)
- // in the case of auto.
- if (cit->flags & ToolbarInfo::AUTO)
- label += qt_(" (auto)");
- add(MenuItem(MenuItem::Command, label,
- FuncRequest(LFUN_TOOLBAR_TOGGLE, cit->name + " allowauto")));
+ MenuItem const item(MenuItem::Command, qt_(cit->gui_name),
+ FuncRequest(LFUN_TOOLBAR_TOGGLE, cit->name));
+ if (guiApp->toolbars().isMainToolbar(cit->name))
+ add(item);
+ else
+ other_lists.add(item);
+ }
+
+ if (!other_lists.empty()) {
+ MenuItem item(MenuItem::Submenu, qt_("Other Toolbars"));
+ item.setSubmenu(other_lists);
+ add(item);
}
}