[gnome-bluetooth] wizard: fix PIN dialog not remembering user choice of fixed PIN
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth] wizard: fix PIN dialog not remembering user choice of fixed PIN
- Date: Mon, 21 Nov 2011 15:49:19 +0000 (UTC)
commit 0686b0361200b3c78c6e742084e2f950793048c0
Author: Daniele Forsi <dforsi src gnome org>
Date: Mon Nov 21 15:09:25 2011 +0100
wizard: fix PIN dialog not remembering user choice of fixed PIN
User choice wasn't correctly remembered if the user opened the
dialog and did not make any change (in that case the wizard acted
as if the "Automatic PIN selection" choice was selected).
https://bugzilla.gnome.org/show_bug.cgi?id=664476
wizard/main.c | 31 +++++++++++--------------------
1 files changed, 11 insertions(+), 20 deletions(-)
---
diff --git a/wizard/main.c b/wizard/main.c
index b53b632..96d4135 100644
--- a/wizard/main.c
+++ b/wizard/main.c
@@ -745,39 +745,30 @@ pin_option_button_clicked (GtkButton *button,
gpointer data)
{
GtkWidget *radio;
- char *oldpin;
-
- oldpin = user_pincode;
- user_pincode = NULL;
gtk_window_set_transient_for (GTK_WINDOW (pin_dialog),
GTK_WINDOW (window_assistant));
gtk_window_present (GTK_WINDOW (pin_dialog));
/* When reopening, try to guess where the pincode was set */
- if (oldpin == NULL)
+ if (user_pincode == NULL)
radio = radio_auto;
- else if (g_str_equal (oldpin, "0000"))
+ else if (g_str_equal (user_pincode, "0000"))
radio = radio_0000;
- else if (g_str_equal (oldpin, "1111"))
+ else if (g_str_equal (user_pincode, "1111"))
radio = radio_1111;
- else if (g_str_equal (oldpin, "1234"))
+ else if (g_str_equal (user_pincode, "1234"))
radio = radio_1234;
- else
+ else if (g_str_equal (user_pincode, "NULL"))
+ radio = radio_none;
+ else {
radio = radio_custom;
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
- if (radio == radio_custom)
- gtk_entry_set_text (GTK_ENTRY (entry_custom), oldpin);
-
- if (gtk_dialog_run (GTK_DIALOG (pin_dialog)) != GTK_RESPONSE_ACCEPT) {
- g_free (user_pincode);
- user_pincode = oldpin;
- } else {
- g_free (oldpin);
+ gtk_entry_set_text (GTK_ENTRY (entry_custom), user_pincode);
}
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
- gtk_widget_hide(pin_dialog);
+ gtk_dialog_run (GTK_DIALOG (pin_dialog));
+ gtk_widget_hide (pin_dialog);
}
static int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]