+ params_["options"] = bibstyle;
+ }
+
+ int btp = btPrintCO->currentIndex();
+
+ if (usingBibtopic()) {
+ // bibtopic allows three kinds of sections:
+ // 1. sections that include all cited references of the database(s)
+ // 2. sections that include all uncited references of the database(s)
+ // 3. sections that include all references of the database(s), cited or not
+ switch (btp) {
+ case 0:
+ params_["btprint"] = from_ascii("btPrintCited");
+ break;
+ case 1:
+ params_["btprint"] = from_ascii("btPrintNotCited");
+ break;
+ case 2:
+ params_["btprint"] = from_ascii("btPrintAll");
+ break;
+ }
+ } else {
+ switch (btp) {
+ case 0:
+ params_["btprint"] = docstring();
+ break;
+ case 1:
+ // use \nocite{*}
+ params_["btprint"] = from_ascii("btPrintAll");
+ break;
+ }
+ }
+}
+
+
+bool GuiBibtex::isValid()
+{
+ return databaseLW->count() != 0;
+}
+
+
+QString GuiBibtex::browseBib(QString const & in_name) const
+{
+ QString const label1 = qt_("Documents|#o#O");
+ QString const dir1 = toqstr(lyxrc.document_path);
+ QStringList const filter(qt_("BibTeX Databases (*.bib)"));
+ return browseRelFile(in_name, bufferFilePath(),
+ qt_("Select a BibTeX database to add"), filter, false, label1, dir1);
+}
+
+
+QString GuiBibtex::browseBst(QString const & in_name) const
+{
+ QString const label1 = qt_("Documents|#o#O");
+ QString const dir1 = toqstr(lyxrc.document_path);
+ QStringList const filter(qt_("BibTeX Styles (*.bst)"));
+ return browseRelFile(in_name, bufferFilePath(),
+ qt_("Select a BibTeX style"), filter, false, label1, dir1);
+}
+
+
+QStringList GuiBibtex::bibStyles() const
+{
+ QStringList data = texFileList("bstFiles.lst");
+ // test whether we have a valid list, otherwise run rescan
+ if (data.isEmpty()) {
+ rescanBibStyles();
+ data = texFileList("bstFiles.lst");
+ }
+ for (int i = 0; i != data.size(); ++i)
+ data[i] = onlyFileName(data[i]);
+ // sort on filename only (no path)
+ data.sort();
+ return data;
+}
+
+
+QStringList GuiBibtex::bibFiles() const
+{
+ QStringList data = texFileList("bibFiles.lst");
+ // test whether we have a valid list, otherwise run rescan
+ if (data.isEmpty()) {
+ rescanBibStyles();
+ data = texFileList("bibFiles.lst");