| 3776 gtk_widget_show(hpaned); |
3776 gtk_widget_show(hpaned); |
| 3777 |
3777 |
| 3778 /* Setup gtkihmtml. */ |
3778 /* Setup gtkihmtml. */ |
| 3779 frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL); |
3779 frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL); |
| 3780 gtk_widget_set_name(gtkconv->imhtml, "gaim_gtkconv_imhtml"); |
3780 gtk_widget_set_name(gtkconv->imhtml, "gaim_gtkconv_imhtml"); |
| 3781 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), |
3781 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), TRUE); |
| 3782 gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")); |
|
| 3783 gtk_paned_pack1(GTK_PANED(hpaned), frame, TRUE, TRUE); |
3782 gtk_paned_pack1(GTK_PANED(hpaned), frame, TRUE, TRUE); |
| 3784 gtk_widget_show(frame); |
3783 gtk_widget_show(frame); |
| 3785 |
3784 |
| 3786 gtk_widget_set_size_request(gtkconv->imhtml, |
3785 gtk_widget_set_size_request(gtkconv->imhtml, |
| 3787 gaim_prefs_get_int("/gaim/gtk/conversations/chat/default_width"), |
3786 gaim_prefs_get_int("/gaim/gtk/conversations/chat/default_width"), |
| 3965 gtk_widget_show(vbox); |
3964 gtk_widget_show(vbox); |
| 3966 |
3965 |
| 3967 /* Setup the gtkimhtml widget */ |
3966 /* Setup the gtkimhtml widget */ |
| 3968 frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL); |
3967 frame = gaim_gtk_create_imhtml(FALSE, >kconv->imhtml, NULL); |
| 3969 gtk_widget_set_name(gtkconv->imhtml, "gaim_gtkconv_imhtml"); |
3968 gtk_widget_set_name(gtkconv->imhtml, "gaim_gtkconv_imhtml"); |
| 3970 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), |
3969 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml),TRUE); |
| 3971 gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")); |
|
| 3972 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
3970 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
| 3973 gtk_widget_show(frame); |
3971 gtk_widget_show(frame); |
| 3974 |
3972 |
| 3975 gtk_widget_set_size_request(gtkconv->imhtml, |
3973 gtk_widget_set_size_request(gtkconv->imhtml, |
| 3976 gaim_prefs_get_int("/gaim/gtk/conversations/im/default_width"), |
3974 gaim_prefs_get_int("/gaim/gtk/conversations/im/default_width"), |
| 4353 if (gaim_prefs_get_bool("/gaim/gtk/conversations/show_formatting_toolbar")) |
4351 if (gaim_prefs_get_bool("/gaim/gtk/conversations/show_formatting_toolbar")) |
| 4354 gtk_widget_show(gtkconv->toolbar); |
4352 gtk_widget_show(gtkconv->toolbar); |
| 4355 else |
4353 else |
| 4356 gtk_widget_hide(gtkconv->toolbar); |
4354 gtk_widget_hide(gtkconv->toolbar); |
| 4357 |
4355 |
| 4358 gtkconv->show_timestamps = gaim_prefs_get_bool( |
4356 gtkconv->show_timestamps = TRUE; |
| 4359 "/gaim/gtk/conversations/show_timestamps"); |
4357 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), TRUE); |
| 4360 |
|
| 4361 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), |
|
| 4362 gtkconv->show_timestamps); |
|
| 4363 |
4358 |
| 4364 g_signal_connect_swapped(G_OBJECT(pane), "focus", |
4359 g_signal_connect_swapped(G_OBJECT(pane), "focus", |
| 4365 G_CALLBACK(gtk_widget_grab_focus), |
4360 G_CALLBACK(gtk_widget_grab_focus), |
| 4366 gtkconv->entry); |
4361 gtkconv->entry); |
| 4367 } |
4362 } |
| 4715 OPT_PROTO_USE_POINTSIZE) { |
4710 OPT_PROTO_USE_POINTSIZE) { |
| 4716 gtk_font_options ^= GTK_IMHTML_USE_POINTSIZE; |
4711 gtk_font_options ^= GTK_IMHTML_USE_POINTSIZE; |
| 4717 } |
4712 } |
| 4718 |
4713 |
| 4719 if (flags & GAIM_MESSAGE_SYSTEM) { |
4714 if (flags & GAIM_MESSAGE_SYSTEM) { |
| 4720 if (gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")) |
4715 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s)</FONT> <B>%s</B>", |
| 4721 g_snprintf(buf, BUF_LONG, "<FONT SIZE=\"2\">(%s)</FONT> <B>%s</B>", |
|
| 4722 mdate, message); |
4716 mdate, message); |
| 4723 else |
4717 |
| 4724 g_snprintf(buf, BUF_LONG, "<B>%s</B>", message); |
|
| 4725 |
|
| 4726 g_snprintf(buf2, sizeof(buf2), |
4718 g_snprintf(buf2, sizeof(buf2), |
| 4727 "<FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT>", |
4719 "<FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT>", |
| 4728 sml_attrib, mdate, message); |
4720 sml_attrib, mdate, message); |
| 4729 |
4721 |
| 4730 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0); |
4722 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0); |
| 4732 /* Add the message to a conversations scrollback buffer */ |
4724 /* Add the message to a conversations scrollback buffer */ |
| 4733 conv->history = g_string_append(conv->history, buf); |
4725 conv->history = g_string_append(conv->history, buf); |
| 4734 conv->history = g_string_append(conv->history, "<BR>\n"); |
4726 conv->history = g_string_append(conv->history, "<BR>\n"); |
| 4735 |
4727 |
| 4736 } else if (flags & GAIM_MESSAGE_ERROR) { |
4728 } else if (flags & GAIM_MESSAGE_ERROR) { |
| 4737 if (gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")) |
4729 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"#ff0000\"><FONT SIZE=\"2\">(%s)</FONT> <B>%s</B></FONT>", |
| 4738 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"#ff0000\"><FONT SIZE=\"2\">(%s)</FONT> <B>%s</B></FONT>", |
|
| 4739 mdate, message); |
4730 mdate, message); |
| 4740 else |
4731 |
| 4741 g_snprintf(buf, BUF_LONG, "<FONT COLOR=\"#ff0000\"><B>%s</B></FONT>", message); |
|
| 4742 |
|
| 4743 g_snprintf(buf2, sizeof(buf2), |
4732 g_snprintf(buf2, sizeof(buf2), |
| 4744 "<FONT COLOR=\"#ff0000\"><FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT></FONT>", |
4733 "<FONT COLOR=\"#ff0000\"><FONT %s><FONT SIZE=\"2\"><!--(%s) --></FONT><B>%s</B></FONT></FONT>", |
| 4745 sml_attrib, mdate, message); |
4734 sml_attrib, mdate, message); |
| 4746 |
4735 |
| 4747 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0); |
4736 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, 0); |
| 4818 } |
4807 } |
| 4819 |
4808 |
| 4820 if(who_escaped) |
4809 if(who_escaped) |
| 4821 g_free(who_escaped); |
4810 g_free(who_escaped); |
| 4822 } |
4811 } |
| 4823 |
4812 g_snprintf(buf, BUF_LONG, |
| 4824 if (gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")) |
|
| 4825 g_snprintf(buf, BUF_LONG, |
|
| 4826 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\">(%s)</FONT> " |
4813 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\">(%s)</FONT> " |
| 4827 "<B>%s</B></FONT> ", color, |
4814 "<B>%s</B></FONT> ", color, |
| 4828 sml_attrib ? sml_attrib : "", mdate, str); |
4815 sml_attrib ? sml_attrib : "", mdate, str); |
| 4829 else |
4816 |
| 4830 g_snprintf(buf, BUF_LONG, |
|
| 4831 "<FONT COLOR=\"%s\" %s><B>%s</B></FONT> ", color, |
|
| 4832 sml_attrib ? sml_attrib : "", str); |
|
| 4833 |
|
| 4834 g_snprintf(buf2, BUF_LONG, |
4817 g_snprintf(buf2, BUF_LONG, |
| 4835 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\"><!--(%s) --></FONT>" |
4818 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\"><!--(%s) --></FONT>" |
| 4836 "<B>%s</B></FONT> ", |
4819 "<B>%s</B></FONT> ", |
| 4837 color, sml_attrib ? sml_attrib : "", mdate, str); |
4820 color, sml_attrib ? sml_attrib : "", mdate, str); |
| 4838 |
4821 |
| 5657 gtk_widget_hide(gtkconv->close); |
5640 gtk_widget_hide(gtkconv->close); |
| 5658 } |
5641 } |
| 5659 } |
5642 } |
| 5660 |
5643 |
| 5661 static void |
5644 static void |
| 5662 show_timestamps_pref_cb(const char *name, GaimPrefType type, gpointer value, |
|
| 5663 gpointer data) |
|
| 5664 { |
|
| 5665 GList *l; |
|
| 5666 GaimConversation *conv; |
|
| 5667 GaimGtkConversation *gtkconv; |
|
| 5668 |
|
| 5669 for (l = gaim_get_conversations(); l != NULL; l = l->next) { |
|
| 5670 conv = (GaimConversation *)l->data; |
|
| 5671 |
|
| 5672 if (!GAIM_IS_GTK_CONVERSATION(conv)) |
|
| 5673 continue; |
|
| 5674 |
|
| 5675 gtkconv = GAIM_GTK_CONVERSATION(conv); |
|
| 5676 |
|
| 5677 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), (gboolean)GPOINTER_TO_INT(value)); |
|
| 5678 } |
|
| 5679 } |
|
| 5680 |
|
| 5681 static void |
|
| 5682 spellcheck_pref_cb(const char *name, GaimPrefType type, gpointer value, |
5645 spellcheck_pref_cb(const char *name, GaimPrefType type, gpointer value, |
| 5683 gpointer data) |
5646 gpointer data) |
| 5684 { |
5647 { |
| 5685 #ifdef USE_GTKSPELL |
5648 #ifdef USE_GTKSPELL |
| 5686 GList *cl; |
5649 GList *cl; |
| 5839 gaim_prefs_add_bool("/gaim/gtk/conversations/escape_closes", FALSE); |
5802 gaim_prefs_add_bool("/gaim/gtk/conversations/escape_closes", FALSE); |
| 5840 gaim_prefs_add_bool("/gaim/gtk/conversations/send_formatting", FALSE); |
5803 gaim_prefs_add_bool("/gaim/gtk/conversations/send_formatting", FALSE); |
| 5841 gaim_prefs_add_bool("/gaim/gtk/conversations/send_bold", FALSE); |
5804 gaim_prefs_add_bool("/gaim/gtk/conversations/send_bold", FALSE); |
| 5842 gaim_prefs_add_bool("/gaim/gtk/conversations/send_italic", FALSE); |
5805 gaim_prefs_add_bool("/gaim/gtk/conversations/send_italic", FALSE); |
| 5843 gaim_prefs_add_bool("/gaim/gtk/conversations/send_underline", FALSE); |
5806 gaim_prefs_add_bool("/gaim/gtk/conversations/send_underline", FALSE); |
| 5844 gaim_prefs_add_bool("/gaim/gtk/conversations/show_timestamps", TRUE); |
|
| 5845 gaim_prefs_add_bool("/gaim/gtk/conversations/spellcheck", TRUE); |
5807 gaim_prefs_add_bool("/gaim/gtk/conversations/spellcheck", TRUE); |
| 5846 #if 1 |
5808 #if 1 |
| 5847 gaim_prefs_add_bool("/gaim/gtk/conversations/ignore_colors", FALSE); |
5809 gaim_prefs_add_bool("/gaim/gtk/conversations/ignore_colors", FALSE); |
| 5848 gaim_prefs_add_bool("/gaim/gtk/conversations/ignore_fonts", FALSE); |
5810 gaim_prefs_add_bool("/gaim/gtk/conversations/ignore_fonts", FALSE); |
| 5849 gaim_prefs_add_bool("/gaim/gtk/conversations/ignore_font_sizes", FALSE); |
5811 gaim_prefs_add_bool("/gaim/gtk/conversations/ignore_font_sizes", FALSE); |
| 5881 /* Connect callbacks. */ |
5843 /* Connect callbacks. */ |
| 5882 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/escape_closes", |
5844 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/escape_closes", |
| 5883 escape_closes_pref_cb, NULL); |
5845 escape_closes_pref_cb, NULL); |
| 5884 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/close_on_tabs", |
5846 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/close_on_tabs", |
| 5885 close_on_tabs_pref_cb, NULL); |
5847 close_on_tabs_pref_cb, NULL); |
| 5886 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/show_timestamps", |
|
| 5887 show_timestamps_pref_cb, NULL); |
|
| 5888 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/show_formatting_toolbar", |
5848 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/show_formatting_toolbar", |
| 5889 show_formatting_toolbar_pref_cb, NULL); |
5849 show_formatting_toolbar_pref_cb, NULL); |
| 5890 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/spellcheck", |
5850 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/spellcheck", |
| 5891 spellcheck_pref_cb, NULL); |
5851 spellcheck_pref_cb, NULL); |
| 5892 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/tab_side", |
5852 gaim_prefs_connect_callback(handle, "/gaim/gtk/conversations/tab_side", |