From 1e08043e67b07203944e6162ba8b9c93da89390d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 2 Dec 2008 08:46:59 +0000 Subject: [PATCH] Add button to rescan the list of bib/bst files from within the dialogs. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27761 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiBibtex.cpp | 11 ++ src/frontends/qt4/GuiBibtex.h | 1 + src/frontends/qt4/ui/BibtexAddUi.ui | 112 ++++++------- src/frontends/qt4/ui/BibtexUi.ui | 234 ++++++++++++++-------------- 4 files changed, 191 insertions(+), 167 deletions(-) diff --git a/src/frontends/qt4/GuiBibtex.cpp b/src/frontends/qt4/GuiBibtex.cpp index 881c669edc..ff0a03e272 100644 --- a/src/frontends/qt4/GuiBibtex.cpp +++ b/src/frontends/qt4/GuiBibtex.cpp @@ -79,6 +79,8 @@ GuiBibtex::GuiBibtex(GuiView & lv) this, SLOT(change_adaptor())); connect(addBibPB, SIGNAL(clicked()), this, SLOT(addPressed())); + connect(rescanPB, SIGNAL(clicked()), + this, SLOT(rescanClicked())); add_ = new GuiBibtexAddDialog(this); add_bc_.setPolicy(ButtonPolicy::OkCancelPolicy); @@ -92,6 +94,8 @@ GuiBibtex::GuiBibtex(GuiView & lv) this, SLOT(addDatabase())); connect(add_->addPB, SIGNAL(clicked()), add_, SLOT(accept())); + connect(add_->rescanPB, SIGNAL(clicked()), + this, SLOT(rescanClicked())); connect(add_->bibLW, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(addDatabase())); connect(add_->bibLW, SIGNAL(itemActivated(QListWidgetItem *)), @@ -264,6 +268,13 @@ void GuiBibtex::downPressed() } +void GuiBibtex::rescanClicked() +{ + rescanBibStyles(); + updateContents(); +} + + void GuiBibtex::databaseChanged() { bool readOnly = isBufferReadonly(); diff --git a/src/frontends/qt4/GuiBibtex.h b/src/frontends/qt4/GuiBibtex.h index e9b6a16ee3..3ce3ada32d 100644 --- a/src/frontends/qt4/GuiBibtex.h +++ b/src/frontends/qt4/GuiBibtex.h @@ -54,6 +54,7 @@ private Q_SLOTS: void databaseChanged(); void availableChanged(); void bibEDChanged(); + void rescanClicked(); private: /// diff --git a/src/frontends/qt4/ui/BibtexAddUi.ui b/src/frontends/qt4/ui/BibtexAddUi.ui index b9bbaca9ae..4b7353eb45 100644 --- a/src/frontends/qt4/ui/BibtexAddUi.ui +++ b/src/frontends/qt4/ui/BibtexAddUi.ui @@ -1,7 +1,4 @@ - - - BibtexAddUi @@ -33,14 +30,61 @@ 6 - - - - QAbstractItemView::ExtendedSelection + + + + Scan for new databases and styles + + + &Rescan + + + + + + + &Browse... + + + false + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 21 + 29 + + + + + + + + + 7 + 0 + 0 + 0 + + + + Enter BibTeX database name - + 0 @@ -89,56 +133,15 @@ - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - - 7 - 0 - 0 - 0 - - - - Enter BibTeX database name - - - - - - - &Browse... - - - false - - - true + + + + QAbstractItemView::ExtendedSelection - - - qt_i18n.h - bibLW bibED @@ -146,6 +149,9 @@ addPB closePB + + qt_i18n.h + diff --git a/src/frontends/qt4/ui/BibtexUi.ui b/src/frontends/qt4/ui/BibtexUi.ui index 21f72c4733..ebcd369f24 100644 --- a/src/frontends/qt4/ui/BibtexUi.ui +++ b/src/frontends/qt4/ui/BibtexUi.ui @@ -1,7 +1,4 @@ - - - BibtexUi @@ -9,7 +6,7 @@ 0 0 352 - 313 + 334 @@ -25,21 +22,53 @@ 6 - + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + - - + + - Add bibliography to the table of contents + Scan for new databases and styles - Add bibliography to &TOC + &Rescan - - + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 77 + 16 + + + + + + 1 @@ -49,55 +78,17 @@ - This bibliography section contains... + The BibTeX style - &Content: + St&yle styleCB - - - - This bibliography section contains... - - - - all cited references - - - - - all uncited references - - - - - all references - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - + Choose a style file @@ -110,7 +101,7 @@ - + Choose a style file @@ -126,67 +117,60 @@ - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - + + + + + 1 + 0 + 0 + 0 + - - - - - Remove the selected database + This bibliography section contains... - &Delete + &Content: + + + styleCB - - + + - Add a BibTeX database file - - - &Add... + This bibliography section contains... + + + all cited references + + + + + all uncited references + + + + + all references + + - - - - - 1 - 0 - 0 - 0 - - + + - BibTeX database to use + Add bibliography to the table of contents - Databa&ses - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - databaseLW + Add bibliography to &TOC - + 0 @@ -235,8 +219,28 @@ - - + + + + Move the selected database downwards in the list + + + Do&wn + + + + + + + Move the selected database upwards in the list + + + &Up + + + + + 1 @@ -246,42 +250,41 @@ - The BibTeX style + BibTeX database to use - St&yle + Databa&ses + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - styleCB + databaseLW - - + + - Move the selected database upwards in the list + Add a BibTeX database file - &Up + &Add... - - + + - Move the selected database downwards in the list + Remove the selected database - Do&wn + &Delete - - - qt_i18n.h - addBibPB deletePB @@ -292,6 +295,9 @@ okPB closePB + + qt_i18n.h + -- 2.39.2