this, SLOT(encodingSwitched(int)));
connect(langModule->customEncodingCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
+ connect(langModule->noInputencCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
connect(langModule->quoteStyleCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor()));
connect(langModule->languagePackageCO, SIGNAL(activated(int)),
toqstr("auto-legacy"));
langModule->encodingCO->addItem(qt_("ASCII"), toqstr("ascii"));
langModule->encodingCO->addItem(qt_("Custom"), toqstr("custom"));
- // Always put the default encoding in the first position.
- langModule->customEncodingCO->addItem(qt_("Traditional (inputenc not loaded)"),
- toqstr("auto-legacy-plain"));
+
QMap<QString,QString> encodingmap;
for (auto const & encvar : encodings) {
if (!encvar.unsafe() && !encvar.guiName().empty())
langModule->encodingCO->itemData(
langModule->encodingCO->currentIndex()).toString() == "custom");
langModule->encodingCO->setEnabled(tex_fonts);
+ langModule->noInputencCB->setEnabled(tex_fonts
+ && langModule->encodingCO->currentIndex() < 2);
+ if (!tex_fonts)
+ langModule->noInputencCB->setChecked(false);
fontModule->fontsDefaultCO->setEnabled(tex_fonts);
fontModule->fontsDefaultLA->setEnabled(tex_fonts);
langModule->customEncodingCO->setEnabled(
!fontModule->osFontsCB->isChecked()
&& langModule->encodingCO->itemData(i).toString() == "custom");
+ langModule->noInputencCB->setEnabled(!fontModule->osFontsCB->isChecked()
+ && langModule->encodingCO->currentIndex() < 2);
+ if (!langModule->noInputencCB->isEnabled())
+ langModule->noInputencCB->setChecked(false);
+
}
else
bp_.inputenc = fromqstr(langModule->customEncodingCO->itemData(
langModule->customEncodingCO->currentIndex()).toString());
+ if (langModule->noInputencCB->isChecked()
+ && (encoding == "auto-legacy" || encoding == "utf8"))
+ bp_.inputenc += "-plain";
bp_.quotes_style = (InsetQuotesParams::QuoteStyle) langModule->quoteStyleCO->itemData(
langModule->quoteStyleCO->currentIndex()).toInt();
langModule->quoteStyleCO->findData(bp_.quotes_style));
langModule->dynamicQuotesCB->setChecked(bp_.dynamic_quotes);
- int p = langModule->encodingCO->findData(toqstr(bp_.inputenc));
+ QString inputenc = toqstr(bp_.inputenc);
+ bool plain = false;
+ if (inputenc.endsWith("-plain")) {
+ inputenc = inputenc.left(inputenc.lastIndexOf("-plain"));
+ plain = true;
+ }
+ langModule->noInputencCB->setChecked(plain);
+ int p = langModule->encodingCO->findData(inputenc);
if (p != -1)
langModule->encodingCO->setCurrentIndex(p);
else {
langModule->encodingCO->setCurrentIndex(
langModule->encodingCO->findData("custom"));
- p = langModule->customEncodingCO->findData(toqstr(bp_.inputenc));
+ p = langModule->customEncodingCO->findData(inputenc);
if (p != -1)
langModule->customEncodingCO->setCurrentIndex(p);
else
</item>
<item row="1" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="2">
+ <widget class="QComboBox" name="customEncodingCO">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>If you selected a custom output encoding to the left, yo can specifiy it here</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="languagePackageCO">
+ <property name="toolTip">
+ <string>Select which language package LyX should use</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="languagePackageLA">
+ <property name="text">
+ <string>Language pa&ckage:</string>
+ </property>
+ <property name="buddy">
+ <cstring>languagePackageCO</cstring>
+ </property>
+ </widget>
+ </item>
<item row="0" column="0">
<widget class="QLabel" name="encodingLA">
<property name="text">
</property>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QComboBox" name="customEncodingCO">
- <property name="enabled">
- <bool>false</bool>
- </property>
+ <item row="2" column="2">
+ <widget class="QLineEdit" name="languagePackageLE">
<property name="toolTip">
- <string>If you selected a custom output encoding to the left, yo can specifiy it here</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="languagePackageLA">
- <property name="text">
- <string>Language pa&ckage:</string>
- </property>
- <property name="buddy">
- <cstring>languagePackageCO</cstring>
+ <string>Enter the command to load the language package (default: \usepackage{babel})</string>
</property>
</widget>
</item>
<item row="1" column="1">
- <widget class="QComboBox" name="languagePackageCO">
+ <widget class="QCheckBox" name="noInputencCB">
<property name="toolTip">
- <string>Select which language package LyX should use</string>
+ <string>If this is checked, LyX does not load the inputenc LaTeX package</string>
</property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="languagePackageLE">
- <property name="toolTip">
- <string>Enter the command to load the language package (default: \usepackage{babel})</string>
+ <property name="text">
+ <string>Do not load &inputenc</string>
</property>
</widget>
</item>