# HG changeset patch # User Eric Warmenhoven # Date 1003179877 0 # Node ID 6e52448f352aeabd930fd9a37c20672575a396c2 # Parent bf7ec3874810009384fdf30ef8f77e80db01d67b [gaim-migrate @ 2526] ability to reenable animation. committer: Tailor Script diff -r bf7ec3874810 -r 6e52448f352a src/conversation.c --- a/src/conversation.c Mon Oct 15 20:08:15 2001 +0000 +++ b/src/conversation.c Mon Oct 15 21:04:37 2001 +0000 @@ -2670,6 +2670,18 @@ c->icon_timer = 0; } +static void start_anim(GtkObject *obj, struct conversation *c) +{ + GList *frames; + GdkPixbufFrame *frame; + int delay; + + frames = gdk_pixbuf_animation_get_frames(c->anim); + frame = g_list_nth_data(frames, c->frame); + delay = MAX(gdk_pixbuf_frame_get_delay_time(frame), 13); + c->icon_timer = gtk_timeout_add(delay * 10, redraw_icon, c); +} + static int des_save_icon(GtkObject *obj, GdkEvent *e, struct conversation *c) { gtk_widget_destroy(c->save_icon); @@ -2745,6 +2757,11 @@ gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(stop_anim), c); gtk_menu_append(GTK_MENU(menu), button); gtk_widget_show(button); + } else if (c->anim) { + button = gtk_menu_item_new_with_label(_("Enable Animation")); + gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(start_anim), c); + gtk_menu_append(GTK_MENU(menu), button); + gtk_widget_show(button); } button = gtk_menu_item_new_with_label(_("Hide Icon"));