]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiDocument.cpp
Properly resize columns of child document table widget
[lyx.git] / src / frontends / qt / GuiDocument.cpp
index 095c0a2ca4bf970596c3397e0a6899f7a8c0daa1..ac4b1f1bf19977582364692c03ff3e40c5339daf 100644 (file)
@@ -893,9 +893,13 @@ GuiDocument::GuiDocument(GuiView & lv)
        masterChildModule->childrenTW->setColumnCount(2);
        masterChildModule->childrenTW->headerItem()->setText(0, qt_("Child Document"));
        masterChildModule->childrenTW->headerItem()->setText(1, qt_("Include to Output"));
-       masterChildModule->childrenTW->resizeColumnToContents(1);
-       masterChildModule->childrenTW->resizeColumnToContents(2);
-
+#if (QT_VERSION > 0x050000)
+        masterChildModule->childrenTW->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
+        masterChildModule->childrenTW->header()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
+#else
+        masterChildModule->childrenTW->header()->setResizeMode(0, QHeaderView::ResizeToContents);
+        masterChildModule->childrenTW->header()->setResizeMode(1, QHeaderView::ResizeToContents);
+#endif
 
        // Formats
        outputModule = new UiWidget<Ui::OutputUi>(this);
@@ -913,8 +917,8 @@ GuiDocument::GuiDocument(GuiView & lv)
 
        connect(outputModule->shellescapeCB, SIGNAL(stateChanged(int)),
                this, SLOT(shellescapeChanged()));
-       connect(outputModule->outputsyncCB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+       connect(outputModule->outputsyncCB, SIGNAL(toggled(bool)),
+               this, SLOT(setOutputSync(bool)));
        connect(outputModule->synccustomCB, SIGNAL(editTextChanged(QString)),
                this, SLOT(change_adaptor()));
        outputModule->synccustomCB->addItem("");
@@ -926,7 +930,9 @@ GuiDocument::GuiDocument(GuiView & lv)
                outputModule->synccustomCB));
 
        connect(outputModule->saveTransientPropertiesCB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+               this, SLOT(change_adaptor()));
+       connect(outputModule->postponeFragileCB, SIGNAL(clicked()),
+               this, SLOT(change_adaptor()));
 
 
        // language & quote
@@ -1309,8 +1315,8 @@ GuiDocument::GuiDocument(GuiView & lv)
        changesModule = new UiWidget<Ui::ChangeTrackingUi>(this);
        connect(changesModule->trackChangesCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
-       connect(changesModule->outputChangesCB, SIGNAL(clicked()),
-               this, SLOT(change_adaptor()));
+       connect(changesModule->outputChangesCB, SIGNAL(toggled(bool)),
+               this, SLOT(outputChangesToggled(bool)));
        connect(changesModule->changeBarsCB, SIGNAL(clicked()),
                this, SLOT(change_adaptor()));
 
@@ -3682,6 +3688,8 @@ void GuiDocument::applyView()
 
        bp_.save_transient_properties =
                outputModule->saveTransientPropertiesCB->isChecked();
+       bp_.postpone_fragile_content =
+               outputModule->postponeFragileCB->isChecked();
 
        // fonts
        bp_.fonts_roman[nontexfonts] =
@@ -4313,6 +4321,8 @@ void GuiDocument::paramsToDialog()
        outputModule->shellescapeCB->setChecked(bp_.shell_escape);
        outputModule->outputsyncCB->setChecked(bp_.output_sync);
        outputModule->synccustomCB->setEditText(toqstr(bp_.output_sync_macro));
+       outputModule->synccustomCB->setEnabled(bp_.output_sync);
+       outputModule->synccustomLA->setEnabled(bp_.output_sync);
 
        outputModule->mathimgSB->setValue(bp_.html_math_img_scale);
        outputModule->mathoutCB->setCurrentIndex(bp_.html_math_output);
@@ -4321,6 +4331,8 @@ void GuiDocument::paramsToDialog()
 
        outputModule->saveTransientPropertiesCB
                ->setChecked(bp_.save_transient_properties);
+       outputModule->postponeFragileCB
+               ->setChecked(bp_.postpone_fragile_content);
 
        // paper
        bool const extern_geometry =
@@ -4415,6 +4427,7 @@ void GuiDocument::paramsToDialog()
        changesModule->trackChangesCB->setChecked(bp_.track_changes);
        changesModule->outputChangesCB->setChecked(bp_.output_changes);
        changesModule->changeBarsCB->setChecked(bp_.change_bars);
+       changesModule->changeBarsCB->setEnabled(bp_.output_changes);
 
        // Make sure that the bc is in the INITIAL state
        if (bc().policy().buttonStatus(ButtonPolicy::RESTORE))
@@ -5147,6 +5160,20 @@ void GuiDocument::linenoToggled(bool on)
 }
 
 
+void GuiDocument::outputChangesToggled(bool on)
+{
+       changesModule->changeBarsCB->setEnabled(on);
+       change_adaptor();
+}
+
+void GuiDocument::setOutputSync(bool on)
+{
+       outputModule->synccustomCB->setEnabled(on);
+       outputModule->synccustomLA->setEnabled(on);
+       change_adaptor();
+}
+
+
 
 Dialog * createGuiDocument(GuiView & lv) { return new GuiDocument(lv); }