summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/widgets/textedit.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/widgets/textedit.cc b/client/widgets/textedit.cc
index 8b18a3d..cdbd8ad 100644
--- a/client/widgets/textedit.cc
+++ b/client/widgets/textedit.cc
@@ -36,6 +36,18 @@ TextEdit::TextEdit(QDomNode &node, MacroWindow *macrowindow)
{
setCommonAttributes(this, node);
+ QDomElement elem = node.toElement();
+
+ if(elem.hasAttribute("readonly")) {
+ if(elem.attribute("readonly") == "true" || elem.attribute("readonly") == "1") {
+ setReadOnly(true);
+ } else if(elem.attribute("readonly") == "false" || elem.attribute("readonly") == "0") {
+ setReadOnly(false);
+ } else {
+ printf("Unknown value of readonly: %s\n", elem.attribute("readonly").toStdString().c_str());
+ }
+ }
+
connect(this, SIGNAL(textChanged()), this, SLOT(changed()));
}