+
+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 const & GuiParagraph::params() const
+{
+ if (haveMultiParSelection()) {
+ // FIXME: in case of multi-paragraph selection, it would be nice to
+ // initialise the parameters that are common to all paragraphs.
+ static ParagraphParameters empty;
+ return empty;
+ }
+ return bufferview()->cursor().innerParagraph().params();
+}
+
+
+void GuiParagraph::dispatchParams()
+{
+ ostringstream data;
+ params_.write(data);
+ FuncRequest const fr(getLfun(), data.str());
+ dispatch(fr);
+}
+
+
+bool GuiParagraph::haveMultiParSelection() const
+{
+ Cursor const & cur = bufferview()->cursor();
+ return cur.selection() && cur.selBegin().pit() != cur.selEnd().pit();
+}
+
+
+bool GuiParagraph::canIndent() const
+{
+ return buffer().params().paragraph_separation
+ == BufferParams::ParagraphIndentSeparation;
+}
+
+
+LyXAlignment GuiParagraph::alignPossible() const
+{
+ return bufferview()->cursor().innerParagraph().layout().alignpossible;
+}
+
+
+LyXAlignment GuiParagraph::alignDefault() const
+{
+ return bufferview()->cursor().innerParagraph().layout().align;
+}
+
+
+bool GuiParagraph::hasLabelwidth() const
+{
+ Layout layout = bufferview()->cursor().innerParagraph().layout();
+ return (layout.margintype == MARGIN_MANUAL
+ || layout.latextype == LATEX_BIB_ENVIRONMENT);
+}
+
+
+void GuiParagraph::saveSession() const
+{
+ Dialog::saveSession();
+ QSettings settings;
+ settings.setValue(sessionKey() + "/autoapply", synchronizedViewCB->isChecked());
+}
+
+
+void GuiParagraph::restoreSession()
+{
+ Dialog::restoreSession();
+ QSettings settings;
+ synchronizedViewCB->setChecked(
+ settings.value(sessionKey() + "/autoapply").toBool());
+}
+
+
+Dialog * createGuiParagraph(GuiView & lv)
+{
+ return new GuiParagraph(lv);
+}
+
+