/pidgin/main: 8d687d033529: Convert pidgin_request_input to use ...

Elliott Sales de Andrade qulogic at pidgin.im
Thu Jul 26 17:59:18 EDT 2012


Changeset: 8d687d033529f0dee306f1c104c680a6c8492342
Author:	 Elliott Sales de Andrade <qulogic at pidgin.im>
Date:	 2012-07-26 00:20 -0400
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/8d687d033529

Description:

Convert pidgin_request_input to use a GtkWebView.

diffstat:

 pidgin/gtkrequest.c |  20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diffs (47 lines):

diff --git a/pidgin/gtkrequest.c b/pidgin/gtkrequest.c
--- a/pidgin/gtkrequest.c
+++ b/pidgin/gtkrequest.c
@@ -30,8 +30,7 @@
 #include "prefs.h"
 #include "util.h"
 
-#include "gtkimhtml.h"
-#include "gtkimhtmltoolbar.h"
+#include "gtkwebview.h"
 #include "gtkrequest.h"
 #include "gtkutils.h"
 #include "pidginstock.h"
@@ -149,7 +148,7 @@ input_response_cb(GtkDialog *dialog, gin
 		gtk_text_buffer_get_end_iter(buffer, &end_iter);
 
 		if ((data->u.input.hint != NULL) && (!strcmp(data->u.input.hint, "html")))
-			multiline_value = gtk_imhtml_get_markup(GTK_IMHTML(data->u.input.entry));
+			multiline_value = gtk_webview_get_body_html(GTK_WEBVIEW(data->u.input.entry));
 		else
 			multiline_value = gtk_text_buffer_get_text(buffer, &start_iter, &end_iter,
 										 FALSE);
@@ -423,16 +422,17 @@ pidgin_request_input(const char *title, 
 	if ((data->u.input.hint != NULL) && (!strcmp(data->u.input.hint, "html"))) {
 		GtkWidget *frame;
 
-		/* imhtml */
-		frame = pidgin_create_imhtml(TRUE, &entry, &toolbar, NULL);
+		/* webview */
+		frame = pidgin_create_webview(TRUE, &entry, &toolbar, NULL);
 		gtk_widget_set_size_request(entry, 320, 130);
-		gtk_widget_set_name(entry, "pidgin_request_imhtml");
-		if (default_value != NULL)
-			gtk_imhtml_append_text(GTK_IMHTML(entry), default_value, GTK_IMHTML_NO_SCROLL);
+		gtk_widget_set_name(entry, "pidgin_request_webview");
+		if (default_value != NULL) {
+			char *tmp = g_markup_escape_text(default_value, -1);
+			gtk_webview_append_html(GTK_WEBVIEW(entry), tmp);
+			g_free(tmp);
+		}
 		gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
 		gtk_widget_show(frame);
-
-		gtk_imhtml_set_return_inserts_newline(GTK_IMHTML(entry));
 	}
 	else {
 		if (multiline) {



More information about the Commits mailing list