core (xmlui), frontends: handling of "text" type in params xml + bug fixes
This commit is contained in:
parent
b2f32986be
commit
8f0cf4697b
1 changed files with 9 additions and 7 deletions
|
|
@ -199,10 +199,10 @@ def paramsXML2XMLUI(xml):
|
|||
|
||||
param_name = param.getAttribute('name')
|
||||
param_label = param.getAttribute('label')
|
||||
if not param_name:
|
||||
type_ = param.getAttribute('type')
|
||||
if not param_name and type_ != 'text':
|
||||
raise exceptions.DataError(_('INTERNAL ERROR: params must have a name'))
|
||||
|
||||
type_ = param.getAttribute('type')
|
||||
value = param.getAttribute('value') or None
|
||||
callback_id = param.getAttribute('callback_id') or None
|
||||
|
||||
|
|
@ -210,7 +210,7 @@ def paramsXML2XMLUI(xml):
|
|||
options = _getParamListOptions(param)
|
||||
widget_kwargs['options'] = options
|
||||
|
||||
if type_ == "button":
|
||||
if type_ in ("button", "text"):
|
||||
param_ui.addEmpty()
|
||||
value = param_label
|
||||
else:
|
||||
|
|
@ -513,9 +513,9 @@ class EmptyWidget(Widget):
|
|||
class TextWidget(Widget):
|
||||
type = 'text'
|
||||
|
||||
def __init__(self, xmlui, text, name=None, parent=None):
|
||||
def __init__(self, xmlui, value, name=None, parent=None):
|
||||
super(TextWidget, self).__init__(xmlui, name, parent)
|
||||
text = self.xmlui.doc.createTextNode(text)
|
||||
text = self.xmlui.doc.createTextNode(value)
|
||||
self.elem.appendChild(text)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue