[LyX/master] Disable bookmarksopenlevel SL when bookmarksopen is false

Juergen Spitzmueller spitz at lyx.org
Sat May 16 08:10:33 UTC 2020


commit f2243a3bc72b896ac0dad3499d60c47b9bd4e251
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat May 16 10:31:48 2020 +0200

    Disable bookmarksopenlevel SL when bookmarksopen is false
    
    Fixes #11289
---
 src/frontends/qt/GuiDocument.cpp |   10 ++++++++++
 src/frontends/qt/GuiDocument.h   |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index ff4c3fe..32cc899 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -1696,6 +1696,8 @@ GuiDocument::GuiDocument(GuiView & lv)
 		this, SLOT(change_adaptor()));
 	connect(pdfSupportModule->bookmarksopenGB, SIGNAL(toggled(bool)),
 		this, SLOT(change_adaptor()));
+	connect(pdfSupportModule->bookmarksopenGB, SIGNAL(toggled(bool)),
+		this, SLOT(bookmarksopenChanged(bool)));
 	connect(pdfSupportModule->bookmarksopenlevelSB, SIGNAL(valueChanged(int)),
 		this, SLOT(change_adaptor()));
 	connect(pdfSupportModule->breaklinksCB, SIGNAL(toggled(bool)),
@@ -1819,6 +1821,12 @@ void GuiDocument::shellescapeChanged()
 	changed();
 }
 
+void GuiDocument::bookmarksopenChanged(bool state)
+{
+	pdfSupportModule->bookmarksopenlevelSB->setEnabled(state);
+	pdfSupportModule->bookmarksopenlevelLA->setEnabled(state);
+}
+
 
 void GuiDocument::slotApply()
 {
@@ -4435,6 +4443,8 @@ void GuiDocument::paramsToDialog()
 	pdfSupportModule->bookmarksopenGB->setChecked(pdf.bookmarksopen);
 
 	pdfSupportModule->bookmarksopenlevelSB->setValue(pdf.bookmarksopenlevel);
+	pdfSupportModule->bookmarksopenlevelSB->setEnabled(pdf.bookmarksopen);
+	pdfSupportModule->bookmarksopenlevelLA->setEnabled(pdf.bookmarksopen);
 
 	pdfSupportModule->breaklinksCB->setChecked(pdf.breaklinks);
 	pdfSupportModule->pdfborderCB->setChecked(pdf.pdfborder);
diff --git a/src/frontends/qt/GuiDocument.h b/src/frontends/qt/GuiDocument.h
index c7ea1b5..4d13f44 100644
--- a/src/frontends/qt/GuiDocument.h
+++ b/src/frontends/qt/GuiDocument.h
@@ -166,6 +166,7 @@ private Q_SLOTS:
 	void linenoToggled(bool);
 	void outputChangesToggled(bool);
 	void setOutputSync(bool);
+	void bookmarksopenChanged(bool);
 private:
 	/// validate listings parameters and return an error message, if any
 	QString validateListingsParameters();


More information about the lyx-cvs mailing list