[LyX/2.3.x] Fix UI quirk in IncludeOnly settings

Juergen Spitzmueller spitz at lyx.org
Fri Mar 13 07:26:21 UTC 2020


commit 48cb1aa3b76848558f417e0ecd6a893173c298e0
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Thu Mar 12 10:37:56 2020 +0100

    Fix UI quirk in IncludeOnly settings
    
    Fixes #11564
    
    (cherry picked from commit b568a49593b6d52f267d8fcfbc0a46dc7ecb613d)
---
 src/frontends/qt4/GuiDocument.cpp |   28 ++++++++++++++--------------
 src/frontends/qt4/GuiDocument.h   |    2 ++
 status.23x                        |    3 +++
 3 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp
index 122a490..307703d 100644
--- a/src/frontends/qt4/GuiDocument.cpp
+++ b/src/frontends/qt4/GuiDocument.cpp
@@ -3291,6 +3291,7 @@ void GuiDocument::applyView()
 	}
 	bp_.maintain_unincluded_children =
 		masterChildModule->maintainAuxCB->isChecked();
+	updateIncludeonlyDisplay();
 
 	// Float Placement
 	bp_.float_placement = floatModule->get();
@@ -3818,6 +3819,7 @@ void GuiDocument::paramsToDialog()
 		masterChildModule->setEnabled(true);
 		includeonlys_ = bp_.getIncludedChildren();
 		updateIncludeonlys();
+		updateIncludeonlyDisplay();
 	}
 	masterChildModule->maintainAuxCB->setChecked(
 		bp_.maintain_unincluded_children);
@@ -4091,12 +4093,8 @@ void GuiDocument::updateSelectedModules()
 }
 
 
-void GuiDocument::updateIncludeonlys()
+void GuiDocument::updateIncludeonlyDisplay()
 {
-	masterChildModule->childrenTW->clear();
-	QString const no = qt_("No");
-	QString const yes = qt_("Yes");
-
 	if (includeonlys_.empty()) {
 		masterChildModule->includeallRB->setChecked(true);
 		masterChildModule->childrenTW->setEnabled(false);
@@ -4106,6 +4104,15 @@ void GuiDocument::updateIncludeonlys()
 		masterChildModule->childrenTW->setEnabled(true);
 		masterChildModule->maintainAuxCB->setEnabled(true);
 	}
+}
+
+
+void GuiDocument::updateIncludeonlys()
+{
+	masterChildModule->childrenTW->clear();
+	QString const no = qt_("No");
+	QString const yes = qt_("Yes");
+
 	ListOfBuffers children = buffer().getChildren();
 	ListOfBuffers::const_iterator it  = children.begin();
 	ListOfBuffers::const_iterator end = children.end();
@@ -4124,17 +4131,10 @@ void GuiDocument::updateIncludeonlys()
 		else
 			all_unincluded = false;
 	}
-	// Both if all childs are included and if none is included
+	// Both if all children are included and if none is included
 	// is equal to "include all" (i.e., omit \includeonly).
-	// Thus, reset the GUI.
-	if (!has_unincluded || all_unincluded) {
-		masterChildModule->includeallRB->setChecked(true);
-		masterChildModule->childrenTW->setEnabled(false);
+	if (!has_unincluded || all_unincluded)
 		includeonlys_.clear();
-	}
-	// If all are included, we need to update again.
-	if (!has_unincluded)
-		updateIncludeonlys();
 }
 
 
diff --git a/src/frontends/qt4/GuiDocument.h b/src/frontends/qt4/GuiDocument.h
index dd51bac..04e22c3 100644
--- a/src/frontends/qt4/GuiDocument.h
+++ b/src/frontends/qt4/GuiDocument.h
@@ -198,6 +198,8 @@ private:
 	///
 	void updateSelectedModules();
 	///
+	void updateIncludeonlyDisplay();
+	///
 	void updateIncludeonlys();
 	///
 	void updateDefaultBiblio(std::string const & style,
diff --git a/status.23x b/status.23x
index f06d283..9b39a48 100644
--- a/status.23x
+++ b/status.23x
@@ -72,6 +72,9 @@ What's new
 
 - Fix problem with validation of InsetLayout.
 
+- Fix over-hasty resetting of dialog in Child Documents settings (bug 11564).
+
+
 * INTERNALS
 
 


More information about the lyx-cvs mailing list