lineno: convert ui GB to CB per Juergen's request

This commit is contained in:
Pavel Sanda 2019-05-24 15:40:09 +02:00
parent 09e69f96dd
commit 88f4718996
3 changed files with 59 additions and 72 deletions

View File

@ -1253,7 +1253,9 @@ GuiDocument::GuiDocument(GuiView & lv)
numberingModule->tocTW->headerItem()->setText(1, qt_("Numbered"));
numberingModule->tocTW->headerItem()->setText(2, qt_("Appears in TOC"));
setSectionResizeMode(numberingModule->tocTW->header(), QHeaderView::ResizeToContents);
connect(numberingModule->linenoGB, SIGNAL(clicked()),
connect(numberingModule->linenoCB, SIGNAL(toggled(bool)),
this, SLOT(linenoToggled()));
connect(numberingModule->linenoCB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(numberingModule->linenoLE, SIGNAL(textChanged(QString)),
this, SLOT(change_adaptor()));
@ -2302,7 +2304,6 @@ void GuiDocument::mathFontChanged(int)
updateFontOptions();
}
void GuiDocument::fontOsfToggled(bool state)
{
if (fontModule->osFontsCB->isChecked())
@ -3287,7 +3288,7 @@ void GuiDocument::applyView()
bp_.tocdepth = numberingModule->tocSL->value();
bp_.secnumdepth = numberingModule->depthSL->value();
}
bp_.use_lineno = numberingModule->linenoGB->isChecked();
bp_.use_lineno = numberingModule->linenoCB->isChecked();
bp_.lineno_opts = fromqstr(numberingModule->linenoLE->text());
// bullets
@ -3813,7 +3814,8 @@ void GuiDocument::paramsToDialog()
numberingModule->tocTW->clear();
}
numberingModule->linenoGB->setChecked(bp_.use_lineno);
numberingModule->linenoCB->setChecked(bp_.use_lineno);
numberingModule->linenoLE->setEnabled(bp_.use_lineno);
numberingModule->linenoLE->setText(toqstr(bp_.lineno_opts));
// bullets
@ -4943,6 +4945,13 @@ void GuiDocument::allPackages(int col)
}
void GuiDocument::linenoToggled()
{
numberingModule->linenoLE->setEnabled(numberingModule->linenoCB->isChecked());
}
Dialog * createGuiDocument(GuiView & lv) { return new GuiDocument(lv); }

View File

@ -161,6 +161,7 @@ private Q_SLOTS:
void moduleFilterPressed();
void moduleFilterChanged(const QString & text);
void resetModuleFilter();
void linenoToggled();
private:
/// validate listings parameters and return an error message, if any
QString validateListingsParameters();

View File

@ -29,13 +29,32 @@
<property name="spacing">
<number>6</number>
</property>
<item row="4" column="0">
<widget class="QTreeWidget" name="tocTW">
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
<item row="6" column="0" rowspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="linenoCB">
<property name="text">
<string>L&amp;ine numbering</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="linenoLE">
<property name="toolTip">
<string>Line numbering (lineno package) options. Please refer to the lineno package manual for details.</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="TextLabel1">
<property name="text">
<string>&amp;List in Table of Contents</string>
</property>
<property name="buddy">
<cstring>tocSL</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
@ -54,6 +73,25 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="TextLabel1_2">
<property name="text">
<string>&amp;Numbering</string>
</property>
<property name="buddy">
<cstring>depthSL</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QTreeWidget" name="tocTW">
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="QSlider" name="depthSL">
<property name="minimum">
@ -70,67 +108,6 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="TextLabel1">
<property name="text">
<string>&amp;List in Table of Contents</string>
</property>
<property name="buddy">
<cstring>tocSL</cstring>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="TextLabel1_2">
<property name="text">
<string>&amp;Numbering</string>
</property>
<property name="buddy">
<cstring>depthSL</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QGroupBox" name="linenoGB">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Add line numbers to the document</string>
</property>
<property name="title">
<string>L&amp;ine numbering</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Additional o&amp;ptions:</string>
</property>
<property name="buddy">
<cstring>linenoLE</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="linenoLE">
<property name="toolTip">
<string>Line numbering (lineno package) options. Please refer to the lineno package manual for details.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<tabstops>