X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiNomencl.cpp;h=6aa35f827810c6e0fdbce6367a8fd21dc2b0a722;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=cd6a04326bb45b72514899530139e83ce5643284;hpb=9f3c7cf1ea1851cd77bd07b369a602a9608c265d;p=lyx.git diff --git a/src/frontends/qt4/GuiNomencl.cpp b/src/frontends/qt4/GuiNomencl.cpp index cd6a04326b..6aa35f8278 100644 --- a/src/frontends/qt4/GuiNomencl.cpp +++ b/src/frontends/qt4/GuiNomencl.cpp @@ -13,15 +13,15 @@ #include "GuiNomencl.h" -#include "support/debug.h" #include "qt_helpers.h" +#include "FuncRequest.h" + +#include "insets/InsetCommand.h" + +#include "support/debug.h" #include #include -#include -#include -#include -#include using namespace std; @@ -29,7 +29,8 @@ namespace lyx { namespace frontend { GuiNomenclature::GuiNomenclature(GuiView & lv) - : GuiCommand(lv, "nomenclature", qt_("Nomenclature")) + : GuiDialog(lv, "nomenclature", qt_("Nomenclature")), + params_(insetCode("nomenclature")) { setupUi(this); @@ -63,13 +64,14 @@ void GuiNomenclature::reject() } -void GuiNomenclature::updateContents() +void GuiNomenclature::paramsToDialog(InsetCommandParams const & /*icp*/) { prefixED->setText(toqstr(params_["prefix"])); symbolED->setText(toqstr(params_["symbol"])); QString description = toqstr(params_["description"]); description.replace("\\\\","\n"); descriptionTE->setPlainText(description); + descriptionTE->setFocus(); bc().setValid(isValid()); } @@ -92,6 +94,22 @@ bool GuiNomenclature::isValid() } +bool GuiNomenclature::initialiseParams(std::string const & data) +{ + InsetCommand::string2params("nomenclature", data, params_); + paramsToDialog(params_); + return true; +} + + +void GuiNomenclature::dispatchParams() +{ + std::string const lfun = InsetCommand::params2string("nomenclature", params_); + dispatch(FuncRequest(getLfun(), lfun)); +} + + + Dialog * createGuiNomenclature(GuiView & lv) { return new GuiNomenclature(lv); @@ -101,4 +119,4 @@ Dialog * createGuiNomenclature(GuiView & lv) } // namespace frontend } // namespace lyx -#include "GuiNomencl_moc.cpp" +#include "moc_GuiNomencl.cpp"