]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiBibitem.cpp
GuiBibtex: Use appropriate title when using Biblatex
[lyx.git] / src / frontends / qt4 / GuiBibitem.cpp
index 12ec4b0ea8fe010cfd5136c74246f0009a06c6e3..b29f8a8704c3d089b9ce476c7b79b6898f394b25 100644 (file)
@@ -32,6 +32,8 @@ GuiBibitem::GuiBibitem(QWidget * parent) : InsetParamsWidget(parent)
                this, SIGNAL(changed()));
        connect(labelED, SIGNAL(textChanged(QString)),
                this, SIGNAL(changed()));
+       connect(literalCB, SIGNAL(clicked()),
+               this, SIGNAL(changed()));
 }
 
 
@@ -41,6 +43,7 @@ void GuiBibitem::paramsToDialog(Inset const * inset)
        InsetCommandParams const & params = ic->params();
        keyED->setText(toqstr(params["key"]));
        labelED->setText(toqstr(params["label"]));
+       literalCB->setChecked(params["literal"] == "true");
 }
 
 
@@ -49,12 +52,16 @@ docstring GuiBibitem::dialogToParams() const
        InsetCommandParams params(insetCode());
        params["key"] = qstring_to_ucs4(keyED->text());
        params["label"] = qstring_to_ucs4(labelED->text());
-       return from_utf8(InsetCommand::params2string("bibitem", params));
+       params["literal"] = literalCB->isChecked()
+                       ? from_ascii("true") : from_ascii("false");
+       return from_utf8(InsetCommand::params2string(params));
 }
 
 
-bool GuiBibitem::checkWidgets() const
+bool GuiBibitem::checkWidgets(bool readonly) const
 {
+       keyED->setReadOnly(readonly);
+       labelED->setReadOnly(readonly);
        if (!InsetParamsWidget::checkWidgets())
                return false;
        return !keyED->text().isEmpty();