};
+vector<string> engine_types_;
vector<pair<string, QString> > pagestyles;
this, SLOT(change_adaptor()));
connect(branchesModule, SIGNAL(renameBranches(docstring const &, docstring const &)),
this, SLOT(branchesRename(docstring const &, docstring const &)));
+ connect(branchesModule, SIGNAL(okPressed()), this, SLOT(slotOK()));
updateUnknownBranches();
}
+void GuiDocument::updateEngineType(string const & items, CiteEngineType const & sel)
+{
+ engine_types_.clear();
+
+ int nn = 0;
+
+ for (int n = 0; !token(items, '|', n).empty(); ++n) {
+ nn += 1;
+ string style = token(items, '|', n);
+ engine_types_.push_back(style);
+ }
+
+ switch (sel) {
+ case ENGINE_TYPE_AUTHORYEAR:
+ biblioModule->citeStyleCO->setCurrentIndex(0);
+ break;
+ case ENGINE_TYPE_NUMERICAL:
+ biblioModule->citeStyleCO->setCurrentIndex(1);
+ break;
+ }
+
+ biblioModule->citationStyleL->setEnabled(nn > 1);
+ biblioModule->citeStyleCO->setEnabled(nn > 1);
+
+ if (nn != 1)
+ return;
+
+ // If the textclass allows only one of authoryear or numerical,
+ // we have no choice but to force that engine type.
+ if (engine_types_[0] == "authoryear")
+ biblioModule->citeStyleCO->setCurrentIndex(0);
+ else
+ biblioModule->citeStyleCO->setCurrentIndex(1);
+}
+
+
namespace {
// FIXME unicode
// both of these should take a vector<docstring>
bp_.use_refstyle = latexModule->refstyleCB->isChecked();
// biblio
- bp_.setCiteEngine(ENGINE_BASIC);
-
if (biblioModule->citeNatbibRB->isChecked())
- bp_.setCiteEngine(ENGINE_NATBIB);
+ bp_.setCiteEngine("natbib");
else if (biblioModule->citeJurabibRB->isChecked())
- bp_.setCiteEngine(ENGINE_JURABIB);
+ bp_.setCiteEngine("jurabib");
+ else
+ bp_.setCiteEngine("basic");
if (biblioModule->citeStyleCO->currentIndex())
bp_.setCiteEngineType(ENGINE_TYPE_NUMERICAL);
latexModule->refstyleCB->setChecked(bp_.use_refstyle);
// biblio
+ string const cite_engine = bp_.citeEngine().list().front();
+
biblioModule->citeDefaultRB->setChecked(
- bp_.citeEngine() == ENGINE_BASIC);
+ cite_engine == "basic");
+
+ biblioModule->citeJurabibRB->setChecked(
+ cite_engine == "jurabib");
biblioModule->citeNatbibRB->setChecked(
- bp_.citeEngine() == ENGINE_NATBIB);
+ cite_engine == "natbib");
biblioModule->citeStyleCO->setCurrentIndex(
bp_.citeEngineType() == ENGINE_TYPE_NUMERICAL);
- biblioModule->citeJurabibRB->setChecked(
- bp_.citeEngine() == ENGINE_JURABIB);
+ updateEngineType(documentClass().opt_enginetype(),
+ bp_.citeEngineType());
biblioModule->bibtopicCB->setChecked(
bp_.use_bibtopic);
InsetListingsParams(bp_.listings_params).separatedParams();
listingsModule->listingsED->setPlainText(toqstr(lstparams));
- // Output
- // update combobox with formats
- updateDefaultFormat();
- int index = outputModule->defaultFormatCO->findData(toqstr(
- bp_.default_output_format));
- // set to default if format is not found
- if (index == -1)
- index = 0;
- outputModule->defaultFormatCO->setCurrentIndex(index);
+ // Fonts
bool const os_fonts_available =
bp_.baseClass()->outputType() == lyx::LATEX
&& LaTeXFeatures::isAvailable("fontspec");
fontModule->osFontsCB->setEnabled(os_fonts_available);
fontModule->osFontsCB->setChecked(
os_fonts_available && bp_.useNonTeXFonts);
-
- outputModule->outputsyncCB->setChecked(bp_.output_sync);
- outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
-
- outputModule->mathimgSB->setValue(bp_.html_math_img_scale);
- outputModule->mathoutCB->setCurrentIndex(bp_.html_math_output);
- outputModule->strictCB->setChecked(bp_.html_be_strict);
- outputModule->cssCB->setChecked(bp_.html_css_as_file);
-
- // Fonts
updateFontsize(documentClass().opt_fontsize(),
bp_.fontsize);
fontModule->fontencLE->setText(toqstr(bp_.fontenc));
}
+ // Output
+ // This must be set _after_ fonts since updateDefaultFormat()
+ // checks osFontsCB settings.
+ // update combobox with formats
+ updateDefaultFormat();
+ int index = outputModule->defaultFormatCO->findData(toqstr(
+ bp_.default_output_format));
+ // set to default if format is not found
+ if (index == -1)
+ index = 0;
+ outputModule->defaultFormatCO->setCurrentIndex(index);
+
+ outputModule->outputsyncCB->setChecked(bp_.output_sync);
+ outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
+
+ outputModule->mathimgSB->setValue(bp_.html_math_img_scale);
+ outputModule->mathoutCB->setCurrentIndex(bp_.html_math_output);
+ outputModule->strictCB->setChecked(bp_.html_be_strict);
+ outputModule->cssCB->setChecked(bp_.html_css_as_file);
+
// paper
bool const extern_geometry =
documentClass().provides("geometry");