]> git.lyx.org Git - features.git/commitdiff
Implement GuiParagraph::enableView() for readonly documents. Does not fully work...
authorAbdelrazak Younes <younes@lyx.org>
Fri, 8 Feb 2008 16:08:45 +0000 (16:08 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 8 Feb 2008 16:08:45 +0000 (16:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22861 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiParagraph.cpp
src/frontends/qt4/GuiParagraph.h

index b840f54ae183ec1f65340b241c1b3a3ab4550edd..44417364121e58d8e424427a312ffedf368b5f29 100644 (file)
@@ -263,6 +263,22 @@ void GuiParagraph::updateView()
 }
 
 
+void GuiParagraph::enableView(bool enable)
+{
+       indentCB->setEnabled(enable);
+       linespacing->setEnabled(enable);
+       labelWidth->setEnabled(enable);
+       synchronizedViewCB->setEnabled(enable);
+       applyPB->setEnabled(enable);
+       restorePB->setEnabled(enable);
+       if (!enable)
+               synchronizedViewCB->setChecked(true);
+       RadioMap::const_iterator it = radioMap.begin();
+       for (; it != radioMap.end(); ++it)
+               it->second->setEnabled(enable);
+}
+
+
 ParagraphParameters & GuiParagraph::params()
 {
        if (haveMulitParSelection()) {
@@ -287,7 +303,7 @@ void GuiParagraph::dispatchParams()
        if (haveMulitParSelection()) {
                ostringstream data;
                multiparsel_.write(data);
-               FuncRequest const fr(LFUN_PARAGRAPH_PARAMS_APPLY, data.str());
+               FuncRequest const fr(getLfun(), data.str());
                dispatch(fr);
                return;
        }
index 07f0c4863dd0e61794dafa8e82b5c81dc81276ac..e2ab02966696e468a853bdf530b9d336ffc79708 100644 (file)
@@ -48,7 +48,9 @@ public:
        //@{
        void updateView();
        void dispatchParams();
+       void enableView(bool enable);
        bool isBufferDependent() const { return true; }
+       virtual kb_action getLfun() const { return LFUN_PARAGRAPH_PARAMS_APPLY; }
        //@}
 
 private: