From: Abdelrazak Younes Date: Fri, 8 Feb 2008 16:08:45 +0000 (+0000) Subject: Implement GuiParagraph::enableView() for readonly documents. Does not fully work... X-Git-Tag: 1.6.10~6382 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=722023c4134123623198ec9d46873ed82a06fc79;p=features.git Implement GuiParagraph::enableView() for readonly documents. Does not fully work yet as the paragraph alignment are not updated with cursor position. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22861 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiParagraph.cpp b/src/frontends/qt4/GuiParagraph.cpp index b840f54ae1..4441736412 100644 --- a/src/frontends/qt4/GuiParagraph.cpp +++ b/src/frontends/qt4/GuiParagraph.cpp @@ -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; } diff --git a/src/frontends/qt4/GuiParagraph.h b/src/frontends/qt4/GuiParagraph.h index 07f0c4863d..e2ab029666 100644 --- a/src/frontends/qt4/GuiParagraph.h +++ b/src/frontends/qt4/GuiParagraph.h @@ -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: