Mercurial > pidgin.yaz
comparison src/gtkconv.c @ 8758:2db51720fd09
[gaim-migrate @ 9513]
Some minor gtkconv fixes
-Disable the "warn" conversation menu item for protocols that don't
support it. Same with Get Info, Invite, and Insert Link
-Fix the following weird icon animation bug: (sf bug 939768)
In the conversation window talking to someone on AIM if
you right click on an animated AIM buddy icon and
unanimate it then you tab over to chat to someone else
using another protocol (not AIM) (like MSN or ICQ) that
don't have buddy icons then come back to the original
AIM person you disabled the animated buddy icon, well,
it's animated again.
It works fine if you stay in AIM and tab from someone
having a disabled animated icon to someone with no
buddy icon and/or someone having a non animated buddy
icon. So I think the bug is in when you tab to another
chat protocol.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 22 Apr 2004 16:24:05 +0000 |
parents | 67f733c1cff8 |
children | 1076cd8579ea |
comparison
equal
deleted
inserted
replaced
8757:ffb333368cdc | 8758:2db51720fd09 |
---|---|
1395 | 1395 |
1396 return TRUE; | 1396 return TRUE; |
1397 break; | 1397 break; |
1398 | 1398 |
1399 } /* End of switch */ | 1399 } /* End of switch */ |
1400 | 1400 } |
1401 #if 0 | 1401 |
1402 if (gaim_prefs_get_bool("/gaim/gtk/conversations/html_shortcuts")) { | |
1403 switch (event->keyval) { | |
1404 | |
1405 | |
1406 } | |
1407 } /* End of switch */ | |
1408 | |
1409 if (gaim_prefs_get_bool("/gaim/gtk/conversations/smiley_shortcuts")) { | |
1410 char buf[7]; | |
1411 | |
1412 *buf = '\0'; | |
1413 | |
1414 switch (event->keyval) { | |
1415 | |
1416 } | |
1417 | |
1418 | |
1419 } | |
1420 #endif | |
1421 | |
1422 } | |
1423 /* If ALT (or whatever) was held down... */ | 1402 /* If ALT (or whatever) was held down... */ |
1424 else if (event->state & GDK_MOD1_MASK) | 1403 else if (event->state & GDK_MOD1_MASK) |
1425 { | 1404 { |
1426 /* XXX - Make sure the conv exists before switching to it */ | 1405 /* XXX - Make sure the conv exists before switching to it */ |
1427 if (event->keyval > '0' && event->keyval <= '9') { | 1406 if (event->keyval > '0' && event->keyval <= '9') { |
1430 gaim_conv_window_switch_conversation(win, switchto); | 1409 gaim_conv_window_switch_conversation(win, switchto); |
1431 | 1410 |
1432 return TRUE; | 1411 return TRUE; |
1433 } | 1412 } |
1434 } | 1413 } |
1414 | |
1435 /* If neither CTRL nor ALT were held down... */ | 1415 /* If neither CTRL nor ALT were held down... */ |
1436 else | 1416 else |
1437 { | 1417 { |
1438 switch (event->keyval) | 1418 switch (event->keyval) |
1439 { | 1419 { |
2131 if (gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim)) | 2111 if (gdk_pixbuf_animation_is_static_image(gtkconv->u.im->anim)) |
2132 return; | 2112 return; |
2133 | 2113 |
2134 delay = gdk_pixbuf_animation_iter_get_delay_time(gtkconv->u.im->iter) / 10; | 2114 delay = gdk_pixbuf_animation_iter_get_delay_time(gtkconv->u.im->iter) / 10; |
2135 | 2115 |
2136 if (gtkconv->u.im->anim) | 2116 gtkconv->u.im->icon_timer = g_timeout_add(delay * 10, redraw_icon, conv); |
2137 gtkconv->u.im->icon_timer = g_timeout_add(delay * 10, redraw_icon, | |
2138 conv); | |
2139 } | 2117 } |
2140 | 2118 |
2141 static void | 2119 static void |
2142 stop_anim(GtkObject *obj, GaimConversation *conv) | 2120 stop_anim(GtkObject *obj, GaimConversation *conv) |
2143 { | 2121 { |
2393 buttons = GTK_IMHTML_SMILEY; | 2371 buttons = GTK_IMHTML_SMILEY; |
2394 } | 2372 } |
2395 gtk_imhtml_set_format_functions(GTK_IMHTML(gtkconv->entry), buttons); | 2373 gtk_imhtml_set_format_functions(GTK_IMHTML(gtkconv->entry), buttons); |
2396 gtk_imhtmltoolbar_associate_smileys (GTK_IMHTMLTOOLBAR(gtkconv->toolbar), gaim_account_get_protocol_id(gaim_conversation_get_account(conv))); | 2374 gtk_imhtmltoolbar_associate_smileys (GTK_IMHTMLTOOLBAR(gtkconv->toolbar), gaim_account_get_protocol_id(gaim_conversation_get_account(conv))); |
2397 | 2375 |
2398 #if 0 | |
2399 /* Deal with menu items */ | 2376 /* Deal with menu items */ |
2400 gtk_widget_set_sensitive(gtkwin->menu.view_log, TRUE); | 2377 gtk_widget_set_sensitive(gtkwin->menu.view_log, TRUE); |
2401 gtk_widget_set_sensitive(gtkwin->menu.add_pounce, TRUE); | 2378 gtk_widget_set_sensitive(gtkwin->menu.add_pounce, TRUE); |
2402 gtk_widget_set_sensitive(gtkwin->menu.get_info, (prpl_info->get_info != NULL)); | 2379 gtk_widget_set_sensitive(gtkwin->menu.get_info, (prpl_info->get_info != NULL)); |
2403 gtk_widget_set_sensitive(gtkwin->menu.warn, (prpl_info->warn != NULL)); | 2380 gtk_widget_set_sensitive(gtkwin->menu.warn, (prpl_info->warn != NULL)); |
2404 gtk_widget_set_sensitive(gtkwin->menu.invite, | 2381 gtk_widget_set_sensitive(gtkwin->menu.invite, |
2405 (prpl_info->chat_invite != NULL)); | 2382 (prpl_info->chat_invite != NULL)); |
2406 #endif | |
2407 | 2383 |
2408 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { | 2384 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { |
2409 if (gaim_find_buddy(gaim_conversation_get_account(conv), | 2385 if (gaim_find_buddy(gaim_conversation_get_account(conv), |
2410 gaim_conversation_get_name(conv)) == NULL) | 2386 gaim_conversation_get_name(conv)) == NULL) |
2411 gtk_widget_set_sensitive(gtkwin->menu.alias, FALSE); | 2387 gtk_widget_set_sensitive(gtkwin->menu.alias, FALSE); |
2421 | 2397 |
2422 gtk_widget_set_sensitive(gtkwin->menu.block, | 2398 gtk_widget_set_sensitive(gtkwin->menu.block, |
2423 (prpl_info->add_deny != NULL)); | 2399 (prpl_info->add_deny != NULL)); |
2424 gtk_widget_set_sensitive(gtkwin->menu.add, TRUE); | 2400 gtk_widget_set_sensitive(gtkwin->menu.add, TRUE); |
2425 gtk_widget_set_sensitive(gtkwin->menu.remove, TRUE); | 2401 gtk_widget_set_sensitive(gtkwin->menu.remove, TRUE); |
2426 gtk_widget_set_sensitive(gtkwin->menu.insert_link, TRUE); | 2402 gtk_widget_set_sensitive(gtkwin->menu.insert_link, |
2403 gc->flags & GAIM_CONNECTION_HTML); | |
2427 gtk_widget_set_sensitive(gtkwin->menu.insert_image, | 2404 gtk_widget_set_sensitive(gtkwin->menu.insert_image, |
2428 (prpl_info->options & OPT_PROTO_IM_IMAGE)); | 2405 (prpl_info->options & OPT_PROTO_IM_IMAGE)); |
2429 } else { | 2406 } else { |
2430 /* Account is offline */ | 2407 /* Account is offline */ |
2431 /* Or it's a chat where we left. */ | 2408 /* Or it's a chat where we left. */ |
3884 gtkconv->bbox = gtk_hbox_new(FALSE, 6); | 3861 gtkconv->bbox = gtk_hbox_new(FALSE, 6); |
3885 gtk_box_pack_start(GTK_BOX(vbox2), gtkconv->bbox, FALSE, FALSE, 0); | 3862 gtk_box_pack_start(GTK_BOX(vbox2), gtkconv->bbox, FALSE, FALSE, 0); |
3886 gtk_widget_show(gtkconv->bbox); | 3863 gtk_widget_show(gtkconv->bbox); |
3887 | 3864 |
3888 setup_im_buttons(conv, gtkconv->bbox); | 3865 setup_im_buttons(conv, gtkconv->bbox); |
3866 gtkconv->u.im->animate = gaim_prefs_get_bool("/gaim/gtk/conversations/im/animate_buddy_icons"); | |
3889 | 3867 |
3890 focus_chain = g_list_prepend (NULL, sw); | 3868 focus_chain = g_list_prepend (NULL, sw); |
3891 gtk_container_set_focus_chain (GTK_CONTAINER(vbox2), focus_chain); | 3869 gtk_container_set_focus_chain (GTK_CONTAINER(vbox2), focus_chain); |
3892 | 3870 |
3893 return paned; | 3871 return paned; |
5181 if (gaim_conversation_get_gc(conv) == NULL) | 5159 if (gaim_conversation_get_gc(conv) == NULL) |
5182 return; | 5160 return; |
5183 | 5161 |
5184 if (gtkconv->u.im->anim) | 5162 if (gtkconv->u.im->anim) |
5185 g_object_unref(G_OBJECT(gtkconv->u.im->anim)); | 5163 g_object_unref(G_OBJECT(gtkconv->u.im->anim)); |
5186 else | |
5187 gtkconv->u.im->animate = gaim_prefs_get_bool("/gaim/gtk/conversations/im/animate_buddy_icons"); | |
5188 | 5164 |
5189 if((buddy = gaim_find_buddy(gaim_conversation_get_account(conv), | 5165 if((buddy = gaim_find_buddy(gaim_conversation_get_account(conv), |
5190 gaim_conversation_get_name(conv))) != NULL) { | 5166 gaim_conversation_get_name(conv))) != NULL) { |
5191 const char *iconfile; | 5167 const char *iconfile; |
5192 if((iconfile = gaim_blist_node_get_string((GaimBlistNode*)buddy, | 5168 if((iconfile = gaim_blist_node_get_string((GaimBlistNode*)buddy, |