]> git.lyx.org Git - features.git/commitdiff
more bib stuff from Juergen
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 14 Feb 2003 17:23:50 +0000 (17:23 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 14 Feb 2003 17:23:50 +0000 (17:23 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6158 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/scripts/TeXFiles.sh
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlBibtex.C
src/frontends/controllers/ControlBibtex.h
src/frontends/qt2/ChangeLog
src/frontends/qt2/QBibtex.C
src/frontends/qt2/QBibtexDialog.C
src/frontends/qt2/ui/QBibtexDialogBase.ui

index b9cbc0ae20bd71f1c2063e70b53deb6daa80e5dc..62bc8bcbe3d9264f4fbfc27b4ffed689cae50c31 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-14  Juergen Spitzmueller  <j.spitzmueller@gmx.de>
+
+       * scripts/TeXFiles.sh: Add search for *.bib-files (>bibFiles.lst)
+       changed version to 0.3.
+
 2003-02-11  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * templates/elsart.lyx: 
index 976c8749ac797a5c4a8e85874af334bf9d58e7c8..0572e3c3e1fbda19cc0cf3d42e24ce8a4ea70f2b 100755 (executable)
@@ -4,27 +4,31 @@
 # TeX class files      -> option cls 
 # TeX style files      -> option sty
 # bibtex style files   -> option bst
+# bibtex database files -> option bib
 #
 # with the help
 # of kpsewhich and creates a 
-# bstFiles.lst, clsFiles.lst, styFiles.lst
+# bstFiles.lst, clsFiles.lst, styFiles.lst, bibFiles.lst
 # without any parameter all files are created.
 #
 # Herbert Voss <voss@perce.org>
 #
 # Updates from Jean-Marc Lasgouttes.
 #
+# bib support added by Juergen Spitzmueller (v0.3)
+#
 CLS_STYLEFILE=clsFiles.lst
 STY_STYLEFILE=styFiles.lst
 BST_STYLEFILE=bstFiles.lst
-version='$Id: TeXFiles.sh,v 0.2 2001-10-15'
+BIB_FILES=bibFiles.lst
+version='$Id: TeXFiles.sh,v 0.3 2003-02-14'
 progname=`echo $0 | sed 's%.*/%%'`
-usage="Usage: TeXFiles.sh [-version | cls | sty | bst] 
+usage="Usage: TeXFiles.sh [-version | cls | sty | bst | bib 
        Default is without any Parameters,
        so that all files will be created"
 
 types=$1
-test -z "$types" && types="cls sty bst"
+test -z "$types" && types="cls sty bst bib"
 
 #
 # MS-DOS and MS-Windows define $COMSPEC or $ComSpec and use ';' to separate
@@ -59,6 +63,8 @@ for type in $types ; do
         kpsetype=.tex;;
    bst) outfile=$BST_STYLEFILE
         kpsetype=.bst;;
+   bib) outfile=$BIB_FILES
+        kpsetype=.bib;;
    *)   echo "ERROR: unknown type $type"
         exit 1;;
   esac
index 0325a69eedbc34a7da8486795a06c7e40a87bb92..4a6e9ca0e39f03d6c2caba4d9b932b915a39b038 100644 (file)
@@ -1,4 +1,7 @@
-2003-02-09  Juergen Spitzmueller  <j.spitzmueller@gmx.de>
+2003-02-14  Juergen Spitzmueller  <j.spitzmueller@gmx.de>
+
+       * ControlBibtex.[Ch]: new function getBibFiles() (provides list
+       of available *.bib-files from bibFiles.lst).
 
        * tex_helpers.C (getTexFileList): sort and dis-duplicate
        listWithoutPath correctly.
index b4fea638a2553643d1822eb054dd4505dd78d745..4fb819857ea2978b86444995d7b24b157d017857 100644 (file)
@@ -76,6 +76,18 @@ string const ControlBibtex::getBibStyles() const
 }
 
 
+string const ControlBibtex::getBibFiles() const
+{
+       string list = getTexFileList("bibFiles.lst", false);
+       // test, if we have a valid list, otherwise run rescan
+       if (list.empty()) {
+               rescanBibStyles();
+               list = getTexFileList("bibFiles.lst", false);
+       }
+       return list;
+}
+
+
 void ControlBibtex::rescanBibStyles() const
 {
        rescanTexStyles();
index 4811dcd6df98bd99d7655a2d33a0042c6d4e809f..aee1e5b25116a1f3dc1cee7dad0740d6d6eebcaa 100644 (file)
@@ -26,7 +26,9 @@ public:
        string const Browse(string const &, string const &, string const &);
        /// get the list of bst files
        string const getBibStyles() const;
-       /// build filelists of all availabe bst/cls/sty-files. done through
+       /// get the list of bib files
+       string const getBibFiles() const;
+       /// build filelists of all availabe bib/bst/cls/sty-files. done through
        /// kpsewhich and an external script, saved in *Files.lst
        void rescanBibStyles() const;
 private:
index cc3cd688e5d5da9ca6b1fd0b2385b4a176340b85..8c867c808d22db952182e54872ccd45a1552701c 100644 (file)
@@ -9,7 +9,10 @@
        * QBibtexDialog.C: Fix browsing mechanism of *.sty files (bug 773).
 
        * ui/QBibtexDialogBase.ui: Remove unused Update button (bug 773).
+       Replace addBib LineEdit with ComboBox.
 
+       * QBibtex.C: Insert available .bib-files into addBibCB. 
+       
 2003-02-13  John Levon  <levon@movementarian.org>
 
        * ui/QSpellcheckerDialogBase.ui: A&dd not &Add, bug 884
index 3dc5cae1acab1bfbd4611e5ad356ca184a30d57a..7fe91194116a378f94b6e586a4993400d7ab7a5b 100644 (file)
@@ -71,6 +71,18 @@ void QBibtex::update_contents()
                if (!bib.empty())
                        dialog_->databaseLB->insertItem(toqstr(bib));
        }
