diff src/gtkconv.c @ 11275:ffc86d9ad8b7

[gaim-migrate @ 13461] Make the new clear formatting button work. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 15 Aug 2005 19:46:32 +0000
parents 1cbe76d30e81
children 17ebda61c6ce
line wrap: on
line diff
--- a/src/gtkconv.c	Mon Aug 15 16:22:25 2005 +0000
+++ b/src/gtkconv.c	Mon Aug 15 19:46:32 2005 +0000
@@ -364,6 +364,12 @@
 	}
 }
 
+static void
+clear_formatting_cb(GtkIMHtml *imhtml, GaimGtkConversation *gtkconv)
+{
+	default_formatize(gtkconv);
+}
+
 static const char *
 gaim_gtk_get_cmd_prefix(void)
 {
@@ -1766,7 +1772,6 @@
 
 					conv->send_history = conv->send_history->next;
 					gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry));
-					gtk_imhtml_clear_formatting(GTK_IMHTML(gtkconv->entry));
 					gtk_imhtml_append_text_with_images(
 						GTK_IMHTML(gtkconv->entry), conv->send_history->data,
 						0, NULL);
@@ -1790,7 +1795,6 @@
 
 					conv->send_history = conv->send_history->prev;
 					gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry));
-					gtk_imhtml_clear_formatting(GTK_IMHTML(gtkconv->entry));
 					gtk_imhtml_append_text_with_images(
 						GTK_IMHTML(gtkconv->entry), conv->send_history->data,
 						0, NULL);
@@ -4182,6 +4186,9 @@
 	 */
 	default_formatize(gtkconv);
 
+	g_signal_connect_after(G_OBJECT(gtkconv->entry), "format_function_clear",
+						   G_CALLBACK(clear_formatting_cb), gtkconv);
+
 	gtkconv->u.im->animate = gaim_prefs_get_bool("/gaim/gtk/conversations/im/animate_buddy_icons");
 	gtkconv->u.im->show_icon = TRUE;