pidgin: 77a65d8b: Enable spell checking in an editable web...

qulogic at pidgin.im qulogic at pidgin.im
Fri Jun 8 03:12:22 EDT 2012


----------------------------------------------------------------------
Revision: 77a65d8b0ab27873da39035bc815d62e12a4fde5
Parent:   924e30e3fc2c0185c1655fa463d9aaf1147f8a2b
Author:   qulogic at pidgin.im
Date:     06/05/12 19:59:36
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/77a65d8b0ab27873da39035bc815d62e12a4fde5

Changelog: 

Enable spell checking in an editable webview.

Changes against parent 924e30e3fc2c0185c1655fa463d9aaf1147f8a2b

  patched  pidgin/gtkutils.c
  patched  pidgin/gtkwebview.c
  patched  pidgin/gtkwebview.h

-------------- next part --------------
============================================================
--- pidgin/gtkutils.c	0cbdb0063aa3c1f11f24efcbb1ca5da4eb307a23
+++ pidgin/gtkutils.c	28a380f489c742b4876e6b867792789d9f4543a8
@@ -347,10 +347,8 @@ pidgin_create_webview(gboolean editable,
 
 	webview = gtk_webview_new();
 	gtk_webview_set_editable(GTK_WEBVIEW(webview), editable);
-#ifdef USE_GTKSPELL
 	if (editable && purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/spellcheck"))
-		pidgin_setup_gtkspell(GTK_TEXT_VIEW(webview));
-#endif
+		pidgin_webview_set_spellcheck(GTK_WEBVIEW(webview), TRUE);
 	gtk_widget_show(webview);
 
 	if (editable) {
============================================================
--- pidgin/gtkwebview.c	db8dae0f30d6ae2ba9e458ad26399d729d9aa28c
+++ pidgin/gtkwebview.c	d68f841eacc522027ab665296bf0375b30391573
@@ -820,6 +820,16 @@ void
 }
 
 void
+pidgin_webview_set_spellcheck(GtkWebView *webview, gboolean enable)
+{
+	WebKitWebSettings *settings;
+	
+	settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webview));
+	g_object_set(G_OBJECT(settings), "enable-spell-checking", enable, NULL);
+	webkit_web_view_set_settings(WEBKIT_WEB_VIEW(webview), settings);
+}
+
+void
 gtk_webview_set_whole_buffer_formatting_only(GtkWebView *webview, gboolean wbfo)
 {
 	GtkWebViewPriv *priv = GTK_WEBVIEW_GET_PRIVATE(webview);
============================================================
--- pidgin/gtkwebview.h	a45485c62f7361f6ba6ebc13fc399039536da7ed
+++ pidgin/gtkwebview.h	b430431e3c516e118e97eda4d7cd435bfcdcc7f6
@@ -192,6 +192,14 @@ void gtk_webview_setup_entry(GtkWebView 
 void gtk_webview_setup_entry(GtkWebView *webview, PurpleConnectionFlags flags);
 
 /**
+ * Setup spell-checking on a GtkWebView.
+ *
+ * @param webview The GtkWebView.
+ * @param enable  Whether to enable or disable spell-checking.
+ */
+void pidgin_webview_set_spellcheck(GtkWebView *webview, gboolean enable);
+
+/**
  * Enables or disables whole buffer formatting only (wbfo) in a GtkWebView.
  * In this mode formatting options to the buffer take effect for the entire
  * buffer instead of specific text.


More information about the Commits mailing list