#include "Buffer.h"
#include "BufferParams.h"
+#include "CiteEnginesList.h"
#include "FuncRequest.h"
#include "LyXRC.h"
#include "qt_helpers.h"
this, SLOT(addPressed()));
connect(rescanPB, SIGNAL(clicked()),
this, SLOT(rescanClicked()));
+ connect(biblatexOptsLE, SIGNAL(textChanged(QString)),
+ this, SLOT(change_adaptor()));
add_ = new GuiBibtexAddDialog(this);
add_bc_.setPolicy(ButtonPolicy::OkCancelPolicy);
void GuiBibtex::updateContents()
{
bool bibtopic = usingBibtopic();
+ bool biblatex = usingBiblatex();
databaseLW->clear();
btPrintCO->setCurrentIndex(btp);
- styleCB->clear();
+ // Only useful for biblatex
+ biblatexOptsLA->setVisible(biblatex);
+ biblatexOptsLE->setVisible(biblatex);
- int item_nr = -1;
+ // only useful for BibTeX
+ styleCB->setVisible(!biblatex);
+ styleLA->setVisible(!biblatex);
+ stylePB->setVisible(!biblatex);
- QStringList const str = bibStyles();
- for (int i = 0; i != str.count(); ++i) {
- QString item = changeExtension(str[i], "");
- if (item == bibstyle)
- item_nr = i;
- styleCB->addItem(item);
- }
+ if (!biblatex) {
+ styleCB->clear();
- if (item_nr == -1 && !bibstyle.isEmpty()) {
- styleCB->addItem(bibstyle);
- item_nr = styleCB->count() - 1;
- }
+ int item_nr = -1;
- if (item_nr != -1)
- styleCB->setCurrentIndex(item_nr);
- else
- styleCB->clearEditText();
+ QStringList const str = bibStyles();
+ for (int i = 0; i != str.count(); ++i) {
+ QString item = changeExtension(str[i], "");
+ if (item == bibstyle)
+ item_nr = i;
+ styleCB->addItem(item);
+ }
+
+ if (item_nr == -1 && !bibstyle.isEmpty()) {
+ styleCB->addItem(bibstyle);
+ item_nr = styleCB->count() - 1;
+ }
+
+
+ if (item_nr != -1)
+ styleCB->setCurrentIndex(item_nr);
+ else
+ styleCB->clearEditText();
+ } else
+ biblatexOptsLE->setText(toqstr(params_["biblatexopts"]));
}
params_["options"] = bibstyle;
}
+ params_["biblatexopts"] = qstring_to_ucs4(biblatexOptsLE->text());
+
int btp = btPrintCO->currentIndex();
if (usingBibtopic()) {
void GuiBibtex::rescanBibStyles() const
{
- rescanTexStyles("bst bib");
+ if (usingBiblatex())
+ rescanTexStyles("bib");
+ else
+ rescanTexStyles("bst bib");
}
}
+bool GuiBibtex::usingBiblatex() const
+{
+ return buffer().masterBuffer()->params().useBiblatex();
+}
+
+
QString GuiBibtex::styleFile() const
{
// the different bibtex packages have (and need) their