Added nicedcv protocol && a couple of aliases parameters for user_interface future migration

This commit is contained in:
Adolfo Gómez García 2021-09-21 16:43:27 +02:00
parent d531a1612a
commit ef3dd893d9
2 changed files with 11 additions and 6 deletions

View File

@ -44,7 +44,7 @@ ICA = 'ica'
NX = 'nx'
X11 = 'x11'
X2GO = 'x2go' # Based on NX
NICE = 'nice'
NICEDCV = 'nicedcv'
OTHER = 'other'
GENERIC = (RDP, RGS, VNC, NX, X11, X2GO, PCOIP, NICE, OTHER)
GENERIC = (RDP, RGS, VNC, NX, X11, X2GO, PCOIP, NICEDCV, OTHER)

View File

@ -219,8 +219,8 @@ class gui:
* order
* label
* tooltip
* defvalue
* rdonly if can't be modified once it's created
* defvalue (if not required, this is optional). Alias for this field is defaultValue
* rdonly if can't be modified once it's created. Aliases for this field is readOnly
Any other paremeter needed is indicated in the corresponding field class.
@ -251,7 +251,8 @@ class gui:
_data: typing.Dict[str, typing.Any]
def __init__(self, **options) -> None:
defvalue = options.get('defvalue', '')
# Added defaultValue as alias for defvalue
defvalue = options.get('defvalue', options.get('defaultValue', ''))
if callable(defvalue):
defvalue = defvalue()
self._data = {
@ -262,7 +263,7 @@ class gui:
'label': options.get('label', ''),
'defvalue': str(defvalue),
'rdonly': options.get(
'rdonly', False
'rdonly', options.get('readOnly', False)
), # This property only affects in "modify" operations
'order': options.get('order', 0),
'tooltip': options.get('tooltip', ''),
@ -469,6 +470,10 @@ class gui:
v = 0
return v
@property
def int_value(self) -> int:
return self.num()
class DateField(InputField):
"""
This represents a date field.