[network-manager-openconnect] When entry with focus gets password from gnome-keyring, select the full region



commit eee2f4fd0f1aa3e2439c9ca337b00f5a382d9b8e
Author: David Woodhouse <David Woodhouse intel com>
Date:   Sat Jun 16 01:38:23 2012 +0100

    When entry with focus gets password from gnome-keyring, select the full region

 auth-dialog/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 870c22b..8d16572 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -629,8 +629,12 @@ static void got_keyring_pw(GnomeKeyringResult result, const char *string, gpoint
 	ui_fragment_data *data = (ui_fragment_data*)userdata;
 	if (string != NULL) {
 		if (data->entry) {
-			if (g_ascii_strncasecmp("", gtk_entry_get_text(GTK_ENTRY(data->entry)), 0) == 0)
+			if (!g_ascii_strcasecmp("",
+						gtk_entry_get_text(GTK_ENTRY(data->entry)))) {
 				gtk_entry_set_text(GTK_ENTRY(data->entry), string);
+				if (gtk_widget_has_focus(data->entry))
+					gtk_editable_select_region(GTK_EDITABLE(data->entry), 0, -1);
+			}
 		} else
 			data->entry_text = g_strdup (string);
 	}



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