diff options
author | flavio <fdanesse@gmail.com> | 2013-07-22 20:54:47 (GMT) |
---|---|---|
committer | flavio <fdanesse@gmail.com> | 2013-07-23 19:02:06 (GMT) |
commit | 54f8ca754ccf7ba84c48751b955f94ff48a2e685 (patch) | |
tree | 080aa6fca1031090d077d2452355dc5c715644ff | |
parent | 7aef6d7c26f05d67709cc895ec96f46870a933db (diff) |
Correction for multiple check none option button
-rw-r--r-- | CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py b/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py index aef30e7..d1b1096 100644 --- a/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py +++ b/CeibalEncuesta/gtk2/CeibalEncuesta/Widgets.py @@ -1589,23 +1589,38 @@ class Widget_MultipleCheckBox(gtk.VButtonBox): if self.updating: return options = self.get_children() - + activan = [] - - for child in options: - child = child.get_button() - if child.get_active(): - activan.append(child.indice) - - self.emit("new", activan) - + text = widget.get_parent().get_parent().get_label().get_text() + if "ninguna" in text and widget.get_active(): + ### Desactivar todas las opciones que no sean "ninguna." for child in options: child = child.get_button() - if child == widget: continue + + if child == widget: + activan = [child.indice] + continue + child.set_active(False) - + + elif not "ninguna" in text 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(): + child.set_active(False) + + else: + if child.get_active(): + activan.append(child.indice) + + self.emit("new", activan) + def update(self, dict): """ Cuando el usuario cambia de encuestado, |