+ case MenuItem::ViewFormats:
+ formats = Exporter::GetExportableFormats(*view->buffer(), true);
+ action = LFUN_PREVIEW;
+ break;
+ case MenuItem::UpdateFormats:
+ formats = Exporter::GetExportableFormats(*view->buffer(), true);
+ action = LFUN_UPDATE;
+ break;
+ default:
+ formats = Exporter::GetExportableFormats(*view->buffer(), false);
+ action = LFUN_EXPORT;
+ }
+ sort(formats.begin(), formats.end(), compare_format());
+
+ Formats::const_iterator fit = formats.begin();
+ Formats::const_iterator end = formats.end();
+ for (; fit != end ; ++fit) {
+ if ((*fit)->dummy())
+ continue;
+ string label = (*fit)->prettyname();
+ // we need to hide the default graphic export formats
+ // from the external menu, because we need them only
+ // for the internal lyx-view and external latex run
+ if (label == "EPS" || label == "XPM" || label == "PNG")
+ continue;
+
+ if (kind == MenuItem::ImportFormats) {
+ if ((*fit)->name() == "text")
+ label = _("Plain Text as Lines");
+ else if ((*fit)->name() == "textparagraph")
+ label = _("Plain Text as Paragraphs");
+ label += "...";
+ }
+ if (!(*fit)->shortcut().empty())
+ label += '|' + (*fit)->shortcut();
+
+ tomenu.add(MenuItem(MenuItem::Command, label,
+ FuncRequest(action, (*fit)->name())),
+ view);
+ }
+}
+
+
+void expandFloatListInsert(Menu & tomenu, LyXView const * view)
+{
+ if (!view->buffer()) {
+ tomenu.add(MenuItem(MenuItem::Command,
+ _("No Documents Open!"),
+ FuncRequest(LFUN_NOACTION)),
+ view);
+ return;
+ }
+
+ FloatList const & floats =
+ view->buffer()->params().getLyXTextClass().floats();
+ FloatList::const_iterator cit = floats.begin();
+ FloatList::const_iterator end = floats.end();
+ for (; cit != end; ++cit) {
+ tomenu.add(MenuItem(MenuItem::Command,
+ _(cit->second.listName()),
+ FuncRequest(LFUN_FLOAT_LIST,
+ cit->second.type())),
+ view);
+ }
+}
+
+
+void expandFloatInsert(Menu & tomenu, LyXView const * view)
+{
+ if (!view->buffer()) {
+ tomenu.add(MenuItem(MenuItem::Command,
+ _("No Documents Open!"),
+ FuncRequest(LFUN_NOACTION)),
+ view);
+ return;
+ }
+
+ FloatList const & floats =
+ view->buffer()->params().getLyXTextClass().floats();
+ FloatList::const_iterator cit = floats.begin();
+ FloatList::const_iterator end = floats.end();
+ for (; cit != end; ++cit) {
+ // normal float
+ string const label = _(cit->second.name());
+ tomenu.add(MenuItem(MenuItem::Command, label,
+ FuncRequest(LFUN_INSET_FLOAT,
+ cit->second.type())),
+ view);
+ }
+}