]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiLabel.cpp
Fix reloading of local layout file (bug #11120)
[lyx.git] / src / frontends / qt4 / GuiLabel.cpp
index 570de61a4f1150de47852465fac5fcfea05d0ee3..d5b207f7738ce426aa8b7f19e6c6d341b7b4d27b 100644 (file)
@@ -46,12 +46,6 @@ void GuiLabel::paramsToDialog(Inset const * inset)
 {
        InsetLabel const * label = static_cast<InsetLabel const *>(inset);
        InsetCommandParams const & params = label->params();
-       paramsToDialog(params);
-}
-
-
-void GuiLabel::paramsToDialog(InsetCommandParams const & params)
-{
        keywordED->setText(toqstr(params["name"]));
 }
 
@@ -60,12 +54,23 @@ docstring GuiLabel::dialogToParams() const
 {
        InsetCommandParams params(insetCode());
        params["name"] = qstring_to_ucs4(keywordED->text());
-       return from_ascii(InsetLabel::params2string(params));
+       return from_utf8(InsetLabel::params2string(params));
+}
+
+
+bool GuiLabel::initialiseParams(std::string const & data)
+{
+       InsetCommandParams p(insetCode());
+       if (!InsetCommand::string2params(data, p))
+               return false;
+       keywordED->setText(toqstr(p["name"]));
+       return true;
 }
 
 
-bool GuiLabel::checkWidgets() const
+bool GuiLabel::checkWidgets(bool readonly) const
 {
+       keywordED->setReadOnly(readonly);
        if (!InsetParamsWidget::checkWidgets())
                return false;
        return !keywordED->text().isEmpty();