diff options
author | flavio <fdanesse@gmail.com> | 2013-07-24 20:16:04 (GMT) |
---|---|---|
committer | flavio <fdanesse@gmail.com> | 2013-07-24 20:16:59 (GMT) |
commit | 8a196bde827727464b301935d12551c653438319 (patch) | |
tree | 61351505c76a5150b3bcdd8e5acfb4800097ae12 | |
parent | 986e371333c58640915266eb40f6ca54c76212a9 (diff) |
Corrections responses have the option to None #3823
-rw-r--r-- | CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py b/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py index c415949..cc2f2c4 100644 --- a/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py +++ b/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py @@ -1568,7 +1568,7 @@ class Widget_MultipleCheckBox(gtk.VButtonBox): for id in indices: key = order[id] - check = MyCheckButton(key) + check = MyCheckButton(key, self.options[key].get("none", False)) text = self.options[key].get("text", None) imagen = self.options[key].get("img", "") @@ -1619,9 +1619,7 @@ class Widget_MultipleCheckBox(gtk.VButtonBox): activan = [] - text = widget.get_parent().get_parent().get_label().get_text() - - if "ninguna" in text and widget.get_active(): + if widget.none and widget.get_active(): ### Desactivar todas las opciones que no sean "ninguna." for child in options: child = child.get_button() @@ -1632,14 +1630,12 @@ class Widget_MultipleCheckBox(gtk.VButtonBox): child.set_active(False) - elif not "ninguna" in text and widget.get_active(): + elif not widget.none and widget.get_active(): ### Desactivar la opciĆ³n "ninguna." for child in options: child = child.get_button() - text = child.get_parent().get_parent().get_label().get_text() - - if "ninguna" in text and child.get_active(): + if child.none and child.get_active(): child.set_active(False) else: @@ -1647,7 +1643,7 @@ class Widget_MultipleCheckBox(gtk.VButtonBox): activan.append(child.indice) self.emit("new", activan) - + def update(self, dict): """ Cuando el usuario cambia de encuestado, @@ -1722,12 +1718,15 @@ class MyContainer(gtk.HBox): class MyCheckButton(gtk.CheckButton): - def __init__(self, indice): + def __init__(self, indice, none): gtk.CheckButton.__init__(self) self.indice = indice - + if none == "true": none = True + if none == "false": none = False + self.none = none + self.show_all() class MyRadioButton(gtk.RadioButton): |