]> git.lyx.org Git - features.git/commitdiff
Fix UI quirk in IncludeOnly settings
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 12 Mar 2020 09:37:56 +0000 (10:37 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 12 Mar 2020 09:37:56 +0000 (10:37 +0100)
Fixes #11564

src/frontends/qt/GuiDocument.cpp
src/frontends/qt/GuiDocument.h

index 9ae68405f7e5ef4fac3e0fdbdabbfef64c23a2d3..5ffccdc25d682eda12c65dc32bc3fa1dec4945ad 100644 (file)
@@ -3650,6 +3650,7 @@ void GuiDocument::applyView()
        }
        bp_.maintain_unincluded_children =
                masterChildModule->maintainAuxCB->isChecked();
+       updateIncludeonlyDisplay();
 
        // Float Settings
        bp_.float_placement = floatModule->getPlacement();
@@ -4178,6 +4179,7 @@ void GuiDocument::paramsToDialog()
                masterChildModule->setEnabled(true);
                includeonlys_ = bp_.getIncludedChildren();
                updateIncludeonlys();
+               updateIncludeonlyDisplay();
        }
        masterChildModule->maintainAuxCB->setChecked(
                bp_.maintain_unincluded_children);
@@ -4514,12 +4516,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);
@@ -4529,6 +4527,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();
@@ -4547,17 +4554,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();
 }
 
 
index 3e9aa7ce5dff1c3b16077bfbb40ab8c8b3ddfb63..c7ea1b5cd33603858abc0cd20e1b0cf0d5d1a434 100644 (file)
@@ -211,6 +211,8 @@ private:
        ///
        void updateSelectedModules();
        ///
+       void updateIncludeonlyDisplay();
+       ///
        void updateIncludeonlys();
        ///
        void updateDefaultBiblio(std::string const & style,