diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index 669779881d..7aed200a47 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -435,6 +435,7 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_INSET_EDIT: case LFUN_INSET_MODIFY: case LFUN_INSET_DIALOG_UPDATE: + case LFUN_INSET_SETTINGS: flag.setEnabled(true); return true; @@ -446,9 +447,15 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetExternal::edit(Cursor & cur, bool, EntryDirection) { - cur.bv().showDialog("external", - params2string(params(), cur.bv().buffer()), - this); + showInsetDialog(&cur.bv()); +} + + +bool InsetExternal::showInsetDialog(BufferView * bv) const +{ + bv->showDialog("external", params2string(params(), bv->buffer()), + const_cast(this)); + return true; } diff --git a/src/insets/InsetExternal.h b/src/insets/InsetExternal.h index 962ac48de1..5572828489 100644 --- a/src/insets/InsetExternal.h +++ b/src/insets/InsetExternal.h @@ -140,6 +140,8 @@ private: /// void edit(Cursor & cur, bool front, EntryDirection entry_from); /// + bool showInsetDialog(BufferView * bv) const; + /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; /// void doDispatch(Cursor & cur, FuncRequest & cmd); diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 4c8ecad020..1b809e1960 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -234,6 +234,7 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_INSET_EDIT: case LFUN_INSET_MODIFY: case LFUN_INSET_DIALOG_UPDATE: + case LFUN_INSET_SETTINGS: flag.setEnabled(true); return true; @@ -245,11 +246,19 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetGraphics::edit(Cursor & cur, bool, EntryDirection) { - cur.bv().showDialog("graphics", params2string(params(), - cur.bv().buffer()), this); + showInsetDialog(&cur.bv()); } +bool InsetGraphics::showInsetDialog(BufferView * bv) const +{ + bv->showDialog("graphics", params2string(params(), bv->buffer()), + const_cast(this)); + return true; +} + + + void InsetGraphics::metrics(MetricsInfo & mi, Dimension & dim) const { graphic_->metrics(mi, dim); diff --git a/src/insets/InsetGraphics.h b/src/insets/InsetGraphics.h index e18d8c63cb..8b459a677f 100644 --- a/src/insets/InsetGraphics.h +++ b/src/insets/InsetGraphics.h @@ -87,6 +87,8 @@ private: /// void edit(Cursor & cur, bool front, EntryDirection entry_from); /// + bool showInsetDialog(BufferView * bv) const; + /// void editGraphics(InsetGraphicsParams const &, Buffer const &) const; /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index 8360d8857d..db7072f95f 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -177,6 +177,7 @@ bool InsetSpace::getStatus(Cursor & cur, FuncRequest const & cmd, status.setOnOff(params_.kind == params.kind); } // fall through + case LFUN_INSET_SETTINGS: case LFUN_INSET_DIALOG_UPDATE: status.setEnabled(true); return true; @@ -188,7 +189,15 @@ bool InsetSpace::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetSpace::edit(Cursor & cur, bool, EntryDirection) { - cur.bv().showDialog("space", params2string(params()), this); + showInsetDialog(&cur.bv()); +} + + +bool InsetSpace::showInsetDialog(BufferView * bv) const +{ + bv->showDialog("space", params2string(params()), + const_cast(this)); + return true; } diff --git a/src/insets/InsetSpace.h b/src/insets/InsetSpace.h index 777456a7d9..d3842ddd05 100644 --- a/src/insets/InsetSpace.h +++ b/src/insets/InsetSpace.h @@ -161,6 +161,8 @@ public: bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; private: + /// + bool showInsetDialog(BufferView * bv) const; /// InsetSpaceParams params_; }; diff --git a/src/insets/InsetVSpace.cpp b/src/insets/InsetVSpace.cpp index 8812024683..0042f981d1 100644 --- a/src/insets/InsetVSpace.cpp +++ b/src/insets/InsetVSpace.cpp @@ -92,6 +92,11 @@ bool InsetVSpace::getStatus(Cursor & cur, FuncRequest const & cmd, } status.setEnabled(true); return true; + + case LFUN_INSET_SETTINGS: + status.setEnabled(true); + return true; + default: return Inset::getStatus(cur, cmd, status); } @@ -100,8 +105,15 @@ bool InsetVSpace::getStatus(Cursor & cur, FuncRequest const & cmd, void InsetVSpace::edit(Cursor & cur, bool, EntryDirection) { - cur.bv().showDialog("vspace", params2string(space()), + showInsetDialog(&cur.bv()); +} + + +bool InsetVSpace::showInsetDialog(BufferView * bv) const +{ + bv->showDialog("vspace", params2string(space()), const_cast(this)); + return true; } diff --git a/src/insets/InsetVSpace.h b/src/insets/InsetVSpace.h index b4b599feba..a559f13be9 100644 --- a/src/insets/InsetVSpace.h +++ b/src/insets/InsetVSpace.h @@ -67,6 +67,8 @@ private: Inset * clone() const { return new InsetVSpace(*this); } /// docstring const label() const; + /// + bool showInsetDialog(BufferView * bv) const; /// VSpace space_;