mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Properly support the cite engines in the GUI
Instead of hardcoding 3 engines, we now support all engines which are defined in the *.citeengines files.
This commit is contained in:
parent
0e6a3ac404
commit
8e4bd6a497
@ -1,6 +1,7 @@
|
|||||||
# \DeclareLyXCiteEngine{BibTeX (basic)}
|
# \DeclareLyXCiteEngine{Basic (BibTeX)}
|
||||||
# DescriptionBegin
|
# DescriptionBegin
|
||||||
# Use the basic citation capabilities provided by plain LaTeX.
|
# The basic citation capabilities provided by BibTeX.
|
||||||
|
# Mainly simple numeric styles primarily suitable for science and maths.
|
||||||
# DescriptionEnd
|
# DescriptionEnd
|
||||||
# Excludes: jurabib | natbib
|
# Excludes: jurabib | natbib
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# \DeclareLyXCiteEngine[jurabib.sty]{Jurabib}
|
# \DeclareLyXCiteEngine[jurabib.sty]{Jurabib (BibTeX)}
|
||||||
# DescriptionBegin
|
# DescriptionBegin
|
||||||
# Loads the LaTeX package jurabib, a citation engine. Jurabib supports annotations,
|
# Jurabib supports a range of author-year styles primarily suitable for law studies
|
||||||
# author-year style citations and hyphenation patterns for bibliography entries in
|
# and the Humanities. It includes localizations for English, German, French, Dutch,
|
||||||
# English, German, French, Dutch, Spanish and Italian.
|
# Spanish and Italian.
|
||||||
# DescriptionEnd
|
# DescriptionEnd
|
||||||
# Excludes: basic | natbib
|
# Excludes: basic | natbib
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# \DeclareLyXCiteEngine[natbib.sty]{Natbib}
|
# \DeclareLyXCiteEngine[natbib.sty]{Natbib (BibTeX)}
|
||||||
# DescriptionBegin
|
# DescriptionBegin
|
||||||
# Loads the LaTeX package natbib, a citation engine. Natbib supports
|
# Natbib supports a range of both author-year and numerical styles mainly
|
||||||
# both author-year and numerical styles for citations, automatic sorting
|
# aimed at the Humanities. It features automatic sorting and merging of
|
||||||
# and merging of numerical citations, annotations, capitalization of the
|
# numerical citations, annotations, capitalization of the `van' part of
|
||||||
# `van' part of author names, shortened and full author lists, and more.
|
# author names, shortened and full author lists, and more.
|
||||||
# DescriptionEnd
|
# DescriptionEnd
|
||||||
# Excludes: basic | jurabib
|
# Excludes: basic | jurabib
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
#include "buffer_funcs.h"
|
#include "buffer_funcs.h"
|
||||||
#include "Bullet.h"
|
#include "Bullet.h"
|
||||||
|
#include "CiteEnginesList.h"
|
||||||
#include "Color.h"
|
#include "Color.h"
|
||||||
#include "ColorSet.h"
|
#include "ColorSet.h"
|
||||||
#include "Converter.h"
|
#include "Converter.h"
|
||||||
@ -272,27 +273,6 @@ PackageTranslator const & packagetranslator()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Cite engine
|
|
||||||
typedef Translator<string, CiteEngineType> CiteEngineTypeTranslator;
|
|
||||||
|
|
||||||
|
|
||||||
CiteEngineTypeTranslator const init_citeenginetypetranslator()
|
|
||||||
{
|
|
||||||
CiteEngineTypeTranslator translator("authoryear", ENGINE_TYPE_AUTHORYEAR);
|
|
||||||
translator.addPair("numerical", ENGINE_TYPE_NUMERICAL);
|
|
||||||
translator.addPair("default", ENGINE_TYPE_DEFAULT);
|
|
||||||
return translator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
CiteEngineTypeTranslator const & citeenginetypetranslator()
|
|
||||||
{
|
|
||||||
static CiteEngineTypeTranslator const translator =
|
|
||||||
init_citeenginetypetranslator();
|
|
||||||
return translator;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Spacing
|
// Spacing
|
||||||
typedef Translator<string, Spacing::Space> SpaceTranslator;
|
typedef Translator<string, Spacing::Space> SpaceTranslator;
|
||||||
|
|
||||||
@ -863,7 +843,7 @@ string BufferParams::readToken(Lexer & lex, string const & token,
|
|||||||
} else if (token == "\\cite_engine_type") {
|
} else if (token == "\\cite_engine_type") {
|
||||||
string engine_type;
|
string engine_type;
|
||||||
lex >> engine_type;
|
lex >> engine_type;
|
||||||
cite_engine_type_ = citeenginetypetranslator().find(engine_type);
|
cite_engine_type_ = theCiteEnginesList.getType(engine_type);
|
||||||
} else if (token == "\\biblio_style") {
|
} else if (token == "\\biblio_style") {
|
||||||
lex.eatLine();
|
lex.eatLine();
|
||||||
biblio_style = lex.getString();
|
biblio_style = lex.getString();
|
||||||
@ -1234,7 +1214,7 @@ void BufferParams::writeFile(ostream & os, Buffer const * buf) const
|
|||||||
os << "basic";
|
os << "basic";
|
||||||
}
|
}
|
||||||
|
|
||||||
os << "\n\\cite_engine_type " << citeenginetypetranslator().find(cite_engine_type_)
|
os << "\n\\cite_engine_type " << theCiteEnginesList.getTypeAsString(cite_engine_type_)
|
||||||
<< "\n\\biblio_style " << biblio_style
|
<< "\n\\biblio_style " << biblio_style
|
||||||
<< "\n\\use_bibtopic " << convert<string>(use_bibtopic)
|
<< "\n\\use_bibtopic " << convert<string>(use_bibtopic)
|
||||||
<< "\n\\use_indices " << convert<string>(use_indices)
|
<< "\n\\use_indices " << convert<string>(use_indices)
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "CiteEnginesList.h"
|
#include "CiteEnginesList.h"
|
||||||
|
|
||||||
|
#include "Citation.h"
|
||||||
#include "LaTeXFeatures.h"
|
#include "LaTeXFeatures.h"
|
||||||
#include "Lexer.h"
|
#include "Lexer.h"
|
||||||
|
|
||||||
@ -22,6 +23,7 @@
|
|||||||
#include "support/gettext.h"
|
#include "support/gettext.h"
|
||||||
#include "support/filetools.h"
|
#include "support/filetools.h"
|
||||||
#include "support/lstrings.h"
|
#include "support/lstrings.h"
|
||||||
|
#include "support/Translator.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -76,6 +78,13 @@ bool LyXCiteEngine::isAvailable() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool LyXCiteEngine::hasEngineType(CiteEngineType const & et) const
|
||||||
|
{
|
||||||
|
return std::find(engine_types_.begin(), engine_types_.end(),
|
||||||
|
theCiteEnginesList.getTypeAsString(et)) != engine_types_.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool LyXCiteEngine::isCompatible(string const & cename) const
|
bool LyXCiteEngine::isCompatible(string const & cename) const
|
||||||
{
|
{
|
||||||
// do we exclude it?
|
// do we exclude it?
|
||||||
@ -119,6 +128,43 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Local translators
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
typedef Translator<string, CiteEngineType> CiteEngineTypeTranslator;
|
||||||
|
|
||||||
|
|
||||||
|
CiteEngineTypeTranslator const init_citeenginetypetranslator()
|
||||||
|
{
|
||||||
|
CiteEngineTypeTranslator translator("authoryear", ENGINE_TYPE_AUTHORYEAR);
|
||||||
|
translator.addPair("numerical", ENGINE_TYPE_NUMERICAL);
|
||||||
|
translator.addPair("default", ENGINE_TYPE_DEFAULT);
|
||||||
|
return translator;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CiteEngineTypeTranslator const & citeenginetypetranslator()
|
||||||
|
{
|
||||||
|
static CiteEngineTypeTranslator const translator =
|
||||||
|
init_citeenginetypetranslator();
|
||||||
|
return translator;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace anon
|
||||||
|
|
||||||
|
|
||||||
|
string CiteEnginesList::getTypeAsString(CiteEngineType const & et) const
|
||||||
|
{
|
||||||
|
return citeenginetypetranslator().find(et);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
CiteEngineType CiteEnginesList::getType(string const & et) const
|
||||||
|
{
|
||||||
|
return citeenginetypetranslator().find(et);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Much of this is borrowed from LayoutFileList::read()
|
// Much of this is borrowed from LayoutFileList::read()
|
||||||
bool CiteEnginesList::read()
|
bool CiteEnginesList::read()
|
||||||
{
|
{
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
#ifndef CITEENGINESLIST_H
|
#ifndef CITEENGINESLIST_H
|
||||||
#define CITEENGINESLIST_H
|
#define CITEENGINESLIST_H
|
||||||
|
|
||||||
|
#include "Citation.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -29,13 +31,13 @@ namespace lyx {
|
|||||||
* which must begin roughly so:
|
* which must begin roughly so:
|
||||||
* # \DeclareLyXCiteEngine[natbib.sty]{Natbib}
|
* # \DeclareLyXCiteEngine[natbib.sty]{Natbib}
|
||||||
* # DescriptionBegin
|
* # DescriptionBegin
|
||||||
* # Loads the LaTeX package natbib, a citation engine. Natbib supports
|
* # Natbib supports a range of both author-year and numerical styles mainly
|
||||||
* # both author-year and numerical styles for citations, automatic sorting
|
* # aimed at the Humanities. It features automatic sorting and merging of
|
||||||
* # and merging of numerical citations, annotations, capitalization of the
|
* # numerical citations, annotations, capitalization of the `van' part of
|
||||||
* # `van' part of author names, shortened and full author lists, and more.
|
* # author names, shortened and full author lists, and more.
|
||||||
* # DescriptionEnd
|
* # DescriptionEnd
|
||||||
* # Excludes: basic | jurabib
|
* # Excludes: basic | jurabib
|
||||||
* The description might be used in the gui to give information to the user. The
|
* The description will be used in the gui to give information to the user. The
|
||||||
* Requires and Excludes lines are read by the configuration script
|
* Requires and Excludes lines are read by the configuration script
|
||||||
* and written to a file citeengines.lst in the user configuration directory.
|
* and written to a file citeengines.lst in the user configuration directory.
|
||||||
* That file is then read on startup to populate the CiteEnginesList, below.
|
* That file is then read on startup to populate the CiteEnginesList, below.
|
||||||
@ -66,6 +68,8 @@ public:
|
|||||||
///
|
///
|
||||||
std::vector<std::string> const & getEngineType() const { return engine_types_; }
|
std::vector<std::string> const & getEngineType() const { return engine_types_; }
|
||||||
///
|
///
|
||||||
|
bool hasEngineType(CiteEngineType const &) const;
|
||||||
|
///
|
||||||
std::string const & getDescription() const { return description_; }
|
std::string const & getDescription() const { return description_; }
|
||||||
///
|
///
|
||||||
std::vector<std::string> const & getPackageList() const
|
std::vector<std::string> const & getPackageList() const
|
||||||
@ -121,6 +125,10 @@ class CiteEnginesList {
|
|||||||
public:
|
public:
|
||||||
///
|
///
|
||||||
CiteEnginesList() {}
|
CiteEnginesList() {}
|
||||||
|
///
|
||||||
|
std::string getTypeAsString(CiteEngineType const &) const;
|
||||||
|
///
|
||||||
|
CiteEngineType getType(std::string const &) const;
|
||||||
/// reads the engines from a file generated by configure.py
|
/// reads the engines from a file generated by configure.py
|
||||||
bool read();
|
bool read();
|
||||||
///
|
///
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "Buffer.h"
|
#include "Buffer.h"
|
||||||
#include "BufferParams.h"
|
#include "BufferParams.h"
|
||||||
#include "BufferView.h"
|
#include "BufferView.h"
|
||||||
|
#include "CiteEnginesList.h"
|
||||||
#include "Color.h"
|
#include "Color.h"
|
||||||
#include "ColorCache.h"
|
#include "ColorCache.h"
|
||||||
#include "Converter.h"
|
#include "Converter.h"
|
||||||
@ -1126,22 +1127,10 @@ GuiDocument::GuiDocument(GuiView & lv)
|
|||||||
|
|
||||||
// biblio
|
// biblio
|
||||||
biblioModule = new UiWidget<Ui::BiblioUi>;
|
biblioModule = new UiWidget<Ui::BiblioUi>;
|
||||||
connect(biblioModule->citeDefaultRB, SIGNAL(toggled(bool)),
|
connect(biblioModule->citeEngineCO, SIGNAL(activated(int)),
|
||||||
this, SLOT(setNumerical(bool)));
|
this, SLOT(citeEngineChanged(int)));
|
||||||
connect(biblioModule->citeJurabibRB, SIGNAL(toggled(bool)),
|
|
||||||
this, SLOT(setAuthorYear(bool)));
|
|
||||||
connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)),
|
|
||||||
biblioModule->citationStyleL, SLOT(setEnabled(bool)));
|
|
||||||
connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)),
|
|
||||||
biblioModule->citeStyleCO, SLOT(setEnabled(bool)));
|
|
||||||
connect(biblioModule->citeDefaultRB, SIGNAL(clicked()),
|
|
||||||
this, SLOT(biblioChanged()));
|
|
||||||
connect(biblioModule->citeNatbibRB, SIGNAL(clicked()),
|
|
||||||
this, SLOT(biblioChanged()));
|
|
||||||
connect(biblioModule->citeStyleCO, SIGNAL(activated(int)),
|
connect(biblioModule->citeStyleCO, SIGNAL(activated(int)),
|
||||||
this, SLOT(biblioChanged()));
|
this, SLOT(biblioChanged()));
|
||||||
connect(biblioModule->citeJurabibRB, SIGNAL(clicked()),
|
|
||||||
this, SLOT(biblioChanged()));
|
|
||||||
connect(biblioModule->bibtopicCB, SIGNAL(clicked()),
|
connect(biblioModule->bibtopicCB, SIGNAL(clicked()),
|
||||||
this, SLOT(biblioChanged()));
|
this, SLOT(biblioChanged()));
|
||||||
connect(biblioModule->bibtexCO, SIGNAL(activated(int)),
|
connect(biblioModule->bibtexCO, SIGNAL(activated(int)),
|
||||||
@ -1151,15 +1140,19 @@ GuiDocument::GuiDocument(GuiView & lv)
|
|||||||
connect(biblioModule->bibtexStyleLE, SIGNAL(textChanged(QString)),
|
connect(biblioModule->bibtexStyleLE, SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(biblioChanged()));
|
this, SLOT(biblioChanged()));
|
||||||
|
|
||||||
|
biblioModule->citeEngineCO->clear();
|
||||||
|
for (LyXCiteEngine const & cet : theCiteEnginesList) {
|
||||||
|
biblioModule->citeEngineCO->addItem(qt_(cet.getName()), toqstr(cet.getID()));
|
||||||
|
int const i = biblioModule->citeEngineCO->findData(toqstr(cet.getID()));
|
||||||
|
biblioModule->citeEngineCO->setItemData(i, qt_(cet.getDescription()),
|
||||||
|
Qt::ToolTipRole);
|
||||||
|
}
|
||||||
|
|
||||||
biblioModule->bibtexOptionsLE->setValidator(new NoNewLineValidator(
|
biblioModule->bibtexOptionsLE->setValidator(new NoNewLineValidator(
|
||||||
biblioModule->bibtexOptionsLE));
|
biblioModule->bibtexOptionsLE));
|
||||||
biblioModule->bibtexStyleLE->setValidator(new NoNewLineValidator(
|
biblioModule->bibtexStyleLE->setValidator(new NoNewLineValidator(
|
||||||
biblioModule->bibtexStyleLE));
|
biblioModule->bibtexStyleLE));
|
||||||
|
|
||||||
biblioModule->citeStyleCO->addItem(qt_("Author-year"));
|
|
||||||
biblioModule->citeStyleCO->addItem(qt_("Numerical"));
|
|
||||||
biblioModule->citeStyleCO->setCurrentIndex(0);
|
|
||||||
|
|
||||||
// NOTE: we do not provide "custom" here for security reasons!
|
// NOTE: we do not provide "custom" here for security reasons!
|
||||||
biblioModule->bibtexCO->clear();
|
biblioModule->bibtexCO->clear();
|
||||||
biblioModule->bibtexCO->addItem(qt_("Default"), QString("default"));
|
biblioModule->bibtexCO->addItem(qt_("Default"), QString("default"));
|
||||||
@ -2278,6 +2271,19 @@ void GuiDocument::biblioChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiDocument::citeEngineChanged(int n)
|
||||||
|
{
|
||||||
|
QString const engine = biblioModule->citeEngineCO->itemData(n).toString();
|
||||||
|
|
||||||
|
vector<string> const engs =
|
||||||
|
theCiteEnginesList[fromqstr(engine)]->getEngineType();
|
||||||
|
|
||||||
|
updateCiteStyles(engs);
|
||||||
|
|
||||||
|
biblioChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiDocument::bibtexChanged(int n)
|
void GuiDocument::bibtexChanged(int n)
|
||||||
{
|
{
|
||||||
biblioModule->bibtexOptionsLE->setEnabled(
|
biblioModule->bibtexOptionsLE->setEnabled(
|
||||||
@ -2289,7 +2295,8 @@ void GuiDocument::bibtexChanged(int n)
|
|||||||
void GuiDocument::setAuthorYear(bool authoryear)
|
void GuiDocument::setAuthorYear(bool authoryear)
|
||||||
{
|
{
|
||||||
if (authoryear)
|
if (authoryear)
|
||||||
biblioModule->citeStyleCO->setCurrentIndex(0);
|
biblioModule->citeStyleCO->setCurrentIndex(
|
||||||
|
biblioModule->citeStyleCO->findData(ENGINE_TYPE_AUTHORYEAR));
|
||||||
biblioChanged();
|
biblioChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2297,11 +2304,39 @@ void GuiDocument::setAuthorYear(bool authoryear)
|
|||||||
void GuiDocument::setNumerical(bool numerical)
|
void GuiDocument::setNumerical(bool numerical)
|
||||||
{
|
{
|
||||||
if (numerical)
|
if (numerical)
|
||||||
biblioModule->citeStyleCO->setCurrentIndex(1);
|
biblioModule->citeStyleCO->setCurrentIndex(
|
||||||
|
biblioModule->citeStyleCO->findData(ENGINE_TYPE_NUMERICAL));
|
||||||
biblioChanged();
|
biblioChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiDocument::updateCiteStyles(vector<string> const & engs, CiteEngineType const & sel)
|
||||||
|
{
|
||||||
|
biblioModule->citeStyleCO->clear();
|
||||||
|
|
||||||
|
vector<string>::const_iterator it = engs.begin();
|
||||||
|
vector<string>::const_iterator end = engs.end();
|
||||||
|
for (; it != end; ++it) {
|
||||||
|
if (*it == "default")
|
||||||
|
biblioModule->citeStyleCO->addItem(qt_("Basic numerical"),
|
||||||
|
ENGINE_TYPE_DEFAULT);
|
||||||
|
else if (*it == "authoryear")
|
||||||
|
biblioModule->citeStyleCO->addItem(qt_("Author-year"),
|
||||||
|
ENGINE_TYPE_AUTHORYEAR);
|
||||||
|
else if (*it == "numerical")
|
||||||
|
biblioModule->citeStyleCO->addItem(qt_("Author-number"),
|
||||||
|
ENGINE_TYPE_NUMERICAL);
|
||||||
|
}
|
||||||
|
int i = biblioModule->citeStyleCO->findData(sel);
|
||||||
|
if (biblioModule->citeStyleCO->findData(sel) == -1)
|
||||||
|
i = 0;
|
||||||
|
biblioModule->citeStyleCO->setCurrentIndex(i);
|
||||||
|
|
||||||
|
biblioModule->citationStyleL->setEnabled(engs.size() > 1);
|
||||||
|
biblioModule->citeStyleCO->setEnabled(engs.size() > 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiDocument::updateEngineType(string const & items, CiteEngineType const & sel)
|
void GuiDocument::updateEngineType(string const & items, CiteEngineType const & sel)
|
||||||
{
|
{
|
||||||
engine_types_.clear();
|
engine_types_.clear();
|
||||||
@ -2314,28 +2349,7 @@ void GuiDocument::updateEngineType(string const & items, CiteEngineType const &
|
|||||||
engine_types_.push_back(style);
|
engine_types_.push_back(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (sel) {
|
updateCiteStyles(engine_types_, sel);
|
||||||
case ENGINE_TYPE_AUTHORYEAR:
|
|
||||||
biblioModule->citeStyleCO->setCurrentIndex(0);
|
|
||||||
break;
|
|
||||||
case ENGINE_TYPE_NUMERICAL:
|
|
||||||
case ENGINE_TYPE_DEFAULT:
|
|
||||||
biblioModule->citeStyleCO->setCurrentIndex(1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
biblioModule->citationStyleL->setEnabled(nn > 1);
|
|
||||||
biblioModule->citeStyleCO->setEnabled(nn > 1);
|
|
||||||
|
|
||||||
if (nn != 1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// If the textclass allows only one of authoryear or numerical,
|
|
||||||
// we have no choice but to force that engine type.
|
|
||||||
if (engine_types_[0] == "authoryear")
|
|
||||||
biblioModule->citeStyleCO->setCurrentIndex(0);
|
|
||||||
else
|
|
||||||
biblioModule->citeStyleCO->setCurrentIndex(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2588,19 +2602,17 @@ void GuiDocument::applyView()
|
|||||||
bp_.use_refstyle = latexModule->refstyleCB->isChecked();
|
bp_.use_refstyle = latexModule->refstyleCB->isChecked();
|
||||||
|
|
||||||
// biblio
|
// biblio
|
||||||
if (biblioModule->citeNatbibRB->isChecked())
|
string const engine =
|
||||||
bp_.setCiteEngine("natbib");
|
fromqstr(biblioModule->citeEngineCO->itemData(
|
||||||
else if (biblioModule->citeJurabibRB->isChecked())
|
biblioModule->citeEngineCO->currentIndex()).toString());
|
||||||
bp_.setCiteEngine("jurabib");
|
bp_.setCiteEngine(engine);
|
||||||
if (biblioModule->citeDefaultRB->isChecked()) {
|
|
||||||
bp_.setCiteEngine("basic");
|
CiteEngineType const style = CiteEngineType(biblioModule->citeStyleCO->itemData(
|
||||||
|
biblioModule->citeStyleCO->currentIndex()).toInt());
|
||||||
|
if (theCiteEnginesList[engine]->hasEngineType(style))
|
||||||
|
bp_.setCiteEngineType(style);
|
||||||
|
else
|
||||||
bp_.setCiteEngineType(ENGINE_TYPE_DEFAULT);
|
bp_.setCiteEngineType(ENGINE_TYPE_DEFAULT);
|
||||||
}
|
|
||||||
else
|
|
||||||
if (biblioModule->citeStyleCO->currentIndex())
|
|
||||||
bp_.setCiteEngineType(ENGINE_TYPE_NUMERICAL);
|
|
||||||
else
|
|
||||||
bp_.setCiteEngineType(ENGINE_TYPE_AUTHORYEAR);
|
|
||||||
|
|
||||||
bp_.use_bibtopic =
|
bp_.use_bibtopic =
|
||||||
biblioModule->bibtopicCB->isChecked();
|
biblioModule->bibtopicCB->isChecked();
|
||||||
@ -3016,21 +3028,15 @@ void GuiDocument::paramsToDialog()
|
|||||||
// biblio
|
// biblio
|
||||||
string const cite_engine = bp_.citeEngine().list().front();
|
string const cite_engine = bp_.citeEngine().list().front();
|
||||||
|
|
||||||
biblioModule->citeDefaultRB->setChecked(
|
biblioModule->citeEngineCO->setCurrentIndex(
|
||||||
cite_engine == "basic");
|
biblioModule->citeEngineCO->findData(toqstr(cite_engine)));
|
||||||
|
|
||||||
biblioModule->citeJurabibRB->setChecked(
|
|
||||||
cite_engine == "jurabib");
|
|
||||||
|
|
||||||
biblioModule->citeNatbibRB->setChecked(
|
|
||||||
cite_engine == "natbib");
|
|
||||||
|
|
||||||
biblioModule->citeStyleCO->setCurrentIndex(
|
|
||||||
bp_.citeEngineType() & ENGINE_TYPE_NUMERICAL);
|
|
||||||
|
|
||||||
updateEngineType(documentClass().opt_enginetype(),
|
updateEngineType(documentClass().opt_enginetype(),
|
||||||
bp_.citeEngineType());
|
bp_.citeEngineType());
|
||||||
|
|
||||||
|
biblioModule->citeStyleCO->setCurrentIndex(
|
||||||
|
biblioModule->citeStyleCO->findData(bp_.citeEngineType()));
|
||||||
|
|
||||||
biblioModule->bibtopicCB->setChecked(
|
biblioModule->bibtopicCB->setChecked(
|
||||||
bp_.use_bibtopic);
|
bp_.use_bibtopic);
|
||||||
|
|
||||||
|
@ -75,6 +75,8 @@ public:
|
|||||||
void updateFontsize(std::string const &, std::string const &);
|
void updateFontsize(std::string const &, std::string const &);
|
||||||
void updateFontlist();
|
void updateFontlist();
|
||||||
void updateDefaultFormat();
|
void updateDefaultFormat();
|
||||||
|
void updateCiteStyles(std::vector<std::string> const &,
|
||||||
|
CiteEngineType const & sel = ENGINE_TYPE_AUTHORYEAR);
|
||||||
void updateEngineType(std::string const &, CiteEngineType const &);
|
void updateEngineType(std::string const &, CiteEngineType const &);
|
||||||
void updatePagestyle(std::string const &, std::string const &);
|
void updatePagestyle(std::string const &, std::string const &);
|
||||||
bool isChildIncluded(std::string const &);
|
bool isChildIncluded(std::string const &);
|
||||||
@ -113,6 +115,7 @@ private Q_SLOTS:
|
|||||||
void classChanged_adaptor();
|
void classChanged_adaptor();
|
||||||
void languagePackageChanged(int);
|
void languagePackageChanged(int);
|
||||||
void biblioChanged();
|
void biblioChanged();
|
||||||
|
void citeEngineChanged(int);
|
||||||
void bibtexChanged(int);
|
void bibtexChanged(int);
|
||||||
void setAuthorYear(bool);
|
void setAuthorYear(bool);
|
||||||
void setNumerical(bool);
|
void setNumerical(bool);
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<ui version="4.0" >
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
<class>BiblioUi</class>
|
<class>BiblioUi</class>
|
||||||
<widget class="QWidget" name="BiblioUi" >
|
<widget class="QWidget" name="BiblioUi">
|
||||||
<property name="geometry" >
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
@ -9,81 +10,93 @@
|
|||||||
<height>394</height>
|
<height>394</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3" >
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0">
|
||||||
<widget class="QGroupBox" name="CiteStyleBG" >
|
<widget class="QGroupBox" name="CiteStyleBG">
|
||||||
<property name="title" >
|
<property name="title">
|
||||||
<string>Citation Style</string>
|
<string>Citation Style</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat" >
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout" >
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0">
|
||||||
<widget class="QRadioButton" name="citeDefaultRB" >
|
<layout class="QHBoxLayout">
|
||||||
<property name="toolTip" >
|
<property name="spacing">
|
||||||
<string>Use BibTeX's default numerical styles</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>&Default (numerical)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" >
|
|
||||||
<widget class="QRadioButton" name="citeNatbibRB" >
|
|
||||||
<property name="toolTip" >
|
|
||||||
<string>Use the natbib styles for natural sciences and arts. Set additional parameters in document class options.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>&Natbib</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1" >
|
|
||||||
<layout class="QHBoxLayout" >
|
|
||||||
<property name="spacing" >
|
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin" >
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="citationStyleL" >
|
<widget class="QLabel" name="citeEngineLA">
|
||||||
<property name="enabled" >
|
<property name="toolTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sty&le Engine:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>citeEngineCO</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="citeEngineCO">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>A selection of different style engines (such as natbib) that respectively provide support for specific citytion and bibliography styles. Expand to get more information.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="citationStyleL">
|
||||||
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Natbib &style:</string>
|
<string>&Variant:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy" >
|
<property name="buddy">
|
||||||
<cstring>citeStyleCO</cstring>
|
<cstring>citeStyleCO</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="citeStyleCO" >
|
<widget class="QComboBox" name="citeStyleCO">
|
||||||
<property name="enabled" >
|
<property name="enabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Provides available cite style variants.</string>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2" >
|
<item row="0" column="1">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>40</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
@ -91,55 +104,45 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" >
|
|
||||||
<widget class="QRadioButton" name="citeJurabibRB" >
|
|
||||||
<property name="toolTip" >
|
|
||||||
<string>Use the jurabib styles for law and humanities</string>
|
|
||||||
</property>
|
|
||||||
<property name="text" >
|
|
||||||
<string>&Jurabib</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0">
|
||||||
<widget class="QGroupBox" name="BiblioStyleBG" >
|
<widget class="QGroupBox" name="BiblioStyleBG">
|
||||||
<property name="title" >
|
<property name="title">
|
||||||
<string>Bibliography Style</string>
|
<string>Bibliography Style</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat" >
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_1" >
|
<layout class="QGridLayout" name="gridLayout_1">
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_1" >
|
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="bibtexStyleLA" >
|
<widget class="QLabel" name="bibtexStyleLA">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>Default st&yle:</string>
|
<string>Default st&yle:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy" >
|
<property name="buddy">
|
||||||
<cstring>bibtexStyleLE</cstring>
|
<cstring>bibtexStyleLE</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="bibtexStyleLE" >
|
<widget class="QLineEdit" name="bibtexStyleLE">
|
||||||
<property name="toolTip" >
|
<property name="toolTip">
|
||||||
<string>Define the default BibTeX style</string>
|
<string>Define the default BibTeX style</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="bibtopicCB" >
|
<widget class="QCheckBox" name="bibtopicCB">
|
||||||
<property name="toolTip" >
|
<property name="toolTip">
|
||||||
<string>Select this if you want to split your bibliography into sections</string>
|
<string>Select this if you want to split your bibliography into sections</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>S&ectioned bibliography</string>
|
<string>S&ectioned bibliography</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@ -147,45 +150,45 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" >
|
<item row="2" column="0">
|
||||||
<widget class="QGroupBox" name="bibtexGB" >
|
<widget class="QGroupBox" name="bibtexGB">
|
||||||
<property name="toolTip" >
|
<property name="toolTip">
|
||||||
<string>Here you can define an alternative program to or specific options of BibTeX.</string>
|
<string>Here you can define an alternative program to or specific options of BibTeX.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="title" >
|
<property name="title">
|
||||||
<string>Bibliography Generation</string>
|
<string>Bibliography Generation</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat" >
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2" >
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" >
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="bibtexLA" >
|
<widget class="QLabel" name="bibtexLA">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>&Processor:</string>
|
<string>&Processor:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy" >
|
<property name="buddy">
|
||||||
<cstring>bibtexCO</cstring>
|
<cstring>bibtexCO</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="bibtexCO" >
|
<widget class="QComboBox" name="bibtexCO">
|
||||||
<property name="toolTip" >
|
<property name="toolTip">
|
||||||
<string>Select a processor</string>
|
<string>Select a processor</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item rowspan="2" row="0" column="1" >
|
<item row="0" column="1" rowspan="2">
|
||||||
<spacer name="horizontalSpacer" >
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation" >
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>183</width>
|
<width>183</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
@ -193,21 +196,21 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2" >
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="bibtexOptionsLA" >
|
<widget class="QLabel" name="bibtexOptionsLA">
|
||||||
<property name="text" >
|
<property name="text">
|
||||||
<string>&Options:</string>
|
<string>Op&tions:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="buddy" >
|
<property name="buddy">
|
||||||
<cstring>bibtexOptionsLE</cstring>
|
<cstring>bibtexOptionsLE</cstring>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="bibtexOptionsLE" >
|
<widget class="QLineEdit" name="bibtexOptionsLE">
|
||||||
<property name="toolTip" >
|
<property name="toolTip">
|
||||||
<string>Define options such as --min-crossrefs (see the documentation of BibTeX)</string>
|
<string>Define options such as --min-crossrefs (see the documentation of BibTeX)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
@ -217,15 +220,15 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" >
|
<item row="3" column="0">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation" >
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType" >
|
<property name="sizeType">
|
||||||
<enum>QSizePolicy::Expanding</enum>
|
<enum>QSizePolicy::Expanding</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
@ -236,7 +239,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<includes>
|
<includes>
|
||||||
<include location="local" >qt_i18n.h</include>
|
<include location="local">qt_i18n.h</include>
|
||||||
</includes>
|
</includes>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
Loading…
Reference in New Issue
Block a user