Mercurial > libervia-backend
changeset 910:9754c0ebadba
core (XMLUI): BoolWidget now accept real boolean for value
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 21 Mar 2014 15:03:56 +0100 (2014-03-21) |
parents | fab49a1d5ea2 |
children | b12706d164d7 |
files | src/tools/xml_tools.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/tools/xml_tools.py Fri Mar 21 15:03:51 2014 +0100 +++ b/src/tools/xml_tools.py Fri Mar 21 15:03:56 2014 +0100 @@ -579,7 +579,9 @@ type = 'bool' def __init__(self, xmlui, value='false', name=None, parent=None): - if value == '0': + if isinstance(value, bool): + value = 'true' if value else 'false' + elif value == '0': value='false' elif value == '1': value='true'