From: John Levon Date: Tue, 17 Dec 2002 17:28:04 +0000 (+0000) Subject: Juergen's last bibtex patch X-Git-Tag: 1.6.10~17786 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=329e1efdd0714f6c3fbb7724509bc36957146336;p=features.git Juergen's last bibtex patch git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5842 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 2b3da94b8c..f0db100383 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,9 @@ +2002-12-13 Juergen Spitzmueller + + * QBibtexDialog.[Ch] + * ui/QBibtexDialog.ui: + Add LineEdit for manual *.bib file insertion, ws changes. + 2002-12-17 John Levon * QLPopupMenu.C: add using endl diff --git a/src/frontends/qt2/QBibtexDialog.C b/src/frontends/qt2/QBibtexDialog.C index 38469d6f22..63c3c4b79c 100644 --- a/src/frontends/qt2/QBibtexDialog.C +++ b/src/frontends/qt2/QBibtexDialog.C @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -53,7 +54,7 @@ void QBibtexDialog::change_adaptor() void QBibtexDialog::browsePressed() { - QString file = + QString const file = QFileDialog::getOpenFileName(QString::null, _("BibTeX style files (*.bst)"), this, @@ -66,15 +67,15 @@ void QBibtexDialog::browsePressed() } } -void QBibtexDialog::addPressed() +void QBibtexDialog::browseBibPressed() { - QString file = QFileDialog::getOpenFileName(QString::null, + QString const file = QFileDialog::getOpenFileName(QString::null, _("BibTeX database files (*.bib)"), this, 0, _("Select a BibTeX database to add")); if (!file.isNull()) { string const f = ChangeExtension(file.latin1(), ""); bool present = false; - for(unsigned int i = 0; i!=databaseLB->count(); i++) { - if (databaseLB->text(i).latin1()==f) + for(unsigned int i = 0; i != databaseLB->count(); ++i) { + if (databaseLB->text(i).latin1() == f) present = true; } @@ -85,6 +86,23 @@ void QBibtexDialog::addPressed() } } +void QBibtexDialog::addPressed() +{ + QString const file = addBibED->text(); + if (!file.isNull()) { + string const f = ChangeExtension(file.latin1(), ""); + bool present = false; + for(unsigned int i = 0; i != databaseLB->count(); ++i) { + if (databaseLB->text(i).latin1() == f) + present = true; + + } + if (!present) { + databaseLB->insertItem(f.c_str()); + form_->changed(); + } + } +} void QBibtexDialog::deletePressed() { diff --git a/src/frontends/qt2/QBibtexDialog.h b/src/frontends/qt2/QBibtexDialog.h index 6e927a4202..d88746c7d7 100644 --- a/src/frontends/qt2/QBibtexDialog.h +++ b/src/frontends/qt2/QBibtexDialog.h @@ -27,6 +27,7 @@ public: protected slots: virtual void change_adaptor(); virtual void browsePressed(); + virtual void browseBibPressed(); virtual void addPressed(); virtual void deletePressed(); virtual void styleChanged(const QString &); diff --git a/src/frontends/qt2/ui/QBibtexDialog.ui b/src/frontends/qt2/ui/QBibtexDialog.ui index ff57f92a43..e961a99118 100644 --- a/src/frontends/qt2/ui/QBibtexDialog.ui +++ b/src/frontends/qt2/ui/QBibtexDialog.ui @@ -13,8 +13,8 @@ 0 0 - 293 - 318 + 285 + 333 @@ -34,70 +34,6 @@ spacing 6 - - QLayoutWidget - - name - Layout8 - - - - margin - 0 - - - spacing - 6 - - - - name - Spacer1 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QPushButton - - name - okPB - - - text - OK - - - default - true - - - - QPushButton - - name - closePB - - - text - Cancel - - - - QLabel @@ -124,34 +60,56 @@ vAlign + + QListBox + + name + databaseLB + + + enabled + true + + + toolTip + Available BibTeX databases + + QPushButton name - databasePB + addBibPB text - &Add... + &Add + + + toolTip + Add a BibTeX database file + + + QLineEdit - autoDefault - false + name + addBibED toolTip - Add a BibTeX database file + Add a BibTeX file manually - + QPushButton name - stylePB + databasePB text - &Browse... + Bro&wse... autoDefault @@ -159,29 +117,46 @@ toolTip - Choose a style file + Browse for a BibTeX database file - + QPushButton name - styleListPB + deletePB text - &Update - - - autoDefault - false + &Delete toolTip - Update style list + Remove the selected database - + + + name + Spacer4 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + QComboBox name @@ -200,112 +175,151 @@ false - - QCheckBox + + QLabel name - bibtocCB + styleLA text - Add bibliography to &TOC + St&yle + + + buddy + styleCB toolTip - Add bibliography to the table of contents + The BibTeX style - + QPushButton name - deletePB + stylePB text - &Delete + &Browse... + + + autoDefault + false toolTip - Remove the selected database + Choose a style file - - QListBox + + QPushButton name - databaseLB + styleListPB - enabled - true + text + &Update + + + autoDefault + false toolTip - Available BibTeX databases + Update style list - - - name - Spacer4 - - - orientation - Vertical - + + QLayoutWidget - sizeType - Expanding - - - sizeHint - - 20 - 20 - + name + Layout8 - - - QLabel + + + margin + 0 + + + spacing + 6 + + + + name + Spacer1 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + QPushButton + + name + okPB + + + text + OK + + + default + true + + + + QPushButton + + name + closePB + + + text + Cancel + + + + + + QCheckBox name - styleLA + bibtocCB text - St&yle - - - buddy - styleCB + Add bibliography to &TOC toolTip - The BibTeX style + Add bibliography to the table of contents - - databasePB - clicked() - QBibtexDialogBase - addPressed() - stylePB clicked() QBibtexDialogBase browsePressed() - - bibtocCB - toggled(bool) - QBibtexDialogBase - change_adaptor() - deletePB clicked() @@ -330,11 +344,30 @@ QBibtexDialogBase change_adaptor() + + bibtocCB + toggled(bool) + QBibtexDialogBase + change_adaptor() + + + databasePB + clicked() + QBibtexDialogBase + browseBibPressed() + + + addBibPB + clicked() + QBibtexDialogBase + addPressed() + addPressed() browsePressed() change_adaptor() - deletePressed() databaseChanged() + deletePressed() + browseBibPressed() styleChanged(const QString &)