]> git.lyx.org Git - lyx.git/commitdiff
InsetParamsWidget should not just ignore the initialization data. I
authorRichard Heck <rgheck@comcast.net>
Thu, 28 Oct 2010 16:31:14 +0000 (16:31 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 28 Oct 2010 16:31:14 +0000 (16:31 +0000)
don't know if there are similar issues with other dialogs based on it,
but this seems to fix it for GuiLabel.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35886 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiLabel.cpp
src/frontends/qt4/GuiLabel.h
src/frontends/qt4/InsetParamsDialog.cpp
src/frontends/qt4/InsetParamsWidget.h

index 6d9ee79daee40e912f591210b08bc146d1655f68..535e464430677540b8a0c14cdf3e07c0eff3050e 100644 (file)
@@ -58,6 +58,16 @@ docstring GuiLabel::dialogToParams() const
 }
 
 
+bool GuiLabel::initialiseParams(std::string const & data)
+{
+       InsetCommandParams p(insetCode());
+       if (!InsetCommand::string2params("label", data, p))
+               return false;
+       keywordED->setText(toqstr(p["name"]));
+       return true;
+}
+
+
 bool GuiLabel::checkWidgets() const
 {
        if (!InsetParamsWidget::checkWidgets())
index 4e7a63f05d4bee0bdfce29872b01eaf16528713d..d616cbf1f5c5228f3a47026e3d70061f21209e31 100644 (file)
@@ -35,6 +35,7 @@ private:
        void paramsToDialog(Inset const *);
        docstring dialogToParams() const;
        bool checkWidgets() const;
+       bool initialiseParams(std::string const &);
        //@}
 };
 
index c7abda546489b37cb914b4c9698c83ebaedcd8fb..17b41080194c6ab8279a2c55287f05814244f0c8 100644 (file)
@@ -88,12 +88,14 @@ InsetParamsDialog::~InsetParamsDialog()
 }\r
 \r
 \r
-bool InsetParamsDialog::initialiseParams(std::string const &)\r
+bool InsetParamsDialog::initialiseParams(std::string const & data)\r
 {\r
-       on_restorePB_clicked();\r
+       if (!d->widget_->initialiseParams(data))\r
+               on_restorePB_clicked();\r
        return true;\r
 }\r
 \r
+\r
 void InsetParamsDialog::setInsetParamsWidget(InsetParamsWidget * widget)\r
 {\r
        d->widget_ = widget;\r
index 58c98a7831d091ad4d38efb23595e78a52426509..df78c7e90f3338214ed8091a979f338e57802ba8 100644 (file)
@@ -65,6 +65,9 @@ public:
        virtual void paramsToDialog(Inset const *) = 0;\r
        ///\r
        virtual docstring dialogToParams() const = 0;\r
+       ///\r
+       virtual bool initialiseParams(std::string const & /* data */) \r
+               { return false; }\r
 \r
        /// \return true if all CheckedWidgets are in a valid state.\r
        virtual bool checkWidgets() const;\r