Pavel Sanda wrote:

> if you implement only additional parameters for programs detected by
> configure and then run some kind of execvp call rather than the normal
> system call, no additional program can be run that way.

Thanks.

Here comes the first step. This implements the possibility to record all 
available programs of a sort in alternative RCs.

bibtex_command and index_command use this. In Prefs, you can now select from 
a set of predefined programs (if they were found), configure their options 
or define a custom command.

No per-document setting yet, this is the next step.

Comments?

Jürgen
Index: lib/configure.py
===================================================================
--- lib/configure.py	(Revision 29541)
+++ lib/configure.py	(Arbeitskopie)
@@ -178,6 +178,67 @@
     return ['', not_found]
 
 
+## Searching some useful programs
+def checkProgAlternatives(description, progs, rc_entry = [], alt_rc_entry = [], path = [], not_found = ''):
+    ''' 
+        The same as checkProg, but additionally, all found programs will be added
+        as alt_rc_entries
+    '''
+    # one rc entry for each progs plus not_found entry
+    if len(rc_entry) > 1 and len(rc_entry) != len(progs) + 1:
+        logger.error("rc entry should have one item or item for each prog and not_found.")
+        sys.exit(2)
+    # check if alt rcs are given
+    if len(alt_rc_entry) > 1 and len(alt_rc_entry) != len(rc_entry):
+        logger.error("invalid alt_rc_entry specification.")
+        sys.exit(2)
+    logger.info('checking for ' + description + '...')
+    ## print '(' + ','.join(progs) + ')',
+    found_prime = False
+    real_ac_dir = ''
+    real_ac_word = not_found
+    for idx in range(len(progs)):
+        # ac_prog may have options, ac_word is the command name
+        ac_prog = progs[idx]
+        ac_word = ac_prog.split(' ')[0]
+        msg = '+checking for "' + ac_word + '"... '
+        path = os.environ["PATH"].split(os.pathsep) + path
+        extlist = ['']
+        if os.environ.has_key("PATHEXT"):
+            extlist = extlist + os.environ["PATHEXT"].split(os.pathsep)
+        found_alt = False
+        for ac_dir in path:
+            for ext in extlist:
+                if os.path.isfile( os.path.join(ac_dir, ac_word + ext) ):
+                    logger.info(msg + ' yes')
+                    # write rc entries for this command
+                    if found_prime == False:
+                        if len(rc_entry) == 1:
+                            addToRC(rc_entry[0].replace('%%', ac_prog))
+                        elif len(rc_entry) > 1:
+                            addToRC(rc_entry[idx].replace('%%', ac_prog))
+                        real_ac_dir = ac_dir
+                        real_ac_word = ac_word
+                        found_prime = True
+                    if len(alt_rc_entry) == 1:
+                        addToRC(alt_rc_entry[0].replace('%%', ac_prog))
+                    elif len(alt_rc_entry) > 1:
+                        addToRC(alt_rc_entry[idx].replace('%%', ac_prog))
+                    found_alt = True
+                    break
+            if found_alt:
+                break
+        if found_alt == False:
+            # if not successful
+            logger.info(msg + ' no')
+    if found_prime:
+        return [real_ac_dir, real_ac_word]
+    # write rc entries for 'not found'
+    if len(rc_entry) > 0:  # the last one.
+        addToRC(rc_entry[-1].replace('%%', not_found))
+    return ['', not_found]
+
+
 def checkViewer(description, progs, rc_entry = [], path = []):
     ''' The same as checkProg, but for viewers and editors '''
     return checkProg(description, progs, rc_entry, path, not_found = 'auto')
@@ -599,12 +660,14 @@
     ''' entries other than Format and Converter '''
     checkProg('ChkTeX', ['chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'],
         rc_entry = [ r'\chktex_command "%%"' ])
