X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiLabel.cpp;h=8c46909f9eeed3640c0d2a7df4cbd6e989ba68a5;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=d5c99a4e5a7b1af110b0f7f2e30ef4bb6f9da7c8;hpb=ba76bf5eb85db5a10839fccee3430d906d3f7b70;p=lyx.git diff --git a/src/frontends/qt4/GuiLabel.cpp b/src/frontends/qt4/GuiLabel.cpp index d5c99a4e5a..8c46909f9e 100644 --- a/src/frontends/qt4/GuiLabel.cpp +++ b/src/frontends/qt4/GuiLabel.cpp @@ -12,9 +12,12 @@ #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 @@ -26,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); @@ -75,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"