X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FInsetParamsDialog.cpp;h=e6ee1d09ec8a19c339e5b715b52ff7550f9292ef;hb=ee7dd4a11ea21851e7e32164c66b37d3bc8ac31d;hp=82d371e62923dcdc8de9cbaae2e40467505c953f;hpb=3a26a8d9d7fa231702b3621821d0750386d8cff6;p=lyx.git diff --git a/src/frontends/qt4/InsetParamsDialog.cpp b/src/frontends/qt4/InsetParamsDialog.cpp index 82d371e629..e6ee1d09ec 100644 --- a/src/frontends/qt4/InsetParamsDialog.cpp +++ b/src/frontends/qt4/InsetParamsDialog.cpp @@ -13,8 +13,12 @@ #include "InsetParamsDialog.h" #include "GuiBox.h" +#include "GuiBranch.h" +#include "GuiBibitem.h" #include "GuiERT.h" #include "GuiInfo.h" +#include "GuiLine.h" +#include "GuiHSpace.h" #include "GuiTabular.h" #include "GuiVSpace.h" #include "FloatPlacement.h" @@ -66,6 +70,7 @@ InsetParamsDialog::InsetParamsDialog(GuiView & lv, InsetParamsWidget * widget) setInsetParamsWidget(widget); synchronizedViewCB->setChecked(false); on_synchronizedViewCB_stateChanged(false); + setFocusProxy(widget); } InsetParamsDialog::~InsetParamsDialog() @@ -74,6 +79,12 @@ InsetParamsDialog::~InsetParamsDialog() } +bool InsetParamsDialog::initialiseParams(std::string const &) +{ + on_restorePB_clicked(); + return true; +} + void InsetParamsDialog::setInsetParamsWidget(InsetParamsWidget * widget) { d->widget_ = widget; @@ -85,7 +96,8 @@ void InsetParamsDialog::setInsetParamsWidget(InsetParamsWidget * widget) void InsetParamsDialog::on_restorePB_clicked() { - updateView(); + updateView(true); + restorePB->setEnabled(false); } @@ -107,12 +119,15 @@ void InsetParamsDialog::newInset() } +void InsetParamsDialog::on_newPB_clicked() +{ + newInset(); +} + + void InsetParamsDialog::on_applyPB_clicked() { - if (synchronizedViewCB->isChecked()) - newInset(); - else - applyView(); + applyView(); } @@ -124,10 +139,7 @@ void InsetParamsDialog::on_closePB_clicked() void InsetParamsDialog::on_synchronizedViewCB_stateChanged(int state) { - bool const sync = (state == Qt::Checked); - QString const label = sync ? qt_("&New") : qt_("&Apply"); - applyPB->setText(label); - checkWidgets(sync); + checkWidgets(state == Qt::Checked); } @@ -167,18 +179,26 @@ void InsetParamsDialog::applyView() } -void InsetParamsDialog::updateView() +void InsetParamsDialog::updateView(bool update_widget) { - Inset const * i = inset(d->widget_->insetCode()); - if (i) { - d->widget_->blockSignals(true); - d->widget_->paramsToDialog(i); - d->widget_->blockSignals(false); + if (update_widget) { + Inset const * i = inset(d->widget_->insetCode()); + if (i) { + d->widget_->blockSignals(true); + d->widget_->paramsToDialog(i); + d->widget_->blockSignals(false); + } } checkWidgets(synchronizedViewCB->isChecked()); } +void InsetParamsDialog::updateView() +{ + updateView(synchronizedViewCB->isChecked()); +} + + Dialog * createDialog(GuiView & lv, InsetCode code) { InsetParamsWidget * widget; @@ -189,18 +209,30 @@ Dialog * createDialog(GuiView & lv, InsetCode code) case FLOAT_CODE: widget = new FloatPlacement(true); break; + case BIBITEM_CODE: + widget = new GuiBibitem; + break; + case BRANCH_CODE: + widget = new GuiBranch; + break; case BOX_CODE: widget = new GuiBox; break; case INFO_CODE: widget = new GuiInfo; break; - //FIXME: not ready yet. - /* + case LINE_CODE: + widget = new GuiLine; + break; + case MATH_SPACE_CODE: + widget = new GuiHSpace(true); + break; + case SPACE_CODE: + widget = new GuiHSpace(false); + break; case TABULAR_CODE: widget = new GuiTabular; break; - */ case VSPACE_CODE: widget = new GuiVSpace; break;