X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiNomencl.cpp;h=6aa35f827810c6e0fdbce6367a8fd21dc2b0a722;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=b34ba798cd142146d63ecbfb5cdeb25f98a23cc3;hpb=2bf1c09376de37a3d66b79ca5f4304f29d5b4d06;p=lyx.git diff --git a/src/frontends/qt4/GuiNomencl.cpp b/src/frontends/qt4/GuiNomencl.cpp index b34ba798cd..6aa35f8278 100644 --- a/src/frontends/qt4/GuiNomencl.cpp +++ b/src/frontends/qt4/GuiNomencl.cpp @@ -14,14 +14,14 @@ #include "GuiNomencl.h" #include "qt_helpers.h" +#include "FuncRequest.h" + +#include "insets/InsetCommand.h" #include "support/debug.h" #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"