]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiNomencl.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiNomencl.cpp
index cd6a04326bb45b72514899530139e83ce5643284..6aa35f827810c6e0fdbce6367a8fd21dc2b0a722 100644 (file)
 
 #include "GuiNomencl.h"
 
-#include "support/debug.h"
 #include "qt_helpers.h"
+#include "FuncRequest.h"
+
+#include "insets/InsetCommand.h"
+
+#include "support/debug.h"
 
 #include <QLabel>
 #include <QLineEdit>
-#include <QPushButton>
-#include <QTextEdit>
-#include <QWhatsThis>
-#include <QCloseEvent>
 
 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"