2006-03-05 17:24:44 +00:00
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
|
* \file GuiBibtex.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Herbert Vo<EFBFBD>
|
|
|
|
|
* \author J<EFBFBD>rgen Spitzm<EFBFBD>ller
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiBibtex.h"
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
2007-08-11 15:48:15 +00:00
|
|
|
|
#include "ui_BibtexAddUi.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include "Qt2BC.h"
|
|
|
|
|
#include "qt_helpers.h"
|
2007-04-26 03:53:02 +00:00
|
|
|
|
#include "Validator.h"
|
2007-04-26 04:41:58 +00:00
|
|
|
|
#include "LyXRC.h"
|
2007-04-26 03:53:02 +00:00
|
|
|
|
#include "CheckedLineEdit.h"
|
2007-04-25 08:42:22 +00:00
|
|
|
|
|
|
|
|
|
#include "controllers/ControlBibtex.h"
|
2007-04-28 20:44:46 +00:00
|
|
|
|
#include "controllers/ButtonPolicy.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
#include "controllers/ControlBibtex.h"
|
|
|
|
|
|
2006-04-09 08:42:58 +00:00
|
|
|
|
#include "support/filetools.h" // changeExtension
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include "support/lstrings.h"
|
|
|
|
|
|
2006-05-02 19:17:59 +00:00
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QListWidget>
|
|
|
|
|
#include <QCheckBox>
|
2007-04-25 08:42:22 +00:00
|
|
|
|
#include <QCloseEvent>
|
|
|
|
|
#include <QLineEdit>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2006-04-09 08:42:58 +00:00
|
|
|
|
using lyx::support::changeExtension;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
using lyx::support::split;
|
|
|
|
|
using lyx::support::trim;
|
|
|
|
|
|
|
|
|
|
using std::vector;
|
|
|
|
|
using std::string;
|
|
|
|
|
|
2007-04-25 08:42:22 +00:00
|
|
|
|
#include "debug.h"
|
|
|
|
|
#include "support/filetools.h"
|
|
|
|
|
#include "support/lstrings.h"
|
|
|
|
|
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-04-25 08:42:22 +00:00
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
2007-08-31 05:53:55 +00:00
|
|
|
|
// GuiBibtexDialog
|
2007-04-25 08:42:22 +00:00
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiBibtexDialog::GuiBibtexDialog(GuiBibtex * form)
|
2007-04-25 08:42:22 +00:00
|
|
|
|
: form_(form)
|
|
|
|
|
{
|
|
|
|
|
setupUi(this);
|
|
|
|
|
QDialog::setModal(true);
|
|
|
|
|
|
|
|
|
|
connect(okPB, SIGNAL(clicked()),
|
|
|
|
|
form, SLOT(slotOK()));
|
|
|
|
|
connect(closePB, SIGNAL(clicked()),
|
|
|
|
|
form, SLOT(slotClose()));
|
|
|
|
|
connect(stylePB, SIGNAL(clicked()),
|
2007-08-31 05:53:55 +00:00
|
|
|
|
this, SLOT(browsePressed()));
|
2007-04-25 08:42:22 +00:00
|
|
|
|
connect(deletePB, SIGNAL(clicked()),
|
2007-08-31 05:53:55 +00:00
|
|
|
|
this, SLOT(deletePressed()));
|
2007-04-25 08:42:22 +00:00
|
|
|
|
connect(styleCB, SIGNAL(editTextChanged (const QString &)),
|
2007-08-31 05:53:55 +00:00
|
|
|
|
this, SLOT(change_adaptor()));
|
2007-04-25 08:42:22 +00:00
|
|
|
|
connect(databaseLW, SIGNAL(itemSelectionChanged()),
|
2007-08-31 05:53:55 +00:00
|
|
|
|
this, SLOT(databaseChanged()));
|
2007-04-25 08:42:22 +00:00
|
|
|
|
connect(bibtocCB, SIGNAL(clicked()),
|
2007-08-31 05:53:55 +00:00
|
|
|
|
this, SLOT(change_adaptor()));
|
2007-04-25 08:42:22 +00:00
|
|
|
|
connect(btPrintCO, SIGNAL(activated(int)),
|
2007-08-31 05:53:55 +00:00
|
|
|
|
this, SLOT(change_adaptor()));
|
2007-04-25 08:42:22 +00:00
|
|
|
|
connect(addBibPB, SIGNAL(clicked()),
|
2007-08-31 05:53:55 +00:00
|
|
|
|
this, SLOT(addPressed()));
|
2007-04-25 08:42:22 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
add_ = new UiDialog<Ui::BibtexAddUi>(this, true);
|
2007-04-25 08:42:22 +00:00
|
|
|
|
|
|
|
|
|
Qt2BC * bcview = new Qt2BC(add_bc_);
|
|
|
|
|
add_bc_.view(bcview);
|
|
|
|
|
add_bc_.bp(new OkCancelPolicy);
|
|
|
|
|
|
|
|
|
|
bcview->setOK(add_->addPB);
|
|
|
|
|
bcview->setCancel(add_->closePB);
|
|
|
|
|
|
|
|
|
|
addCheckedLineEdit(add_bc_.view(), add_->bibED, 0);
|
|
|
|
|
|
|
|
|
|
connect(add_->bibED, SIGNAL(textChanged(const QString &)),
|
|
|
|
|
this, SLOT(bibEDChanged()));
|
|
|
|
|
connect(add_->addPB, SIGNAL(clicked()),
|
|
|
|
|
this, SLOT(addDatabase()));
|
|
|
|
|
connect(add_->addPB, SIGNAL(clicked()),
|
|
|
|
|
add_, SLOT(accept()));
|
|
|
|
|
connect(add_->bibLW, SIGNAL(itemActivated(QListWidgetItem *)),
|
|
|
|
|
this, SLOT(addDatabase()));
|
|
|
|
|
connect(add_->bibLW, SIGNAL(itemActivated(QListWidgetItem *)),
|
|
|
|
|
add_, SLOT(accept()));
|
|
|
|
|
connect(add_->bibLW, SIGNAL(itemSelectionChanged()),
|
|
|
|
|
this, SLOT(availableChanged()));
|
|
|
|
|
connect(add_->browsePB, SIGNAL(clicked()),
|
|
|
|
|
this, SLOT(browseBibPressed()));
|
|
|
|
|
connect(add_->closePB, SIGNAL(clicked()),
|
|
|
|
|
add_, SLOT(reject()));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::bibEDChanged()
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
// Indicate to the button controller that the contents have
|
|
|
|
|
// changed. The actual test of validity is carried out by
|
|
|
|
|
// the checkedLineEdit.
|
|
|
|
|
add_bc_.valid(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::change_adaptor()
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
form_->changed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::browsePressed()
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
docstring const file = form_->controller().browseBst(docstring());
|
|
|
|
|
|
|
|
|
|
if (!file.empty()) {
|
|
|
|
|
// FIXME UNICODE
|
|
|
|
|
docstring const filen = from_utf8(changeExtension(to_utf8(file), ""));
|
|
|
|
|
bool present = false;
|
|
|
|
|
unsigned int pres = 0;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i != styleCB->count(); ++i) {
|
|
|
|
|
if (qstring_to_ucs4(styleCB->itemText(i)) == filen) {
|
|
|
|
|
present = true;
|
|
|
|
|
pres = i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!present)
|
|
|
|
|
styleCB->insertItem(0, toqstr(filen));
|
|
|
|
|
|
|
|
|
|
styleCB->setCurrentIndex(pres);
|
|
|
|
|
form_->changed();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::browseBibPressed()
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
docstring const file = trim(form_->controller().browseBib(docstring()));
|
|
|
|
|
|
|
|
|
|
if (!file.empty()) {
|
|
|
|
|
// FIXME UNICODE
|
|
|
|
|
QString const f = toqstr(changeExtension(to_utf8(file), ""));
|
|
|
|
|
bool present = false;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < add_->bibLW->count(); ++i) {
|
|
|
|
|
if (add_->bibLW->item(i)->text() == f)
|
|
|
|
|
present = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!present) {
|
|
|
|
|
add_->bibLW->addItem(f);
|
|
|
|
|
form_->changed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
add_->bibED->setText(f);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::addPressed()
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
add_bc_.valid(false);
|
|
|
|
|
add_->exec();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::addDatabase()
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
int const sel = add_->bibLW->currentRow();
|
|
|
|
|
docstring const file = trim(qstring_to_ucs4(add_->bibED->text()));
|
|
|
|
|
|
|
|
|
|
if (sel < 0 && file.empty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// Add the selected browser_bib keys to browser_database
|
|
|
|
|
// multiple selections are possible
|
|
|
|
|
for (int i = 0; i != add_->bibLW->count(); ++i) {
|
|
|
|
|
QListWidgetItem * const item = add_->bibLW->item(i);
|
|
|
|
|
if (add_->bibLW->isItemSelected(item)) {
|
|
|
|
|
add_->bibLW->setItemSelected(item, false);
|
|
|
|
|
QList<QListWidgetItem *> matches =
|
|
|
|
|
databaseLW->findItems(item->text(), Qt::MatchExactly);
|
|
|
|
|
if (matches.empty())
|
|
|
|
|
databaseLW->addItem(item->text());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!file.empty()) {
|
|
|
|
|
add_->bibED->clear();
|
|
|
|
|
QString const f = toqstr(from_utf8(changeExtension(to_utf8(file), "")));
|
|
|
|
|
QList<QListWidgetItem *> matches =
|
|
|
|
|
databaseLW->findItems(f, Qt::MatchExactly);
|
|
|
|
|
if (matches.empty())
|
|
|
|
|
databaseLW->addItem(f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
form_->changed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::deletePressed()
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
databaseLW->takeItem(databaseLW->currentRow());
|
|
|
|
|
form_->changed();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::databaseChanged()
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
deletePB->setEnabled(!form_->readOnly() && databaseLW->currentRow() != -1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::availableChanged()
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
add_bc_.valid(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtexDialog::closeEvent(QCloseEvent *e)
|
2007-04-25 08:42:22 +00:00
|
|
|
|
{
|
|
|
|
|
form_->slotWMHide();
|
|
|
|
|
e->accept();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// QBibTex
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
typedef QController<ControlBibtex, GuiView<GuiBibtexDialog> > BibtexBase;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiBibtex::GuiBibtex(Dialog & parent)
|
2007-04-25 08:42:22 +00:00
|
|
|
|
: BibtexBase(parent, _("BibTeX Bibliography"))
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtex::build_dialog()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2007-08-31 05:53:55 +00:00
|
|
|
|
dialog_.reset(new GuiBibtexDialog(this));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
bcview().setOK(dialog_->okPB);
|
|
|
|
|
bcview().setCancel(dialog_->closePB);
|
2006-05-02 19:17:59 +00:00
|
|
|
|
bcview().addReadOnly(dialog_->databaseLW);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
bcview().addReadOnly(dialog_->stylePB);
|
|
|
|
|
bcview().addReadOnly(dialog_->styleCB);
|
|
|
|
|
bcview().addReadOnly(dialog_->bibtocCB);
|
|
|
|
|
bcview().addReadOnly(dialog_->addBibPB);
|
|
|
|
|
bcview().addReadOnly(dialog_->deletePB);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtex::update_contents()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
|
|
|
|
bool bibtopic = controller().usingBibtopic();
|
|
|
|
|
|
2006-05-02 19:17:59 +00:00
|
|
|
|
dialog_->databaseLW->clear();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2006-10-20 13:53:43 +00:00
|
|
|
|
docstring bibs(controller().params()["bibfiles"]);
|
|
|
|
|
docstring bib;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
while (!bibs.empty()) {
|
|
|
|
|
bibs = split(bibs, bib, ',');
|
|
|
|
|
bib = trim(bib);
|
|
|
|
|
if (!bib.empty())
|
2006-05-02 19:17:59 +00:00
|
|
|
|
dialog_->databaseLW->addItem(toqstr(bib));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-05-02 19:17:59 +00:00
|
|
|
|
dialog_->add_->bibLW->clear();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
vector<string> bib_str;
|
|
|
|
|
controller().getBibFiles(bib_str);
|
|
|
|
|
for (vector<string>::const_iterator it = bib_str.begin();
|
|
|
|
|
it != bib_str.end(); ++it) {
|
2006-04-09 08:42:58 +00:00
|
|
|
|
string bibItem(changeExtension(*it, ""));
|
2006-05-02 19:17:59 +00:00
|
|
|
|
dialog_->add_->bibLW->addItem(toqstr(bibItem));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-03-20 10:24:23 +00:00
|
|
|
|
string bibstyle(controller().getStylefile());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2006-03-20 10:24:23 +00:00
|
|
|
|
dialog_->bibtocCB->setChecked(controller().bibtotoc() && !bibtopic);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
dialog_->bibtocCB->setEnabled(!bibtopic);
|
|
|
|
|
|
2006-10-20 13:53:43 +00:00
|
|
|
|
docstring btprint(controller().params()["btprint"]);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
int btp = 0;
|
|
|
|
|
if (btprint == "btPrintNotCited")
|
|
|
|
|
btp = 1;
|
|
|
|
|
else if (btprint == "btPrintAll")
|
|
|
|
|
btp = 2;
|
|
|
|
|
|
2006-08-17 08:50:34 +00:00
|
|
|
|
dialog_->btPrintCO->setCurrentIndex(btp);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
dialog_->btPrintCO->setEnabled(bibtopic);
|
|
|
|
|
|
|
|
|
|
dialog_->styleCB->clear();
|
|
|
|
|
|
|
|
|
|
int item_nr(-1);
|
|
|
|
|
|
|
|
|
|
vector<string> str;
|
|
|
|
|
controller().getBibStyles(str);
|
|
|
|
|
for (vector<string>::const_iterator it = str.begin();
|
|
|
|
|
it != str.end(); ++it) {
|
2006-04-09 08:42:58 +00:00
|
|
|
|
string item(changeExtension(*it, ""));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
if (item == bibstyle)
|
|
|
|
|
item_nr = int(it - str.begin());
|
2006-08-17 08:50:34 +00:00
|
|
|
|
dialog_->styleCB->addItem(toqstr(item));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item_nr == -1 && !bibstyle.empty()) {
|
2006-08-17 08:50:34 +00:00
|
|
|
|
dialog_->styleCB->addItem(toqstr(bibstyle));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
item_nr = dialog_->styleCB->count() - 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (item_nr != -1)
|
2006-08-17 08:50:34 +00:00
|
|
|
|
dialog_->styleCB->setCurrentIndex(item_nr);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
else
|
2006-08-17 08:50:34 +00:00
|
|
|
|
dialog_->styleCB->clearEditText();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
void GuiBibtex::apply()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2006-10-20 13:53:43 +00:00
|
|
|
|
docstring dbs(qstring_to_ucs4(dialog_->databaseLW->item(0)->text()));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2006-05-02 19:17:59 +00:00
|
|
|
|
unsigned int maxCount = dialog_->databaseLW->count();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
for (unsigned int i = 1; i < maxCount; i++) {
|
|
|
|
|
dbs += ',';
|
2006-10-20 13:53:43 +00:00
|
|
|
|
dbs += qstring_to_ucs4(dialog_->databaseLW->item(i)->text());
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-10-20 13:53:43 +00:00
|
|
|
|
controller().params()["bibfiles"] = dbs;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2006-10-20 13:53:43 +00:00
|
|
|
|
docstring const bibstyle(qstring_to_ucs4(dialog_->styleCB->currentText()));
|
2006-03-05 17:24:44 +00:00
|
|
|
|
bool const bibtotoc(dialog_->bibtocCB->isChecked());
|
|
|
|
|
|
|
|
|
|
if (bibtotoc && (!bibstyle.empty())) {
|
|
|
|
|
// both bibtotoc and style
|
2006-10-20 13:53:43 +00:00
|
|
|
|
controller().params()["options"] = "bibtotoc," + bibstyle;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
} else if (bibtotoc) {
|
|
|
|
|
// bibtotoc and no style
|
2007-04-25 16:39:21 +00:00
|
|
|
|
controller().params()["options"] = from_ascii("bibtotoc");
|
2006-03-05 17:24:44 +00:00
|
|
|
|
} else {
|
|
|
|
|
// only style. An empty one is valid, because some
|
|
|
|
|
// documentclasses have an own \bibliographystyle{}
|
|
|
|
|
// command!
|
2006-10-20 13:53:43 +00:00
|
|
|
|
controller().params()["options"] = bibstyle;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 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
|
2006-08-17 08:50:34 +00:00
|
|
|
|
int btp = dialog_->btPrintCO->currentIndex();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
switch (btp) {
|
|
|
|
|
case 0:
|
2007-04-25 16:39:21 +00:00
|
|
|
|
controller().params()["btprint"] = from_ascii("btPrintCited");
|
2006-03-05 17:24:44 +00:00
|
|
|
|
break;
|
|
|
|
|
case 1:
|
2007-04-25 16:39:21 +00:00
|
|
|
|
controller().params()["btprint"] = from_ascii("btPrintNotCited");
|
2006-03-05 17:24:44 +00:00
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2007-04-25 16:39:21 +00:00
|
|
|
|
controller().params()["btprint"] = from_ascii("btPrintAll");
|
2006-03-05 17:24:44 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!controller().usingBibtopic())
|
2006-10-20 13:53:43 +00:00
|
|
|
|
controller().params()["btprint"] = docstring();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
bool GuiBibtex::isValid()
|
2006-03-05 17:24:44 +00:00
|
|
|
|
{
|
2006-05-02 19:17:59 +00:00
|
|
|
|
return dialog_->databaseLW->count() != 0;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
2007-04-25 08:42:22 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
#include "GuiBibtex_moc.cpp"
|