fontModule->fontsizeCO->addItem(qt_("11"));
fontModule->fontsizeCO->addItem(qt_("12"));
- fontModule->fontencCO->addItem(qt_("Global Default"), QString("global"));
+ fontModule->fontencCO->addItem(qt_("Default"), QString("global"));
fontModule->fontencCO->addItem(qt_("Custom"), QString("custom"));
- fontModule->fontencCO->addItem(qt_("TeX default (OT1, no fontenc)"), QString("default"));
- fontModule->fontencCO->setToolTip(
- qt_("Select LaTeX font encoding(s).\n"
- "The standard [Global Default] is "
- "\"T1 via 'fontenc' package\" (see Tools>Preferences>Output>LaTeX).\n"
- "Notes:\n"
- "TeX's default fonts (Computer Modern) are not available "
- "in T1 encoding, Latin Modern is the recommended lookalike.\n"
- "Font encodings for Greek and Cyrillic are automatically added if required."
- ));
+ fontModule->fontencCO->addItem(qt_("None (no fontenc)"), QString("default"));
for (int n = 0; GuiDocument::fontfamilies_gui[n][0]; ++n)
fontModule->fontsDefaultCO->addItem(
this, SLOT(change_adaptor()));
connect(langModule->languagePackageCO, SIGNAL(currentIndexChanged(int)),
this, SLOT(languagePackageChanged(int)));
+ connect(langModule->dynamicQuotesCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
langModule->languagePackageLE->setValidator(new NoNewLineValidator(
langModule->languagePackageLE));
encodinglist.sort();
langModule->encodingCO->addItems(encodinglist);
- langModule->quoteStyleCO->addItem(
- qt_("``text''"),InsetQuotes::EnglishQuotes);
- langModule->quoteStyleCO->addItem(
- qt_("''text''"), InsetQuotes::SwedishQuotes);
- langModule->quoteStyleCO->addItem
- (qt_(",,text``"), InsetQuotes::GermanQuotes);
- langModule->quoteStyleCO->addItem(
- qt_(",,text''"), InsetQuotes::PolishQuotes);
- langModule->quoteStyleCO->addItem(
- qt_("<<text>>"), InsetQuotes::FrenchQuotes);
- langModule->quoteStyleCO->addItem(
- qt_(">>text<<"), InsetQuotes::DanishQuotes);
-
langModule->languagePackageCO->addItem(
qt_("Default"), toqstr("default"));
langModule->languagePackageCO->addItem(
}
-void GuiDocument::on_bufferViewChanged()
+void GuiDocument::onBufferViewChanged()
{
if (isVisibleView())
initialiseParams("");
}
+void GuiDocument::updateQuoteStyles(bool const set)
+{
+ Language const * lang = lyx::languages.getLanguage(
+ fromqstr(langModule->languageCO->itemData(
+ langModule->languageCO->currentIndex()).toString()));
+
+ InsetQuotesParams::QuoteStyle def = bp_.getQuoteStyle(lang->quoteStyle());
+
+ langModule->quoteStyleCO->clear();
+
+ bool has_default = false;
+ for (int i = 0; i < quoteparams.stylescount(); ++i) {
+ InsetQuotesParams::QuoteStyle qs = InsetQuotesParams::QuoteStyle(i);
+ if (qs == InsetQuotesParams::DynamicQuotes)
+ continue;
+ bool const langdef = (qs == def);
+ if (langdef) {
+ // add the default style on top
+ langModule->quoteStyleCO->insertItem(0,
+ toqstr(quoteparams.getGuiLabel(qs, langdef)), qs);
+ has_default = true;
+ }
+ else
+ langModule->quoteStyleCO->addItem(
+ toqstr(quoteparams.getGuiLabel(qs, langdef)), qs);
+ }
+ if (set && has_default)
+ // (re)set to the default style
+ langModule->quoteStyleCO->setCurrentIndex(0);
+}
+
+
void GuiDocument::languageChanged(int i)
{
// some languages only work with polyglossia
}
// set appropriate quotation mark style
- if (!lang->quoteStyle().empty()) {
- langModule->quoteStyleCO->setCurrentIndex(
- bp_.getQuoteStyle(lang->quoteStyle()));
- }
+ updateQuoteStyles(true);
}
}
}
- bp_.quotes_language = (InsetQuotes::QuoteLanguage) langModule->quoteStyleCO->itemData(
+ bp_.quotes_style = (InsetQuotesParams::QuoteStyle) langModule->quoteStyleCO->itemData(
langModule->quoteStyleCO->currentIndex()).toInt();
+ bp_.dynamic_quotes = langModule->dynamicQuotesCB->isChecked();
QString const langname = langModule->languageCO->itemData(
langModule->languageCO->currentIndex()).toString();
biblioChanged_ = false;
// indices
- // We may be called when there is no Buffer, e.g., when
+ // We may be called when there is no Buffer, e.g., when
// the last view has just been closed.
bool const isReadOnly = isBufferAvailable() ? buffer().isReadonly() : false;
indicesModule->update(bp_, isReadOnly);
bp_.language->lang()));
langModule->languageCO->setCurrentIndex(pos);
+ updateQuoteStyles();
+
langModule->quoteStyleCO->setCurrentIndex(
- bp_.quotes_language);
+ langModule->quoteStyleCO->findData(bp_.quotes_style));
+ langModule->dynamicQuotesCB->setChecked(bp_.dynamic_quotes);
bool default_enc = true;
if (bp_.inputenc != "auto") {
toqstr(bp_.fonts_cjk));
else
fontModule->cjkFontLE->setText(QString());
-
+
fontModule->microtypeCB->setChecked(bp_.use_microtype);
fontModule->fontScCB->setChecked(bp_.fonts_expert_sc);