this, SLOT(updateResetDefaultBiblio()));
connect(biblioModule->biblatexBbxCO, SIGNAL(activated(int)),
this, SLOT(biblioChanged()));
+ connect(biblioModule->biblatexBbxCO, SIGNAL(editTextChanged(QString)),
+ this, SLOT(biblioChanged()));
connect(biblioModule->biblatexBbxCO, SIGNAL(editTextChanged(QString)),
this, SLOT(updateResetDefaultBiblio()));
connect(biblioModule->biblatexCbxCO, SIGNAL(activated(int)),
this, SLOT(biblioChanged()));
+ connect(biblioModule->biblatexCbxCO, SIGNAL(editTextChanged(QString)),
+ this, SLOT(biblioChanged()));
connect(biblioModule->biblatexCbxCO, SIGNAL(editTextChanged(QString)),
this, SLOT(updateResetDefaultBiblio()));
connect(biblioModule->rescanBibliosPB, SIGNAL(clicked()),
}
+void GuiDocument::checkPossibleCiteEngines()
+{
+ // Check if the class provides a specific engine,
+ // and if so, enforce this.
+ string force_engine;
+ if (documentClass().provides("natbib")
+ || documentClass().provides("natbib-internal"))
+ force_engine = "natbib";
+ else if (documentClass().provides("jurabib"))
+ force_engine = "jurabib";
+ else if (documentClass().provides("biblatex"))
+ force_engine = "biblatex";
+ else if (documentClass().provides("biblatex-natbib"))
+ force_engine = "biblatex-natbib";
+
+ if (!force_engine.empty())
+ biblioModule->citeEngineCO->setCurrentIndex(
+ biblioModule->citeEngineCO->findData(toqstr(force_engine)));
+ biblioModule->citeEngineCO->setEnabled(force_engine.empty());
+}
+
+
void GuiDocument::rescanBibFiles()
{
if (isBiblatex())
updateEngineType(documentClass().opt_enginetype(),
bp_.citeEngineType());
+ checkPossibleCiteEngines();
+
biblioModule->citeStyleCO->setCurrentIndex(
biblioModule->citeStyleCO->findData(bp_.citeEngineType()));
biblioModule->citeEngineCO->itemData(
biblioModule->citeEngineCO->currentIndex()).toString();
+ // this can happen if the cite engine is unknown, which can happen
+ // if one is using a file that came from someone else, etc. in that
+ // case, we crash if we proceed.
+ if (engine.isEmpty())
+ return false;
+
return theCiteEnginesList[fromqstr(engine)]->getCiteFramework() == "biblatex";
}
// We need a non-const buffer object.
Buffer & buf = const_cast<BufferView *>(bufferview())->buffer();
// There may be several undo records; group them (bug #8998)
- buf.undo().beginUndoGroup();
+ // This handles undo groups automagically
+ UndoGroupHelper ugh(&buf);
// This must come first so that a language change is correctly noticed
setLanguage();
// If we used an LFUN, we would not need these two lines:
BufferView * bv = const_cast<BufferView *>(bufferview());
bv->processUpdateFlags(Update::Force | Update::FitCursor);
-
- // Don't forget to close the group. Note that it is important
- // to check that there is no early return in the method.
- buf.undo().endUndoGroup();
}