this, SLOT(change_adaptor()));
connect(textLayoutModule->twoColumnCB, SIGNAL(clicked()),
this, SLOT(setColSep()));
- connect(textLayoutModule->listingsED, SIGNAL(textChanged()),
- this, SLOT(change_adaptor()));
- connect(textLayoutModule->bypassCB, SIGNAL(clicked()),
- this, SLOT(change_adaptor()));
- connect(textLayoutModule->bypassCB, SIGNAL(clicked()),
- this, SLOT(setListingsMessage()));
- connect(textLayoutModule->listingsED, SIGNAL(textChanged()),
- this, SLOT(setListingsMessage()));
- textLayoutModule->listingsTB->setPlainText(
- qt_("Input listings parameters on the right. Enter ? for a list of parameters."));
+
textLayoutModule->lspacingLE->setValidator(new QDoubleValidator(
textLayoutModule->lspacingLE));
textLayoutModule->indentLE->setValidator(unsignedLengthValidator(
connect(floatModule, SIGNAL(changed()),
this, SLOT(change_adaptor()));
+ // listings
+ listingsModule = new UiWidget<Ui::ListingsSettingsUi>;
+ connect(listingsModule->listingsED, SIGNAL(textChanged()),
+ this, SLOT(change_adaptor()));
+ connect(listingsModule->bypassCB, SIGNAL(clicked()),
+ this, SLOT(change_adaptor()));
+ connect(listingsModule->bypassCB, SIGNAL(clicked()),
+ this, SLOT(setListingsMessage()));
+ connect(listingsModule->listingsED, SIGNAL(textChanged()),
+ this, SLOT(setListingsMessage()));
+ listingsModule->listingsTB->setPlainText(
+ qt_("Input listings parameters below. Enter ? for a list of parameters."));
+
docPS->addPanel(latexModule, qt_("Document Class"));
docPS->addPanel(modulesModule, qt_("Modules"));
docPS->addPanel(fontModule, qt_("Fonts"));
docPS->addPanel(pdfSupportModule, qt_("PDF Properties"));
docPS->addPanel(mathsModule, qt_("Math Options"));
docPS->addPanel(floatModule, qt_("Float Placement"));
+ docPS->addPanel(listingsModule, qt_("Listings"));
docPS->addPanel(bulletsModule, qt_("Bullets"));
docPS->addPanel(branchesModule, qt_("Branches"));
docPS->addPanel(outputModule, qt_("Output"));
static string param_cache;
static QString msg_cache;
- if (textLayoutModule->bypassCB->isChecked())
+ if (listingsModule->bypassCB->isChecked())
return QString();
- string params = fromqstr(textLayoutModule->listingsED->toPlainText());
+ string params = fromqstr(listingsModule->listingsED->toPlainText());
if (params != param_cache) {
param_cache = params;
msg_cache = toqstr(InsetListingsParams(params).validate());
return;
isOK = true;
// listingsTB->setTextColor("black");
- textLayoutModule->listingsTB->setPlainText(
- qt_("Input listings parameters on the right. "
+ listingsModule->listingsTB->setPlainText(
+ qt_("Input listings parameters below. "
"Enter ? for a list of parameters."));
} else {
isOK = false;
// listingsTB->setTextColor("red");
- textLayoutModule->listingsTB->setPlainText(msg);
+ listingsModule->listingsTB->setPlainText(msg);
}
}
// Modules
modulesToParams(bp_);
+ // Math
if (mathsModule->amsautoCB->isChecked()) {
bp_.use_amsmath = BufferParams::package_auto;
} else {
bp_.use_esint = BufferParams::package_off;
}
+ // Page Layout
if (pageLayoutModule->pagestyleCO->currentIndex() == 0)
bp_.pagestyle = "default";
else {
bp_.pagestyle = pagestyles[i].first;
}
+ // Text Layout
switch (textLayoutModule->lspacingCO->currentIndex()) {
case 0:
bp_.spacing().set(Spacing::Single);
else
bp_.columns = 1;
- // text should have passed validation
- bp_.listings_params =
- InsetListingsParams(fromqstr(textLayoutModule->listingsED->toPlainText())).params();
-
if (textLayoutModule->indentRB->isChecked()) {
// if paragraphs are separated by an indentation
bp_.paragraph_separation = BufferParams::ParagraphIndentSeparation;
else
bp_.master = string();
+ // Float Placement
bp_.float_placement = floatModule->get();
+ // Listings
+ // text should have passed validation
+ bp_.listings_params =
+ InsetListingsParams(fromqstr(listingsModule->listingsED->toPlainText())).params();
+
// output
bp_.defaultOutputFormat = fromqstr(outputModule->defaultFormatCO->itemData(
outputModule->defaultFormatCO->currentIndex()).toString());
textLayoutModule->twoColumnCB->setChecked(
bp_.columns == 2);
- // break listings_params to multiple lines
- string lstparams =
- InsetListingsParams(bp_.listings_params).separatedParams();
- textLayoutModule->listingsED->setPlainText(toqstr(lstparams));
-
if (!bp_.options.empty()) {
latexModule->optionsLE->setText(
toqstr(bp_.options));
latexModule->childDocGB->setChecked(false);
}
+ // Float Settings
floatModule->set(bp_.float_placement);
+ // ListingsSettings
+ // break listings_params to multiple lines
+ string lstparams =
+ InsetListingsParams(bp_.listings_params).separatedParams();
+ listingsModule->listingsED->setPlainText(toqstr(lstparams));
+
// Output
// update combobox with formats
updateDefaultFormat();
--- /dev/null
+<ui version="4.0" >
+ <class>ListingsSettingsUi</class>
+ <widget class="QWidget" name="ListingsSettingsUi" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>219</width>
+ <height>185</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="3" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>201</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QTextEdit" name="listingsED" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" >
+ <string>Input here the listings parameters</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QTextBrowser" name="listingsTB" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="acceptDrops" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string>Feedback window</string>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Plain</enum>
+ </property>
+ <property name="acceptRichText" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QCheckBox" name="bypassCB" >
+ <property name="toolTip" >
+ <string>Check it to enter parameters that are not recognizable by LyX</string>
+ </property>
+ <property name="text" >
+ <string>&Bypass validation</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <includes>
+ <include location="local" >qt_i18n.h</include>
+ </includes>
+ <resources/>
+ <connections/>
+</ui>
<x>0</x>
<y>0</y>
<width>421</width>
- <height>416</height>
+ <height>310</height>
</rect>
</property>
<property name="windowTitle" >
<number>6</number>
</property>
<item row="2" column="0" >
- <widget class="QGroupBox" name="listingsGB" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="layoutDirection" >
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="title" >
- <string>Listing settings</string>
- </property>
- <property name="flat" >
- <bool>true</bool>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="1" column="0" >
- <widget class="QCheckBox" name="bypassCB" >
- <property name="toolTip" >
- <string>Check it to enter parameters that are not recognizable by LyX</string>
- </property>
- <property name="text" >
- <string>&Bypass validation</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QTextBrowser" name="listingsTB" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="acceptDrops" >
- <bool>false</bool>
- </property>
- <property name="toolTip" >
- <string>Feedback window</string>
- </property>
- <property name="frameShape" >
- <enum>QFrame::Box</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Plain</enum>
- </property>
- <property name="acceptRichText" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QTextEdit" name="listingsED" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip" >
- <string>Input here the listings parameters</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QGroupBox" name="spacingGB" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="title" >
- <string>Spacing</string>
- </property>
- <property name="flat" >
- <bool>true</bool>
- </property>
- <property name="checkable" >
- <bool>false</bool>
- </property>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" >
- <widget class="QLabel" name="lspacingL" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>91</width>
- <height>18</height>
- </size>
- </property>
- <property name="text" >
- <string>&Line spacing:</string>
- </property>
- <property name="buddy" >
- <cstring>lspacingCO</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="lspacingCO" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip" >
- <string>Spacing type</string>
- </property>
- <property name="duplicatesEnabled" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="2" >
- <widget class="QLineEdit" name="lspacingLE" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip" >
- <string>Number of lines</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0" colspan="2" >
- <widget class="QCheckBox" name="twoColumnCB" >
- <property name="toolTip" >
- <string>Format text into two columns</string>
- </property>
- <property name="text" >
- <string>Two-&column document</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
- <width>401</width>
- <height>16</height>
+ <width>403</width>
+ <height>21</height>
</size>
</property>
</spacer>
</property>
</widget>
</item>
+ <item row="1" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="3" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QGroupBox" name="spacingGB" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Spacing</string>
+ </property>
+ <property name="flat" >
+ <bool>true</bool>
+ </property>
+ <property name="checkable" >
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="lspacingL" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>91</width>
+ <height>18</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string>&Line spacing:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>lspacingCO</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="lspacingCO" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" >
+ <string>Spacing type</string>
+ </property>
+ <property name="duplicatesEnabled" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2" >
+ <widget class="QLineEdit" name="lspacingLE" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" >
+ <string>Number of lines</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2" >
+ <widget class="QCheckBox" name="twoColumnCB" >
+ <property name="toolTip" >
+ <string>Format text into two columns</string>
+ </property>
+ <property name="text" >
+ <string>Two-&column document</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>