}
if (enabled || !i.optional()) {
items_.push_back(i);
- items_.back().status().enabled(enabled);
+ items_.back().status().setEnabled(enabled);
}
}
else
if (!bv)
return;
set<string> grp;
- InsetGraphics::getGraphicsGroups(bv->buffer(), grp);
+ graphics::getGraphicsGroups(bv->buffer(), grp);
if (grp.empty())
return;
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);
}
}