pidgin/gtkaccount.c

changeset 29226
88232e6c5591
parent 27668
536cb7a2d348
child 29686
f9dee36112d0
equal deleted inserted replaced
29225:f95f3c1be6dd 29226:88232e6c5591
379 } 379 }
380 380
381 static void 381 static void
382 update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog) 382 update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog)
383 { 383 {
384 GtkStyle *style;
384 gboolean set; 385 gboolean set;
385 GList *l; 386 GList *l;
386 387
387 if (dialog->account == NULL) 388 if (dialog->account == NULL)
388 return; 389 return;
390 if (gc != NULL && dialog->account != purple_connection_get_account(gc)) 391 if (gc != NULL && dialog->account != purple_connection_get_account(gc))
391 return; 392 return;
392 393
393 set = !(purple_account_is_connected(dialog->account) || purple_account_is_connecting(dialog->account)); 394 set = !(purple_account_is_connected(dialog->account) || purple_account_is_connecting(dialog->account));
394 gtk_widget_set_sensitive(dialog->protocol_menu, set); 395 gtk_widget_set_sensitive(dialog->protocol_menu, set);
395 gtk_widget_set_sensitive(dialog->username_entry, set); 396 gtk_editable_set_editable(GTK_EDITABLE(dialog->username_entry), set);
396 397 style = set ? NULL : gtk_widget_get_style(dialog->username_entry);
397 for (l = dialog->user_split_entries ; l != NULL ; l = l->next) 398 gtk_widget_modify_base(dialog->username_entry, GTK_STATE_NORMAL,
398 gtk_widget_set_sensitive((GtkWidget *)l->data, set); 399 style ? &style->base[GTK_STATE_INSENSITIVE] : NULL);
400
401 for (l = dialog->user_split_entries ; l != NULL ; l = l->next) {
402 if (GTK_IS_EDITABLE(l->data)) {
403 gtk_editable_set_editable(GTK_EDITABLE(l->data), set);
404 style = set ? NULL : gtk_widget_get_style(GTK_WIDGET(l->data));
405 gtk_widget_modify_base(GTK_WIDGET(l->data), GTK_STATE_NORMAL,
406 style ? &style->base[GTK_STATE_INSENSITIVE] : NULL);
407 } else {
408 gtk_widget_set_sensitive(GTK_WIDGET(l->data), set);
409 }
410 }
399 } 411 }
400 412
401 static void 413 static void
402 add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) 414 add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent)
403 { 415 {

mercurial