From 1e08043e67b07203944e6162ba8b9c93da89390d Mon Sep 17 00:00:00 2001 From: =?UTF-8?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 | 274 ++++++++++++++-------------- 4 files changed, 211 insertions(+), 187 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,20 +22,102 @@ 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 + 0 + 0 + 0 + + + + The BibTeX style + + + St&yle + + + styleCB + + + + + + + Choose a style file + + + &Browse... + + + false + + + + + + + Choose a style file + + + true + + + true + + + false + + + + @@ -59,7 +138,7 @@ - + This bibliography section contains... @@ -81,112 +160,17 @@ - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - + + - Choose a style file + Add bibliography to the table of contents - &Browse... - - - false + Add bibliography to &TOC - - - - Choose a style file - - - true - - - true - - - false - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - Remove the selected database - - - &Delete - - - - - - - Add a BibTeX database file - - - &Add... - - - - - - - - 1 - 0 - 0 - 0 - - - - BibTeX database to use - - - Databa&ses - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - databaseLW - - - - + 0 @@ -235,24 +219,13 @@ - - - - - 1 - 0 - 0 - 0 - - + + - The BibTeX style + Move the selected database downwards in the list - St&yle - - - styleCB + Do&wn @@ -266,22 +239,52 @@ - - + + + + + 1 + 0 + 0 + 0 + + - Move the selected database downwards in the list + BibTeX database to use - Do&wn + Databa&ses + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + databaseLW + + + + + + + Add a BibTeX database file + + + &Add... + + + + + + + Remove the selected database + + + &Delete - - - qt_i18n.h - addBibPB deletePB @@ -292,6 +295,9 @@ okPB closePB + + qt_i18n.h +