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
This commit is contained in:
Jürgen Spitzmüller 2008-12-02 08:46:59 +00:00
parent cf6e817709
commit 1e08043e67
4 changed files with 211 additions and 187 deletions

View File

@ -79,6 +79,8 @@ GuiBibtex::GuiBibtex(GuiView & lv)
this, SLOT(change_adaptor())); this, SLOT(change_adaptor()));
connect(addBibPB, SIGNAL(clicked()), connect(addBibPB, SIGNAL(clicked()),
this, SLOT(addPressed())); this, SLOT(addPressed()));
connect(rescanPB, SIGNAL(clicked()),
this, SLOT(rescanClicked()));
add_ = new GuiBibtexAddDialog(this); add_ = new GuiBibtexAddDialog(this);
add_bc_.setPolicy(ButtonPolicy::OkCancelPolicy); add_bc_.setPolicy(ButtonPolicy::OkCancelPolicy);
@ -92,6 +94,8 @@ GuiBibtex::GuiBibtex(GuiView & lv)
this, SLOT(addDatabase())); this, SLOT(addDatabase()));
connect(add_->addPB, SIGNAL(clicked()), connect(add_->addPB, SIGNAL(clicked()),
add_, SLOT(accept())); add_, SLOT(accept()));
connect(add_->rescanPB, SIGNAL(clicked()),
this, SLOT(rescanClicked()));
connect(add_->bibLW, SIGNAL(itemActivated(QListWidgetItem *)), connect(add_->bibLW, SIGNAL(itemActivated(QListWidgetItem *)),
this, SLOT(addDatabase())); this, SLOT(addDatabase()));
connect(add_->bibLW, SIGNAL(itemActivated(QListWidgetItem *)), connect(add_->bibLW, SIGNAL(itemActivated(QListWidgetItem *)),
@ -264,6 +268,13 @@ void GuiBibtex::downPressed()
} }
void GuiBibtex::rescanClicked()
{
rescanBibStyles();
updateContents();
}
void GuiBibtex::databaseChanged() void GuiBibtex::databaseChanged()
{ {
bool readOnly = isBufferReadonly(); bool readOnly = isBufferReadonly();

View File

@ -54,6 +54,7 @@ private Q_SLOTS:
void databaseChanged(); void databaseChanged();
void availableChanged(); void availableChanged();
void bibEDChanged(); void bibEDChanged();
void rescanClicked();
private: private:
/// ///

View File

@ -1,7 +1,4 @@
<ui version="4.0" > <ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>BibtexAddUi</class> <class>BibtexAddUi</class>
<widget class="QDialog" name="BibtexAddUi" > <widget class="QDialog" name="BibtexAddUi" >
<property name="geometry" > <property name="geometry" >
@ -33,14 +30,61 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="0" colspan="2" > <item row="2" column="2" >
<widget class="QListWidget" name="bibLW" > <widget class="QPushButton" name="rescanPB" >
<property name="selectionMode" > <property name="toolTip" >
<enum>QAbstractItemView::ExtendedSelection</enum> <string>Scan for new databases and styles</string>
</property>
<property name="text" >
<string>&amp;Rescan</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" colspan="2" > <item row="2" column="0" >
<widget class="QPushButton" name="browsePB" >
<property name="text" >
<string>&amp;Browse...</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
<property name="default" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>21</width>
<height>29</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="3" >
<widget class="QLineEdit" name="bibED" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Enter BibTeX database name</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3" >
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" > <property name="margin" >
<number>0</number> <number>0</number>
@ -89,56 +133,15 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="1" > <item row="0" column="0" colspan="3" >
<spacer> <widget class="QListWidget" name="bibLW" >
<property name="orientation" > <property name="selectionMode" >
<enum>Qt::Horizontal</enum> <enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QLineEdit" name="bibED" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>Enter BibTeX database name</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QPushButton" name="browsePB" >
<property name="text" >
<string>&amp;Browse...</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
<property name="default" >
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<pixmapfunction></pixmapfunction>
<includes>
<include location="local" >qt_i18n.h</include>
</includes>
<tabstops> <tabstops>
<tabstop>bibLW</tabstop> <tabstop>bibLW</tabstop>
<tabstop>bibED</tabstop> <tabstop>bibED</tabstop>
@ -146,6 +149,9 @@
<tabstop>addPB</tabstop> <tabstop>addPB</tabstop>
<tabstop>closePB</tabstop> <tabstop>closePB</tabstop>
</tabstops> </tabstops>
<includes>
<include location="local" >qt_i18n.h</include>
</includes>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -1,7 +1,4 @@
<ui version="4.0" > <ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>BibtexUi</class> <class>BibtexUi</class>
<widget class="QDialog" name="BibtexUi" > <widget class="QDialog" name="BibtexUi" >
<property name="geometry" > <property name="geometry" >
@ -9,7 +6,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>352</width> <width>352</width>
<height>313</height> <height>334</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
@ -25,20 +22,102 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item rowspan="5" row="1" column="0" colspan="2" > <item rowspan="2" row="9" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item rowspan="6" row="1" column="0" colspan="2" >
<widget class="QListWidget" name="databaseLW" /> <widget class="QListWidget" name="databaseLW" />
</item> </item>
<item row="9" column="0" colspan="2" > <item rowspan="2" row="6" column="2" >
<widget class="QCheckBox" name="bibtocCB" > <widget class="QPushButton" name="rescanPB" >
<property name="toolTip" > <property name="toolTip" >
<string>Add bibliography to the table of contents</string> <string>Scan for new databases and styles</string>
</property> </property>
<property name="text" > <property name="text" >
<string>Add bibliography to &amp;TOC</string> <string>&amp;Rescan</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0" > <item row="5" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>77</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0" colspan="2" >
<widget class="QLabel" name="styleLA" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>The BibTeX style</string>
</property>
<property name="text" >
<string>St&amp;yle</string>
</property>
<property name="buddy" >
<cstring>styleCB</cstring>
</property>
</widget>
</item>
<item row="8" column="2" >
<widget class="QPushButton" name="stylePB" >
<property name="toolTip" >
<string>Choose a style file</string>
</property>
<property name="text" >
<string>&amp;Browse...</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="8" column="0" colspan="2" >
<widget class="QComboBox" name="styleCB" >
<property name="toolTip" >
<string>Choose a style file</string>
</property>
<property name="editable" >
<bool>true</bool>
</property>
<property name="autoCompletion" >
<bool>true</bool>
</property>
<property name="duplicatesEnabled" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="9" column="0" >
<widget class="QLabel" name="btPrintLA" > <widget class="QLabel" name="btPrintLA" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy>
@ -59,7 +138,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1" > <item row="9" column="1" >
<widget class="QComboBox" name="btPrintCO" > <widget class="QComboBox" name="btPrintCO" >
<property name="toolTip" > <property name="toolTip" >
<string>This bibliography section contains...</string> <string>This bibliography section contains...</string>
@ -81,112 +160,17 @@
</item> </item>
</widget> </widget>
</item> </item>
<item rowspan="2" row="8" column="2" > <item row="10" column="0" colspan="2" >
<spacer> <widget class="QCheckBox" name="bibtocCB" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="2" >
<widget class="QPushButton" name="stylePB" >
<property name="toolTip" > <property name="toolTip" >
<string>Choose a style file</string> <string>Add bibliography to the table of contents</string>
</property> </property>
<property name="text" > <property name="text" >
<string>&amp;Browse...</string> <string>Add bibliography to &amp;TOC</string>
</property>
<property name="autoDefault" >
<bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0" colspan="2" > <item row="11" column="0" colspan="3" >
<widget class="QComboBox" name="styleCB" >
<property name="toolTip" >
<string>Choose a style file</string>
</property>
<property name="editable" >
<bool>true</bool>
</property>
<property name="autoCompletion" >
<bool>true</bool>
</property>
<property name="duplicatesEnabled" >
<bool>false</bool>
</property>
</widget>
</item>
<item rowspan="2" row="5" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2" >
<widget class="QPushButton" name="deletePB" >
<property name="toolTip" >
<string>Remove the selected database</string>
</property>
<property name="text" >
<string>&amp;Delete</string>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="addBibPB" >
<property name="toolTip" >
<string>Add a BibTeX database file</string>
</property>
<property name="text" >
<string>&amp;Add...</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3" >
<widget class="QLabel" name="databaseLA" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>BibTeX database to use</string>
</property>
<property name="text" >
<string>Databa&amp;ses</string>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="buddy" >
<cstring>databaseLW</cstring>
</property>
</widget>
</item>
<item row="10" column="0" colspan="3" >
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" > <property name="margin" >
<number>0</number> <number>0</number>
@ -235,24 +219,13 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="6" column="0" colspan="2" > <item row="4" column="2" >
<widget class="QLabel" name="styleLA" > <widget class="QPushButton" name="downPB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" > <property name="toolTip" >
<string>The BibTeX style</string> <string>Move the selected database downwards in the list</string>
</property> </property>
<property name="text" > <property name="text" >
<string>St&amp;yle</string> <string>Do&amp;wn</string>
</property>
<property name="buddy" >
<cstring>styleCB</cstring>
</property> </property>
</widget> </widget>
</item> </item>
@ -266,22 +239,52 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="2" > <item row="0" column="0" colspan="3" >
<widget class="QPushButton" name="downPB" > <widget class="QLabel" name="databaseLA" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" > <property name="toolTip" >
<string>Move the selected database downwards in the list</string> <string>BibTeX database to use</string>
</property> </property>
<property name="text" > <property name="text" >
<string>Do&amp;wn</string> <string>Databa&amp;ses</string>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="buddy" >
<cstring>databaseLW</cstring>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="addBibPB" >
<property name="toolTip" >
<string>Add a BibTeX database file</string>
</property>
<property name="text" >
<string>&amp;Add...</string>
</property>
</widget>
</item>
<item row="2" column="2" >
<widget class="QPushButton" name="deletePB" >
<property name="toolTip" >
<string>Remove the selected database</string>
</property>
<property name="text" >
<string>&amp;Delete</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<pixmapfunction></pixmapfunction>
<includes>
<include location="local" >qt_i18n.h</include>
</includes>
<tabstops> <tabstops>
<tabstop>addBibPB</tabstop> <tabstop>addBibPB</tabstop>
<tabstop>deletePB</tabstop> <tabstop>deletePB</tabstop>
@ -292,6 +295,9 @@
<tabstop>okPB</tabstop> <tabstop>okPB</tabstop>
<tabstop>closePB</tabstop> <tabstop>closePB</tabstop>
</tabstops> </tabstops>
<includes>
<include location="local" >qt_i18n.h</include>
</includes>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>