From 88f4718996ac47fdd00ae086cbadcb5570a45263 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Fri, 24 May 2019 15:40:09 +0200 Subject: [PATCH] lineno: convert ui GB to CB per Juergen's request --- src/frontends/qt4/GuiDocument.cpp | 17 ++++- src/frontends/qt4/GuiDocument.h | 1 + src/frontends/qt4/ui/NumberingUi.ui | 113 +++++++++++----------------- 3 files changed, 59 insertions(+), 72 deletions(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 48bc112a3e..3f7e3c6e0e 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -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); } diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h index 86c1686ce9..01fb0de0ef 100644 --- a/src/frontends/qt4/GuiDocument.h +++ b/src/frontends/qt4/GuiDocument.h @@ -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(); diff --git a/src/frontends/qt4/ui/NumberingUi.ui b/src/frontends/qt4/ui/NumberingUi.ui index bd9b1532c5..12b9657283 100644 --- a/src/frontends/qt4/ui/NumberingUi.ui +++ b/src/frontends/qt4/ui/NumberingUi.ui @@ -29,35 +29,38 @@ 6 - - - - - 1 - - - + + + + + + L&ine numbering + + + + + + + Line numbering (lineno package) options. Please refer to the lineno package manual for details. + + + + - - - - -1 - - - 5 - - - 3 + + + + &List in Table of Contents - - Qt::Horizontal + + tocSL - - + + - -2 + -1 5 @@ -70,16 +73,6 @@ - - - - &List in Table of Contents - - - tocSL - - - @@ -90,45 +83,29 @@ - - - - true - - - Add line numbers to the document - - - L&ine numbering + + + + + 1 + + + + + + + + -2 - - true + + 5 - - true + + 3 - - false + + Qt::Horizontal - - - - - Additional o&ptions: - - - linenoLE - - - - - - - Line numbering (lineno package) options. Please refer to the lineno package manual for details. - - - - -- 2.39.2