+ //
+ // extracts the toolbars from the backend
+ ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
+ ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
+
+ for (; cit != end; ++cit) {
+ docstring label = _(cit->gui_name);
+ // frontends are not supposed to turn on/off toolbars, if they cannot
+ // update ToolbarBackend::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 & ToolbarBackend::AUTO)
+ label += _(" (auto)");
+ tomenu.add(MenuItem(MenuItem::Command, label,
+ FuncRequest(LFUN_TOOLBAR_TOGGLE_STATE, cit->name)));
+ }
+}
+
+
+void expandBranches(Menu & tomenu, Buffer const * buf)
+{
+ if (!buf)