Mercurial > pidgin.yaz
comparison src/gtkconv.c @ 10665:4829abdc5c35
[gaim-migrate @ 12205]
and to oldstatus
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Mon, 07 Mar 2005 18:36:34 +0000 |
parents | 84fb7beabb5c |
children | b39d5850883a |
comparison
equal
deleted
inserted
replaced
10664:7244386075c6 | 10665:4829abdc5c35 |
---|---|
197 | 197 |
198 static void | 198 static void |
199 default_formatize(GaimConversation *conv) | 199 default_formatize(GaimConversation *conv) |
200 { | 200 { |
201 GaimGtkConversation *c = GAIM_GTK_CONVERSATION(conv); | 201 GaimGtkConversation *c = GAIM_GTK_CONVERSATION(conv); |
202 GaimConnection *gc = gaim_conversation_get_gc(conv); | 202 |
203 | 203 if (conv->features & GAIM_CONNECTION_HTML) |
204 if (gc && gc->flags & GAIM_CONNECTION_HTML) | |
205 { | 204 { |
206 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_formatting")) | 205 if (gaim_prefs_get_bool("/gaim/gtk/conversations/send_formatting")) |
207 { | 206 { |
208 char *color; | 207 char *color; |
209 GdkColor fg_color, bg_color; | 208 GdkColor fg_color, bg_color; |
218 gtk_imhtml_toggle_underline(GTK_IMHTML(c->entry)); | 217 gtk_imhtml_toggle_underline(GTK_IMHTML(c->entry)); |
219 | 218 |
220 gtk_imhtml_toggle_fontface(GTK_IMHTML(c->entry), | 219 gtk_imhtml_toggle_fontface(GTK_IMHTML(c->entry), |
221 gaim_prefs_get_string("/gaim/gtk/conversations/font_face")); | 220 gaim_prefs_get_string("/gaim/gtk/conversations/font_face")); |
222 | 221 |
223 if (!(gc->flags & GAIM_CONNECTION_NO_FONTSIZE)) | 222 if (!(conv->features & GAIM_CONNECTION_NO_FONTSIZE)) |
224 gtk_imhtml_font_set_size(GTK_IMHTML(c->entry), | 223 gtk_imhtml_font_set_size(GTK_IMHTML(c->entry), |
225 gaim_prefs_get_int("/gaim/gtk/conversations/font_size")); | 224 gaim_prefs_get_int("/gaim/gtk/conversations/font_size")); |
226 | 225 |
227 if(strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), "") != 0) | 226 if(strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/fgcolor"), "") != 0) |
228 { | 227 { |
237 color = g_strdup(""); | 236 color = g_strdup(""); |
238 | 237 |
239 gtk_imhtml_toggle_forecolor(GTK_IMHTML(c->entry), color); | 238 gtk_imhtml_toggle_forecolor(GTK_IMHTML(c->entry), color); |
240 g_free(color); | 239 g_free(color); |
241 | 240 |
242 if(!(gc->flags & GAIM_CONNECTION_NO_BGCOLOR) && | 241 if(!(conv->features & GAIM_CONNECTION_NO_BGCOLOR) && |
243 strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), "") != 0) | 242 strcmp(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), "") != 0) |
244 { | 243 { |
245 gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), | 244 gdk_color_parse(gaim_prefs_get_string("/gaim/gtk/conversations/bgcolor"), |
246 &bg_color); | 245 &bg_color); |
247 color = g_strdup_printf("#%02x%02x%02x", | 246 color = g_strdup_printf("#%02x%02x%02x", |
255 gtk_imhtml_toggle_backcolor(GTK_IMHTML(c->entry), color); | 254 gtk_imhtml_toggle_backcolor(GTK_IMHTML(c->entry), color); |
256 g_free(color); | 255 g_free(color); |
257 } | 256 } |
258 | 257 |
259 | 258 |
260 if (gc->flags & GAIM_CONNECTION_FORMATTING_WBFO) | 259 if (conv->features & GAIM_CONNECTION_FORMATTING_WBFO) |
261 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(c->entry), TRUE); | 260 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(c->entry), TRUE); |
262 else | 261 else |
263 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(c->entry), FALSE); | 262 gtk_imhtml_set_whole_buffer_formatting_only(GTK_IMHTML(c->entry), FALSE); |
264 } | 263 } |
265 } | 264 } |
484 g_free(clean); | 483 g_free(clean); |
485 return; | 484 return; |
486 } | 485 } |
487 | 486 |
488 gc = gaim_account_get_connection(account); | 487 gc = gaim_account_get_connection(account); |
489 if (gc && (gc->flags & GAIM_CONNECTION_NO_NEWLINES)) { | 488 if (gc && (conv->features & GAIM_CONNECTION_NO_NEWLINES)) { |
490 char **bufs; | 489 char **bufs; |
491 int i; | 490 int i; |
492 | 491 |
493 bufs = gtk_imhtml_get_markup_lines(GTK_IMHTML(gtkconv->entry)); | 492 bufs = gtk_imhtml_get_markup_lines(GTK_IMHTML(gtkconv->entry)); |
494 for (i = 0; bufs[i]; i++) { | 493 for (i = 0; bufs[i]; i++) { |
2631 | 2630 |
2632 /************************************************************************** | 2631 /************************************************************************** |
2633 * End of the bunch of buddy icon functions | 2632 * End of the bunch of buddy icon functions |
2634 **************************************************************************/ | 2633 **************************************************************************/ |
2635 | 2634 |
2635 | |
2636 /* | 2636 /* |
2637 * Makes sure all the menu items and all the buttons are hidden/shown and | 2637 * Makes sure all the menu items and all the buttons are hidden/shown and |
2638 * sensitive/insensitive. This is called after changing tabs and when an | 2638 * sensitive/insensitive. This is called after changing tabs and when an |
2639 * account signs on or off. | 2639 * account signs on or off. |
2640 */ | 2640 */ |
2729 if ((gc != NULL) && | 2729 if ((gc != NULL) && |
2730 ( (gaim_conversation_get_type(conv) != GAIM_CONV_CHAT) || | 2730 ( (gaim_conversation_get_type(conv) != GAIM_CONV_CHAT) || |
2731 !gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv)) )) { | 2731 !gaim_conv_chat_has_left(GAIM_CONV_CHAT(conv)) )) { |
2732 /* Account is online */ | 2732 /* Account is online */ |
2733 /* Deal with the toolbar */ | 2733 /* Deal with the toolbar */ |
2734 if (gc->flags & GAIM_CONNECTION_HTML) { | 2734 if (conv->features & GAIM_CONNECTION_HTML) { |
2735 buttons = GTK_IMHTML_ALL; /* Everything on */ | 2735 buttons = GTK_IMHTML_ALL; /* Everything on */ |
2736 if (!(prpl_info->options & OPT_PROTO_IM_IMAGE)) | 2736 if (!(prpl_info->options & OPT_PROTO_IM_IMAGE)) |
2737 buttons &= ~GTK_IMHTML_IMAGE; | 2737 buttons &= ~GTK_IMHTML_IMAGE; |
2738 if (gc->flags & GAIM_CONNECTION_NO_BGCOLOR) | 2738 if (conv->features & GAIM_CONNECTION_NO_BGCOLOR) |
2739 buttons &= ~GTK_IMHTML_BACKCOLOR; | 2739 buttons &= ~GTK_IMHTML_BACKCOLOR; |
2740 if (gc->flags & GAIM_CONNECTION_NO_FONTSIZE) { | 2740 if (conv->features & GAIM_CONNECTION_NO_FONTSIZE) { |
2741 buttons &= ~GTK_IMHTML_GROW; | 2741 buttons &= ~GTK_IMHTML_GROW; |
2742 buttons &= ~GTK_IMHTML_SHRINK; | 2742 buttons &= ~GTK_IMHTML_SHRINK; |
2743 } | 2743 } |
2744 if (gc->flags & GAIM_CONNECTION_NO_URLDESC) | 2744 if (conv->features & GAIM_CONNECTION_NO_URLDESC) |
2745 buttons &= ~GTK_IMHTML_LINKDESC; | 2745 buttons &= ~GTK_IMHTML_LINKDESC; |
2746 } else { | 2746 } else { |
2747 buttons = GTK_IMHTML_SMILEY; | 2747 buttons = GTK_IMHTML_SMILEY; |
2748 } | 2748 } |
2749 gtk_imhtml_set_format_functions(GTK_IMHTML(gtkconv->entry), buttons); | 2749 gtk_imhtml_set_format_functions(GTK_IMHTML(gtkconv->entry), buttons); |
2754 gtk_widget_set_sensitive(gtkwin->menu.add_pounce, TRUE); | 2754 gtk_widget_set_sensitive(gtkwin->menu.add_pounce, TRUE); |
2755 gtk_widget_set_sensitive(gtkwin->menu.get_info, (prpl_info->get_info != NULL)); | 2755 gtk_widget_set_sensitive(gtkwin->menu.get_info, (prpl_info->get_info != NULL)); |
2756 gtk_widget_set_sensitive(gtkwin->menu.warn, (prpl_info->warn != NULL)); | 2756 gtk_widget_set_sensitive(gtkwin->menu.warn, (prpl_info->warn != NULL)); |
2757 gtk_widget_set_sensitive(gtkwin->menu.invite, (prpl_info->chat_invite != NULL)); | 2757 gtk_widget_set_sensitive(gtkwin->menu.invite, (prpl_info->chat_invite != NULL)); |
2758 gtk_widget_set_sensitive(gtkwin->menu.block, (prpl_info->add_deny != NULL)); | 2758 gtk_widget_set_sensitive(gtkwin->menu.block, (prpl_info->add_deny != NULL)); |
2759 gtk_widget_set_sensitive(gtkwin->menu.insert_link, (gc->flags & GAIM_CONNECTION_HTML)); | 2759 gtk_widget_set_sensitive(gtkwin->menu.insert_link, (conv->features & GAIM_CONNECTION_HTML)); |
2760 gtk_widget_set_sensitive(gtkwin->menu.insert_image, (prpl_info->options & OPT_PROTO_IM_IMAGE)); | 2760 gtk_widget_set_sensitive(gtkwin->menu.insert_image, (prpl_info->options & OPT_PROTO_IM_IMAGE)); |
2761 | 2761 |
2762 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { | 2762 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { |
2763 gtk_widget_set_sensitive(gtkwin->menu.add, (prpl_info->add_buddy != NULL)); | 2763 gtk_widget_set_sensitive(gtkwin->menu.add, (prpl_info->add_buddy != NULL)); |
2764 gtk_widget_set_sensitive(gtkwin->menu.remove, (prpl_info->remove_buddy != NULL)); | 2764 gtk_widget_set_sensitive(gtkwin->menu.remove, (prpl_info->remove_buddy != NULL)); |
5408 } | 5408 } |
5409 else if (type == GAIM_CONV_UPDATE_ICON) | 5409 else if (type == GAIM_CONV_UPDATE_ICON) |
5410 { | 5410 { |
5411 gaim_gtkconv_update_buddy_icon(conv); | 5411 gaim_gtkconv_update_buddy_icon(conv); |
5412 } | 5412 } |
5413 else if (type == GAIM_CONV_UPDATE_FEATURES) | |
5414 { | |
5415 gray_stuff_out(conv); | |
5416 } | |
5413 } | 5417 } |
5414 | 5418 |
5415 static GaimConversationUiOps conversation_ui_ops = | 5419 static GaimConversationUiOps conversation_ui_ops = |
5416 { | 5420 { |
5417 gaim_gtkconv_destroy, /* destroy_conversation */ | 5421 gaim_gtkconv_destroy, /* destroy_conversation */ |