]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt4/GuiDocument.cpp
Basic support for natbib & jurabib options
[features.git] / src / frontends / qt4 / GuiDocument.cpp
index f7f00795ab6aafe198731a02259e0772767df9d4..20fbd02cf91735f76440a90eb78fd1619bb8d9e6 100644 (file)
@@ -2378,8 +2378,6 @@ void GuiDocument::updateEngineDependends()
        biblioModule->bibtopicCB->setEnabled(!biblatex);
 
        // These are only useful with Biblatex
-       biblioModule->citePackageOptionsLE->setEnabled(biblatex);
-       biblioModule->citePackageOptionsL->setEnabled(biblatex);
        biblioModule->biblatexBbxCO->setEnabled(biblatex);
        biblioModule->biblatexBbxLA->setEnabled(biblatex);
        biblioModule->biblatexCbxCO->setEnabled(biblatex);
@@ -2387,6 +2385,17 @@ void GuiDocument::updateEngineDependends()
        biblioModule->resetBbxPB->setEnabled(biblatex);
        biblioModule->resetCbxPB->setEnabled(biblatex);
        biblioModule->matchBbxPB->setEnabled(biblatex);
+
+       // These are useful with biblatex, jurabib and natbib
+       QString const engine =
+               biblioModule->citeEngineCO->itemData(
+                               biblioModule->citeEngineCO->currentIndex()).toString();
+       LyXCiteEngine const * ce = theCiteEnginesList[fromqstr(engine)];
+
+       bool const citepack = ce->requires("biblatex.sty") || ce->requires("jurabib.sty")
+                       || ce->requires("natbib.sty");
+       biblioModule->citePackageOptionsLE->setEnabled(citepack);
+       biblioModule->citePackageOptionsL->setEnabled(citepack);
 }
 
 
@@ -3758,14 +3767,13 @@ void GuiDocument::updateDefaultBiblio(string const & style,
 {
        QString const bibstyle = toqstr(style);
        biblioModule->defaultBiblioCO->clear();
-       biblioModule->biblatexBbxCO->clear();
-       biblioModule->biblatexCbxCO->clear();
 
        int item_nr = -1;
 
        if (isBiblatex()) {
                if (which != "cbx") {
                        // First the bbx styles
+                       biblioModule->biblatexBbxCO->clear();
                        QStringList str = texFileList("bbxFiles.lst");
                        // test whether we have a valid list, otherwise run rescan
                        if (str.isEmpty()) {
@@ -3797,6 +3805,7 @@ void GuiDocument::updateDefaultBiblio(string const & style,
 
                if (which != "bbx") {
                        // now the cbx styles
+                       biblioModule->biblatexCbxCO->clear();
                        QStringList str = texFileList("cbxFiles.lst");
                        // test whether we have a valid list, otherwise run rescan
                        if (str.isEmpty()) {
@@ -3826,6 +3835,8 @@ void GuiDocument::updateDefaultBiblio(string const & style,
                                biblioModule->biblatexCbxCO->clearEditText();
                }
        } else {// BibTeX
+               biblioModule->biblatexBbxCO->clear();
+               biblioModule->biblatexCbxCO->clear();
                QStringList str = texFileList("bstFiles.lst");
                // test whether we have a valid list, otherwise run rescan
                if (str.isEmpty()) {