summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2008-09-22 12:19:22 +0000
committerdeva <deva>2008-09-22 12:19:22 +0000
commit64f5bc46a4925da459704092e884e747ccbc544c (patch)
tree3c0202ace3801f7c93f95fd3e096b316fd671f6a
parent29c7310559c541ed682b84756967fa24d06043ed (diff)
Added readonly functionality to the textedit.
-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()));
}