]> git.lyx.org Git - features.git/commitdiff
Juergen's last bibtex patch
authorJohn Levon <levon@movementarian.org>
Tue, 17 Dec 2002 17:28:04 +0000 (17:28 +0000)
committerJohn Levon <levon@movementarian.org>
Tue, 17 Dec 2002 17:28:04 +0000 (17:28 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5842 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt2/ChangeLog
src/frontends/qt2/QBibtexDialog.C
src/frontends/qt2/QBibtexDialog.h
src/frontends/qt2/ui/QBibtexDialog.ui

index 2b3da94b8c407d430814ea65ead3a41536246efc..f0db100383234e750b97285e0366e4c254d1d8e4 100644 (file)
@@ -1,3 +1,9 @@
+2002-12-13  Juergen Spitzmueller  <j.spitzmueller@gmx.de>
+
+       * QBibtexDialog.[Ch]
+       * ui/QBibtexDialog.ui:
+       Add LineEdit for manual *.bib file insertion, ws changes.
+
 2002-12-17  John Levon  <levon@movementarian.org>
 
        * QLPopupMenu.C: add using endl
index 38469d6f22b49808cbb0c0904555fbe007d40a01..63c3c4b79cda1f2c7cffc277d66d74b699b14a1d 100644 (file)
@@ -24,6 +24,7 @@
 #include <qwidget.h>
 #include <qpushbutton.h>
 #include <qcombobox.h>
+#include <qlineedit.h>
 #include <qlistbox.h>
 #include <qcheckbox.h>
 #include <qfiledialog.h>
@@ -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()
 {
index 6e927a4202495ce7e30741943cc530db67222994..d88746c7d7fddaa96a5db09be5073bd5039f640e 100644 (file)
@@ -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 &);
index ff57f92a438b042ccadd5626f5f643b254c70f0e..e961a99118df267bf58881db68b59fbdfb17022d 100644 (file)
@@ -13,8 +13,8 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>293</width>
-            <height>318</height>
+            <width>285</width>
+            <height>333</height>
         </rect>
     </property>
     <property stdset="1">
             <name>spacing</name>
             <number>6</number>
         </property>
-        <widget row="8"  column="0"  rowspan="1"  colspan="2" >
-            <class>QLayoutWidget</class>
-            <property stdset="1">
-                <name>name</name>
-                <cstring>Layout8</cstring>
-            </property>
-            <hbox>
-                <property stdset="1">
-                    <name>margin</name>
-                    <number>0</number>
-                </property>
-                <property stdset="1">
-                    <name>spacing</name>
-                    <number>6</number>
-                </property>
-                <spacer>
-                    <property>
-                        <name>name</name>
-                        <cstring>Spacer1</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>orientation</name>
-                        <enum>Horizontal</enum>
-                    </property>
-                    <property stdset="1">
-                        <name>sizeType</name>
-                        <enum>Expanding</enum>
-                    </property>
-                    <property>
-                        <name>sizeHint</name>
-                        <size>
-                            <width>20</width>
-                            <height>20</height>
-                        </size>
-                    </property>
-                </spacer>
-                <widget>
-                    <class>QPushButton</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>okPB</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>OK</string>
-                    </property>
-                    <property stdset="1">
-                        <name>default</name>
-                        <bool>true</bool>
-                    </property>
-                </widget>
-                <widget>
-                    <class>QPushButton</class>
-                    <property stdset="1">
-                        <name>name</name>
-                        <cstring>closePB</cstring>
-                    </property>
-                    <property stdset="1">
-                        <name>text</name>
-                        <string>Cancel</string>
-                    </property>
-                </widget>
-            </hbox>
-        </widget>
         <widget row="0"  column="0"  rowspan="1"  colspan="2" >
             <class>QLabel</class>
             <property stdset="1">
                 <name>vAlign</name>
             </property>
         </widget>
+        <widget row="2"  column="0"  rowspan="3"  colspan="1" >
+            <class>QListBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>databaseLB</cstring>
+            </property>
+            <property stdset="1">
+                <name>enabled</name>
+                <bool>true</bool>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>Available BibTeX databases</string>
+            </property>
+        </widget>
         <widget row="1"  column="1" >
             <class>QPushButton</class>
             <property stdset="1">
                 <name>name</name>
-                <cstring>databasePB</cstring>
+                <cstring>addBibPB</cstring>
             </property>
             <property stdset="1">
                 <name>text</name>
-                <string>&amp;Add...</string>
+                <string>&amp;Add</string>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>Add a BibTeX database file</string>
             </property>
+        </widget>
+        <widget row="1"  column="0" >
+            <class>QLineEdit</class>
             <property stdset="1">
-                <name>autoDefault</name>
-                <bool>false</bool>
+                <name>name</name>
+                <cstring>addBibED</cstring>
             </property>
             <property>
                 <name>toolTip</name>
-                <string>Add a BibTeX database file</string>
+                <string>Add a BibTeX file manually</string>
             </property>
         </widget>
-        <widget row="5"  column="1" >
+        <widget row="2"  column="1" >
             <class>QPushButton</class>
             <property stdset="1">
                 <name>name</name>
-                <cstring>stylePB</cstring>
+                <cstring>databasePB</cstring>
             </property>
             <property stdset="1">
                 <name>text</name>
-                <string>&amp;Browse...</string>
+                <string>Bro&amp;wse...</string>
             </property>
             <property stdset="1">
                 <name>autoDefault</name>
             </property>
             <property>
                 <name>toolTip</name>
-                <string>Choose a style file</string>
+                <string>Browse for a BibTeX database file</string>
             </property>
         </widget>
-        <widget row="6"  column="1" >
+        <widget row="3"  column="1" >
             <class>QPushButton</class>
             <property stdset="1">
                 <name>name</name>
-                <cstring>styleListPB</cstring>
+                <cstring>deletePB</cstring>
             </property>
             <property stdset="1">
                 <name>text</name>
-                <string>&amp;Update</string>
-            </property>
-            <property stdset="1">
-                <name>autoDefault</name>
-                <bool>false</bool>
+                <string>&amp;Delete</string>
             </property>
             <property>
                 <name>toolTip</name>
-                <string>Update style list</string>
+                <string>Remove the selected database</string>
             </property>
         </widget>
-        <widget row="5"  column="0" >
+        <spacer row="4"  column="1" >
+            <property>
+                <name>name</name>
+                <cstring>Spacer4</cstring>
+            </property>
+            <property stdset="1">
+                <name>orientation</name>
+                <enum>Vertical</enum>
+            </property>
+            <property stdset="1">
+                <name>sizeType</name>
+                <enum>Expanding</enum>
+            </property>
+            <property>
+                <name>sizeHint</name>
+                <size>
+                    <width>20</width>
+                    <height>20</height>
+                </size>
+            </property>
+        </spacer>
+        <widget row="6"  column="0" >
             <class>QComboBox</class>
             <property stdset="1">
                 <name>name</name>
                 <bool>false</bool>
             </property>
         </widget>
-        <widget row="7"  column="0" >
-            <class>QCheckBox</class>
+        <widget row="5"  column="0" >
+            <class>QLabel</class>
             <property stdset="1">
                 <name>name</name>
-                <cstring>bibtocCB</cstring>
+                <cstring>styleLA</cstring>
             </property>
             <property stdset="1">
                 <name>text</name>
-                <string>Add bibliography to &amp;TOC</string>
+                <string>St&amp;yle</string>
+            </property>
+            <property>
+                <name>buddy</name>
+                <cstring>styleCB</cstring>
             </property>
             <property>
                 <name>toolTip</name>
-                <string>Add bibliography to the table of contents</string>
+                <string>The BibTeX style</string>
             </property>
         </widget>
-        <widget row="2"  column="1" >
+        <widget row="6"  column="1" >
             <class>QPushButton</class>
             <property stdset="1">
                 <name>name</name>
-                <cstring>deletePB</cstring>
+                <cstring>stylePB</cstring>
             </property>
             <property stdset="1">
                 <name>text</name>
-                <string>&amp;Delete</string>
+                <string>&amp;Browse...</string>
+            </property>
+            <property stdset="1">
+                <name>autoDefault</name>
+                <bool>false</bool>
             </property>
             <property>
                 <name>toolTip</name>
-                <string>Remove the selected database</string>
+                <string>Choose a style file</string>
             </property>
         </widget>
-        <widget row="1"  column="0"  rowspan="3"  colspan="1" >
-            <class>QListBox</class>
+        <widget row="7"  column="1" >
+            <class>QPushButton</class>
             <property stdset="1">
                 <name>name</name>
-                <cstring>databaseLB</cstring>
+                <cstring>styleListPB</cstring>
             </property>
             <property stdset="1">
-                <name>enabled</name>
-                <bool>true</bool>
+                <name>text</name>
+                <string>&amp;Update</string>
+            </property>
+            <property stdset="1">
+                <name>autoDefault</name>
+                <bool>false</bool>
             </property>
             <property>
                 <name>toolTip</name>
-                <string>Available BibTeX databases</string>
+                <string>Update style list</string>
             </property>
         </widget>
-        <spacer row="3"  column="1" >
-            <property>
-                <name>name</name>
-                <cstring>Spacer4</cstring>
-            </property>
-            <property stdset="1">
-                <name>orientation</name>
-                <enum>Vertical</enum>
-            </property>
+        <widget row="9"  column="0"  rowspan="1"  colspan="2" >
+            <class>QLayoutWidget</class>
             <property stdset="1">
-                <name>sizeType</name>
-                <enum>Expanding</enum>
-            </property>
-            <property>
-                <name>sizeHint</name>
-                <size>
-                    <width>20</width>
-                    <height>20</height>
-                </size>
+                <name>name</name>
+                <cstring>Layout8</cstring>
             </property>
-        </spacer>
-        <widget row="4"  column="0" >
-            <class>QLabel</class>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer1</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>okPB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>OK</string>
+                    </property>
+                    <property stdset="1">
+                        <name>default</name>
+                        <bool>true</bool>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>closePB</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Cancel</string>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <widget row="8"  column="0" >
+            <class>QCheckBox</class>
             <property stdset="1">
                 <name>name</name>
-                <cstring>styleLA</cstring>
+                <cstring>bibtocCB</cstring>
             </property>
             <property stdset="1">
                 <name>text</name>
-                <string>St&amp;yle</string>
-            </property>
-            <property>
-                <name>buddy</name>
-                <cstring>styleCB</cstring>
+                <string>Add bibliography to &amp;TOC</string>
             </property>
             <property>
                 <name>toolTip</name>
-                <string>The BibTeX style</string>
+                <string>Add bibliography to the table of contents</string>
             </property>
         </widget>
     </grid>
 </widget>
 <connections>
-    <connection>
-        <sender>databasePB</sender>
-        <signal>clicked()</signal>
-        <receiver>QBibtexDialogBase</receiver>
-        <slot>addPressed()</slot>
-    </connection>
     <connection>
         <sender>stylePB</sender>
         <signal>clicked()</signal>
         <receiver>QBibtexDialogBase</receiver>
         <slot>browsePressed()</slot>
     </connection>
-    <connection>
-        <sender>bibtocCB</sender>
-        <signal>toggled(bool)</signal>
-        <receiver>QBibtexDialogBase</receiver>
-        <slot>change_adaptor()</slot>
-    </connection>
     <connection>
         <sender>deletePB</sender>
         <signal>clicked()</signal>
         <receiver>QBibtexDialogBase</receiver>
         <slot>change_adaptor()</slot>
     </connection>
+    <connection>
+        <sender>bibtocCB</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>QBibtexDialogBase</receiver>
+        <slot>change_adaptor()</slot>
+    </connection>
+    <connection>
+        <sender>databasePB</sender>
+        <signal>clicked()</signal>
+        <receiver>QBibtexDialogBase</receiver>
+        <slot>browseBibPressed()</slot>
+    </connection>
+    <connection>
+        <sender>addBibPB</sender>
+        <signal>clicked()</signal>
+        <receiver>QBibtexDialogBase</receiver>
+        <slot>addPressed()</slot>
+    </connection>
     <slot access="public">addPressed()</slot>
     <slot access="public">browsePressed()</slot>
     <slot access="public">change_adaptor()</slot>
-    <slot access="public">deletePressed()</slot>
     <slot access="public">databaseChanged()</slot>
+    <slot access="public">deletePressed()</slot>
+    <slot access="public">browseBibPressed()</slot>
     <slot access="public">styleChanged(const QString &amp;)</slot>
 </connections>
 <tabstops>