pidgin: 779eca7c: Allow copying username (and other settin...

sadrul at pidgin.im sadrul at pidgin.im
Sat Jan 23 22:55:46 EST 2010


-----------------------------------------------------------------
Revision: 779eca7c0854d4a8f2108ed8274ab5b588490884
Ancestor: f0a8332b652a3ebe81e392b4283bbda403dd0881
Author: sadrul at pidgin.im
Date: 2010-01-24T03:53:36
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/779eca7c0854d4a8f2108ed8274ab5b588490884

Modified files:
        pidgin/gtkaccount.c

ChangeLog: 

Allow copying username (and other settings) for a connected account from
the account dialog.

-------------- next part --------------
============================================================
--- pidgin/gtkaccount.c	8a952ead31af5a0d1fdb89d362d173657b9fd422
+++ pidgin/gtkaccount.c	96fc8927e15c06d338ceceef1324c1c974019932
@@ -381,6 +381,7 @@ update_editable(PurpleConnection *gc, Ac
 static void
 update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog)
 {
+	GtkStyle *style;
 	gboolean set;
 	GList *l;
 
@@ -392,10 +393,21 @@ update_editable(PurpleConnection *gc, Ac
 
 	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);
+	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)
-		gtk_widget_set_sensitive((GtkWidget *)l->data, set);
+	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


More information about the Commits mailing list