-    checkProg('BibTeX', ['bibtex'],
-        rc_entry = [ r'\bibtex_command "%%"' ])
+    checkProgAlternatives('BibTeX or alternative programs', ['bibtex', 'bibtex8', 'biber'],
+        rc_entry = [ r'\bibtex_command "%%"' ],
+        alt_rc_entry = [ r'\bibtex_alternatives "%%"' ])
     checkProg('JBibTeX, the Japanese BibTeX', ['jbibtex', 'bibtex'],
         rc_entry = [ r'\jbibtex_command "%%"' ])
-    checkProg('an index processor', ['texindy', 'makeindex -c -q'],
-        rc_entry = [ r'\index_command "%%"' ])
+    checkProgAlternatives('available index processors', ['texindy', 'makeindex -c -q'],
+        rc_entry = [ r'\index_command "%%"' ],
+        alt_rc_entry = [ r'\index_alternatives "%%"' ])
     checkProg('an index processor appropriate to Japanese', ['mendex -c -q', 'makeindex -c -q'],
         rc_entry = [ r'\jindex_command "%%"' ])
     checkProg('the splitindex processor', ['splitindex.pl', 'java splitindex', 'splitindex'],
Index: src/LyXRC.h
===================================================================
--- src/LyXRC.h	(Revision 29541)
+++ src/LyXRC.h	(Arbeitskopie)
@@ -23,6 +23,7 @@
 #include "support/strfwd.h"
 
 #include <string>
+#include <vector>
 
 
 namespace lyx {
@@ -46,6 +47,7 @@
 		RC_AUTOSAVE,
 		RC_AUTO_NUMBER,
 		RC_BACKUPDIR_PATH,
+		RC_BIBTEX_ALTERNATIVES,
 		RC_BIBTEX_COMMAND,
 		RC_BINDFILE,
 		RC_CHECKLASTFILES,
@@ -84,6 +86,7 @@
 		RC_FULL_SCREEN_WIDTH,
 		RC_GEOMETRY_SESSION,
 		RC_GROUP_LAYOUTS,
+		RC_INDEX_ALTERNATIVES,
 		RC_INDEX_COMMAND,
 		RC_INPUT,
 		RC_JBIBTEX_COMMAND,
@@ -245,10 +248,14 @@
 	PAPER_SIZE default_papersize;
 	/// command to run chktex incl. options
 	std::string chktex_command;
+	/// all available commands to run bibtex incl. options
+	std::vector<std::string> bibtex_alternatives;
 	/// command to run bibtex incl. options
 	std::string bibtex_command;
 	/// command to run japanese bibtex incl. options
 	std::string jbibtex_command;
+	/// all available index commands incl. options
+	std::vector<std::string> index_alternatives;
 	/// command to run makeindex incl. options or other index programs
 	std::string index_command;
 	/// command to run japanese index program incl. options
Index: src/frontends/qt4/GuiPrefs.cpp
===================================================================
--- src/frontends/qt4/GuiPrefs.cpp	(Revision 29541)
+++ src/frontends/qt4/GuiPrefs.cpp	(Arbeitskopie)
@@ -569,10 +569,14 @@
 		this, SIGNAL(changed()));
 	connect(latexChecktexED, SIGNAL(textChanged(QString)),
 		this, SIGNAL(changed()));
+	connect(latexBibtexCO, SIGNAL(activated(int)),
+		this, SIGNAL(changed()));
 	connect(latexBibtexED, SIGNAL(textChanged(QString)),
 		this, SIGNAL(changed()));
 	connect(latexJBibtexED, SIGNAL(textChanged(QString)),
 		this, SIGNAL(changed()));
+	connect(latexIndexCO, SIGNAL(activated(int)),
+		this, SIGNAL(changed()));
 	connect(latexIndexED, SIGNAL(textChanged(QString)),
 		this, SIGNAL(changed()));
 	connect(latexJIndexED, SIGNAL(textChanged(QString)),
@@ -594,13 +598,77 @@
 }
 
 
+void PrefLatex::on_latexBibtexCO_activated(int n)
+{
+	QString const bibtex = latexBibtexCO->itemData(n).toString();
+	if (bibtex.isEmpty()) {
+		latexBibtexED->clear();
+		latexBibtexOptionsLA->setText(qt_("C&ommand:"));
+		return;
+	}
+	for (vector<string>::const_iterator it = bibtex_alternatives.begin();
+	     it != bibtex_alternatives.end(); ++it) {
+		QString const bib = toqstr(*it);
+		int ind = bib.indexOf(" ");
+		QString sel_command = bib.left(ind);
+		QString sel_options = bib;
+		sel_options.remove(0, ind);
+		if (bibtex == sel_command) {
+			if (ind == -1)
+				latexBibtexED->clear();
+			else
+				latexBibtexED->setText(sel_options.trimmed());
+		}
+	}
+	latexBibtexOptionsLA->setText(qt_("&Options:"));
+}
+
+
+void PrefLatex::on_latexIndexCO_activated(int n)
+{
+	QString const index = latexIndexCO->itemData(n).toString();
+	if (index.isEmpty()) {
+		latexIndexED->clear();
+		latexIndexOptionsLA->setText(qt_("Co&mmand:"));
+		return;
+	}
+	for (vector<string>::const_iterator it = index_alternatives.begin();
+	     it != index_alternatives.end(); ++it) {
+		QString const idx = toqstr(*it);
+		int ind = idx.indexOf(" ");
+		QString sel_command = idx.left(ind);
+		QString sel_options = idx;
+		sel_options.remove(0, ind);
+		if (index == sel_command) {
+			if (ind == -1)
+				latexIndexED->clear();
+			else
+				latexIndexED->setText(sel_options.trimmed());
+		}
+	}
+	latexIndexOptionsLA->setText(qt_("Op&tions:"));
+}
+
+
 void PrefLatex::apply(LyXRC & rc) const
 {
+	QString const bibtex = latexBibtexCO->itemData(
+		latexBibtexCO->currentIndex()).toString();
+	if (bibtex.isEmpty())
+		rc.bibtex_command = fromqstr(latexBibtexED->text());
+	else
+		rc.bibtex_command = fromqstr(bibtex) + " " + fromqstr(latexBibtexED->text());
+
+	QString const index = latexIndexCO->itemData(
+		latexIndexCO->currentIndex()).toString();
+	if (index.isEmpty())
+		rc.index_command = fromqstr(latexIndexED->text());
+	else
+		rc.index_command = fromqstr(index) + " " + fromqstr(latexIndexED->text());
+
 	rc.fontenc = fromqstr(latexEncodingED->text());
 	rc.chktex_command = fromqstr(latexChecktexED->text());
-	rc.bibtex_command = fromqstr(latexBibtexED->text());
 	rc.jbibtex_command = fromqstr(latexJBibtexED->text());
-	rc.index_command = fromqstr(latexIndexED->text());
 	rc.jindex_command = fromqstr(latexJIndexED->text());
 	rc.nomencl_command = fromqstr(latexNomenclED->text());
 	rc.auto_reset_options = latexAutoresetCB->isChecked();
@@ -615,11 +683,65 @@
 
 void PrefLatex::update(LyXRC const & rc)
 {
+	latexBibtexCO->clear();
+
+	latexBibtexCO->addItem(qt_("Custom"), QString());
+	for (vector<string>::const_iterator it = rc.bibtex_alternatives.begin();
+			     it != rc.bibtex_alternatives.end(); ++it) {
+		QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
+		latexBibtexCO->addItem(command, command);
+	}
+
+	bibtex_alternatives = rc.bibtex_alternatives;
+
+	QString const bib = toqstr(rc.bibtex_command);
+	int ind = bib.indexOf(" ");
+	QString sel_command = bib.left(ind);
+	QString sel_options = bib;
+	sel_options.remove(0, ind);
+
+	int pos = latexBibtexCO->findData(sel_command);
+	if (pos != -1) {
+		latexBibtexCO->setCurrentIndex(pos);
+		latexBibtexED->setText(sel_options.trimmed());
+		latexBibtexOptionsLA->setText(qt_("&Options:"));
+	} else {
+		latexBibtexED->setText(toqstr(rc.bibtex_command));
+		latexBibtexCO->setCurrentIndex(0);
+		latexBibtexOptionsLA->setText(qt_("C&ommand:"));
+	}
+
+	latexIndexCO->clear();
+
+	latexIndexCO->addItem(qt_("Custom"), QString());
+	for (vector<string>::const_iterator it = rc.index_alternatives.begin();
+			     it != rc.index_alternatives.end(); ++it) {
+		QString const command = toqstr(*it).left(toqstr(*it).indexOf(" "));
+		latexIndexCO->addItem(command, command);
+	}
+
+	index_alternatives = rc.index_alternatives;
+
+	QString const idx = toqstr(rc.index_command);
+	ind = idx.indexOf(" ");
+	sel_command = idx.left(ind);
+	sel_options = idx;
+	sel_options.remove(0, ind);
+
+	pos = latexIndexCO->findData(sel_command);
+	if (pos != -1) {
+		latexIndexCO->setCurrentIndex(pos);
+		latexIndexED->setText(sel_options.trimmed());
+		latexIndexOptionsLA->setText(qt_("Op&tions:"));
+	} else {
+		latexIndexED->setText(toqstr(rc.index_command));
+		latexIndexCO->setCurrentIndex(0);
+		latexIndexOptionsLA->setText(qt_("Co&mmand:"));
+	}
+
 	latexEncodingED->setText(toqstr(rc.fontenc));
 	latexChecktexED->setText(toqstr(rc.chktex_command));
-	latexBibtexED->setText(toqstr(rc.bibtex_command));
 	latexJBibtexED->setText(toqstr(rc.jbibtex_command));
-	latexIndexED->setText(toqstr(rc.index_command));
 	latexJIndexED->setText(toqstr(rc.jindex_command));
 	latexNomenclED->setText(toqstr(rc.nomencl_command));
 	latexAutoresetCB->setChecked(rc.auto_reset_options);
Index: src/frontends/qt4/ui/PrefLatexUi.ui
===================================================================
--- src/frontends/qt4/ui/PrefLatexUi.ui	(Revision 29541)
+++ src/frontends/qt4/ui/PrefLatexUi.ui	(Arbeitskopie)
@@ -5,47 +5,54 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>427</width>
-    <height>367</height>
+    <width>489</width>
+    <height>636</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string/>
   </property>
-  <layout class="QGridLayout" >
-   <property name="margin" >
-    <number>9</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <item row="11" column="0" colspan="3" >
+  <layout class="QGridLayout" name="gridLayout_3" >
+   <item row="0" column="0" colspan="2" >
+    <widget class="QLabel" name="latexEncodingLA" >
+     <property name="text" >
+      <string>Te&amp;X encoding:</string>
+     </property>
+     <property name="buddy" >
+      <cstring>latexEncodingED</cstring>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2" >
+    <widget class="QLineEdit" name="latexEncodingED" />
+   </item>
+   <item rowspan="2" row="0" column="3" >
     <spacer>
      <property name="orientation" >
-      <enum>Qt::Vertical</enum>
+      <enum>Qt::Horizontal</enum>
      </property>
      <property name="sizeType" >
       <enum>QSizePolicy::Expanding</enum>
      </property>
-     <property name="sizeHint" >
+     <property name="sizeHint" stdset="0" >
       <size>
-       <width>409</width>
-       <height>21</height>
+       <width>21</width>
+       <height>52</height>
       </size>
      </property>
     </spacer>
    </item>
-   <item row="10" column="0" colspan="3" >
-    <widget class="QCheckBox" name="latexAutoresetCB" >
-     <property name="toolTip" >
-      <string>Set class options to default on class change</string>
-     </property>
+   <item row="1" column="0" colspan="2" >
+    <widget class="QLabel" name="latexPaperSizeLA" >
      <property name="text" >
-      <string>R&amp;eset class options when document class changes</string>
+      <string>Default paper si&amp;ze:</string>
      </property>
+     <property name="buddy" >
+      <cstring>latexPaperSizeCO</cstring>
+     </property>
     </widget>
    </item>
-   <item row="1" column="1" >
+   <item row="1" column="2" >
     <widget class="QComboBox" name="latexPaperSizeCO" >
      <item>
       <property name="text" >
@@ -89,90 +96,208 @@
      </item>
     </widget>
    </item>
-   <item row="0" column="1" >
-    <widget class="QLineEdit" name="latexEncodingED" />
-   </item>
-   <item rowspan="2" row="0" column="2" >
-    <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>52</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="2" column="0" >
-    <widget class="QLabel" name="latexChecktexLA" >
+   <item row="2" column="0" colspan="2" >
+    <widget class="QLabel" name="latexDviPaperLA" >
      <property name="text" >
-      <string>Chec&amp;kTeX command:</string>
+      <string>&amp;DVI viewer paper size options:</string>
      </property>
      <property name="buddy" >
-      <cstring>latexChecktexED</cstring>
+      <cstring>latexDviPaperED</cstring>
      </property>
     </widget>
    </item>
-   <item row="2" column="1" colspan="2" >
-    <widget class="QLineEdit" name="latexChecktexED" >
+   <item row="2" column="2" colspan="2" >
+    <widget class="QLineEdit" name="latexDviPaperED" >
      <property name="toolTip" >
-      <string>CheckTeX start options and flags</string>
+      <string>Optional paper size flag (-paper) for some DVI viewers</string>
      </property>
     </widget>
    </item>
-   <item row="0" column="0" >
-    <widget class="QLabel" name="latexEncodingLA" >
-     <property name="text" >
-      <string>Te&amp;X encoding:</string>
+   <item row="3" column="0" colspan="4" >
+    <widget class="QGroupBox" name="bibtexGB" >
+     <property name="title" >
+      <string>Bibliography generation</string>
      </property>
-     <property name="buddy" >
-      <cstring>latexEncodingED</cstring>
+     <property name="flat" >
+      <bool>true</bool>
      </property>
+     <layout class="QGridLayout" name="gridLayout" >
+      <item row="0" column="0" >
+       <layout class="QHBoxLayout" name="horizontalLayout" >
+        <item>
+         <widget class="QLabel" name="latexBibtexLA" >
+          <property name="text" >
+           <string>&amp;Processor:</string>
+          </property>
+          <property name="buddy" >
+           <cstring>latexBibtexCO</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="latexBibtexCO" />
+        </item>
+       </layout>
+      </item>
+      <item row="1" column="0" >
+       <layout class="QHBoxLayout" name="horizontalLayout_2" >
+        <item>
+         <widget class="QLabel" name="latexBibtexOptionsLA" >
+          <property name="text" >
+           <string>&amp;Options:</string>
+          </property>
+          <property name="buddy" >
+           <cstring>latexBibtexED</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="latexBibtexED" >
+          <property name="toolTip" >
+           <string>BibTeX command and options</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item row="2" column="0" >
+       <layout class="QHBoxLayout" name="horizontalLayout_3" >
+        <item>
+         <widget class="QLabel" name="latexJBibtexLA" >
+          <property name="text" >
+           <string>Processor for &amp;Japanese:</string>
+          </property>
+          <property name="buddy" >
+           <cstring>latexJBibtexED</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="latexJBibtexED" >
+          <property name="toolTip" >
+           <string>Specific BibTeX command and options for pLaTeX (Japanese)</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+     <zorder>latexBibtexLA</zorder>
+     <zorder>latexBibtexCO</zorder>
+     <zorder>latexBibtexED</zorder>
+     <zorder>latexBibtexOptionsLA</zorder>
+     <zorder>latexJBibtexED</zorder>
+     <zorder>latexJBibtexLA</zorder>
+     <zorder>latexDviPaperED</zorder>
+     <zorder>latexDviPaperLA</zorder>
     </widget>
    </item>
-   <item row="1" column="0" >
-    <widget class="QLabel" name="latexPaperSizeLA" >
+   <item row="4" column="0" colspan="4" >
+    <widget class="QGroupBox" name="indexGB" >
+     <property name="title" >
+      <string>Index generation</string>
+     </property>
+     <property name="flat" >
+      <bool>true</bool>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_2" >
+      <item row="0" column="0" >
+       <layout class="QHBoxLayout" name="horizontalLayout_4" >
+        <item>
+         <widget class="QLabel" name="latexIndexLA" >
+          <property name="text" >
+           <string>Pr&amp;ocessor:</string>
+          </property>
+          <property name="buddy" >
+           <cstring>latexIndexCO</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="latexIndexCO" />
+        </item>
+       </layout>
+      </item>
+      <item row="1" column="0" >
+       <layout class="QHBoxLayout" name="horizontalLayout_5" >
+        <item>
+         <widget class="QLabel" name="latexIndexOptionsLA" >
+          <property name="text" >
+           <string>Op&amp;tions:</string>
+          </property>
+          <property name="buddy" >
+           <cstring>latexIndexED</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="latexIndexED" >
+          <property name="toolTip" >
+           <string>Index command and options (makeindex, xindy)</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+      <item row="2" column="0" >
+       <layout class="QHBoxLayout" name="horizontalLayout_6" >
+        <item>
+         <widget class="QLabel" name="latexJIndexLA" >
+          <property name="text" >
+           <string>Processor for Ja&amp;panese:</string>
+          </property>
+          <property name="buddy" >
+           <cstring>latexJIndexED</cstring>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="latexJIndexED" >
+          <property name="toolTip" >
+           <string>Specific index command and options for pLaTeX (Japanese)</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="5" column="0" >
+    <widget class="QLabel" name="latexNomenclLA" >
      <property name="text" >
-      <string>Default paper si&amp;ze:</string>
+      <string>&amp;Nomenclature command:</string>
      </property>
      <property name="buddy" >
-      <cstring>latexPaperSizeCO</cstring>
+      <cstring>latexNomenclED</cstring>
      </property>
     </widget>
    </item>
-   <item row="3" column="1" colspan="2" >
-    <widget class="QLineEdit" name="latexBibtexED" >
+   <item row="5" column="1" colspan="3" >
+    <widget class="QLineEdit" name="latexNomenclED" >
      <property name="toolTip" >
-      <string>BibTeX command and options</string>
+      <string>Command and options for nomencl (usually makeindex)</string>
      </property>
     </widget>
    </item>
-   <item row="3" column="0" >
-    <widget class="QLabel" name="latexBibtexLA" >
+   <item row="6" column="0" >
+    <widget class="QLabel" name="latexChecktexLA" >
      <property name="text" >
-      <string>&amp;BibTeX command:</string>
+      <string>Chec&amp;kTeX command:</string>
      </property>
      <property name="buddy" >
-      <cstring>latexBibtexED</cstring>
+      <cstring>latexChecktexED</cstring>
      </property>
     </widget>
    </item>
-   <item row="7" column="0" >
-    <widget class="QLabel" name="latexNomenclLA" >
-     <property name="text" >
-      <string>&amp;Nomenclature command:</string>
+   <item row="6" column="1" colspan="3" >
+    <widget class="QLineEdit" name="latexChecktexED" >
+     <property name="toolTip" >
+      <string>CheckTeX start options and flags</string>
      </property>
-     <property name="buddy" >
-      <cstring>latexNomenclED</cstring>
-     </property>
     </widget>
    </item>
-   <item row="9" column="0" colspan="3" >
+   <item row="7" column="0" colspan="4" >
     <widget class="QCheckBox" name="pathCB" >
      <property name="enabled" >
       <bool>true</bool>
@@ -191,81 +316,32 @@
      </property>
     </widget>
    </item>
-   <item row="7" column="1" colspan="2" >
-    <widget class="QLineEdit" name="latexNomenclED" >
+   <item row="8" column="0" colspan="4" >
+    <widget class="QCheckBox" name="latexAutoresetCB" >
      <property name="toolTip" >
-      <string>Command and options for nomencl (usually makeindex)</string>
+      <string>Set class options to default on class change</string>
      </property>
-    </widget>
-   </item>
-   <item row="5" column="1" colspan="2" >
-    <widget class="QLineEdit" name="latexIndexED" >
-     <property name="toolTip" >
-      <string>Index command and options (makeindex, xindy)</string>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="0" >
-    <widget class="QLabel" name="latexIndexLA" >
      <property name="text" >
-      <string>&amp;Index command:</string>
+      <string>R&amp;eset class options when document class changes</string>
      </property>
-     <property name="buddy" >
-      <cstring>latexIndexED</cstring>
-     </property>
     </widget>
    </item>
-   <item row="6" column="1" colspan="2" >
-    <widget class="QLineEdit" name="latexJIndexED" >
-     <property name="toolTip" >
-      <string>Specific index command and options for pLaTeX (Japanese)</string>
+   <item row="9" column="0" colspan="4" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
      </property>
-    </widget>
-   </item>
-   <item row="4" column="1" colspan="2" >
-    <widget class="QLineEdit" name="latexJBibtexED" >
-     <property name="toolTip" >
-      <string>Specific BibTeX command and options for pLaTeX (Japanese)</string>
+     <property name="sizeType" >
+      <enum>QSizePolicy::Expanding</enum>
      </property>
-    </widget>
-   </item>
-   <item row="4" column="0" >
-    <widget class="QLabel" name="latexJBibtexLA" >
-     <property name="text" >
-      <string>BibTeX command (&amp;Japanese):</string>
+     <property name="sizeHint" stdset="0" >
+      <size>
+       <width>409</width>
+       <height>21</height>
+      </size>
      </property>
-     <property name="buddy" >
-      <cstring>latexJBibtexED</cstring>
-     </property>
-    </widget>
+    </spacer>
    </item>
-   <item row="6" column="0" >
-    <widget class="QLabel" name="latexJIndexLA" >
-     <property name="text" >
-      <string>Index command (Ja&amp;panese):</string>
-     </property>
-     <property name="buddy" >
-      <cstring>latexJIndexED</cstring>
-     </property>
-    </widget>
-   </item>
-   <item row="8" column="1" colspan="2" >
-    <widget class="QLineEdit" name="latexDviPaperED" >
-     <property name="toolTip" >
-      <string>Optional paper size flag (-paper) for some DVI viewers</string>
-     </property>
-    </widget>
-   </item>
-   <item row="8" column="0" >
-    <widget class="QLabel" name="latexDviPaperLA" >
-     <property name="text" >
-      <string>&amp;DVI viewer paper size options:</string>
-     </property>
-     <property name="buddy" >
-      <cstring>latexDviPaperED</cstring>
-     </property>
-    </widget>
-   </item>
   </layout>
  </widget>
  <tabstops>
Index: src/frontends/qt4/GuiPrefs.h
===================================================================
--- src/frontends/qt4/GuiPrefs.h	(Revision 29541)
+++ src/frontends/qt4/GuiPrefs.h	(Arbeitskopie)
@@ -221,6 +221,16 @@
 
 	virtual void apply(LyXRC & rc) const;
 	virtual void update(LyXRC const & rc);
+
+private Q_SLOTS:
+	void on_latexBibtexCO_activated(int n);
+	void on_latexIndexCO_activated(int n);
+
+private:
+	///
+	std::vector<std::string> bibtex_alternatives;
+	///
+	std::vector<std::string> index_alternatives;
 };
 
 
Index: src/LyXFunc.cpp
===================================================================
--- src/LyXFunc.cpp	(Revision 29541)
+++ src/LyXFunc.cpp	(Arbeitskopie)
@@ -1880,6 +1880,7 @@
 	case LyXRC::RC_AUTOSAVE:
 	case LyXRC::RC_AUTO_NUMBER:
 	case LyXRC::RC_BACKUPDIR_PATH:
+	case LyXRC::RC_BIBTEX_ALTERNATIVES:
 	case LyXRC::RC_BIBTEX_COMMAND:
 	case LyXRC::RC_BINDFILE:
 	case LyXRC::RC_CHECKLASTFILES:
@@ -1919,6 +1920,7 @@
 	case LyXRC::RC_FONT_ENCODING:
 	case LyXRC::RC_FORMAT:
 	case LyXRC::RC_GROUP_LAYOUTS:
+	case LyXRC::RC_INDEX_ALTERNATIVES:
 	case LyXRC::RC_INDEX_COMMAND:
 	case LyXRC::RC_JBIBTEX_COMMAND:
 	case LyXRC::RC_JINDEX_COMMAND:
Index: src/LyXRC.cpp
===================================================================
--- src/LyXRC.cpp	(Revision 29541)
+++ src/LyXRC.cpp	(Arbeitskopie)
@@ -61,6 +61,7 @@
 	{ "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
 	{ "\\autosave", LyXRC::RC_AUTOSAVE },
 	{ "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
+	{ "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
 	{ "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
 	{ "\\bind_file", LyXRC::RC_BINDFILE },
 	{ "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
@@ -97,6 +98,7 @@
 	{ "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
 	{ "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
 	{ "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
+	{ "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
 	{ "\\index_command", LyXRC::RC_INDEX_COMMAND },
 	{ "\\input", LyXRC::RC_INPUT },
 	{ "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
@@ -592,6 +594,12 @@
 			}
 			break;
 
+		case RC_BIBTEX_ALTERNATIVES:
+			if (lexrc.next(true)) {
+				bibtex_alternatives.push_back(lexrc.getString());
+			}
+			break;
+
 		case RC_BIBTEX_COMMAND:
 			if (lexrc.next(true)) {
 				bibtex_command = lexrc.getString();
@@ -604,6 +612,12 @@
 			}
 			break;
 
+		case RC_INDEX_ALTERNATIVES:
+			if (lexrc.next(true)) {
+				index_alternatives.push_back(lexrc.getString());
+			}
+			break;
+
 		case RC_INDEX_COMMAND:
 			if (lexrc.next(true)) {
 				index_command = lexrc.getString();
@@ -1351,6 +1365,15 @@
 		}
 		if (tag != RC_LAST)
 			break;
+	case RC_BIBTEX_ALTERNATIVES:
+		if (ignore_system_lyxrc ||
+		    bibtex_alternatives != system_lyxrc.bibtex_alternatives) {
+			for (vector<string>::const_iterator it = bibtex_alternatives.begin();
+			     it != bibtex_alternatives.end(); ++it)
+			os << "\\bibtex_alternatives \"" << *it << "\"\n";
+		}
+		if (tag != RC_LAST)
+			break;
 	case RC_BIBTEX_COMMAND:
 		if (ignore_system_lyxrc ||
 		    bibtex_command != system_lyxrc.bibtex_command) {
@@ -1365,6 +1388,15 @@
 		}
 		if (tag != RC_LAST)
 			break;
+	case RC_INDEX_ALTERNATIVES:
+		if (ignore_system_lyxrc ||
+		    index_alternatives != system_lyxrc.index_alternatives) {
+			for (vector<string>::const_iterator it = index_alternatives.begin();
+			     it != index_alternatives.end(); ++it)
+			os << "\\index_alternatives \"" << *it << "\"\n";
+		}
+		if (tag != RC_LAST)
+			break;
 	case RC_INDEX_COMMAND:
 		if (ignore_system_lyxrc ||
 		    index_command != system_lyxrc.index_command) {

Reply via email to