]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiDocument.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiDocument.cpp
index 6ed27ea4aa3f85dc9f6678ce813185a823528b20..71eff5b92c4de5481598a5698cfeff0c97e8e8c4 100644 (file)
@@ -624,10 +624,14 @@ GuiDocument::GuiDocument(GuiView & lv)
                this, SLOT(includeonlyClicked(QTreeWidgetItem *, int)));
        connect(masterChildModule->includeonlyRB, SIGNAL(toggled(bool)),
                masterChildModule->childrenTW, SLOT(setEnabled(bool)));
+       connect(masterChildModule->includeonlyRB, SIGNAL(toggled(bool)),
+               masterChildModule->maintainAuxCB, SLOT(setEnabled(bool)));
        connect(masterChildModule->includeallRB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
        connect(masterChildModule->includeonlyRB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
+       connect(masterChildModule->maintainAuxCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
        masterChildModule->childrenTW->setColumnCount(2);
        masterChildModule->childrenTW->headerItem()->setText(0, qt_("Child Document"));
        masterChildModule->childrenTW->headerItem()->setText(1, qt_("Include to Output"));
@@ -2098,6 +2102,8 @@ void GuiDocument::applyView()
                        bp_.addIncludedChildren(*it);
                }
        }
+       bp_.maintain_unincluded_children =
+               masterChildModule->maintainAuxCB->isChecked();
 
        // Float Placement
        bp_.float_placement = floatModule->get();
@@ -2481,13 +2487,19 @@ void GuiDocument::paramsToDialog()
        // Master/Child
        std::vector<Buffer *> children = buffer().getChildren(false);
        if (children.empty()) {
-               masterChildModule->setEnabled(false);
+               masterChildModule->childrenTW->clear();
                includeonlys_.clear();
+               docPS->showPanel(qt_("Child Documents"), false);
+               if (docPS->isCurrentPanel(qt_("Child Documents")))
+                       docPS->setCurrentPanel(qt_("Document Class"));
        } else {
+               docPS->showPanel(qt_("Child Documents"), true);
                masterChildModule->setEnabled(true);
                includeonlys_ = bp_.getIncludedChildren();
                updateIncludeonlys();
        }
+       masterChildModule->maintainAuxCB->setChecked(
+               bp_.maintain_unincluded_children);
 
        // Float Settings
        floatModule->set(bp_.float_placement);
@@ -2725,9 +2737,11 @@ void GuiDocument::updateIncludeonlys()
        if (includeonlys_.empty()) {
                masterChildModule->includeallRB->setChecked(true);
                masterChildModule->childrenTW->setEnabled(false);
+               masterChildModule->maintainAuxCB->setEnabled(false);
        } else {
                masterChildModule->includeonlyRB->setChecked(true);
                masterChildModule->childrenTW->setEnabled(true);
+               masterChildModule->maintainAuxCB->setEnabled(true);
        }
        QTreeWidgetItem * item = 0;
        std::vector<Buffer *> children = buffer().getChildren(false);