| 509 |
509 |
| 510 static void |
510 static void |
| 511 pidgin_status_box_finalize(GObject *obj) |
511 pidgin_status_box_finalize(GObject *obj) |
| 512 { |
512 { |
| 513 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(obj); |
513 PidginStatusBox *statusbox = PIDGIN_STATUS_BOX(obj); |
| |
514 int i; |
| 514 |
515 |
| 515 purple_signals_disconnect_by_handle(statusbox); |
516 purple_signals_disconnect_by_handle(statusbox); |
| 516 purple_prefs_disconnect_by_handle(statusbox); |
517 purple_prefs_disconnect_by_handle(statusbox); |
| 517 |
518 |
| 518 destroy_icon_box(statusbox); |
519 destroy_icon_box(statusbox); |
| |
520 |
| |
521 if (statusbox->active_row) |
| |
522 gtk_tree_row_reference_free(statusbox->active_row); |
| |
523 |
| |
524 for (i = 0; i < G_N_ELEMENTS(statusbox->connecting_pixbufs); i++) { |
| |
525 if (statusbox->connecting_pixbufs[i] != NULL) |
| |
526 gdk_pixbuf_unref(statusbox->connecting_pixbufs[i]); |
| |
527 } |
| |
528 |
| |
529 for (i = 0; i < G_N_ELEMENTS(statusbox->typing_pixbufs); i++) { |
| |
530 if (statusbox->typing_pixbufs[i] != NULL) |
| |
531 gdk_pixbuf_unref(statusbox->typing_pixbufs[i]); |
| |
532 } |
| 519 |
533 |
| 520 g_object_unref(G_OBJECT(statusbox->store)); |
534 g_object_unref(G_OBJECT(statusbox->store)); |
| 521 g_object_unref(G_OBJECT(statusbox->dropdown_store)); |
535 g_object_unref(G_OBJECT(statusbox->dropdown_store)); |
| 522 G_OBJECT_CLASS(parent_class)->finalize(obj); |
536 G_OBJECT_CLASS(parent_class)->finalize(obj); |
| 523 } |
537 } |
| 1164 |
1178 |
| 1165 static void |
1179 static void |
| 1166 cache_pixbufs(PidginStatusBox *status_box) |
1180 cache_pixbufs(PidginStatusBox *status_box) |
| 1167 { |
1181 { |
| 1168 GtkIconSize icon_size; |
1182 GtkIconSize icon_size; |
| |
1183 int i; |
| 1169 |
1184 |
| 1170 g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL); |
1185 g_object_set(G_OBJECT(status_box->icon_rend), "xpad", 3, NULL); |
| 1171 icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); |
1186 icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_EXTRA_SMALL); |
| 1172 |
1187 |
| 1173 if (status_box->connecting_pixbufs[0] != NULL) |
1188 for (i = 0; i < G_N_ELEMENTS(status_box->connecting_pixbufs); i++) { |
| 1174 gdk_pixbuf_unref(status_box->connecting_pixbufs[0]); |
1189 if (status_box->connecting_pixbufs[i] != NULL) |
| 1175 if (status_box->connecting_pixbufs[1] != NULL) |
1190 gdk_pixbuf_unref(status_box->connecting_pixbufs[i]); |
| 1176 gdk_pixbuf_unref(status_box->connecting_pixbufs[1]); |
1191 } |
| 1177 if (status_box->connecting_pixbufs[2] != NULL) |
|
| 1178 gdk_pixbuf_unref(status_box->connecting_pixbufs[2]); |
|
| 1179 if (status_box->connecting_pixbufs[3] != NULL) |
|
| 1180 gdk_pixbuf_unref(status_box->connecting_pixbufs[3]); |
|
| 1181 |
1192 |
| 1182 status_box->connecting_index = 0; |
1193 status_box->connecting_index = 0; |
| 1183 status_box->connecting_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT0, |
1194 status_box->connecting_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT0, |
| 1184 icon_size, "PidginStatusBox"); |
1195 icon_size, "PidginStatusBox"); |
| 1185 status_box->connecting_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT1, |
1196 status_box->connecting_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT1, |
| 1197 status_box->connecting_pixbufs[7] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT7, |
1208 status_box->connecting_pixbufs[7] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT7, |
| 1198 icon_size, "PidginStatusBox"); |
1209 icon_size, "PidginStatusBox"); |
| 1199 status_box->connecting_pixbufs[8] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT8, |
1210 status_box->connecting_pixbufs[8] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_CONNECT8, |
| 1200 icon_size, "PidginStatusBox"); |
1211 icon_size, "PidginStatusBox"); |
| 1201 |
1212 |
| 1202 if (status_box->typing_pixbufs[0] != NULL) |
1213 for (i = 0; i < G_N_ELEMENTS(status_box->typing_pixbufs); i++) { |
| 1203 gdk_pixbuf_unref(status_box->typing_pixbufs[0]); |
1214 if (status_box->typing_pixbufs[i] != NULL) |
| 1204 if (status_box->typing_pixbufs[1] != NULL) |
1215 gdk_pixbuf_unref(status_box->typing_pixbufs[i]); |
| 1205 gdk_pixbuf_unref(status_box->typing_pixbufs[1]); |
1216 } |
| 1206 if (status_box->typing_pixbufs[2] != NULL) |
|
| 1207 gdk_pixbuf_unref(status_box->typing_pixbufs[2]); |
|
| 1208 if (status_box->typing_pixbufs[3] != NULL) |
|
| 1209 gdk_pixbuf_unref(status_box->typing_pixbufs[3]); |
|
| 1210 |
1217 |
| 1211 status_box->typing_index = 0; |
1218 status_box->typing_index = 0; |
| 1212 status_box->typing_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_TYPING0, |
1219 status_box->typing_pixbufs[0] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_TYPING0, |
| 1213 icon_size, "PidginStatusBox"); |
1220 icon_size, "PidginStatusBox"); |
| 1214 status_box->typing_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_TYPING1, |
1221 status_box->typing_pixbufs[1] = gtk_widget_render_icon (GTK_WIDGET(status_box->vbox), PIDGIN_STOCK_ANIMATION_TYPING1, |