[caribou] Preset radio buttons to correct value



commit 66ca73770cb01cd1c48839ca4eeef6bb24a2f300
Author: Eitan Isaacson <eitan monotonous org>
Date:   Tue May 3 16:29:19 2011 -0700

    Preset radio buttons to correct value

 caribou/settings/preferences_window.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/caribou/settings/preferences_window.py b/caribou/settings/preferences_window.py
index 58d1b4c..9ca57de 100644
--- a/caribou/settings/preferences_window.py
+++ b/caribou/settings/preferences_window.py
@@ -120,10 +120,12 @@ class AbstractPreferencesUI:
                 control.set_col_spacings(3)
                 radios = []
                 for string, localized in setting.allowed:
-                    radios.append(Gtk.RadioButton.new_with_label(
-                            [], localized))
-                for radio in radios[1:]:
+                    rb = Gtk.RadioButton.new_with_label([], localized)
+                    radios.append(rb)
+                for radio, allowed in zip(radios[1:], setting.allowed[1:]):
                     radio.join_group(radios[0])
+                    if allowed[0] == setting.value:
+                        radio.set_active(True)
 
                 hid = setting.connect(
                     'value-changed',



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]