diff --git a/src/frontends/qt4/FloatPlacement.cpp b/src/frontends/qt4/FloatPlacement.cpp index be5cf0543a..d8fc52bc95 100644 --- a/src/frontends/qt4/FloatPlacement.cpp +++ b/src/frontends/qt4/FloatPlacement.cpp @@ -251,6 +251,18 @@ void FloatPlacement::checkAllowed() } } + +bool FloatPlacement::checkWidgets(bool readonly) const +{ + floatTypeCO->setEnabled(!readonly); + defaultsCB->setEnabled(!readonly); + options->setEnabled(!readonly); + spanCB->setEnabled(!readonly); + sidewaysCB->setEnabled(!readonly); + + return InsetParamsWidget::checkWidgets(); +} + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/FloatPlacement.h b/src/frontends/qt4/FloatPlacement.h index 73ed4eb010..5aeecc2ded 100644 --- a/src/frontends/qt4/FloatPlacement.h +++ b/src/frontends/qt4/FloatPlacement.h @@ -37,6 +37,7 @@ public: FuncCode creationCode() const { return LFUN_FLOAT_INSERT; } void paramsToDialog(Inset const *); docstring dialogToParams() const; + bool checkWidgets(bool readonly) const; //@} /// void useWide(); diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index d3bd8e86c0..affc6cf464 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -411,6 +411,27 @@ docstring GuiBox::dialogToParams() const } +bool GuiBox::checkWidgets(bool readonly) const +{ + pagebreakCB->setEnabled(!readonly); + typeCO->setEnabled(!readonly); + innerBoxCO->setEnabled(!readonly); + valignCO->setEnabled(!readonly); + ialignCO->setEnabled(!readonly); + halignCO->setEnabled(!readonly); + valignCO->setEnabled(!readonly); + ialignCO->setEnabled(!readonly); + widthCB->setEnabled(!readonly); + widthED->setReadOnly(readonly); + widthUnitsLC->setEnabled(!readonly); + heightED->setReadOnly(readonly); + heightUnitsLC->setEnabled(!readonly); + heightCB->setEnabled(!readonly); + + return InsetParamsWidget::checkWidgets(); +} + + void GuiBox::setSpecial(bool ibox) { QString const last_item = diff --git a/src/frontends/qt4/GuiBox.h b/src/frontends/qt4/GuiBox.h index 5020f5c19a..4ff7ce9443 100644 --- a/src/frontends/qt4/GuiBox.h +++ b/src/frontends/qt4/GuiBox.h @@ -42,6 +42,7 @@ private: FuncCode creationCode() const { return LFUN_BOX_INSERT; } void paramsToDialog(Inset const *); docstring dialogToParams() const; + bool checkWidgets(bool readonly) const; //@} /// add and remove special lengths diff --git a/src/frontends/qt4/GuiBranch.cpp b/src/frontends/qt4/GuiBranch.cpp index 3124314401..c362905115 100644 --- a/src/frontends/qt4/GuiBranch.cpp +++ b/src/frontends/qt4/GuiBranch.cpp @@ -64,6 +64,14 @@ docstring GuiBranch::dialogToParams() const return from_utf8(InsetBranch::params2string(params)); } + +bool GuiBranch::checkWidgets(bool readonly) const +{ + branchCO->setEnabled(!readonly); + return InsetParamsWidget::checkWidgets(); +} + + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiBranch.h b/src/frontends/qt4/GuiBranch.h index 62f2ecaa2a..326839758b 100644 --- a/src/frontends/qt4/GuiBranch.h +++ b/src/frontends/qt4/GuiBranch.h @@ -34,6 +34,7 @@ private: FuncCode creationCode() const { return LFUN_BRANCH_INSERT; } void paramsToDialog(Inset const *); docstring dialogToParams() const; + bool checkWidgets(bool readonly) const; //@} }; diff --git a/src/frontends/qt4/GuiERT.cpp b/src/frontends/qt4/GuiERT.cpp index cc9f984b9d..8fc92e2250 100644 --- a/src/frontends/qt4/GuiERT.cpp +++ b/src/frontends/qt4/GuiERT.cpp @@ -58,6 +58,14 @@ void GuiERT::paramsToDialog(Inset const * inset) } } + +bool GuiERT::checkWidgets(bool readonly) const +{ + ertBG->setEnabled(!readonly); + return InsetParamsWidget::checkWidgets(); +} + + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiERT.h b/src/frontends/qt4/GuiERT.h index 18a1a9163c..35ca85c332 100644 --- a/src/frontends/qt4/GuiERT.h +++ b/src/frontends/qt4/GuiERT.h @@ -32,6 +32,7 @@ private: FuncCode creationCode() const { return LFUN_INSET_INSERT; } void paramsToDialog(Inset const *); docstring dialogToParams() const; + bool checkWidgets(bool readonly) const; //@} }; diff --git a/src/frontends/qt4/GuiTabular.cpp b/src/frontends/qt4/GuiTabular.cpp index 312b14fd87..55c3edab26 100644 --- a/src/frontends/qt4/GuiTabular.cpp +++ b/src/frontends/qt4/GuiTabular.cpp @@ -1012,6 +1012,46 @@ void GuiTabular::paramsToDialog(Inset const * inset) } +bool GuiTabular::checkWidgets(bool readonly) const +{ + tabularRowED->setReadOnly(readonly); + tabularColumnED->setReadOnly(readonly); + multicolumnCB->setEnabled(!readonly); + multirowCB->setEnabled(!readonly); + specialAlignmentED->setReadOnly(readonly); + rotateCellCB->setEnabled(!readonly); + rotateCellAngleSB->setEnabled(!readonly); + rotateTabularCB->setEnabled(!readonly); + rotateTabularAngleSB->setEnabled(!readonly); + longTabularCB->setEnabled(!readonly); + borders->setEnabled(!readonly); + tabularWidthED->setReadOnly(readonly); + tabularWidthUnitLC->setEnabled(!readonly); + columnWidthED->setReadOnly(readonly); + columnWidthUnitLC->setEnabled(!readonly); + multirowOffsetED->setReadOnly(readonly); + multirowOffsetUnitLC->setEnabled(!readonly); + setBordersGB->setEnabled(!readonly); + allBordersGB->setEnabled(!readonly); + borderStyleGB->setEnabled(!readonly); + booktabsRB->setEnabled(!readonly); + topspaceCO->setEnabled(!readonly); + topspaceUnitLC->setEnabled(!readonly); + bottomspaceCO->setEnabled(!readonly); + bottomspaceUnitLC->setEnabled(!readonly); + interlinespaceCO->setEnabled(!readonly); + interlinespaceUnitLC->setEnabled(!readonly); + hAlignCO->setEnabled(!readonly); + decimalPointED->setReadOnly(readonly); + vAlignCO->setEnabled(!readonly); + TableAlignCO->setEnabled(!readonly); + longtableGB->setEnabled(!readonly); + alignmentGB->setEnabled(!readonly); + + return InsetParamsWidget::checkWidgets(); +} + + bool GuiTabular::funcEnabled(Tabular::Feature f) const { string cmd = "tabular " + featureAsString(f); diff --git a/src/frontends/qt4/GuiTabular.h b/src/frontends/qt4/GuiTabular.h index 1d90afa604..a354a4a220 100644 --- a/src/frontends/qt4/GuiTabular.h +++ b/src/frontends/qt4/GuiTabular.h @@ -44,6 +44,7 @@ private: FuncCode creationCode() const { return LFUN_TABULAR_INSERT; } void paramsToDialog(Inset const *); docstring dialogToParams() const; + bool checkWidgets(bool readonly) const; //@} /// diff --git a/src/frontends/qt4/GuiVSpace.cpp b/src/frontends/qt4/GuiVSpace.cpp index 13b873443d..3756b15560 100644 --- a/src/frontends/qt4/GuiVSpace.cpp +++ b/src/frontends/qt4/GuiVSpace.cpp @@ -146,6 +146,17 @@ void GuiVSpace::paramsToDialog(Inset const * inset) enableCustom(spacingCO->currentIndex()); } + +bool GuiVSpace::checkWidgets(bool readonly) const +{ + valueLE->setReadOnly(readonly); + spacingCO->setEnabled(!readonly); + unitCO->setEnabled(!readonly); + keepCB->setEnabled(!readonly); + + return InsetParamsWidget::checkWidgets(); +} + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiVSpace.h b/src/frontends/qt4/GuiVSpace.h index f36a519c99..f26d40e763 100644 --- a/src/frontends/qt4/GuiVSpace.h +++ b/src/frontends/qt4/GuiVSpace.h @@ -39,6 +39,7 @@ private: FuncCode creationCode() const { return LFUN_INSET_INSERT; } void paramsToDialog(Inset const *); docstring dialogToParams() const; + bool checkWidgets(bool readonly) const; //@} };