X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiLabel.cpp;h=8c46909f9eeed3640c0d2a7df4cbd6e989ba68a5;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=d49bb745859d1d19acd3ff7345b74fa213d16c2c;hpb=85deaeb1659c4bcd5cb8d60bbdebe55506a767d5;p=lyx.git diff --git a/src/frontends/qt4/GuiLabel.cpp b/src/frontends/qt4/GuiLabel.cpp index d49bb74585..8c46909f9e 100644 --- a/src/frontends/qt4/GuiLabel.cpp +++ b/src/frontends/qt4/GuiLabel.cpp @@ -12,13 +12,15 @@ #include "GuiLabel.h" -#include "support/debug.h" +#include "FuncRequest.h" #include "qt_helpers.h" +#include "support/debug.h" +#include "insets/InsetCommand.h" + #include #include #include -#include using namespace std; @@ -27,12 +29,13 @@ namespace frontend { ///////////////////////////////////////////////////////////////// // -// Base implementation +// GuiLabel // ///////////////////////////////////////////////////////////////// GuiLabel::GuiLabel(GuiView & lv) - : GuiCommand(lv, "label", qt_("Label")) + : GuiDialog(lv, "label", qt_("Label")), + params_(insetCode("label")) { setupUi(this); @@ -62,13 +65,6 @@ void GuiLabel::reject() } -void GuiLabel::closeEvent(QCloseEvent * e) -{ - slotClose(); - e->accept(); -} - - void GuiLabel::updateContents() { docstring const contents = params_["name"]; @@ -83,16 +79,37 @@ void GuiLabel::applyView() } + +void GuiLabel::enableView(bool enable) +{ + keywordED->setEnabled(enable); +} + + bool GuiLabel::isValid() { return !keywordED->text().isEmpty(); } +bool GuiLabel::initialiseParams(std::string const & data) +{ + InsetCommand::string2params("label", data, params_); + return true; +} + + +void GuiLabel::dispatchParams() +{ + std::string const lfun = InsetCommand::params2string("label", params_); + dispatch(FuncRequest(getLfun(), lfun)); +} + + Dialog * createGuiLabel(GuiView & lv) { return new GuiLabel(lv); } } // namespace frontend } // namespace lyx -#include "GuiLabel_moc.cpp" +#include "moc_GuiLabel.cpp"