summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <pj@pehjota.net>2017-10-06 16:22:59 (EDT)
committer Patrick McDermott <pj@pehjota.net>2017-10-06 16:31:05 (EDT)
commita035bfbe7b55404aef5f0af0db615e6bd99c294d (patch)
tree8d4ea13f3cdcc68c81ce9955f3fad381c7045959 /src
parent5619735c1f410b59cc0fa2a539b699d2821aeb1e (diff)
downloadmarquee-a035bfbe7b55404aef5f0af0db615e6bd99c294d.zip
marquee-a035bfbe7b55404aef5f0af0db615e6bd99c294d.tar.gz
marquee-a035bfbe7b55404aef5f0af0db615e6bd99c294d.tar.bz2
src/web-settings.c: Set WebKitWebContext settings
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);
}