}
-
-/////////////////////////////////////////////////////////////////////
-//
-// 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
/////////////////////////////////////////////////////////////////////
//
-// 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;
}
-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);
}
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);
bc().setRestore(restorePB);
// initialize the strftime validator
- bc().addCheckedLineEdit(dateFormat->DateED);
+ bc().addCheckedLineEdit(output->DateED);
}
#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"
};
-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);
PrefColorsUi.ui \
PrefCompletionUi.ui \
PrefConvertersUi.ui \
- PrefDateUi.ui \
+ PrefOutputUi.ui \
PrefDisplayUi.ui \
PrefEditUi.ui \
PrefFileformatsUi.ui \
PrefLanguageUi.ui \
PrefLatexUi.ui \
PrefPathsUi.ui \
- PrefPlaintextUi.ui \
PrefPrinterUi.ui \
PrefScreenFontsUi.ui \
PrefShortcutsUi.ui \
+++ /dev/null
-<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>&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>
--- /dev/null
+<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 &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>&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>
+++ /dev/null
-<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 > 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 &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>