X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiNomencl.cpp;h=6aa35f827810c6e0fdbce6367a8fd21dc2b0a722;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=02b06ec0bed05c67b6e13f06b8897546017346ef;hpb=99c9b0fbcf39d399630bfc466a8c7adb56b4dc76;p=lyx.git diff --git a/src/frontends/qt4/GuiNomencl.cpp b/src/frontends/qt4/GuiNomencl.cpp index 02b06ec0be..6aa35f8278 100644 --- a/src/frontends/qt4/GuiNomencl.cpp +++ b/src/frontends/qt4/GuiNomencl.cpp @@ -13,23 +13,24 @@ #include "GuiNomencl.h" -#include "debug.h" #include "qt_helpers.h" +#include "FuncRequest.h" + +#include "insets/InsetCommand.h" + +#include "support/debug.h" #include #include -#include -#include -#include -#include -using std::string; +using namespace std; namespace lyx { namespace frontend { -GuiNomenclature::GuiNomenclature(LyXView & lv) - : GuiCommand(lv, "nomenclature") +GuiNomenclature::GuiNomenclature(GuiView & lv) + : GuiDialog(lv, "nomenclature", qt_("Nomenclature")), + params_(insetCode("nomenclature")) { setupUi(this); @@ -63,20 +64,14 @@ void GuiNomenclature::reject() } -void GuiNomenclature::closeEvent(QCloseEvent * e) -{ - slotClose(); - e->accept(); -} - - -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()); } @@ -99,7 +94,23 @@ bool GuiNomenclature::isValid() } -Dialog * createGuiNomenclature(LyXView & lv) +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); } @@ -108,4 +119,4 @@ Dialog * createGuiNomenclature(LyXView & lv) } // namespace frontend } // namespace lyx -#include "GuiNomencl_moc.cpp" +#include "moc_GuiNomencl.cpp"