# HG changeset patch
# User Goffi <goffi@goffi.org>
# Date 1391533472 -3600
# Node ID e0770d977d585535477b223d831ed22f5220e3d0
# Parent  7f2082b192ed4ad3d90710f068aa312a5eb74568
xmlui: added boolean type management in XMLUIResult2DataFormResult

diff -r 7f2082b192ed -r e0770d977d58 src/tools/xml_tools.py
--- a/src/tools/xml_tools.py	Tue Feb 04 18:03:53 2014 +0100
+++ b/src/tools/xml_tools.py	Tue Feb 04 18:04:32 2014 +0100
@@ -49,6 +49,10 @@
             __field_type = "string"
         elif field.fieldType == 'text-private':
             __field_type = "password"
+        elif field.fieldType == 'boolean':
+            __field_type = "bool"
+            if field.value is None:
+                field.value = "false"
         elif field.fieldType == 'list-single':
             __field_type = "list"
         else:
@@ -387,6 +391,10 @@
 
     def addBool(self, name=None, value="true"):
         """Add a string box"""
+        if value=="0":
+            value="false"
+        elif value=="1":
+            value="true"
         assert value in ["true", "false"]
         elem = self._createElem('bool', name, self.currentLayout)
         elem.setAttribute('value', value)