From: Pavel Sanda Date: Thu, 15 Apr 2010 14:25:25 +0000 (+0000) Subject: Join PrefDateUi and PrefPlaintextUi into PrefOutputUi X-Git-Tag: 2.0.0~3469 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=52756f5dc785335ed12dc0a5965f08b843e7e770;p=features.git Join PrefDateUi and PrefPlaintextUi into PrefOutputUi git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34140 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 5c3cbc3ebe..d782b6f5af 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -324,34 +324,6 @@ static void setComboxFont(QComboBox * cb, string const & family, } - -///////////////////////////////////////////////////////////////////// -// -// PrefPlaintext -// -///////////////////////////////////////////////////////////////////// - -PrefPlaintext::PrefPlaintext(GuiPreferences * form) - : PrefModule(qt_(catOutput), qt_("Plain text"), form) -{ - setupUi(this); - connect(plaintextLinelengthSB, SIGNAL(valueChanged(int)), - this, SIGNAL(changed())); -} - - -void PrefPlaintext::apply(LyXRC & rc) const -{ - rc.plaintext_linelen = plaintextLinelengthSB->value(); -} - - -void PrefPlaintext::update(LyXRC const & rc) -{ - plaintextLinelengthSB->setValue(rc.plaintext_linelen); -} - - ///////////////////////////////////////////////////////////////////// // // StrftimeValidator @@ -383,21 +355,23 @@ QValidator::State StrftimeValidator::validate(QString & input, int & /*pos*/) co ///////////////////////////////////////////////////////////////////// // -// PrefDate +// PrefOutput // ///////////////////////////////////////////////////////////////////// -PrefDate::PrefDate(GuiPreferences * form) - : PrefModule(qt_(catOutput), qt_("Date format"), form) +PrefOutput::PrefOutput(GuiPreferences * form) + : PrefModule(qt_(catOutput), qt_("General"), form) { setupUi(this); DateED->setValidator(new StrftimeValidator(DateED)); connect(DateED, SIGNAL(textChanged(QString)), this, SIGNAL(changed())); + connect(plaintextLinelengthSB, SIGNAL(valueChanged(int)), + this, SIGNAL(changed())); } -void PrefDate::on_DateED_textChanged(const QString &) +void PrefOutput::on_DateED_textChanged(const QString &) { QString t = DateED->text(); int p = 0; @@ -407,15 +381,17 @@ void PrefDate::on_DateED_textChanged(const QString &) } -void PrefDate::apply(LyXRC & rc) const +void PrefOutput::apply(LyXRC & rc) const { rc.date_insert_format = fromqstr(DateED->text()); + rc.plaintext_linelen = plaintextLinelengthSB->value(); } -void PrefDate::update(LyXRC const & rc) +void PrefOutput::update(LyXRC const & rc) { DateED->setText(toqstr(rc.date_insert_format)); + plaintextLinelengthSB->setValue(rc.plaintext_linelen); } @@ -2927,10 +2903,10 @@ GuiPreferences::GuiPreferences(GuiView & lv) addModule(new PrefLanguage(this)); addModule(new PrefSpellchecker(this)); + //for strftime validator + PrefOutput * output = new PrefOutput(this); + addModule(output); addModule(new PrefPrinter(this)); - PrefDate * dateFormat = new PrefDate(this); - addModule(dateFormat); - addModule(new PrefPlaintext(this)); addModule(new PrefLatex(this)); PrefConverters * converters = new PrefConverters(this); @@ -2954,7 +2930,7 @@ GuiPreferences::GuiPreferences(GuiView & lv) bc().setRestore(restorePB); // initialize the strftime validator - bc().addCheckedLineEdit(dateFormat->DateED); + bc().addCheckedLineEdit(output->DateED); } diff --git a/src/frontends/qt4/GuiPrefs.h b/src/frontends/qt4/GuiPrefs.h index 2a0405fb3e..028ac48a36 100644 --- a/src/frontends/qt4/GuiPrefs.h +++ b/src/frontends/qt4/GuiPrefs.h @@ -26,8 +26,7 @@ #include "ui_PrefsUi.h" -#include "ui_PrefPlaintextUi.h" -#include "ui_PrefDateUi.h" +#include "ui_PrefOutputUi.h" #include "ui_PrefInputUi.h" #include "ui_PrefLatexUi.h" #include "ui_PrefScreenFontsUi.h" @@ -157,22 +156,11 @@ Q_SIGNALS: }; -class PrefPlaintext : public PrefModule, public Ui::PrefPlaintextUi +class PrefOutput : public PrefModule, public Ui::PrefOutputUi { Q_OBJECT public: - PrefPlaintext(GuiPreferences * form); - - virtual void apply(LyXRC & rc) const; - virtual void update(LyXRC const & rc); -}; - - -class PrefDate : public PrefModule, public Ui::PrefDateUi -{ - Q_OBJECT -public: - PrefDate(GuiPreferences * form); + PrefOutput(GuiPreferences * form); virtual void apply(LyXRC & rc) const; virtual void update(LyXRC const & rc); diff --git a/src/frontends/qt4/Makefile.am b/src/frontends/qt4/Makefile.am index a9150df9c8..ba4a3056e0 100644 --- a/src/frontends/qt4/Makefile.am +++ b/src/frontends/qt4/Makefile.am @@ -300,7 +300,7 @@ UIFILES = \ PrefColorsUi.ui \ PrefCompletionUi.ui \ PrefConvertersUi.ui \ - PrefDateUi.ui \ + PrefOutputUi.ui \ PrefDisplayUi.ui \ PrefEditUi.ui \ PrefFileformatsUi.ui \ @@ -309,7 +309,6 @@ UIFILES = \ PrefLanguageUi.ui \ PrefLatexUi.ui \ PrefPathsUi.ui \ - PrefPlaintextUi.ui \ PrefPrinterUi.ui \ PrefScreenFontsUi.ui \ PrefShortcutsUi.ui \ diff --git a/src/frontends/qt4/ui/PrefDateUi.ui b/src/frontends/qt4/ui/PrefDateUi.ui deleted file mode 100644 index 0783c33ab0..0000000000 --- a/src/frontends/qt4/ui/PrefDateUi.ui +++ /dev/null @@ -1,73 +0,0 @@ - - PrefDateUi - - - - 0 - 0 - 279 - 91 - - - - - - - - 11 - - - 6 - - - - - 0 - - - 6 - - - - - &Date format: - - - DateED - - - - - - - Date format for strftime output - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - - qt_i18n.h - - - - diff --git a/src/frontends/qt4/ui/PrefOutputUi.ui b/src/frontends/qt4/ui/PrefOutputUi.ui new file mode 100644 index 0000000000..a4da043ee5 --- /dev/null +++ b/src/frontends/qt4/ui/PrefOutputUi.ui @@ -0,0 +1,119 @@ + + PrefOutputUi + + + + 0 + 0 + 270 + 128 + + + + + + + + + + + + Output &line length: + + + plaintextLinelengthSB + + + + + + + + 0 + 0 + + + + The maximum line length of exported plain text/LaTeX/SGML files. If set to 0, paragraphs are output in a single line; if the line length is > 0, paragraphs are separated by a blank line. + + + 120 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + &Date format: + + + DateED + + + + + + + + 0 + 0 + + + + Date format for strftime output + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + qt_i18n.h + + + + diff --git a/src/frontends/qt4/ui/PrefPlaintextUi.ui b/src/frontends/qt4/ui/PrefPlaintextUi.ui deleted file mode 100644 index 6b012b069b..0000000000 --- a/src/frontends/qt4/ui/PrefPlaintextUi.ui +++ /dev/null @@ -1,81 +0,0 @@ - - PrefPlaintextUi - - - - 0 - 0 - 340 - 99 - - - - - - - - 9 - - - 6 - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - - - - - - - - The maximum line length of exported plain text/LaTeX/SGML files. If set to 0, paragraphs are output in a single line; if the line length is > 0, paragraphs are separated by a blank line. - - - 120 - - - - - - - Output &line length: - - - plaintextLinelengthSB - - - - - - - qt_i18n.h - - - -