From: Jürgen Spitzmüller Date: Sun, 29 Nov 2009 13:29:36 +0000 (+0000) Subject: improve fontenc GUI. X-Git-Tag: 2.0.0~4998 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2d0195723d861e8b94e3accfe9859868c811ef53;p=features.git improve fontenc GUI. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32227 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index cae0dbc812..ea71bfdfce 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -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)); diff --git a/src/frontends/qt4/GuiPrefs.h b/src/frontends/qt4/GuiPrefs.h index f0d9539976..2a0405fb3e 100644 --- a/src/frontends/qt4/GuiPrefs.h +++ b/src/frontends/qt4/GuiPrefs.h @@ -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); diff --git a/src/frontends/qt4/ui/PrefLatexUi.ui b/src/frontends/qt4/ui/PrefLatexUi.ui index 3fdd0c9439..499fe5a5a5 100644 --- a/src/frontends/qt4/ui/PrefLatexUi.ui +++ b/src/frontends/qt4/ui/PrefLatexUi.ui @@ -12,20 +12,23 @@ - + + + 9 + + + 6 + - - - Te&X encoding: + + + Enable if a specific font encoding (such as T1) should be used (via fontenc) - - latexEncodingED + + Use LaTe&X font encoding: - - - @@ -34,14 +37,21 @@ QSizePolicy::Expanding - + - 21 - 52 + 121 + 51 + + + + Specify the font encoding (e.g., T1). + + + @@ -52,50 +62,6 @@ - - - - - Default - - - - - US letter - - - - - US legal - - - - - US executive - - - - - A3 - - - - - A4 - - - - - A5 - - - - - B5 - - - - @@ -121,9 +87,21 @@ true - + + + 9 + + + 6 + - + + + 0 + + + 6 + @@ -140,7 +118,13 @@ - + + + 0 + + + 6 + @@ -161,7 +145,13 @@ - + + + 0 + + + 6 + @@ -182,14 +172,6 @@ - latexBibtexLA - latexBibtexCO - latexBibtexED - latexBibtexOptionsLA - latexJBibtexED - latexJBibtexLA - latexDviPaperED - latexDviPaperLA @@ -200,9 +182,21 @@ true - + + + 9 + + + 6 + - + + + 0 + + + 6 + @@ -219,7 +213,13 @@ - + + + 0 + + + 6 + @@ -240,7 +240,13 @@ - + + + 0 + + + 6 + @@ -326,6 +332,50 @@ + + + + + Default + + + + + US letter + + + + + US legal + + + + + US executive + + + + + A3 + + + + + A4 + + + + + A5 + + + + + B5 + + + + @@ -334,7 +384,7 @@ QSizePolicy::Expanding - + 409 21