diff options
author | Daniele Forsi <dforsi@src.gnome.org> | 2011-12-18 22:20:23 +0100 |
---|---|---|
committer | Daniele Forsi <dforsi@src.gnome.org> | 2011-12-18 22:43:18 +0100 |
commit | ede97e75a14f8c7d410ffaa195ae5fe3cc1f428c (patch) | |
tree | 7b9a30e7f0c50739459a93d4107ce196679471c8 /wizard | |
parent | eb90227aa6ad92df3c3481cc02d519deffe06f9e (diff) | |
download | gnome-bluetooth-ede97e75a14f8c7d410ffaa195ae5fe3cc1f428c.tar.gz |
wizard: use different signal handlers for the two types of radio buttons
Do not call set_user_pincode() for the radio button beside the entry widget,
just call toggle_set_sensitive().
Also there is no need to loop over the button group since we know the address of
the widget that was toggled.
Diffstat (limited to 'wizard')
-rw-r--r-- | wizard/main.c | 32 | ||||
-rw-r--r-- | wizard/wizard.ui | 1 |
2 files changed, 4 insertions, 29 deletions
diff --git a/wizard/main.c b/wizard/main.c index 92097528..d01c4dd9 100644 --- a/wizard/main.c +++ b/wizard/main.c @@ -648,35 +648,11 @@ toggle_set_sensitive (GtkWidget *button, void set_user_pincode (GtkWidget *button) { - GSList *list, *l; - - list = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)); - for (l = list; l ; l = l->next) { - GtkEntry *entry; - const char *pin; - - if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))) - continue; - - pin = g_object_get_data (G_OBJECT (button), "pin"); - entry = g_object_get_data (G_OBJECT (button), "entry"); - - if (entry != NULL) { - g_free (user_pincode); - user_pincode = g_strdup (gtk_entry_get_text(entry)); - gtk_dialog_set_response_sensitive (GTK_DIALOG (pin_dialog), - GTK_RESPONSE_ACCEPT, - gtk_entry_get_text_length (entry) >= 1); - } else if (pin != NULL) { - g_free (user_pincode); - if (*pin == '\0') - user_pincode = NULL; - else - user_pincode = g_strdup (pin); - } + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button))) + return; - break; - } + g_free (user_pincode); + user_pincode = g_strdup (g_object_get_data (G_OBJECT (button), "pin")); } void diff --git a/wizard/wizard.ui b/wizard/wizard.ui index 5c8b289e..c5e215f0 100644 --- a/wizard/wizard.ui +++ b/wizard/wizard.ui @@ -488,7 +488,6 @@ <property name="active">True</property> <property name="draw_indicator">True</property> <property name="group">radio_auto</property> - <signal name="toggled" handler="set_user_pincode"/> <signal name="toggled" handler="toggle_set_sensitive"/> </object> <packing> |