]> git.lyx.org Git - features.git/commitdiff
Join PrefDateUi and PrefPlaintextUi into PrefOutputUi
authorPavel Sanda <sanda@lyx.org>
Thu, 15 Apr 2010 14:25:25 +0000 (14:25 +0000)
committerPavel Sanda <sanda@lyx.org>
Thu, 15 Apr 2010 14:25:25 +0000 (14:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34140 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/GuiPrefs.h
src/frontends/qt4/Makefile.am
src/frontends/qt4/ui/PrefDateUi.ui [deleted file]
src/frontends/qt4/ui/PrefOutputUi.ui [new file with mode: 0644]
src/frontends/qt4/ui/PrefPlaintextUi.ui [deleted file]

index 5c3cbc3ebea60f289757f8786e9d884ad14df17f..d782b6f5afb4b4ae9e03d6e2a95dff3b5b12e318 100644 (file)
@@ -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);
 }
 
 
index 2a0405fb3ec337eb1a482fd30757f8fe31bf801a..028ac48a369a6ada5b70243df1cc55edc0b17bf4 100644 (file)
@@ -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);
index a9150df9c8eb49d5a8c064329c34fd77b33c613d..ba4a3056e0bd52dfb5fdfafa2376e3c96eecf2f5 100644 (file)
@@ -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 (file)
index 0783c33..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<ui version="4.0" >
- <class>PrefDateUi</class>
- <widget class="QWidget" name="PrefDateUi" >
-  <property name="geometry" >
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>279</width>
-    <height>91</height>
-   </rect>
-  </property>
-  <property name="windowTitle" >
-   <string/>
-  </property>
-  <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>11</number>
-   </property>
-   <property name="spacing" >
-    <number>6</number>
-   </property>
-   <item>
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <widget class="QLabel" name="DateLA" >
-       <property name="text" >
-        <string>&amp;Date format:</string>
-       </property>
-       <property name="buddy" >
-        <cstring>DateED</cstring>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QLineEdit" name="DateED" >
-       <property name="toolTip" >
-        <string>Date format for strftime output</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>20</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <pixmapfunction></pixmapfunction>
- <includes>
-  <include location="local" >qt_i18n.h</include>
- </includes>
- <resources/>
- <connections/>
-</ui>
diff --git a/src/frontends/qt4/ui/PrefOutputUi.ui b/src/frontends/qt4/ui/PrefOutputUi.ui
new file mode 100644 (file)
index 0000000..a4da043
--- /dev/null
@@ -0,0 +1,119 @@
+<ui version="4.0" >
+ <class>PrefOutputUi</class>
+ <widget class="QWidget" name="PrefOutputUi" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>270</width>
+    <height>128</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string/>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout" >
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout_2" >
+     <item>
+      <widget class="QLabel" name="plaintextLinelengthLA" >
+       <property name="text" >
+        <string>Output &amp;line length:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>plaintextLinelengthSB</cstring>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QSpinBox" name="plaintextLinelengthSB" >
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="toolTip" >
+        <string>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.</string>
+       </property>
+       <property name="maximum" >
+        <number>120</number>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer_2" >
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0" >
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout" >
+     <item>
+      <widget class="QLabel" name="DateLA" >
+       <property name="text" >
+        <string>&amp;Date format:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>DateED</cstring>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="DateED" >
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+       <property name="toolTip" >
+        <string>Date format for strftime output</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer" >
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0" >
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <spacer name="verticalSpacer" >
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0" >
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <includes>
+  <include location="local" >qt_i18n.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/src/frontends/qt4/ui/PrefPlaintextUi.ui b/src/frontends/qt4/ui/PrefPlaintextUi.ui
deleted file mode 100644 (file)
index 6b012b0..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<ui version="4.0">
- <class>PrefPlaintextUi</class>
- <widget class="QWidget" name="PrefPlaintextUi">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>340</width>
-    <height>99</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="1" column="0" colspan="3">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="2">
-    <spacer>
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeType">
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>20</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="0" column="1">
-    <widget class="QSpinBox" name="plaintextLinelengthSB">
-     <property name="toolTip">
-      <string>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 &gt; 0, paragraphs are separated by a blank line.</string>
-     </property>
-     <property name="maximum">
-      <number>120</number>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="0">
-    <widget class="QLabel" name="plaintextLinelengthLA">
-     <property name="text">
-      <string>Output &amp;line length:</string>
-     </property>
-     <property name="buddy">
-      <cstring>plaintextLinelengthSB</cstring>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <includes>
-  <include location="local">qt_i18n.h</include>
- </includes>
- <resources/>
- <connections/>
-</ui>