]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiNomenclature.cpp
Do not compute caret geometry when we are not ready to do so.
[lyx.git] / src / frontends / qt4 / GuiNomenclature.cpp
index 7415f7f3dff3f21c446a3ddc4adb4f9cb2cb3ea1..3afad18a83e3e25cf7e7a904937e9c9cdf4a8f14 100644 (file)
@@ -29,6 +29,8 @@ GuiNomenclature::GuiNomenclature(QWidget * parent) : InsetParamsWidget(parent)
                this, SIGNAL(changed()));
        connect(descriptionTE, SIGNAL(textChanged()),
                this, SIGNAL(changed()));
+       connect(literalCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
 
        setFocusProxy(descriptionTE);
 }
@@ -41,6 +43,7 @@ void GuiNomenclature::paramsToDialog(Inset const * inset)
 
        prefixED->setText(toqstr(params["prefix"]));
        symbolED->setText(toqstr(params["symbol"]));
+       literalCB->setChecked(params["literal"] == "true");
        QString description = toqstr(params["description"]);
        description.replace("\\\\","\n");
        descriptionTE->setPlainText(description);
@@ -56,6 +59,8 @@ docstring GuiNomenclature::dialogToParams() const
        QString description = descriptionTE->toPlainText();
        description.replace('\n',"\\\\");
        params["description"] = qstring_to_ucs4(description);
+       params["literal"] = literalCB->isChecked()
+                       ? from_ascii("true") : from_ascii("false");
        return from_utf8(InsetNomencl::params2string(params));
 }
 
@@ -70,8 +75,10 @@ bool GuiNomenclature::initialiseParams(std::string const & data)
 }
 
 
-bool GuiNomenclature::checkWidgets() const
+bool GuiNomenclature::checkWidgets(bool readonly) const
 {
+       symbolED->setReadOnly(readonly);
+       descriptionTE->setReadOnly(readonly);
        if (!InsetParamsWidget::checkWidgets())
                return false;
        QString const description = descriptionTE->toPlainText();