]> 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 02b06ec0bed05c67b6e13f06b8897546017346ef..6aa35f827810c6e0fdbce6367a8fd21dc2b0a722 100644 (file)
 
 #include "GuiNomencl.h"
 
-#include "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 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"