]> git.lyx.org Git - features.git/commitdiff
Implement checkWidgets in the remaining InsetParamsWidget derived dialogs.
authorJuergen Spitzmueller <spitz@lyx.org>
Thu, 2 Apr 2015 15:03:08 +0000 (17:03 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Thu, 2 Apr 2015 15:03:08 +0000 (17:03 +0200)
12 files changed:
src/frontends/qt4/FloatPlacement.cpp
src/frontends/qt4/FloatPlacement.h
src/frontends/qt4/GuiBox.cpp
src/frontends/qt4/GuiBox.h
src/frontends/qt4/GuiBranch.cpp
src/frontends/qt4/GuiBranch.h
src/frontends/qt4/GuiERT.cpp
src/frontends/qt4/GuiERT.h
src/frontends/qt4/GuiTabular.cpp
src/frontends/qt4/GuiTabular.h
src/frontends/qt4/GuiVSpace.cpp
src/frontends/qt4/GuiVSpace.h

index be5cf0543ae5be78dcb9a7207c1c2b4da2e7383e..d8fc52bc9584cc16d74ccceb7bdbe002f2a6c3e5 100644 (file)
@@ -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
 
index 73ed4eb01003b27cd2f4e6862dbf6e4f2a9461d2..5aeecc2deda7b0df1dc6fbc084658b95dafdca13 100644 (file)
@@ -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();
index d3bd8e86c06320a6b4dc7db3698f0fd05071db68..affc6cf46492dd59c140e86e4823fe61a69b79bd 100644 (file)
@@ -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 =
index 5020f5c19a671089a9a35e1a1d42c744e13cd6ed..4ff7ce9443a6b1dedfda79252d39c494e919daa7 100644 (file)
@@ -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
index 3124314401dda7abec6f6fe49b38774a64330b9e..c3629051155f3e5d6ef61cb0056568405354250c 100644 (file)
@@ -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
 
index 62f2ecaa2a9b121d3fdee7bebc1b2c9ea29cfe9e..326839758b417db65dcf6e3494c56723b93ba599 100644 (file)
@@ -34,6 +34,7 @@ private:
        FuncCode creationCode() const { return LFUN_BRANCH_INSERT; }
        void paramsToDialog(Inset const *);
        docstring dialogToParams() const;
+       bool checkWidgets(bool readonly) const;
        //@}
 };
 
index cc9f984b9d182278a1af61fdfc00785b03650e68..8fc92e22505ccbf4db88df349cb7fe8e3eca0846 100644 (file)
@@ -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
 
index 18a1a9163cee358ed343c6ce1fbf8d60bda80448..35ca85c332a7af07980afbc6803068dcf9a28dec 100644 (file)
@@ -32,6 +32,7 @@ private:
        FuncCode creationCode() const { return LFUN_INSET_INSERT; }
        void paramsToDialog(Inset const *);
        docstring dialogToParams() const;
+       bool checkWidgets(bool readonly) const;
        //@}
 };
 
index 312b14fd874b0639e06be08b0158e5871db3de55..55c3edab267e09c30bfd6fba92b99297988dea4a 100644 (file)
@@ -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);
index 1d90afa60445f1f3938034432c2350a27b0fe297..a354a4a220c47994bcff1dc6fdc65f2f63d572b9 100644 (file)
@@ -44,6 +44,7 @@ private:
        FuncCode creationCode() const { return LFUN_TABULAR_INSERT; }
        void paramsToDialog(Inset const *);
        docstring dialogToParams() const;
+       bool checkWidgets(bool readonly) const;
        //@}
 
        ///
index 13b873443da5550e0e5e5eae884e279d03aac9de..3756b15560421574d6f0d7f3b20629b7502b438a 100644 (file)
@@ -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
 
index f36a519c99cccd5a3ae420f3878395519e846a3c..f26d40e763ef2d54793a37941368da158220e199 100644 (file)
@@ -39,6 +39,7 @@ private:
        FuncCode creationCode() const { return LFUN_INSET_INSERT; }
        void paramsToDialog(Inset const *);
        docstring dialogToParams() const;
+       bool checkWidgets(bool readonly) const;
        //@}
 };