]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiLabel.cpp
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / GuiLabel.cpp
index d5c99a4e5a7b1af110b0f7f2e30ef4bb6f9da7c8..8c46909f9eeed3640c0d2a7df4cbd6e989ba68a5 100644 (file)
 
 #include "GuiLabel.h"
 
-#include "support/debug.h"
+#include "FuncRequest.h"
 #include "qt_helpers.h"
 
+#include "support/debug.h"
+#include "insets/InsetCommand.h"
+
 #include <QLabel>
 #include <QPushButton>
 #include <QLineEdit>
@@ -26,12 +29,13 @@ namespace frontend {
 
 /////////////////////////////////////////////////////////////////
 //
-// Base implementation
+// GuiLabel
 //
 /////////////////////////////////////////////////////////////////
 
 GuiLabel::GuiLabel(GuiView & lv)
-       : GuiCommand(lv, "label", qt_("Label"))
+       : GuiDialog(lv, "label", qt_("Label")),
+         params_(insetCode("label"))
 {
        setupUi(this);
 
@@ -75,16 +79,37 @@ void GuiLabel::applyView()
 }
 
 
+
+void GuiLabel::enableView(bool enable)
+{
+       keywordED->setEnabled(enable);
+}
+
+
 bool GuiLabel::isValid()
 {
        return !keywordED->text().isEmpty();
 }
 
 
+bool GuiLabel::initialiseParams(std::string const & data)
+{
+       InsetCommand::string2params("label", data, params_);
+       return true;
+}
+
+
+void GuiLabel::dispatchParams()
+{
+       std::string const lfun = InsetCommand::params2string("label", params_);
+       dispatch(FuncRequest(getLfun(), lfun));
+}
+
+
 Dialog * createGuiLabel(GuiView & lv) { return new GuiLabel(lv); }
 
 
 } // namespace frontend
 } // namespace lyx
 
-#include "GuiLabel_moc.cpp"
+#include "moc_GuiLabel.cpp"