From 2425cad5171932d32b96752fc15c608ab3944227 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 21 Jun 2019 00:00:05 +0200 Subject: Add Alt-n tab switching --- badwolf.1 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'badwolf.1') diff --git a/badwolf.1 b/badwolf.1 index 01af4e8..864b598 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -42,6 +42,8 @@ Go back/forward in current tab’s history Go to the previous/next tab .It any F1 Shows the about dialog +.It any Alt-n +Where n is any numeric-row key. Go to the n-th tab, 0 goes to the last one. .El .Ss DEFAULT ONES Here is a incomplete list of the default Webkit/GTK keybindings: -- cgit v1.3.1-23-gd82d From 6402dd8a8b7117da2a87a9fbceac68f9ce8b179f Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 13 Jun 2019 02:38:30 +0200 Subject: Add setting spell checking via BADWOLF_L10N --- badwolf.1 | 7 +++++++ badwolf.c | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'badwolf.1') diff --git a/badwolf.1 b/badwolf.1 index 864b598..3c066bf 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -55,6 +55,13 @@ When the search box is focused it goes to the Next/Previous search term. .It search Escape Cancels current search .El +.Sh ENVIRONMENT +.Bl -width Ds -tag +.It Ev BADWOLF_L10N +A colon-separated list in the form lang_COUNTRY where lang is in ISO-639 and COUNTRY in ISO-3166. For example +.Ic BADWOLF_L10N="en_GB:fr_FR:de_DE" . +When this variable isn't set, spelling isn't activated. A more generic variable name is also intended to be used in the future. +.El .Sh BUGS You can submit contributions or tickets to .Lk https://gitlab.com/lanodan/badwolf 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, -- cgit v1.3.1-23-gd82d From fc8d34d7538fc8c3890f9af843bf2f78a320e465 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 5 Jul 2019 08:15:32 +0200 Subject: badwolf.1: Add Alt-d to close tab --- badwolf.1 | 2 +- badwolf.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'badwolf.1') diff --git a/badwolf.1 b/badwolf.1 index 3c066bf..33b86c0 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -28,7 +28,7 @@ Zooms the webpage in/out. Resets webpage zoom to 100%. .It any C-t Creates a new tab (in a new session, similar as pressing the button) -.It browser C-F4 +.It browser C-F4, browser A-d Closes the current tab .It browser C-f Focuses on the search entry diff --git a/badwolf.c b/badwolf.c index bcd7e98..641eaec 100644 --- a/badwolf.c +++ b/badwolf.c @@ -8,7 +8,7 @@ #include /* g_fprintf() */ #include #include /* LC_* */ -#include /* realpath() */ +#include /* realpath(), malloc() */ #include const gchar *homepage = "https://hacktivis.me/projects/badwolf"; @@ -658,7 +658,7 @@ SearchEntryCb_stop__search(GtkSearchEntry *search, gpointer user_data) struct Client * new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web_view) { - struct Client *browser = g_try_malloc(sizeof(struct Client)); + struct Client *browser = malloc(sizeof(struct Client)); target_url = ensure_uri_scheme(target_url, (related_web_view == NULL)); char *badwolf_l10n = NULL; -- cgit v1.3.1-23-gd82d