Summary Files Commits Branches @commit @diff @stats
path: root / badwolf.c
diff options
context:
space:
mode:
Commit6402dd8a8b7117da2a87a9fbceac68f9ce8b179f (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-06-13 02:38:30 +0200
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-06-22 04:34:58 +0200
Files3b5eceb539c1f8945451dc74c2dbd51f7bb101c2 /badwolf.c
goodwolf-6402dd8a8b7117da2a87a9fbceac68f9ce8b179f.tar
goodwolf-6402dd8a8b7117da2a87a9fbceac68f9ce8b179f.tar.gz
goodwolf-6402dd8a8b7117da2a87a9fbceac68f9ce8b179f.zip
Parent2425cad5171932d32b96752fc15c608ab3944227 (diff)
Add setting spell checking via BADWOLF_L10N
1 files changed, 15 insertions, 1 deletions
-rw-r--r--badwolf.c16
diff --git a/badwolf.c b/badwolf.c
index 70306da..cebb6e4 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -547,7 +547,7 @@ downloadCb_decide_destination(WebKitDownload *download,
gint chooser_response;
GtkWindow *parent_window = GTK_WINDOW(browser->window->main_window);
- GtkWidget *file_dialog = gtk_file_chooser_dialog_new(NULL,
+ GtkWidget *file_dialog = gtk_file_chooser_dialog_new(NULL,
parent_window,
GTK_FILE_CHOOSER_ACTION_SAVE,
_("_Cancel"),
@@ -654,6 +654,7 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web
{
struct Client *browser = g_try_malloc(sizeof(struct Client));
target_url = ensure_uri_scheme(target_url, (related_web_view == NULL));
+ char *badwolf_l10n = NULL;
if(browser == NULL) return NULL;
@@ -671,6 +672,19 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web
webkit_web_context_set_process_model(web_context,
WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES);
+ badwolf_l10n = getenv("BADWOLF_L10N");
+ g_fprintf(stderr, "BADWOLF_L10N: %s\n", badwolf_l10n);
+
+ if(badwolf_l10n != NULL)
+ {
+ gchar **languages = g_strsplit(badwolf_l10n, ":", -1);
+ webkit_web_context_set_spell_checking_languages(web_context, (const gchar* const *)languages);
+ g_strfreev(languages);
+
+ webkit_web_context_set_spell_checking_enabled(web_context, TRUE);
+ g_fprintf(stderr, "spell_checking_enabled: %d\n", webkit_web_context_get_spell_checking_enabled(web_context));
+ }
+
WebKitSettings *settings = webkit_settings_new_with_settings(BADWOLF_WEBKIT_SETTINGS);
browser->webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW,