Mercurial > pidgin.yaz
diff pidgin/gtkimhtmltoolbar.c @ 30660:2ab000954aff
Use a helper variable to (vastly, to me) improve readability.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 03 Jul 2010 00:59:58 +0000 |
parents | 96d3f44d006d |
children | 832c94bdc3bb |
line wrap: on
line diff
--- a/pidgin/gtkimhtmltoolbar.c Thu Jul 01 00:03:35 2010 +0000 +++ b/pidgin/gtkimhtmltoolbar.c Sat Jul 03 00:59:58 2010 +0000 @@ -1323,6 +1323,7 @@ GtkWidget *insert_menu; GtkWidget *menuitem; GtkWidget *sep; + GObject *wide_attention_button; int i; struct { const char *label; @@ -1467,6 +1468,8 @@ gtk_widget_show_all(sep); /* Attention */ + wide_attention_button = g_object_get_data(G_OBJECT(toolbar), "attention"); + attention_button = gtk_button_new(); gtk_button_set_relief(GTK_BUTTON(attention_button), GTK_RELIEF_NONE); bbox = gtk_hbox_new(FALSE, 3); @@ -1478,17 +1481,15 @@ gtk_box_pack_start(GTK_BOX(bbox), label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(box), attention_button, FALSE, FALSE, 0); g_signal_connect_swapped(G_OBJECT(attention_button), "clicked", - G_CALLBACK(gtk_button_clicked), - g_object_get_data(G_OBJECT(toolbar), "attention")); + G_CALLBACK(gtk_button_clicked), wide_attention_button); gtk_widget_show_all(attention_button); - g_signal_connect(G_OBJECT(g_object_get_data(G_OBJECT(toolbar), "attention")), + g_signal_connect(wide_attention_button, "attention", "notify::sensitive", G_CALLBACK(button_sensitiveness_changed), attention_button); /* set attention button to be greyed out until we get a conversation */ - gtk_widget_set_sensitive(g_object_get_data(G_OBJECT(toolbar), "attention"), - FALSE); + gtk_widget_set_sensitive(wide_attention_button, FALSE); gtk_box_pack_start(GTK_BOX(hbox), box, FALSE, FALSE, 0); g_object_set_data(G_OBJECT(hbox), "lean-view", box);