| 2095 GdkPixmap *pm; |
2095 GdkPixmap *pm; |
| 2096 GdkBitmap *bm; |
2096 GdkBitmap *bm; |
| 2097 gint delay; |
2097 gint delay; |
| 2098 int scale_width, scale_height; |
2098 int scale_width, scale_height; |
| 2099 |
2099 |
| 2100 if (!g_list_find(gaim_get_ims(), conv)) { |
|
| 2101 gaim_debug(GAIM_DEBUG_WARNING, "gtkconv", |
|
| 2102 "Conversation not found in redraw_icon. I think this " |
|
| 2103 "is a bug.\n"); |
|
| 2104 return FALSE; |
|
| 2105 } |
|
| 2106 |
|
| 2107 gtkconv = GAIM_GTK_CONVERSATION(conv); |
2100 gtkconv = GAIM_GTK_CONVERSATION(conv); |
| 2108 account = gaim_conversation_get_account(conv); |
2101 account = gaim_conversation_get_account(conv); |
| 2109 if(account && account->gc) |
2102 if(account && account->gc) |
| 2110 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl); |
2103 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl); |
| 2111 |
2104 |
| 2135 delay = gdk_pixbuf_animation_iter_get_delay_time(gtkconv->u.im->iter); |
2128 delay = gdk_pixbuf_animation_iter_get_delay_time(gtkconv->u.im->iter); |
| 2136 |
2129 |
| 2137 if (delay < 100) |
2130 if (delay < 100) |
| 2138 delay = 100; |
2131 delay = 100; |
| 2139 |
2132 |
| 2140 gtkconv->u.im->icon_timer = g_timeout_add(delay, redraw_icon, conv); |
2133 gtkconv->u.im->icon_timer = g_timeout_add(delay, redraw_icon, gtkconv); |
| 2141 |
2134 |
| 2142 return FALSE; |
2135 return FALSE; |
| 2143 } |
2136 } |
| 2144 |
2137 |
| 2145 static void |
2138 static void |
| 2146 start_anim(GtkObject *obj, GaimGtkConversation *gtkconv) |
2139 start_anim(GtkObject *obj, GaimGtkConversation *gtkconv) |
| 2147 { |
2140 { |
| 2148 GaimConversation *conv = gtkconv->active_conv; |
|
| 2149 int delay; |
2141 int delay; |
| 2150 |
2142 |
| 2151 if (gtkconv->u.im->anim == NULL) |
2143 if (gtkconv->u.im->anim == NULL) |
| 2152 return; |
2144 return; |
| 2153 |
2145 |
| 2237 ext = "icon"; |
2229 ext = "icon"; |
| 2238 |
2230 |
| 2239 buf = g_strdup_printf("%s.%s", gaim_normalize(conv->account, conv->name), ext); |
2231 buf = g_strdup_printf("%s.%s", gaim_normalize(conv->account, conv->name), ext); |
| 2240 |
2232 |
| 2241 gaim_request_file(conv, _("Save Icon"), buf, TRUE, |
2233 gaim_request_file(conv, _("Save Icon"), buf, TRUE, |
| 2242 G_CALLBACK(saveicon_writefile_cb), NULL, conv); |
2234 G_CALLBACK(saveicon_writefile_cb), NULL, gtkconv); |
| 2243 |
2235 |
| 2244 g_free(buf); |
2236 g_free(buf); |
| 2245 } |
2237 } |
| 2246 |
2238 |
| 2247 static void |
2239 static void |
| 2287 |
2278 |
| 2288 if (gtkconv->u.im->anim && |
2279 if (gtkconv->u.im->anim && |
| 2289 !(gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim))) |
2280 !(gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim))) |
| 2290 { |
2281 { |
| 2291 gaim_new_check_item(menu, _("Animate"), |
2282 gaim_new_check_item(menu, _("Animate"), |
| 2292 G_CALLBACK(toggle_icon_animate_cb), conv, |
2283 G_CALLBACK(toggle_icon_animate_cb), gtkconv, |
| 2293 gtkconv->u.im->icon_timer); |
2284 gtkconv->u.im->icon_timer); |
| 2294 } |
2285 } |
| 2295 |
2286 |
| 2296 button = gtk_menu_item_new_with_label(_("Hide Icon")); |
2287 button = gtk_menu_item_new_with_label(_("Hide Icon")); |
| 2297 g_signal_connect_swapped(G_OBJECT(button), "activate", |
2288 g_signal_connect_swapped(G_OBJECT(button), "activate", |