]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Menus.cpp
Show Biblatex files in the TeXInfo dialog
[lyx.git] / src / frontends / qt4 / Menus.cpp
index 1100dd30e36a057dd4ffa72cabcb91c6a5974263..81ce5764ae7e839c281452da9883e378cbb20fd4 100644 (file)
@@ -1687,10 +1687,52 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
        MenuDefinition fqs;
        MenuDefinition iqs;
        MenuDefinition rqs;
+       MenuDefinition jqs;
+       MenuDefinition kqs;
+       MenuDefinition xqs;
+       InsetQuotesParams::QuoteStyle globalqs =
+                       bv->buffer().masterBuffer()->params().quotes_style;
+       FuncRequest cmd = FuncRequest(LFUN_INSET_MODIFY, from_ascii("changetype xld"));
+       docstring desc = bformat(_("%1$stext (dynamic)"),
+                                docstring(1, quoteparams.getQuoteChar(globalqs,
+                                                                      InsetQuotesParams::PrimaryQuotes,
+                                                                      InsetQuotesParams::OpeningQuote)));
+       if (prefixIs(qtype, "x"))
+               add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+       else
+               xqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+       cmd = FuncRequest(LFUN_INSET_MODIFY, from_ascii("changetype xls"));
+       desc = bformat(_("%1$stext (dynamic)"),
+                      docstring(1, quoteparams.getQuoteChar(globalqs, 
+                                                            InsetQuotesParams::SecondaryQuotes,
+                                                            InsetQuotesParams::OpeningQuote)));
+       if (prefixIs(qtype, "x"))
+               add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+       else
+               xqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+       cmd = FuncRequest(LFUN_INSET_MODIFY, from_ascii("changetype xrd"));
+       desc = bformat(_("text%1$s (dynamic)"),
+                      docstring(1, quoteparams.getQuoteChar(globalqs,
+                                                            InsetQuotesParams::PrimaryQuotes,
+                                                            InsetQuotesParams::ClosingQuote)));
+       if (prefixIs(qtype, "x"))
+               add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+       else
+               xqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+       cmd = FuncRequest(LFUN_INSET_MODIFY, from_ascii("changetype xrs"));
+       desc = bformat(_("text%1$s (dynamic)"),
+                      docstring(1, quoteparams.getQuoteChar(globalqs,
+                                                            InsetQuotesParams::SecondaryQuotes,
+                                                            InsetQuotesParams::ClosingQuote)));
+       if (prefixIs(qtype, "x"))
+               add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+       else
+               xqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+
        for (; qq != end; ++qq) {
                docstring const style = from_ascii(qq->first);
-               FuncRequest const cmd = FuncRequest(LFUN_INSET_MODIFY, from_ascii("changetype ") + style);
-               docstring const desc = contains(style, 'l') ? 
+               cmd = FuncRequest(LFUN_INSET_MODIFY, from_ascii("changetype ") + style);
+               desc = contains(style, 'l') ? 
                        bformat(_("%1$stext"), qq->second) : bformat(_("text%1$s"), qq->second);
                if (prefixIs(style, qtype[0]))
                        add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
@@ -1718,8 +1760,17 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
                        iqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
                else if (prefixIs(style, 'r') && !prefixIs(qtype, "r"))
                        rqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+               else if (prefixIs(style, 'j') && !prefixIs(qtype, "j"))
+                       jqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
+               else if (prefixIs(style, 'k') && !prefixIs(qtype, "k"))
+                       kqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
        }
 
+       if (!xqs.empty()) {
+               MenuItem item(MenuItem::Submenu, qt_("Dynamic Quotation Marks"));
+               item.setSubmenu(xqs);
+               add(item);
+       }
        if (!eqs.empty()) {
                MenuItem item(MenuItem::Submenu,
                              toqstr(quoteparams.getGuiLabel(InsetQuotesParams::EnglishQuotes)));
@@ -1792,6 +1843,18 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
                item.setSubmenu(rqs);
                add(item);
        }
+       if (!jqs.empty()) {
+               MenuItem item(MenuItem::Submenu,
+                             toqstr(quoteparams.getGuiLabel(InsetQuotesParams::CJKQuotes)));
+               item.setSubmenu(jqs);
+               add(item);
+       }
+       if (!kqs.empty()) {
+               MenuItem item(MenuItem::Submenu,
+                             toqstr(quoteparams.getGuiLabel(InsetQuotesParams::CJKAngleQuotes)));
+               item.setSubmenu(kqs);
+               add(item);
+       }
 }