+       
+       dialog_->addBibCB->clear();
+
+       vector<string> const bib_str = getVectorFromString(
+               controller().getBibFiles(), "\n");
+       for (vector<string>::const_iterator it = bib_str.begin();
+               it != bib_str.end(); ++it) {
+               string bibItem(ChangeExtension(*it, ""));
+               dialog_->addBibCB->insertItem(toqstr(bibItem));
+       }
+       dialog_->addBibCB->clearEdit();
+
 
        string bibtotoc = "bibtotoc";
        string bibstyle(controller().params().getOptions());
index 260ca756fc96122cccf5bd8ad82418ad398ab73f..b21cda289527dcca42ef4dc1f89e09672afd71bc 100644 (file)
@@ -60,7 +60,7 @@ void QBibtexDialog::browsePressed()
        if (!file.isNull()) {
                string const filen = ChangeExtension(fromqstr(file), "");
                bool present = false;
-               int pres = 0;
+               unsigned int pres = 0;
 
                for (unsigned int i = 0; i != styleCB->count(); i++) {
                        if (fromqstr(styleCB->text(i)) == filen) {
@@ -100,7 +100,7 @@ void QBibtexDialog::browseBibPressed()
 
 void QBibtexDialog::addPressed()
 {
-       QString const file = addBibED->text();
+       QString const file = addBibCB->currentText();
        if (!file.isNull()) {
                string const f = ChangeExtension(file.latin1(), "");
                bool present = false;
index 9ab985fdf1f044342f52911bfec7ddba410ff2a4..d3609c9336dcf10b1da449664c4b3bc15b693843 100644 (file)
@@ -13,7 +13,7 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>281</width>
+            <width>265</width>
             <height>315</height>
         </rect>
     </property>
@@ -72,7 +72,7 @@
             </property>
             <property>
                 <name>toolTip</name>
-                <string>Available BibTeX databases</string>
+                <string>Selected BibTeX databases</string>
             </property>
         </widget>
         <widget row="1"  column="1" >
                 <string>Add a BibTeX database file</string>
             </property>
         </widget>
-        <widget row="1"  column="0" >
-            <class>QLineEdit</class>
-            <property stdset="1">
-                <name>name</name>
-                <cstring>addBibED</cstring>
-            </property>
-            <property>
-                <name>toolTip</name>
-                <string>Add a BibTeX file manually</string>
-            </property>
-        </widget>
         <widget row="2"  column="1" >
             <class>QPushButton</class>
             <property stdset="1">
                 </size>
             </property>
         </spacer>
-        <widget row="6"  column="0" >
-            <class>QComboBox</class>
-            <property stdset="1">
-                <name>name</name>
-                <cstring>styleCB</cstring>
-            </property>
-            <property stdset="1">
-                <name>editable</name>
-                <bool>true</bool>
-            </property>
-            <property stdset="1">
-                <name>autoCompletion</name>
-                <bool>true</bool>
-            </property>
-            <property stdset="1">
-                <name>duplicatesEnabled</name>
-                <bool>false</bool>
-            </property>
-        </widget>
         <widget row="5"  column="0" >
             <class>QLabel</class>
             <property stdset="1">
                 <string>Choose a style file</string>
             </property>
         </widget>
-        <widget row="9"  column="0"  rowspan="1"  colspan="2" >
+        <widget row="8"  column="0"  rowspan="1"  colspan="2" >
             <class>QLayoutWidget</class>
             <property stdset="1">
                 <name>name</name>
                 </widget>
             </hbox>
         </widget>
-        <widget row="8"  column="0" >
+        <widget row="7"  column="0" >
             <class>QCheckBox</class>
             <property stdset="1">
                 <name>name</name>
                 <string>Add bibliography to the table of contents</string>
             </property>
         </widget>
+        <widget row="6"  column="0" >
+            <class>QComboBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>styleCB</cstring>
+            </property>
+            <property stdset="1">
+                <name>editable</name>
+                <bool>true</bool>
+            </property>
+            <property stdset="1">
+                <name>autoCompletion</name>
+                <bool>true</bool>
+            </property>
+            <property stdset="1">
+                <name>duplicatesEnabled</name>
+                <bool>false</bool>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>Chose a style file</string>
+            </property>
+        </widget>
+        <widget row="1"  column="0" >
+            <class>QComboBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>addBibCB</cstring>
+            </property>
+            <property stdset="1">
+                <name>editable</name>
+                <bool>true</bool>
+            </property>
+            <property stdset="1">
+                <name>autoCompletion</name>
+                <bool>true</bool>
+            </property>
+            <property stdset="1">
+                <name>duplicatesEnabled</name>
+                <bool>false</bool>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>Select a database</string>
+            </property>
+        </widget>
     </grid>
 </widget>
 <connections>