From ab2919e892e964a379f4e2b4287f3385e78d86a1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 29 May 2020 23:44:13 +0200 Subject: uri.c: Add support for relative paths --- po/messages.pot | 4 ++-- uri.c | 19 ++++++++++++++++++- uri_test.c | 5 ++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/po/messages.pot b/po/messages.pot index 115f3b4..8b30b0d 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+gf25fc89.HEAD\n" +"Project-Id-Version: Badwolf 1.0.0+gfffd169.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-18 04:14+0200\n" +"POT-Creation-Date: 2020-05-29 23:45+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/uri.c b/uri.c index 6843e4a..59e50d7 100644 --- a/uri.c +++ b/uri.c @@ -11,12 +11,29 @@ const gchar * badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) { const gchar *fallback = "about:blank"; + char *path = NULL; if(g_strcmp0(text, "") <= 0) return fallback; if(g_uri_parse_scheme(text)) return text; - if(try_file && (access(text, R_OK) == 0)) return g_strdup_printf("file://%s", text); + if(try_file) + { + path = realpath(text, NULL); + gchar *f = NULL; + + if(path != NULL) + { + if(access(path, R_OK) == 0) + { + f = g_strdup_printf("file://%s", path); + } + + free(path); + + return f; + } + } return g_strdup_printf("http://%s", text); } diff --git a/uri_test.c b/uri_test.c index 5881120..a153817 100644 --- a/uri_test.c +++ b/uri_test.c @@ -29,10 +29,13 @@ badwolf_ensure_uri_scheme_test(void) {fallback, "", TRUE}, {"http:///dev/null", "/dev/null", FALSE}, {"file:///dev/null", "/dev/null", TRUE}, + {"http:///usr/../dev/null", "/usr/../dev/null", FALSE}, + {"file:///dev/null", "/usr/../dev/null", TRUE}, {"http://example.org", "example.org", FALSE}, {"http://example.org", "example.org", TRUE}, {"http://", "http://", FALSE}, - {"http://", "http://", TRUE} // + {"http://", "http://", TRUE}, + {"http://badwolf.c", "badwolf.c", FALSE} // }; for(size_t i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) -- cgit v1.3.1-23-gd82d From 0b13fde2ed08abc2ddea18df2344b842f9f44b3d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 29 May 2020 23:55:25 +0200 Subject: Fix implicit-declaration for realpath --- Makefile | 2 +- po/messages.pot | 4 ++-- uri.c | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f371a28..9cd4d96 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ EXE_test = uri_test TRANS = fr.mo pt_BR.mo DOCS = usr.bin.badwolf README.md KnowledgeBase.md interface.txt -CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" +CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" CDEPS += `$(PKGCONFIG) --cflags $(DEPS)` LIBS = `$(PKGCONFIG) --libs $(DEPS)` diff --git a/po/messages.pot b/po/messages.pot index 8b30b0d..28609d4 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+gfffd169.develop\n" +"Project-Id-Version: Badwolf 1.0.0+g6880bf7.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-29 23:45+0200\n" +"POT-Creation-Date: 2020-05-29 23:52+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/uri.c b/uri.c index 59e50d7..912bf86 100644 --- a/uri.c +++ b/uri.c @@ -4,7 +4,8 @@ #include "uri.h" -#include /* g_strcmp0() */ +#include /* g_strcmp0(), g_uri_parse_scheme(), g_strdup_printf */ +#include /* realpath(), free() */ #include /* access() */ const gchar * -- cgit v1.3.1-23-gd82d From c6794979d1bebb5b66f12cf3542223133b20767f Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 12 Jun 2020 01:50:39 +0200 Subject: downloads: Ellipsize destination file path --- config.h | 12 ++++++++++++ downloads.c | 1 + po/messages.pot | 14 +++++++------- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/config.h b/config.h index d963cb6..14b142c 100644 --- a/config.h +++ b/config.h @@ -93,4 +93,16 @@ */ #define BADWOLF_STATUSLABEL_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE +/* BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE: pango ellipsize mode of the download destination path, + * can be one of: + * - PANGO_ELLIPSIZE_NONE + * - PANGO_ELLIPSIZE_START + * - PANGO_ELLIPSIZE_MIDDLE + * - PANGO_ELLIPSIZE_END + * + * See https://developer.gnome.org/pango/stable/pango-Layout-Objects.html#PangoEllipsizeMode + */ +#define BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE + + #endif /* CONFIG_H_INCLUDED */ diff --git a/downloads.c b/downloads.c index 1a21ada..9b83edd 100644 --- a/downloads.c +++ b/downloads.c @@ -42,6 +42,7 @@ download_new_entry(WebKitDownload *webkit_download, struct Download *download) download->stop_icon = gtk_button_new_from_icon_name("process-stop", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(download->progress), TRUE); + gtk_label_set_ellipsize(GTK_LABEL(download->file_path), BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE); g_signal_connect( download->stop_icon, "clicked", G_CALLBACK(download_stop_iconCb_clicked), webkit_download); diff --git a/po/messages.pot b/po/messages.pot index 28609d4..45867ee 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+g6880bf7.develop\n" +"Project-Id-Version: Badwolf 1.0.0+ged40d74.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-29 23:52+0200\n" +"POT-Creation-Date: 2020-06-12 01:46+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,27 +17,27 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: downloads.c:117 +#: downloads.c:118 #, c-format msgid "%02i:%02i:%02i Download cancelled" msgstr "" -#: downloads.c:119 +#: downloads.c:120 #, c-format msgid "%02i:%02i:%02i Download error" msgstr "" -#: downloads.c:141 +#: downloads.c:142 #, c-format msgid "%02i:%02i:%02i Download finished" msgstr "" -#: downloads.c:167 +#: downloads.c:168 #, c-format msgid "%02i:%02i:%02i Downloading…" msgstr "" -#: downloads.c:195 downloads.c:212 downloads.c:215 +#: downloads.c:196 downloads.c:213 downloads.c:216 msgid "Badwolf Downloads" msgstr "" -- cgit v1.3.1-23-gd82d From 90342c857f56a1f1a67f0d3b1f64b114c6bc348e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 12 Jun 2020 02:20:14 +0200 Subject: downloads: Use a ListBox in a ScrollWindow --- config.h | 1 - downloads.c | 17 ++++++++++------- po/messages.pot | 14 +++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/config.h b/config.h index 14b142c..8426ce3 100644 --- a/config.h +++ b/config.h @@ -104,5 +104,4 @@ */ #define BADWOLF_DOWNLOAD_FILE_PATH_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE - #endif /* CONFIG_H_INCLUDED */ diff --git a/downloads.c b/downloads.c index 9b83edd..09b7bb0 100644 --- a/downloads.c +++ b/downloads.c @@ -53,8 +53,7 @@ download_new_entry(WebKitDownload *webkit_download, struct Download *download) gtk_box_pack_start(GTK_BOX(download->container), download->status, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(download->container), download->file_path, FALSE, FALSE, 0); - gtk_box_pack_start( - GTK_BOX(download->window->downloads_tab), download->container, FALSE, FALSE, 0); + gtk_list_box_insert(GTK_LIST_BOX(download->window->downloads_tab), download->container, -1); gtk_widget_show_all(download->container); } @@ -180,14 +179,18 @@ downloadCb_received_data(WebKitDownload *webkit_download, guint64 data_lenght, g GtkWidget * badwolf_downloads_tab_new() { - return gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + return gtk_list_box_new(); } void badwolf_downloads_tab_attach(struct Window *window) { - gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook), window->downloads_tab, NULL, 0); - gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(window->notebook), window->downloads_tab, TRUE); + GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL); + gtk_widget_set_name(scrolled_window, "browser__scrollwin_downloads"); + gtk_container_add(GTK_CONTAINER(scrolled_window), window->downloads_tab); + gtk_notebook_insert_page(GTK_NOTEBOOK(window->notebook), scrolled_window, NULL, 0); + + gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(window->notebook), scrolled_window, TRUE); GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(tab_box, "browser__tabbox"); @@ -211,9 +214,9 @@ badwolf_downloads_tab_attach(struct Window *window) gtk_box_pack_start(GTK_BOX(tab_box), label, TRUE, TRUE, 0); gtk_widget_set_tooltip_text(tab_box, _("Badwolf Downloads")); - gtk_notebook_set_tab_label(GTK_NOTEBOOK(window->notebook), window->downloads_tab, tab_box); + gtk_notebook_set_tab_label(GTK_NOTEBOOK(window->notebook), scrolled_window, tab_box); gtk_notebook_set_menu_label_text( - GTK_NOTEBOOK(window->notebook), window->downloads_tab, _("Badwolf Downloads")); + GTK_NOTEBOOK(window->notebook), scrolled_window, _("Badwolf Downloads")); gtk_widget_show_all(tab_box); } diff --git a/po/messages.pot b/po/messages.pot index 45867ee..0d84a9f 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+ged40d74.develop\n" +"Project-Id-Version: Badwolf 1.0.0+g828e2e3.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-06-12 01:46+0200\n" +"POT-Creation-Date: 2020-06-12 02:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,27 +17,27 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: downloads.c:118 +#: downloads.c:117 #, c-format msgid "%02i:%02i:%02i Download cancelled" msgstr "" -#: downloads.c:120 +#: downloads.c:119 #, c-format msgid "%02i:%02i:%02i Download error" msgstr "" -#: downloads.c:142 +#: downloads.c:141 #, c-format msgid "%02i:%02i:%02i Download finished" msgstr "" -#: downloads.c:168 +#: downloads.c:167 #, c-format msgid "%02i:%02i:%02i Downloading…" msgstr "" -#: downloads.c:196 downloads.c:213 downloads.c:216 +#: downloads.c:199 downloads.c:216 downloads.c:218 msgid "Badwolf Downloads" msgstr "" -- cgit v1.3.1-23-gd82d From 8922faeb8cefd7ba292df626cf0519c9cae74ba1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 3 Jul 2020 06:34:05 +0200 Subject: badwolf.1: Fix syntax issues This seems to fix some issues with how GNU groff renders it. --- badwolf.1 | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/badwolf.1 b/badwolf.1 index d25674b..a9c2ce1 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -2,7 +2,7 @@ ./" Copyright © 2019-2020 Badwolf Authors ./" SPDX-License-Identifier: BSD-3-Clause .Dd 2019-10-31 -.Dt badwolf 1 +.Dt BADWOLF 1 .Sh NAME .Nm badwolf .Nd minimalist and privacy-oriented WebkitGTK browser @@ -20,8 +20,9 @@ will probably get added at a later release. .Sh KEYBINDINGS The following section lists the keybinding by their action, each item is described by the widget the focus is on or .Aq any -if it works for the whole window, followed by the keybind it grabs. A is short for Alt, C is short for Control, S is short for Shift. -.Bl -width Ds -tag +if it works for the whole window, followed by the keybind it grabs. +A is short for Alt, C is short for Control, S is short for Shift. +.Bl -tag -width Ds .It webview C-Scroll Zooms the webpage in/out. .It webview C-0 @@ -51,11 +52,12 @@ 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. +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: -.Bl -width Ds -tag +.Bl -tag -width Ds .It any C-PageUp / C-PageDown Go to the previous/next tab .It search C-g / C-S-g @@ -64,11 +66,13 @@ When the search box is focused it goes to the Next/Previous search term. Cancels current search .El .Sh ENVIRONMENT -.Bl -width Ds -tag +.Bl -tag -width Ds .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 +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. +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 FILES .Bl -tag -width Ds -compact @@ -79,13 +83,14 @@ to be loaded into .Nm . Note: They aren't the JavaScript-based Web-Extensions supported by Firefox or Chrome, but native code in shared objects using the WebKitGTK API. .Pp Examples of useful extensions may be found at: -.Bl -compact +.Bl -item -compact .Lk https://hacktivis.me/git/badwolf-extensions .Lk https://github.com/jun7/wyebadblock .El .It Pa ${DATADIR:-/usr/local/share}/badwolf/interface.css .It Pa ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/interface.css -CSS files (respectively system and user-level) for styling badwolf interface. See +CSS files (respectively system and user-level) for styling badwolf interface. +See .Lk https://developer.gnome.org/gtk3/stable/chap-css-properties.html for the properties being available. .Pp @@ -95,6 +100,8 @@ environment variable on launching .Nm and going to the CSS tab. .El +.Sh AUTHORS +.An Haelwenn (lanodan) Monnier Aq Mt contact+badwolf@hacktivis.me .Sh BUGS You can submit contributions or tickets to .Lk https://gitlab.com/lanodan/badwolf @@ -102,5 +109,3 @@ or .Mt contact+badwolf@hacktivis.me , with .Xr git-send-email 1 for patches. -.Sh AUTHORS -.An Haelwenn (lanodan) Monnier Aq Mt contact+badwolf@hacktivis.me -- cgit v1.3.1-23-gd82d From d27b739c3384442c69269604454abb052348b019 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 3 Jul 2020 06:43:07 +0200 Subject: badwolf.1: Use full modifier names instead of A/C/S --- badwolf.1 | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/badwolf.1 b/badwolf.1 index a9c2ce1..d1bda3e 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -21,21 +21,20 @@ will probably get added at a later release. The following section lists the keybinding by their action, each item is described by the widget the focus is on or .Aq any if it works for the whole window, followed by the keybind it grabs. -A is short for Alt, C is short for Control, S is short for Shift. .Bl -tag -width Ds -.It webview C-Scroll +.It webview Ctrl-Scroll Zooms the webpage in/out. -.It webview C-0 +.It webview Ctrl-0 Resets webpage zoom to 100%. -.It any C-t +.It any Ctrl-t Creates a new tab (in a new session, similar as pressing the button) -.It browser C-F4, browser A-d +.It browser Ctrl-F4, browser Alt-d Closes the current tab -.It browser C-f +.It browser Ctrl-f Focuses on the search entry -.It browser C-l +.It browser Ctrl-l Focuses on the location(URL) entry -.It browser C-S-r / C-r, browser F5 +.It browser Ctrl-Shift-r / Ctrl-r, browser F5 Reloads the content in the current tab (with/without clearing cache) .It browser Escape Stops loading the content in the current tab @@ -43,11 +42,11 @@ Stops loading the content in the current tab Toggles caret browsing. .It browser F12 Opens the web inspector. -.It browser C-[ / C-] +.It browser Ctrl-[ / Ctrl-] Go back/forward in current tab’s history -.It browser C-p +.It browser Ctrl-p Print the current page. (spawns a dialog) -.It any A-Left / A-Right +.It any Alt-Left / Alt-Right Go to the previous/next tab .It any F1 Shows the about dialog @@ -58,9 +57,9 @@ Go to the n-th tab, 0 goes to the last one. .Ss DEFAULT ONES Here is a incomplete list of the default Webkit/GTK keybindings: .Bl -tag -width Ds -.It any C-PageUp / C-PageDown +.It any Ctrl-PageUp / Ctrl-PageDown Go to the previous/next tab -.It search C-g / C-S-g +.It search Ctrl-g / Ctrl-Shift-g When the search box is focused it goes to the Next/Previous search term. .It search Escape Cancels current search -- cgit v1.3.1-23-gd82d From 9c0eb5080122f304b0bf444b040d98a366fbad62 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 4 Jul 2020 01:32:07 +0200 Subject: README.md: Add IRC+Matrix --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 22846e1..c264303 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,10 @@ You need to have gettext installed. If you want a GUI, poedit exists and Weblate - Syncing PO file with the POT file: ``make po/de.po`` - Initialising a new PO file (example for German, `de_DE`): ``msginit -l de_DE -i po/messages.pot -o po/de.po`` +## Contacts / Discussions +- IRC: `#badwolf-browser` on FreeNode +- Matrix (bridge): + ## Repositories ### git - Main: , -- cgit v1.3.1-23-gd82d From 1d4e9c3d4a22be09c0dbc1bc01e618ce5a394ef3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 4 Jul 2020 06:52:00 +0200 Subject: badwolf: badwolf_get_tab_position → gtk_notebook_page_num MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- badwolf.c | 16 ++------------- po/messages.pot | 60 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 32 insertions(+), 44 deletions(-) diff --git a/badwolf.c b/badwolf.c index 54dcf53..d7d1001 100644 --- a/badwolf.c +++ b/badwolf.c @@ -74,8 +74,7 @@ WebViewCb_close(WebKitWebView *webView, gpointer user_data) struct Client *browser = (struct Client *)user_data; GtkNotebook *notebook = GTK_NOTEBOOK(browser->window->notebook); - gtk_notebook_remove_page(notebook, - badwolf_get_tab_position(GTK_CONTAINER(notebook), browser->box)); + gtk_notebook_remove_page(notebook, gtk_notebook_page_num(GTK_NOTEBOOK(notebook), browser->box)); gtk_widget_destroy(browser->box); @@ -212,7 +211,7 @@ webView_tab_label_change(struct Client *browser, const gchar *title) gtk_notebook_set_menu_label_text(GTK_NOTEBOOK(notebook), browser->box, title); // Set the window title if the title change was on the current tab - if(badwolf_get_tab_position(GTK_CONTAINER(notebook), browser->box) == + if(gtk_notebook_page_num(GTK_NOTEBOOK(notebook), browser->box) == gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook))) gtk_window_set_title(GTK_WINDOW(browser->window->main_window), title); } @@ -883,17 +882,6 @@ notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gtk_window_set_title(GTK_WINDOW(window->main_window), gtk_widget_get_tooltip_text(label)); } -gint -badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child) -{ - GValue position = G_VALUE_INIT; - g_value_init(&position, G_TYPE_INT); - - gtk_container_child_get_property(notebook, child, "position", &position); - - return g_value_get_int(&position); -} - int main(int argc, char *argv[]) { diff --git a/po/messages.pot b/po/messages.pot index 0d84a9f..403e66a 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -37,27 +37,27 @@ msgstr "" msgid "%02i:%02i:%02i Downloading…" msgstr "" -#: downloads.c:199 downloads.c:216 downloads.c:218 +#: downloads.c:199 downloads.c:216 downloads.c:219 msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:910 +#: badwolf.c:898 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:403 +#: badwolf.c:402 msgid "Continue" msgstr "" -#: badwolf.c:353 +#: badwolf.c:352 msgid "" "Couldn't verify the TLS certificate to ensure a better security of the " "connection. You might want to verify your machine and network.\n" "\n" msgstr "" -#: badwolf.c:99 +#: badwolf.c:98 msgid "Crashed" msgstr "" @@ -65,31 +65,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:376 +#: badwolf.c:375 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:357 +#: badwolf.c:356 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:370 +#: badwolf.c:369 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:367 +#: badwolf.c:366 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:373 +#: badwolf.c:372 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:364 +#: badwolf.c:363 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:360 +#: badwolf.c:359 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -100,79 +100,79 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:839 +#: badwolf.c:838 msgid "New tab" msgstr "" -#: badwolf.c:959 +#: badwolf.c:947 msgid "Open new tab" msgstr "" -#: badwolf.c:103 +#: badwolf.c:102 msgid "Out of Memory" msgstr "" -#: badwolf.c:908 +#: badwolf.c:896 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:915 +#: badwolf.c:903 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:400 +#: badwolf.c:399 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:403 +#: badwolf.c:402 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:610 +#: badwolf.c:609 msgid "Toggle javascript" msgstr "" -#: badwolf.c:615 +#: badwolf.c:614 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:107 +#: badwolf.c:106 msgid "Unknown Crash" msgstr "" -#: badwolf.c:613 +#: badwolf.c:612 msgid "_IMG" msgstr "" -#: badwolf.c:608 +#: badwolf.c:607 msgid "_JS" msgstr "" -#: badwolf.c:728 +#: badwolf.c:727 msgid "search in current page" msgstr "" -#: badwolf.c:98 +#: badwolf.c:97 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:102 +#: badwolf.c:101 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:106 +#: badwolf.c:105 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:922 +#: badwolf.c:910 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:993 +#: badwolf.c:981 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 7425c1579beea18aaf5150b0e80f532f35e597d5 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 4 Jul 2020 07:15:29 +0200 Subject: Switch automatically to a tab when user-requested This changes behavior but doesn't breaks meaning nor documentation and significantly improves usability. So meant to be applied directly into 1.0.x release branch. Closes: https://gitlab.com/lanodan/badWolf/-/issues/8 --- badwolf.c | 18 ++++++++++++------ badwolf.h | 2 +- keybindings.c | 4 ++-- po/messages.pot | 18 +++++++++--------- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/badwolf.c b/badwolf.c index d7d1001..184c4a3 100644 --- a/badwolf.c +++ b/badwolf.c @@ -286,7 +286,7 @@ WebViewCb_create(WebKitWebView *related_web_view, struct Window *window = (struct Window *)user_data; struct Client *browser = new_browser(window, NULL, related_web_view); - if(badwolf_new_tab(GTK_NOTEBOOK(window->notebook), browser) < 0) + if(badwolf_new_tab(GTK_NOTEBOOK(window->notebook), browser, FALSE) < 0) return NULL; else return browser->webView; @@ -824,7 +824,8 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat return browser; } -/* badwolf_new_tab: Inserts struct Client *browser in GtkNotebook *notebook +/* badwolf_new_tab: Inserts struct Client *browser in GtkNotebook *notebook + * and optionally switches selected tab to it. * * returns: * 0 : Ran successfully @@ -832,7 +833,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat * -2 : browser is NULL */ int -badwolf_new_tab(GtkNotebook *notebook, struct Client *browser) +badwolf_new_tab(GtkNotebook *notebook, struct Client *browser, bool auto_switch) { gint current_page = gtk_notebook_get_current_page(notebook); gchar *title = _("New tab"); @@ -849,6 +850,11 @@ badwolf_new_tab(GtkNotebook *notebook, struct Client *browser) gtk_widget_queue_draw(GTK_WIDGET(notebook)); + if(auto_switch) + { + gtk_notebook_set_current_page(notebook, gtk_notebook_page_num(notebook, browser->box)); + } + return 0; } @@ -859,7 +865,7 @@ new_tabCb_clicked(GtkButton *new_tab, gpointer user_data) struct Window *window = (struct Window *)user_data; struct Client *browser = new_browser(window, NULL, NULL); - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), browser); + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), browser, TRUE); } static void @@ -967,10 +973,10 @@ main(int argc, char *argv[]) gtk_widget_show_all(window->main_window); if(argc == 1) - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, NULL, NULL)); + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, NULL, NULL), FALSE); else for(int i = 1; i < argc; ++i) - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, argv[i], NULL)); + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, argv[i], NULL), FALSE); gtk_notebook_set_current_page(GTK_NOTEBOOK(window->notebook), 1); diff --git a/badwolf.h b/badwolf.h index 7911c33..3d9b7f4 100644 --- a/badwolf.h +++ b/badwolf.h @@ -38,6 +38,6 @@ GtkWidget *badwolf_new_tab_box(const gchar *title, struct Client *browser); void webView_tab_label_change(struct Client *browser, const gchar *title); struct Client * new_browser(struct Window *window, const gchar *target_url, WebKitWebView *related_web_view); -int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser); +int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser, bool auto_switch); gint badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child); #endif /* BADWOLF_H_INCLUDED */ diff --git a/keybindings.c b/keybindings.c index 75860ed..ef33aaa 100644 --- a/keybindings.c +++ b/keybindings.c @@ -14,7 +14,7 @@ about_dialogCb_activate_link(GtkAboutDialog *about_dialog, gchar *uri, gpointer (void)about_dialog; struct Window *window = (struct Window *)user_data; - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, uri, NULL)); + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, uri, NULL), FALSE); gtk_widget_destroy(GTK_WIDGET(about_dialog)); @@ -112,7 +112,7 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client * { case GDK_KEY_Page_Down: gtk_notebook_next_page(notebook); return TRUE; case GDK_KEY_Page_Up: gtk_notebook_prev_page(notebook); return TRUE; - case GDK_KEY_t: badwolf_new_tab(notebook, new_browser(window, NULL, NULL)); return TRUE; + case GDK_KEY_t: badwolf_new_tab(notebook, new_browser(window, NULL, NULL), TRUE); return TRUE; } } } diff --git a/po/messages.pot b/po/messages.pot index 403e66a..ced4831 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 1.0.0+g828e2e3.develop\n" +"Project-Id-Version: Badwolf 1.0.0+g1d4e9c3.0\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-06-12 02:16+0200\n" +"POT-Creation-Date: 2020-07-08 07:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,7 +41,7 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:898 +#: badwolf.c:904 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" @@ -100,11 +100,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:838 +#: badwolf.c:839 msgid "New tab" msgstr "" -#: badwolf.c:947 +#: badwolf.c:953 msgid "Open new tab" msgstr "" @@ -112,12 +112,12 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:896 +#: badwolf.c:902 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:903 +#: badwolf.c:909 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -167,12 +167,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:910 +#: badwolf.c:916 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:981 +#: badwolf.c:987 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From df18b8d0a3a0634e18b518e9cfc21fd8f4ea7908 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 5 Jul 2020 05:23:28 +0200 Subject: README.md: Inkscape is used instead of rsvg --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c264303..8e868eb 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Dependencies are: Compilation is done with `make`, install with `make install` (`DESTDIR` and `PREFIX` environment variables are supported, amongs other common ones). An example AppArmor profile is provided at `usr.bin.badwolf`, please do some long runtime checks before shipping it or a modified version, help can be provided but with no support. -You'll also need `rsvg-convert(1)` (from librsvg) and scour if you want to regenerate the icons, for example after modifying them or adding a new size. These aren't needed for normal installation as it is bundled. +You'll also need inkscape (command line only) if you want to regenerate the icons, for example after modifying them or adding a new size. These aren't needed for normal installation as it is bundled. ## Notes Most of the privacy/security stuff will be done with patches against WebKit as quite a lot isn’t into [WebKitSettings](https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html) and with generic WebKit extensions that should be resuseable. -- cgit v1.3.1-23-gd82d From 66b97883479416164737af0487ca3329ee08a52f Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 8 Jul 2020 08:01:38 +0200 Subject: Makefile: Bump to 1.0.2 Note: 1.0.1 got deleted because bumping was forgotten --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9cd4d96..1500c84 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # - Usage of += for appending to a variable PACKAGE = Badwolf -VERSION = 1.0.0 +VERSION = 1.0.2 VERSION_FULL = $(VERSION)`./version.sh` PREFIX ?= /usr/local -- cgit v1.3.1-23-gd82d