aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorXan Lopez <xlopez@igalia.com>2011-05-23 20:26:10 +0800
committerXan Lopez <xlopez@igalia.com>2011-05-23 20:26:46 +0800
commit3f84b79bfa35911bdfe3a196b042a278c4486e42 (patch)
treedd514ac48b12ce5bdb76a29bf2e94f7ae9aaf678 /embed
parent243e5e4985626aa44bfd0b74d17c478a4402e851 (diff)
downloadgsoc2013-epiphany-3f84b79bfa35911bdfe3a196b042a278c4486e42.tar
gsoc2013-epiphany-3f84b79bfa35911bdfe3a196b042a278c4486e42.tar.gz
gsoc2013-epiphany-3f84b79bfa35911bdfe3a196b042a278c4486e42.tar.bz2
gsoc2013-epiphany-3f84b79bfa35911bdfe3a196b042a278c4486e42.tar.lz
gsoc2013-epiphany-3f84b79bfa35911bdfe3a196b042a278c4486e42.tar.xz
gsoc2013-epiphany-3f84b79bfa35911bdfe3a196b042a278c4486e42.tar.zst
gsoc2013-epiphany-3f84b79bfa35911bdfe3a196b042a278c4486e42.zip
Add optional spell checking, enabled by default
Depends on WebKitGTK+ being built with spell check support, otherwise it won't do anything. Based on a patch by Diego Escalante.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed-prefs.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/embed/ephy-embed-prefs.c b/embed/ephy-embed-prefs.c
index b5c953e8c..b6639c116 100644
--- a/embed/ephy-embed-prefs.c
+++ b/embed/ephy-embed-prefs.c
@@ -393,6 +393,27 @@ webkit_pref_callback_gnome_fonts (GSettings *ephy_settings,
}
}
+static void
+webkit_pref_callback_enable_spell_checking (GSettings *settings,
+ char *key,
+ gpointer data)
+{
+ gboolean value = FALSE;
+ char **languages;
+ char *langs = NULL;
+
+ value = g_settings_get_boolean (settings, key);
+
+ if (value) {
+ languages = g_settings_get_strv (settings, EPHY_PREFS_WEB_LANGUAGE);
+ langs = g_strjoinv (",", languages);
+ g_strdelimit (langs, "-", '_');
+ }
+
+ g_object_set (webkit_settings, "enable-spell-checking", value, NULL);
+ g_object_set (webkit_settings, "spell-checking-languages", langs, NULL);
+}
+
static const PrefData webkit_pref_entries[] =
{
/* GNOME font settings */
@@ -449,6 +470,11 @@ static const PrefData webkit_pref_entries[] =
webkit_pref_callback_gnome_fonts },
{ EPHY_PREFS_WEB_SCHEMA,
+ EPHY_PREFS_WEB_ENABLE_SPELL_CHECKING,
+ NULL,
+ webkit_pref_callback_enable_spell_checking },
+
+ { EPHY_PREFS_WEB_SCHEMA,
EPHY_PREFS_WEB_ENABLE_USER_CSS,
"user-stylesheet-uri",
webkit_pref_callback_user_stylesheet },