/pidgin/main: 26ce49409c17: Fix handling of login_label connecte...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Thu Jul 5 13:24:33 EDT 2012


Changeset: 26ce49409c17b903ca4e064b08755b2d27083da6
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2012-07-03 12:53 +0200
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/26ce49409c17

Description:

Fix handling of login_label connected with OPT_PROTO_REGISTER_NOSCREENNAME in account setup dialog

diffstat:

 pidgin/gtkaccount.c |  57 ++++++++++++++++++++++++++--------------------------
 1 files changed, 29 insertions(+), 28 deletions(-)

diffs (81 lines):

diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -307,6 +307,34 @@
 	}
 }
 
+static gboolean
+username_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog)
+{
+	GdkColor color = {0, 34952, 35466, 34181};
+	GHashTable *table = NULL;
+	const char *label = NULL;
+
+	if(PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(dialog->prpl_info, get_account_text_table)) {
+		table = dialog->prpl_info->get_account_text_table(NULL);
+		label = g_hash_table_lookup(table, "login_label");
+
+		if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') {
+			/* We have to avoid hitting the username_changed_cb function
+			 * because it enables buttons we don't want enabled yet ;)
+			 */
+			g_signal_handlers_block_by_func(widget, G_CALLBACK(username_changed_cb), dialog);
+			gtk_entry_set_text(GTK_ENTRY(widget), label);
+			/* Make sure we can hit it again */
+			g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_changed_cb), dialog);
+			gtk_widget_modify_text(widget, GTK_STATE_NORMAL, &color);
+		}
+
+		g_hash_table_destroy(table);
+	}
+
+	return FALSE;
+}
+
 static void
 register_button_cb(GtkWidget *checkbox, AccountPrefsDialog *dialog)
 {
@@ -318,6 +346,7 @@
 	
 	if (register_noscreenname) {
 		gtk_entry_set_text(GTK_ENTRY(dialog->username_entry), "");
+		username_nofocus_cb(dialog->username_entry, NULL, dialog);
 		gtk_entry_set_text(GTK_ENTRY(dialog->password_entry), "");
 		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->remember_pass_check), FALSE);
 	}
@@ -333,34 +362,6 @@
 	}
 }
 
-static gboolean
-username_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog)
-{
-	GdkColor color = {0, 34952, 35466, 34181};
-	GHashTable *table = NULL;
-	const char *label = NULL;
-
-	if(PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(dialog->prpl_info, get_account_text_table)) {
-		table = dialog->prpl_info->get_account_text_table(NULL);
-		label = g_hash_table_lookup(table, "login_label");
-
-		if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') {
-			/* We have to avoid hitting the username_changed_cb function
-			 * because it enables buttons we don't want enabled yet ;)
-			 */
-			g_signal_handlers_block_by_func(widget, G_CALLBACK(username_changed_cb), dialog);
-			gtk_entry_set_text(GTK_ENTRY(widget), label);
-			/* Make sure we can hit it again */
-			g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_changed_cb), dialog);
-			gtk_widget_modify_text(widget, GTK_STATE_NORMAL, &color);
-		}
-
-		g_hash_table_destroy(table);
-	}
-
-	return FALSE;
-}
-
 static void
 icon_filesel_choose_cb(const char *filename, gpointer data)
 {



More information about the Commits mailing list