2 * \file QBibtexDialog.C
3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author John Levon <moz@compsoc.man.ac.uk>
10 #include <qpushbutton.h>
11 #include <qcombobox.h>
13 #include <qcheckbox.h>
14 #include <qfiledialog.h>
16 #include "QBibtexDialog.h"
19 #include "ControlBibtex.h"
23 #include "support/filetools.h"
25 QBibtexDialog::QBibtexDialog(QBibtex * form)
26 : QBibtexDialogBase(0, 0, false, 0),
29 connect(okPB, SIGNAL(clicked()),
30 form, SLOT(slotOK()));
31 connect(closePB, SIGNAL(clicked()),
32 form, SLOT(slotClose()));
36 void QBibtexDialog::change_adaptor()
42 void QBibtexDialog::browsePressed()
44 QString file = QFileDialog::getOpenFileName(QString::null,
45 _("BibTeX style files (*.bst)"), this, 0, _("Select a BibTeX style"));
46 lyxerr << "HELLO" << std::endl;
48 lyxerr << "MONKEYS" << std::endl;
49 styleED->setText(ChangeExtension(OnlyFilename(file.latin1()), "").c_str());
55 void QBibtexDialog::addPressed()
57 string file(QFileDialog::getOpenFileName(QString::null,
58 _("BibTeX database files (*.bib)"), this, 0, _("Select a BibTeX database to add")).latin1());
60 // FIXME: check duplicates
61 databaseLB->insertItem(ChangeExtension(file, "").c_str());
67 void QBibtexDialog::styleChanged(const QString & sel)
69 if (string(_("Other ...")) == sel.latin1() && !form_->readOnly()) {
70 styleED->setEnabled(true);
71 stylePB->setEnabled(true);
73 styleED->setEnabled(false);
74 stylePB->setEnabled(false);
80 void QBibtexDialog::closeEvent(QCloseEvent *e)