# HG changeset patch # User Sadrul Habib Chowdhury # Date 1264305216 0 # Node ID d69df70937cc8e8ecc7dfe11d7bc5e5b4184a868 # Parent a25090259b4c3ba70426c0ddb42d6b6c512ede4d Allow copying username (and other settings) for a connected account from the account dialog. diff -r a25090259b4c -r d69df70937cc pidgin/gtkaccount.c --- a/pidgin/gtkaccount.c Sat Jan 23 06:20:54 2010 +0000 +++ b/pidgin/gtkaccount.c Sun Jan 24 03:53:36 2010 +0000 @@ -381,6 +381,7 @@ static void update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog) { + GtkStyle *style; gboolean set; GList *l; @@ -392,10 +393,21 @@ set = !(purple_account_is_connected(dialog->account) || purple_account_is_connecting(dialog->account)); gtk_widget_set_sensitive(dialog->protocol_menu, set); - gtk_widget_set_sensitive(dialog->username_entry, set); - - for (l = dialog->user_split_entries ; l != NULL ; l = l->next) - gtk_widget_set_sensitive((GtkWidget *)l->data, set); + gtk_editable_set_editable(GTK_EDITABLE(dialog->username_entry), set); + style = set ? NULL : gtk_widget_get_style(dialog->username_entry); + gtk_widget_modify_base(dialog->username_entry, GTK_STATE_NORMAL, + style ? &style->base[GTK_STATE_INSENSITIVE] : NULL); + + for (l = dialog->user_split_entries ; l != NULL ; l = l->next) { + if (GTK_IS_EDITABLE(l->data)) { + gtk_editable_set_editable(GTK_EDITABLE(l->data), set); + style = set ? NULL : gtk_widget_get_style(GTK_WIDGET(l->data)); + gtk_widget_modify_base(GTK_WIDGET(l->data), GTK_STATE_NORMAL, + style ? &style->base[GTK_STATE_INSENSITIVE] : NULL); + } else { + gtk_widget_set_sensitive(GTK_WIDGET(l->data), set); + } + } } static void