changeset 32605:e7b7e36790f8

merge of '10d7899aac75e85039e557e2c4238e1b276a4353' and '29e5737d31f8504f0f1b30ed6595671b0a735535'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 09 Sep 2011 03:32:27 +0000
parents e7eba7a6a989 (current diff) bd8b8224ad73 (diff)
children 3f9b670cba14
files
diffstat 2 files changed, 9 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkdialogs.c	Fri Sep 09 03:27:52 2011 +0000
+++ b/pidgin/gtkdialogs.c	Fri Sep 09 03:32:27 2011 +0000
@@ -421,9 +421,8 @@
 static GtkWidget *
 pidgin_build_help_dialog(const char *title, const char *role, GString *string)
 {
-	GtkWidget *win, *vbox, *frame, *logo, *imhtml, *button;
+	GtkWidget *win, *vbox, *frame, *logo, *webview, *button;
 	GdkPixbuf *pixbuf;
-	GtkTextIter iter;
 	AtkObject *obj;
 	char *filename, *tmp;
 
@@ -450,15 +449,15 @@
 	g_free(tmp);
 	gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0);
 
-	frame = pidgin_create_imhtml(FALSE, &imhtml, NULL, NULL);
+	frame = pidgin_create_webview(FALSE, &webview, NULL, NULL);
 	/* FIXME: Compile now and fix it later when we have a proper replacement for this function
 	gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), GTK_IMHTML_ALL ^ GTK_IMHTML_SMILEY);
 	*/
 	gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
 
-	gtk_webview_append_html(GTK_WEBVIEW(imhtml), string->str);
-	gtk_text_buffer_get_start_iter(gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml)), &iter);
-	gtk_text_buffer_place_cursor(gtk_text_view_get_buffer(GTK_TEXT_VIEW(imhtml)), &iter);
+	gtk_webview_append_html(GTK_WEBVIEW(webview), string->str);
+	/* FIXME: This doesn't seem to stay at the top. */
+	webkit_web_view_move_cursor(WEBKIT_WEB_VIEW(webview), GTK_MOVEMENT_BUFFER_ENDS, -1);
 
 	button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE,
 	                G_CALLBACK(destroy_win), win);
--- a/pidgin/gtknotify.c	Fri Sep 09 03:27:52 2011 +0000
+++ b/pidgin/gtknotify.c	Fri Sep 09 03:32:27 2011 +0000
@@ -819,7 +819,7 @@
 	GtkWidget *label;
 	GtkWidget *button;
 	GtkWidget *web_view;
-	GtkWidget *scrolled_window;
+	GtkWidget *frame;
 	char label_text[2048];
 	char *linked_text, *primary_esc, *secondary_esc;
 
@@ -855,17 +855,11 @@
 	gtk_widget_show(label);
 
 	/* Add the webview */
-	scrolled_window = gtk_scrolled_window_new (NULL, NULL);
-	gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window), GTK_SHADOW_IN);
-	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-
-	web_view = gtk_webview_new();
-	gtk_container_add(GTK_CONTAINER(scrolled_window), web_view);
-
+	frame = pidgin_create_webview(FALSE, &web_view, NULL, NULL);
 	gtk_widget_set_name(web_view, "pidgin_notify_webview");
 	gtk_widget_set_size_request(web_view, 300, 250);
-	gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
-	gtk_widget_show_all(scrolled_window);
+	gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+	gtk_widget_show(frame);
 
 	/* Add the Close button. */
 	button = gtk_dialog_add_button(GTK_DIALOG(window), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
@@ -1138,7 +1132,6 @@
 	if (pinfo != NULL) {
 		GtkWidget *webview = g_object_get_data(G_OBJECT(pinfo->window), "webview-widget");
 		char *linked_text = purple_markup_linkify(info);
-		g_assert(webview);
 		gtk_webview_load_html_string_with_imgstore(GTK_WEBVIEW(webview), linked_text);
 		g_free(linked_text);
 		g_free(key);