jp (xmlui): check root read_only status in addition to widget one

This commit is contained in:
Goffi 2019-06-14 12:49:45 +02:00
commit 540c95f133
2 changed files with 4 additions and 4 deletions

View file

@ -41,7 +41,7 @@ class XMLUI(object):
def xmlui(self, data):
xmlui = xmlui_manager.create(self.host, data)
xmlui.show(values_only=True)
xmlui.show(values_only=True, read_only=True)
self.host.disp(u"")
def xmlui_list(self, data):

View file

@ -215,7 +215,7 @@ class StringWidget(xmlui_base.StringWidget, InputWidget):
type = u"string"
def show(self):
if self.read_only:
if self.read_only or self.root.read_only:
self.disp(self.value)
else:
elems = []
@ -240,7 +240,7 @@ class TextBoxWidget(xmlui_base.TextWidget, StringWidget):
def show(self):
self.verboseName()
if self.read_only:
if self.read_only or self.root.read_only:
self.disp(self.value)
else:
if self.value:
@ -325,7 +325,7 @@ class BoolWidget(xmlui_base.BoolWidget, InputWidget):
def show(self):
disp_true = A.color(A.FG_GREEN, u"TRUE")
disp_false = A.color(A.FG_RED, u"FALSE")
if self.read_only:
if self.read_only or self.root.read_only:
self.disp(disp_true if self.value else disp_false)
else:
self.disp(A.color(C.A_HEADER, u"0: ",