From 64f5bc46a4925da459704092e884e747ccbc544c Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 22 Sep 2008 12:19:22 +0000 Subject: Added readonly functionality to the textedit. --- client/widgets/textedit.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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())); } -- cgit v1.2.3