improve fontenc GUI.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32227 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2009-11-29 13:29:36 +00:00
parent c5738e5af6
commit 2d0195723d
3 changed files with 144 additions and 75 deletions

View 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));

View 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);

View File

@ -12,20 +12,23 @@
<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" >
@ -34,14 +37,21 @@
<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" >
@ -52,50 +62,6 @@
</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" >
@ -121,9 +87,21 @@
<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" >
@ -140,7 +118,13 @@
</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" >
@ -161,7 +145,13 @@
</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" >
@ -182,14 +172,6 @@
</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" >
@ -200,9 +182,21 @@
<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" >
@ -219,7 +213,13 @@
</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" >
@ -240,7 +240,13 @@
</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" >
@ -326,6 +332,50 @@
</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" >
@ -334,7 +384,7 @@
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0" >
<property name="sizeHint" >
<size>
<width>409</width>
<height>21</height>