X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FMenuBackend.cpp;h=05aa0b461de1e5833d62a5567ca3ff43d18f251b;hb=0362c6aae73c293d1c20277c12d362acfe0b2ef6;hp=5426b218b48d2f04cfd1dd35b1e244d1c5eb0b40;hpb=cdb78de5253dc8921cac903d94899e98181e9d2c;p=lyx.git diff --git a/src/MenuBackend.cpp b/src/MenuBackend.cpp index 5426b218b4..05aa0b461d 100644 --- a/src/MenuBackend.cpp +++ b/src/MenuBackend.cpp @@ -23,11 +23,9 @@ #include "BufferParams.h" #include "Converter.h" #include "CutAndPaste.h" -#include "support/debug.h" #include "Floating.h" #include "FloatList.h" #include "Format.h" -#include "support/gettext.h" #include "KeyMap.h" #include "Session.h" #include "LyXAction.h" @@ -41,9 +39,11 @@ #include "frontends/Application.h" +#include "support/convert.h" +#include "support/debug.h" #include "support/filetools.h" +#include "support/gettext.h" #include "support/lstrings.h" -#include "support/convert.h" #include @@ -549,6 +549,7 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, Buffer const * buf) if ((*fit)->dummy()) continue; docstring label = from_utf8((*fit)->prettyname()); + docstring const shortcut = from_utf8((*fit)->shortcut()); switch (kind) { case MenuItem::ImportFormats: @@ -570,8 +571,13 @@ void expandFormats(MenuItem::Kind kind, Menu & tomenu, Buffer const * buf) BOOST_ASSERT(false); break; } - if (!(*fit)->shortcut().empty()) - label += char_type('|') + from_utf8((*fit)->shortcut()); + // FIXME: if we had proper support for translating the + // format names defined in configure.py, there would + // not be a need to check whether the shortcut is + // correct. If we add it uncondiitonally, it would + // create useless warnings on bad shortcuts + if (!shortcut.empty() && contains(label, shortcut)) + label += char_type('|') + shortcut; if (buf) tomenu.addWithStatusCheck(MenuItem(MenuItem::Command, label, @@ -593,7 +599,7 @@ void expandFloatListInsert(Menu & tomenu, Buffer const * buf) } FloatList const & floats = - buf->params().getTextClass().floats(); + buf->params().textClass().floats(); FloatList::const_iterator cit = floats.begin(); FloatList::const_iterator end = floats.end(); for (; cit != end; ++cit) { @@ -615,7 +621,7 @@ void expandFloatInsert(Menu & tomenu, Buffer const * buf) } FloatList const & floats = - buf->params().getTextClass().floats(); + buf->params().textClass().floats(); FloatList::const_iterator cit = floats.begin(); FloatList::const_iterator end = floats.end(); for (; cit != end; ++cit) { @@ -636,13 +642,13 @@ void expandFlexInsert(Menu & tomenu, Buffer const * buf, string s) FuncRequest(LFUN_NOACTION))); return; } - InsetLayouts const & insetlayouts = - buf->params().getTextClass().insetlayouts(); - InsetLayouts::const_iterator cit = insetlayouts.begin(); - InsetLayouts::const_iterator end = insetlayouts.end(); + InsetLayouts const & insetLayouts = + buf->params().textClass().insetLayouts(); + InsetLayouts::const_iterator cit = insetLayouts.begin(); + InsetLayouts::const_iterator end = insetLayouts.end(); for (; cit != end; ++cit) { docstring const label = cit->first; - if (cit->second.lyxtype == s) + if (cit->second.lyxtype() == s) tomenu.addWithStatusCheck(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_FLEX_INSERT, label))); @@ -737,7 +743,7 @@ void expandToc(Menu & tomenu, Buffer const * buf) tomenu.add(MenuItem(MenuItem::Command, _("Master Document"), f)); } - FloatList const & floatlist = buf->params().getTextClass().floats(); + FloatList const & floatlist = buf->params().textClass().floats(); TocList const & toc_list = buf->tocBackend().tocs(); TocList::const_iterator cit = toc_list.begin(); TocList::const_iterator end = toc_list.end(); @@ -762,8 +768,18 @@ void expandToc(Menu & tomenu, Buffer const * buf) label = _(floatName); // BUG3633: listings is not a proper float so its name // is not shown in floatlist. + else if (cit->first == "equation") + label = _("List of Equations"); + else if (cit->first == "index") + label = _("List of Indexes"); else if (cit->first == "listing") - label = _("List of listings"); + label = _("List of Listings"); + else if (cit->first == "marginalnote") + label = _("List of Marginal notes"); + else if (cit->first == "note") + label = _("List of Notes"); + else if (cit->first == "footnote") + label = _("List of Foot notes"); // this should not happen now, but if something else like // listings is added later, this can avoid an empty menu name. else