#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();
for (int i = 0; i != bibfiles.count(); ++i)
add_->bibLW->addItem(changeExtension(bibfiles[i], ""));
- QString bibstyle = styleFile();
+ QString const bibstyle = styleFile();
bibtocCB->setChecked(bibtotoc() && !bibtopic);
bibtocCB->setEnabled(!bibtopic);
else if (bibtopic && btPrintCO->count() < 3)
btPrintCO->insertItem(1, qt_("all uncited references", 0));
- docstring btprint = params_["btprint"];
+ docstring const & btprint = params_["btprint"];
int btp = 0;
- if ((bibtopic && btprint == "btPrintNotCited") ||
- (!bibtopic && btprint == "btPrintAll"))
+ if ((bibtopic && btprint == from_ascii("btPrintNotCited")) ||
+ (!bibtopic && btprint == from_ascii("btPrintAll")))
btp = 1;
- else if (bibtopic && btprint == "btPrintAll")
+ else if (bibtopic && btprint == from_ascii("btPrintAll"))
btp = 2;
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 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().params().useBiblatex();
+}
+
+
QString GuiBibtex::styleFile() const
{
// the different bibtex packages have (and need) their