summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/web-settings.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/web-settings.c b/src/web-settings.c
index 00918cb..fe99de0 100644
--- a/src/web-settings.c
+++ b/src/web-settings.c
@@ -201,6 +201,32 @@ wks_str_cb(MqConfig __attribute__((unused)) *config, const gchar *name,
}
static void
+wkwc_set_spell_checking_enabled(MqConfig __attribute__((unused)) *config,
+ const gchar __attribute__((unused)) *name, const gboolean value,
+ WebKitWebContext *wk_web_context)
+{
+ webkit_web_context_set_spell_checking_enabled(wk_web_context, value);
+}
+
+static void
+wkwc_set_spell_checking_languages(MqConfig *config, const gchar *name,
+ const gchar __attribute__((unused)) *value,
+ WebKitWebContext *wk_web_context)
+{
+ webkit_web_context_set_spell_checking_languages(wk_web_context,
+ mq_config_get_string_list(config, name));
+}
+
+static void
+wkwc_set_preferred_languages(MqConfig *config, const gchar *name,
+ const gchar __attribute__((unused)) *value,
+ WebKitWebContext *wk_web_context)
+{
+ webkit_web_context_set_preferred_languages(wk_web_context,
+ mq_config_get_string_list(config, name));
+}
+
+static void
init_mappings_table(void)
{
gsize i;
@@ -270,4 +296,23 @@ mq_web_settings_connect(MqConfig *config, WebKitSettings *wk_settings,
break;
}
}
+
+ /* General -> Spell Checking */
+ mq_config_notify_boolean(config, "spell.enable",
+ (MqConfigBooleanCallback) wkwc_set_spell_checking_enabled,
+ wk_web_context);
+ wkwc_set_spell_checking_enabled(config, "spell.enable",
+ mq_config_get_boolean(config, "spell.enable"), wk_web_context);
+ mq_config_notify_string(config, "spell.langs",
+ (MqConfigStringCallback) wkwc_set_spell_checking_languages,
+ wk_web_context);
+ wkwc_set_spell_checking_languages(config, "spell.langs", NULL,
+ wk_web_context);
+
+ /* Display -> Languages */
+ mq_config_notify_string(config, "intl.accept-languages",
+ (MqConfigStringCallback) wkwc_set_preferred_languages,
+ wk_web_context);
+ wkwc_set_preferred_languages(config, "intl.accept-languages", NULL,
+ wk_web_context);
}