]> git.lyx.org Git - features.git/commitdiff
improve fontenc GUI.
authorJürgen Spitzmüller <spitz@lyx.org>
Sun, 29 Nov 2009 13:29:36 +0000 (13:29 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sun, 29 Nov 2009 13:29:36 +0000 (13:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32227 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/GuiPrefs.h
src/frontends/qt4/ui/PrefLatexUi.ui

index cae0dbc8127f3931d9d7e9955c8c98dd9f77a13d..ea71bfdfce6cd660d2830918a588c178f0fcc9b6 100644 (file)
@@ -590,6 +590,8 @@ PrefLatex::PrefLatex(GuiPreferences * form)
        : PrefModule(qt_(catOutput), qt_("LaTeX"), form)
 {
        setupUi(this);
+       connect(latexEncodingCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
        connect(latexEncodingED, SIGNAL(textChanged(QString)),
                this, SIGNAL(changed()));
        connect(latexChecktexED, SIGNAL(textChanged(QString)),
@@ -623,6 +625,12 @@ PrefLatex::PrefLatex(GuiPreferences * form)
 }
 
 
+void PrefLatex::on_latexEncodingCB_stateChanged(int state)
+{
+       latexEncodingED->setEnabled(state == Qt::Checked);
+}
+
+
 void PrefLatex::on_latexBibtexCO_activated(int n)
 {
        QString const bibtex = latexBibtexCO->itemData(n).toString();
@@ -699,7 +707,10 @@ void PrefLatex::apply(LyXRC & rc) const
        else
                rc.index_command = fromqstr(index) + " " + fromqstr(idxopt);
 
-       rc.fontenc = fromqstr(latexEncodingED->text());
+       if (latexEncodingCB->isChecked())
+               rc.fontenc = fromqstr(latexEncodingED->text());
+       else
+               rc.fontenc = "default";
        rc.chktex_command = fromqstr(latexChecktexED->text());
        rc.jbibtex_command = fromqstr(latexJBibtexED->text());
        rc.jindex_command = fromqstr(latexJIndexED->text());
@@ -770,7 +781,14 @@ void PrefLatex::update(LyXRC const & rc)
                latexIndexOptionsLA->setText(qt_("Co&mmand:"));
        }
 
-       latexEncodingED->setText(toqstr(rc.fontenc));
+       if (rc.fontenc == "default") {
+               latexEncodingCB->setChecked(false);
+               latexEncodingED->setEnabled(false);
+       } else {
+               latexEncodingCB->setChecked(true);
+               latexEncodingED->setEnabled(true);
+               latexEncodingED->setText(toqstr(rc.fontenc));
+       }
        latexChecktexED->setText(toqstr(rc.chktex_command));
        latexJBibtexED->setText(toqstr(rc.jbibtex_command));
        latexJIndexED->setText(toqstr(rc.jindex_command));
index f0d953997625c1857ab2e616dc91a6db894622d1..2a0405fb3ec337eb1a482fd30757f8fe31bf801a 100644 (file)
@@ -226,6 +226,7 @@ public:
        virtual void update(LyXRC const & rc);
 
 private Q_SLOTS:
+       void on_latexEncodingCB_stateChanged(int state);
        void on_latexBibtexCO_activated(int n);
        void on_latexIndexCO_activated(int n);
 
index 3fdd0c9439666e3ece838bbf124bb426d410dd56..499fe5a5a5d90a7393486087d184ae37c7583e9c 100644 (file)
   <property name="windowTitle" >
    <string/>
   </property>
-  <layout class="QGridLayout" name="gridLayout_3" >
+  <layout class="QGridLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
    <item row="0" column="0" colspan="2" >
-    <widget class="QLabel" name="latexEncodingLA" >
-     <property name="text" >
-      <string>Te&amp;X encoding:</string>
+    <widget class="QCheckBox" name="latexEncodingCB" >
+     <property name="toolTip" >
+      <string>Enable if a specific font encoding (such as T1) should be used (via fontenc)</string>
      </property>
-     <property name="buddy" >
-      <cstring>latexEncodingED</cstring>
+     <property name="text" >
+      <string>Use LaTe&amp;X font encoding:</string>
      </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" >
      <property name="sizeType" >
       <enum>QSizePolicy::Expanding</enum>
      </property>
-     <property name="sizeHint" stdset="0" >
+     <property name="sizeHint" >
       <size>
-       <width>21</width>
-       <height>52</height>
+       <width>121</width>
+       <height>51</height>
       </size>
      </property>
     </spacer>
    </item>
+   <item row="0" column="2" >
+    <widget class="QLineEdit" name="latexEncodingED" >
+     <property name="toolTip" >
+      <string>Specify the font encoding (e.g., T1).</string>
+     </property>
+    </widget>
+   </item>
    <item row="1" column="0" colspan="2" >
     <widget class="QLabel" name="latexPaperSizeLA" >
      <property name="text" >
      </property>
     </widget>
    </item>
-   <item row="1" column="2" >
-    <widget class="QComboBox" name="latexPaperSizeCO" >
-     <item>
-      <property name="text" >
-       <string>Default</string>
-      </property>
-     </item>
-     <item>
-      <property name="text" >
-       <string>US letter</string>
-      </property>
-     </item>
-     <item>
-      <property name="text" >
-       <string>US legal</string>
-      </property>
-     </item>
-     <item>
-      <property name="text" >
-       <string>US executive</string>
-      </property>
-     </item>
-     <item>
-      <property name="text" >
-       <string>A3</string>
-      </property>
-     </item>
-     <item>
-      <property name="text" >
-       <string>A4</string>
-      </property>
-     </item>
-     <item>
-      <property name="text" >
-       <string>A5</string>
-      </property>
-     </item>
-     <item>
-      <property name="text" >
-       <string>B5</string>
-      </property>
-     </item>
-    </widget>
-   </item>
    <item row="2" column="0" colspan="2" >
     <widget class="QLabel" name="latexDviPaperLA" >
      <property name="text" >
      <property name="flat" >
       <bool>true</bool>
      </property>
-     <layout class="QGridLayout" name="gridLayout" >
+     <layout class="QGridLayout" >
+      <property name="margin" >
+       <number>9</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
       <item row="0" column="0" >
-       <layout class="QHBoxLayout" name="horizontalLayout" >
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
         <item>
          <widget class="QLabel" name="latexBibtexLA" >
           <property name="text" >
        </layout>
       </item>
       <item row="1" column="0" >
-       <layout class="QHBoxLayout" name="horizontalLayout_2" >
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
         <item>
          <widget class="QLabel" name="latexBibtexOptionsLA" >
           <property name="text" >
        </layout>
       </item>
       <item row="2" column="0" >
-       <layout class="QHBoxLayout" name="horizontalLayout_3" >
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
         <item>
          <widget class="QLabel" name="latexJBibtexLA" >
           <property name="text" >
        </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="4" column="0" colspan="4" >
      <property name="flat" >
       <bool>true</bool>
      </property>
-     <layout class="QGridLayout" name="gridLayout_2" >
+     <layout class="QGridLayout" >
+      <property name="margin" >
+       <number>9</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
       <item row="0" column="0" >
-       <layout class="QHBoxLayout" name="horizontalLayout_4" >
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
         <item>
          <widget class="QLabel" name="latexIndexLA" >
           <property name="text" >
        </layout>
       </item>
       <item row="1" column="0" >
-       <layout class="QHBoxLayout" name="horizontalLayout_5" >
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
         <item>
          <widget class="QLabel" name="latexIndexOptionsLA" >
           <property name="text" >
        </layout>
       </item>
       <item row="2" column="0" >
-       <layout class="QHBoxLayout" name="horizontalLayout_6" >
+       <layout class="QHBoxLayout" >
+        <property name="margin" >
+         <number>0</number>
+        </property>
+        <property name="spacing" >
+         <number>6</number>
+        </property>
         <item>
          <widget class="QLabel" name="latexJIndexLA" >
           <property name="text" >
      </property>
     </widget>
    </item>
+   <item row="1" column="2" >
+    <widget class="QComboBox" name="latexPaperSizeCO" >
+     <item>
+      <property name="text" >
+       <string>Default</string>
+      </property>
+     </item>
+     <item>
+      <property name="text" >
+       <string>US letter</string>
+      </property>
+     </item>
+     <item>
+      <property name="text" >
+       <string>US legal</string>
+      </property>
+     </item>
+     <item>
+      <property name="text" >
+       <string>US executive</string>
+      </property>
+     </item>
+     <item>
+      <property name="text" >
+       <string>A3</string>
+      </property>
+     </item>
+     <item>
+      <property name="text" >
+       <string>A4</string>
+      </property>
+     </item>
+     <item>
+      <property name="text" >
+       <string>A5</string>
+      </property>
+     </item>
+     <item>
+      <property name="text" >
+       <string>B5</string>
+      </property>
+     </item>
+    </widget>
+   </item>
    <item row="9" column="0" colspan="4" >
     <spacer>
      <property name="orientation" >
      <property name="sizeType" >
       <enum>QSizePolicy::Expanding</enum>
      </property>
-     <property name="sizeHint" stdset="0" >
+     <property name="sizeHint" >
       <size>
        <width>409</width>
        <height>21</height>