docstring const & after = citinset->getParam("after");
size_t const n = cmd.size();
- bool const force = cmd[0] == 'C';
- bool const full = cmd[n] == '*';
+ bool const force = isUpperCase(cmd[0]);
+ bool const star = cmd[n] == '*';
vector<docstring> const keys = getVectorFromString(key);
docstring label = *cit;
CitationStyle cs = citeStyleList[ii - 1];
cs.forceUpperCase &= force;
- cs.fullAuthorList &= full;
+ cs.hasStarredVersion &= star;
addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(label),
FuncRequest(LFUN_INSET_MODIFY,
"changetype " + from_utf8(citationStyleToString(cs)))));
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));
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)));
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);
+ }
}