From 7f6bb9caeb3466ffaf297481af905503b69b7ae3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 9 Feb 2020 21:35:52 +0100 Subject: keybindings.c: make format --- keybindings.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/keybindings.c b/keybindings.c index d574276..e134fc4 100644 --- a/keybindings.c +++ b/keybindings.c @@ -29,20 +29,20 @@ badwolf_about_dialog(GtkWindow *main_window, gpointer user_data) char *comments = NULL; - comments = g_strdup_printf( - _("Minimalist and privacy-oriented WebKitGTK+ browser\n" - "Runtime WebKit version: %d.%d.%d"), - webkit_get_major_version(), - webkit_get_minor_version(), - webkit_get_micro_version()); + comments = g_strdup_printf(_("Minimalist and privacy-oriented WebKitGTK+ browser\n" + "Runtime WebKit version: %d.%d.%d"), + webkit_get_major_version(), + webkit_get_minor_version(), + webkit_get_micro_version()); gtk_window_set_transient_for(GTK_WINDOW(about_dialog), main_window); gtk_window_set_destroy_with_parent(GTK_WINDOW(about_dialog), TRUE); gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about_dialog), "SPDX-License-Identifier: BSD-3-Clause"); - gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about_dialog), - "2019-2020 Badwolf Authors "); + gtk_about_dialog_set_copyright( + GTK_ABOUT_DIALOG(about_dialog), + "2019-2020 Badwolf Authors "); gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_dialog), homepage); gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about_dialog), comments); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), version); -- cgit v1.3.1-23-gd82d From b55b8a0b601c0fe05d6bad87b4801ef1976950d0 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Wed, 11 Mar 2020 15:54:32 +0100 Subject: config.h: Disable allow-top-navigation-to-data-urls WebKitSetting introduced in 2.28.0, works for webkit 2.26.4 so not breaking anything. --- config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/config.h b/config.h index c88d59d..789cdf4 100644 --- a/config.h +++ b/config.h @@ -73,6 +73,7 @@ "javascript-can-open-windows-automatically", FALSE, \ "media-playback-requires-user-gesture", TRUE, \ "minimum-font-size", 9, \ + "allow-top-navigation-to-data-urls", FALSE, \ NULL // clang-format on -- cgit v1.3.1-23-gd82d From e2338bb5ed27875dbc3e01386a085df5738443eb Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 22 Mar 2020 19:03:30 +0100 Subject: badwolf.c: Fix clang-10 warnings --- badwolf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/badwolf.c b/badwolf.c index cb26dcf..e9f55fc 100644 --- a/badwolf.c +++ b/badwolf.c @@ -193,7 +193,7 @@ webView_tab_label_change(struct Client *browser, const gchar *title) { GtkWidget *notebook = browser->window->notebook; -#define title_IS_EMPTY (title == NULL) || (title == (const gchar *)"") +#define title_IS_EMPTY strnlen(title, 2) == 0 if(title_IS_EMPTY) title = webkit_web_view_get_title(browser->webView); if(title_IS_EMPTY) title = webkit_web_view_get_uri(browser->webView); @@ -744,7 +744,7 @@ badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child) int main(int argc, char *argv[]) { - struct Window *window = &(struct Window){NULL}; + struct Window *window = &(struct Window){NULL, NULL, NULL}; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); bind_textdomain_codeset(PACKAGE, "UTF-8"); -- cgit v1.3.1-23-gd82d From 3fe2bff627575a6dced09e0e49e775acc773c514 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 30 Mar 2020 10:06:50 +0200 Subject: badwolf.c: Fixup unguarded strnlen() --- badwolf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index e9f55fc..93ab325 100644 --- a/badwolf.c +++ b/badwolf.c @@ -193,7 +193,7 @@ webView_tab_label_change(struct Client *browser, const gchar *title) { GtkWidget *notebook = browser->window->notebook; -#define title_IS_EMPTY strnlen(title, 2) == 0 +#define title_IS_EMPTY (title == NULL) || strnlen(title, 2) == 0 if(title_IS_EMPTY) title = webkit_web_view_get_title(browser->webView); if(title_IS_EMPTY) title = webkit_web_view_get_uri(browser->webView); -- cgit v1.3.1-23-gd82d From 01ec661788758698d3a791c835023d067beee050 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 31 Mar 2020 05:52:11 +0200 Subject: Unscrew the dark-theme with yet another hack --- badwolf.c | 9 ++------- config.h | 6 ------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/badwolf.c b/badwolf.c index 93ab325..16862b6 100644 --- a/badwolf.c +++ b/badwolf.c @@ -536,6 +536,8 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat browser->statuslabel = gtk_label_new(NULL); browser->search = gtk_search_entry_new(); + setenv("GTK_THEME", ":light", 0); + WebKitWebContext *web_context = webkit_web_context_new_ephemeral(); webkit_web_context_set_sandbox_enabled(web_context, TRUE); webkit_web_context_set_process_model(web_context, @@ -752,13 +754,6 @@ main(int argc, char *argv[]) gtk_init(&argc, &argv); -#ifdef BADWOLF_PREFER_DARK_THEME - g_object_set(gtk_settings_get_default(), - "gtk-application-prefer-dark-theme", - BADWOLF_PREFER_DARK_THEME, - NULL); -#endif - fprintf(stderr, _("Running Badwolf version: %s\n"), version); fprintf(stderr, _("Buildtime WebKit version: %d.%d.%d\n"), diff --git a/config.h b/config.h index 789cdf4..ec92dda 100644 --- a/config.h +++ b/config.h @@ -87,10 +87,4 @@ */ #define BADWOLF_STATUSLABEL_ELLIPSIZE PANGO_ELLIPSIZE_MIDDLE -/* BADWOLF_PREFER_DARK_THEME: Overwrites user GtkSettings for gtk-application-prefer-dark-theme - * Done as a temporary workaround against https://bugs.webkit.org/show_bug.cgi?id=197947 - * Remove definition to keep user settings, should only be done once the bug is fixed. - */ -#define BADWOLF_PREFER_DARK_THEME FALSE - #endif /* CONFIG_H_INCLUDED */ -- cgit v1.3.1-23-gd82d From 689b862c6739b76e0853fb8c8b5806c9d1c90e7d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 31 Mar 2020 05:53:19 +0200 Subject: po: Bump translations --- po/fr.po | 25 +++++++++++++------------ po/messages.pot | 22 +++++++++++----------- po/pt_BR.po | 39 +++++++++++++++------------------------ 3 files changed, 39 insertions(+), 47 deletions(-) diff --git a/po/fr.po b/po/fr.po index 4d5827f..da7c85c 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-02-09 19:39+0100\n" +"POT-Creation-Date: 2020-03-31 05:48+0200\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:764 +#: badwolf.c:759 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" @@ -71,19 +71,20 @@ msgstr "Erreur : Le certificat n'est pas encore valide.\n" msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" -#: keybindings.c:33 +#: keybindings.c:32 #, c-format msgid "" "Minimalist and privacy-oriented WebKitGTK+ browser\n" "Runtime WebKit version: %d.%d.%d" -msgstr "Navigateur WebKitGTK+ minimaliste et orienté vie privée\n" +msgstr "" +"Navigateur WebKitGTK+ minimaliste et orienté vie privée\n" "Version WebKit au lancement: %d.%d.%d" -#: badwolf.c:686 +#: badwolf.c:688 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:786 +#: badwolf.c:781 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" @@ -91,12 +92,12 @@ msgstr "Ouvrir un nouvel onglet" msgid "Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:762 +#: badwolf.c:757 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:769 +#: badwolf.c:764 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" @@ -110,7 +111,7 @@ msgstr "Erreur TLS pour %s." msgid "Temporarly Add Exception" msgstr "Ajouter Temporairement une Exception" -#: badwolf.c:571 +#: badwolf.c:573 msgid "Toggle javascript" msgstr "Activer/Désactiver javascript" @@ -118,7 +119,7 @@ msgstr "Activer/Désactiver javascript" msgid "Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:612 +#: badwolf.c:614 msgid "search in current page" msgstr "recherche dans la page courante" @@ -134,12 +135,12 @@ msgstr "le processus web a dépassé la limitation de mémoire.\n" msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:776 +#: badwolf.c:771 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Répertoire webkit-web-extension configuré à %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:815 +#: badwolf.c:810 msgid "ø" msgstr "" diff --git a/po/messages.pot b/po/messages.pot index 11c883c..8fd0053 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.0+gcba1cf3\n" +"Project-Id-Version: Badwolf 0.5.1+ge2338bb\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-03-11 16:00+0100\n" +"POT-Creation-Date: 2020-03-31 05:48+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: badwolf.c:764 +#: badwolf.c:759 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" @@ -72,11 +72,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:686 +#: badwolf.c:688 msgid "New tab" msgstr "" -#: badwolf.c:786 +#: badwolf.c:781 msgid "Open new tab" msgstr "" @@ -84,12 +84,12 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:762 +#: badwolf.c:757 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:769 +#: badwolf.c:764 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -103,7 +103,7 @@ msgstr "" msgid "Temporarly Add Exception" msgstr "" -#: badwolf.c:571 +#: badwolf.c:573 msgid "Toggle javascript" msgstr "" @@ -111,7 +111,7 @@ msgstr "" msgid "Unknown Crash" msgstr "" -#: badwolf.c:612 +#: badwolf.c:614 msgid "search in current page" msgstr "" @@ -127,12 +127,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:776 +#: badwolf.c:771 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:815 +#: badwolf.c:810 msgid "ø" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index aca5ce3..d05d459 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.4.0+g607300e\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-02-04 07:54+0100\n" +"POT-Creation-Date: 2020-03-31 05:48+0200\n" "PO-Revision-Date: 2020-01-20 22:17-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:764 +#: badwolf.c:759 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit %d.%d.%d\n" @@ -71,15 +71,18 @@ msgstr "" msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erro: A identidade não confere com a esperada.\n" -#: keybindings.c:39 -msgid "Minimalist and privacy-oriented WebKitGTK+ browser" +#: keybindings.c:32 +#, fuzzy, c-format +msgid "" +"Minimalist and privacy-oriented WebKitGTK+ browser\n" +"Runtime WebKit version: %d.%d.%d" msgstr "Navegador orientado pela privacidade e minimalismo" -#: badwolf.c:686 +#: badwolf.c:688 msgid "New tab" msgstr "Nova aba" -#: badwolf.c:786 +#: badwolf.c:781 msgid "Open new tab" msgstr "Abrir uma Nova aba" @@ -88,12 +91,12 @@ msgstr "Abrir uma Nova aba" msgid "Out of Memory" msgstr "Sem memória" -#: badwolf.c:762 +#: badwolf.c:757 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Rodando versão %s do Badwolf\n" -#: badwolf.c:769 +#: badwolf.c:764 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit: %d.%d.%d\n" @@ -107,7 +110,7 @@ msgstr "Erro TLS para %s." msgid "Temporarly Add Exception" msgstr "Temporáriamente adicionar exceção" -#: badwolf.c:571 +#: badwolf.c:573 msgid "Toggle javascript" msgstr "Habilitar Javascript" @@ -116,7 +119,7 @@ msgstr "Habilitar Javascript" msgid "Unknown Crash" msgstr "Erro desconhecido" -#: badwolf.c:612 +#: badwolf.c:614 msgid "search in current page" msgstr "buscar na página atual" @@ -132,24 +135,12 @@ msgstr "o processo web excedeu o limite de memória.\n" msgid "the web process terminated for an unknown reason.\n" msgstr "o processo web terminou por uma razão desconhecida.\n" -#: badwolf.c:95 -msgid "title|Crashed" -msgstr "Erro" - -#: badwolf.c:99 -msgid "title|Out of Memory" -msgstr "Sem memória" - -#: badwolf.c:103 -msgid "title|Unknown Crash" -msgstr "Erro desconhecido" - -#: badwolf.c:776 +#: badwolf.c:771 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "diretório de extensões configurado para: %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:815 +#: badwolf.c:810 msgid "ø" msgstr "ø" -- cgit v1.3.1-23-gd82d From 27e52f39ecc17e934e642152117948321bd6abbe Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 2 Apr 2020 05:48:49 +0200 Subject: badwolf.c: Call gtk_widget_set_name() on relevant widgets --- badwolf.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/badwolf.c b/badwolf.c index 16862b6..5fe7d21 100644 --- a/badwolf.c +++ b/badwolf.c @@ -131,11 +131,15 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) { (void)browser; GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_widget_set_name(tab_box, "browser__tabbox"); GtkWidget *close = gtk_button_new_from_icon_name("window-close-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_widget_set_name(close, "browser__tabbox__close"); GtkWidget *label = gtk_label_new(title); + gtk_widget_set_name(label, "browser__tabbox__label"); GtkWidget *playing = gtk_image_new_from_icon_name("audio-volume-high-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_widget_set_name(playing, "browser__tabbox__playing"); #ifdef BADWOLF_TAB_BOX_WIDTH gtk_widget_set_size_request(label, BADWOLF_TAB_BOX_WIDTH, -1); @@ -526,15 +530,22 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat if(browser == NULL) return NULL; - browser->window = window; - browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); - browser->toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); - browser->location = gtk_entry_new(); + browser->window = window; + browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + gtk_widget_set_name(browser->box, "browser__box"); + browser->toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_widget_set_name(browser->toolbar, "browser__toolbar"); + browser->location = gtk_entry_new(); + gtk_widget_set_name(browser->location, "browser__location"); browser->javascript = gtk_check_button_new(); + gtk_widget_set_name(browser->javascript, "browser__javascript"); - browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_widget_set_name(browser->statusbar, "browser__statusbar"); browser->statuslabel = gtk_label_new(NULL); - browser->search = gtk_search_entry_new(); + gtk_widget_set_name(browser->statuslabel, "browser__statuslabel"); + browser->search = gtk_search_entry_new(); + gtk_widget_set_name(browser->statuslabel, "browser__search"); setenv("GTK_THEME", ":light", 0); @@ -569,6 +580,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat "settings", settings, NULL)); + gtk_widget_set_name(GTK_WIDGET(browser->webView), "browser__webView"); gtk_widget_set_tooltip_text(browser->javascript, _("Toggle javascript")); -- cgit v1.3.1-23-gd82d From a60529ec9f97663138e15d5f9598962c61f34d7e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 2 Apr 2020 06:49:46 +0200 Subject: Add CSS Provider for styling the interface --- Makefile | 1 + badwolf.1 | 11 +++++++++++ badwolf.c | 26 ++++++++++++++++++++++++++ interface.css | 1 + po/messages.pot | 56 ++++++++++++++++++++++++++++---------------------------- 5 files changed, 67 insertions(+), 28 deletions(-) create mode 100644 interface.css diff --git a/Makefile b/Makefile index e0083d5..f8183b4 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,7 @@ install: all cp -p badwolf.1 $(DESTDIR)$(MANDIR)/man1 mkdir -p $(DESTDIR)$(DATADIR)/locale cp -r locale/ $(DESTDIR)$(DATADIR) + cp interface.css $(DESTDIR)$(DATADIR) mkdir -p $(DESTDIR)$(APPSDIR) cp -p badwolf.desktop $(DESTDIR)$(APPSDIR)/ mkdir -p $(DESTDIR)$(DOCDIR) diff --git a/badwolf.1 b/badwolf.1 index 6f8ecb8..622faff 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -79,6 +79,17 @@ Examples of useful extensions may be found at: .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 +.Lk https://developer.gnome.org/gtk3/stable/chap-css-properties.html +for the properties being available. +.Pp +For testing your styles I would recommend using the +.Ev GTK_DEBUG=interactive +environment variable on launching +.Nm +and going to the CSS tab. .El .Sh BUGS You can submit contributions or tickets to diff --git a/badwolf.c b/badwolf.c index 5fe7d21..bdbbbd4 100644 --- a/badwolf.c +++ b/badwolf.c @@ -13,6 +13,7 @@ #include /* LC_* */ #include /* perror(), fprintf() */ #include /* malloc() */ +#include /* access() */ const gchar *homepage = "https://hacktivis.me/projects/badwolf"; const gchar *version = VERSION; @@ -790,6 +791,31 @@ main(int argc, char *argv[]) GTK_WINDOW(window->main_window), BADWOLF_DEFAULT_WIDTH, BADWOLF_DEFAULT_HEIGHT); gtk_window_set_role(GTK_WINDOW(window->main_window), "browser"); + GtkCssProvider *css_provider_app = gtk_css_provider_new(); + gchar *provider_path_app = g_build_filename(DATADIR, "interface.css", NULL); + if(access(provider_path_app, R_OK) == 0) + { + gtk_css_provider_load_from_path(css_provider_app, provider_path_app, NULL); + gtk_style_context_add_provider_for_screen( + gtk_widget_get_screen(GTK_WIDGET(window->main_window)), + GTK_STYLE_PROVIDER(css_provider_app), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + } + g_free(provider_path_app); + + GtkCssProvider *css_provider_user = gtk_css_provider_new(); + gchar *provider_path_user = + g_build_filename(g_get_user_data_dir(), "badwolf", "interface.css", NULL); + if(access(provider_path_user, R_OK) == 0) + { + gtk_css_provider_load_from_path(css_provider_user, provider_path_user, NULL); + gtk_style_context_add_provider_for_screen( + gtk_widget_get_screen(GTK_WIDGET(window->main_window)), + GTK_STYLE_PROVIDER(css_provider_user), + GTK_STYLE_PROVIDER_PRIORITY_USER); + } + g_free(provider_path_user); + gtk_widget_set_tooltip_text(window->new_tab, _("Open new tab")); gtk_notebook_set_action_widget(GTK_NOTEBOOK(window->notebook), window->new_tab, GTK_PACK_END); diff --git a/interface.css b/interface.css new file mode 100644 index 0000000..2a22c9b --- /dev/null +++ b/interface.css @@ -0,0 +1 @@ +#browser__location, #browser__statuslabel { font-family: monospace; } diff --git a/po/messages.pot b/po/messages.pot index 8fd0053..7ce7663 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+ge2338bb\n" +"Project-Id-Version: Badwolf 0.5.1+g1934146\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-03-31 05:48+0200\n" +"POT-Creation-Date: 2020-04-02 06:50+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,51 +17,51 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: badwolf.c:759 +#: badwolf.c:772 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:384 +#: badwolf.c:389 msgid "Continue" msgstr "" -#: badwolf.c:334 +#: badwolf.c:339 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:95 +#: badwolf.c:96 msgid "Crashed" msgstr "" -#: badwolf.c:357 +#: badwolf.c:362 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:338 +#: badwolf.c:343 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:351 +#: badwolf.c:356 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:348 +#: badwolf.c:353 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:354 +#: badwolf.c:359 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:345 +#: badwolf.c:350 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:341 +#: badwolf.c:346 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -72,67 +72,67 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:688 +#: badwolf.c:701 msgid "New tab" msgstr "" -#: badwolf.c:781 +#: badwolf.c:819 msgid "Open new tab" msgstr "" -#: badwolf.c:99 +#: badwolf.c:100 msgid "Out of Memory" msgstr "" -#: badwolf.c:757 +#: badwolf.c:770 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:764 +#: badwolf.c:777 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:381 +#: badwolf.c:386 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:384 +#: badwolf.c:389 msgid "Temporarly Add Exception" msgstr "" -#: badwolf.c:573 +#: badwolf.c:586 msgid "Toggle javascript" msgstr "" -#: badwolf.c:103 +#: badwolf.c:104 msgid "Unknown Crash" msgstr "" -#: badwolf.c:614 +#: badwolf.c:627 msgid "search in current page" msgstr "" -#: badwolf.c:94 +#: badwolf.c:95 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:98 +#: badwolf.c:99 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:102 +#: badwolf.c:103 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:771 +#: badwolf.c:784 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:810 +#: badwolf.c:848 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From f35b0b8d29a5cf5fe5adcb752fa2d45a8c96e516 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 2 Apr 2020 06:58:57 +0200 Subject: badwolf.c: fix widget name for search entry --- badwolf.c | 2 +- po/messages.pot | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/badwolf.c b/badwolf.c index bdbbbd4..75296e4 100644 --- a/badwolf.c +++ b/badwolf.c @@ -546,7 +546,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat browser->statuslabel = gtk_label_new(NULL); gtk_widget_set_name(browser->statuslabel, "browser__statuslabel"); browser->search = gtk_search_entry_new(); - gtk_widget_set_name(browser->statuslabel, "browser__search"); + gtk_widget_set_name(browser->search, "browser__search"); setenv("GTK_THEME", ":light", 0); diff --git a/po/messages.pot b/po/messages.pot index 7ce7663..b1717cd 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g1934146\n" +"Project-Id-Version: Badwolf 0.5.1+ga60529e\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-04-02 06:50+0200\n" +"POT-Creation-Date: 2020-04-02 06:58+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" -- cgit v1.3.1-23-gd82d From e64d606e233e320d8df20958ee9e964fd95dca6a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 4 Apr 2020 01:20:17 +0200 Subject: decisions.md: Bump I should make it an habit to update this file when making decisions, probably missed some, feel free to contact me if you think I did. --- decisions.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/decisions.md b/decisions.md index 6ee4e5a..cc8ab5c 100644 --- a/decisions.md +++ b/decisions.md @@ -5,6 +5,17 @@ Bascially, the idea is to have a file in your projects repo, where you record the decisions you make over the course of the project's lifetime. Rewriting history will not be done but Post-Scriptum notices will. +## 2020-02-04 & 2020-02-09 : Use BSD extensions in the Makefile +The BSD extensions += and ?= for variable extension is used to avoid having to explicitely pass a list of variables to make, thus making build recipies simpler. +They are also compatible with GNU make so portability shouldn't have significantly dropped. +Which also meant dropping `.POSIX` into the file so `CC` wouldn't be set by default to `c99` (which isn't what I want, the codebase is in c11). + +## 2020-01-30 02:59 : Make window declaration static +This allows to avoid a quite useless memory allocation that would only be freed at the end of the program. + +## 2020-01-22 15:30 : Update copyright to Badwolf Authors +I don't want copyright assignment to me or any organisation, it should belong to every contributor, meaning that any copyright change will need to be accepted by them or their contribution would need to be replaced if need to be. + ## 2020-01-08 08:42:00Z : Start of the decisions.md file From memory and git log: -- cgit v1.3.1-23-gd82d From ad8b3dd9b8d29d067d9b2f4babe7aaa70be58c3d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 21 Jan 2020 02:12:30 +0100 Subject: Download progress tab --- Makefile | 4 +- badwolf.c | 72 ++++++++++++------------- badwolf.h | 1 + config.h | 3 ++ downloads.c | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ downloads.h | 28 ++++++++++ po/messages.pot | 76 +++++++++++++++++---------- version.sh | 5 +- 8 files changed, 278 insertions(+), 71 deletions(-) create mode 100644 downloads.c create mode 100644 downloads.h diff --git a/Makefile b/Makefile index f8183b4..64f02fd 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ PKGCONFIG ?= pkg-config MSGFMT ?= msgfmt DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 -SRCS = uri.c uri_test.c keybindings.c badwolf.c -OBJS = uri.o keybindings.o badwolf.o +SRCS = uri.c uri_test.c keybindings.c downloads.c badwolf.c +OBJS = uri.o keybindings.o downloads.o badwolf.o OBJS_test = uri_test.o EXE = badwolf EXE_test = uri_test diff --git a/badwolf.c b/badwolf.c index 75296e4..147658f 100644 --- a/badwolf.c +++ b/badwolf.c @@ -5,6 +5,7 @@ #include "badwolf.h" #include "config.h" +#include "downloads.h" #include "keybindings.h" #include "uri.h" @@ -50,9 +51,6 @@ static gboolean WebViewCb_decide_policy(WebKitWebView *web_view, static void web_contextCb_download_started(WebKitWebContext *web_context, WebKitDownload *download, gpointer user_data); -static gboolean downloadCb_decide_destination(WebKitDownload *download, - gchar *suggested_filename, - gpointer user_data); static gboolean locationCb_activate(GtkEntry *location, gpointer user_data); static gboolean javascriptCb_toggled(GtkButton *javascript, gpointer user_data); static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data); @@ -408,46 +406,36 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, static void web_contextCb_download_started(WebKitWebContext *web_context, - WebKitDownload *download, + WebKitDownload *webkit_download, gpointer user_data) { (void)web_context; + struct Client *browser = (struct Client *)user_data; + struct Download *download = malloc(sizeof(struct Client)); - g_signal_connect(G_OBJECT(download), + if(download != NULL) + { + download->window = browser->window; + + download_new_entry(webkit_download, download); + + g_signal_connect( + G_OBJECT(webkit_download), "received-data", G_CALLBACK(downloadCb_received_data), download); + g_signal_connect(G_OBJECT(webkit_download), + "created-destination", + G_CALLBACK(downloadCb_created_destination), + download); + g_signal_connect(G_OBJECT(webkit_download), "failed", G_CALLBACK(downloadCb_failed), download); + g_signal_connect( + G_OBJECT(webkit_download), "finished", G_CALLBACK(downloadCb_finished), download); + } + + g_signal_connect(G_OBJECT(webkit_download), "decide-destination", G_CALLBACK(downloadCb_decide_destination), user_data); } -static gboolean -downloadCb_decide_destination(WebKitDownload *download, - gchar *suggested_filename, - gpointer user_data) -{ - struct Client *browser = (struct Client *)user_data; - gint chooser_response; - GtkWindow *parent_window = GTK_WINDOW(browser->window->main_window); - - GtkFileChooserNative *file_dialog = - gtk_file_chooser_native_new(NULL, parent_window, GTK_FILE_CHOOSER_ACTION_SAVE, NULL, NULL); - GtkFileChooser *file_chooser = GTK_FILE_CHOOSER(file_dialog); - - gtk_file_chooser_set_current_name(file_chooser, suggested_filename); - gtk_file_chooser_set_do_overwrite_confirmation(file_chooser, TRUE); - webkit_download_set_allow_overwrite(download, TRUE); - - chooser_response = gtk_native_dialog_run(GTK_NATIVE_DIALOG(file_dialog)); - - if(chooser_response == GTK_RESPONSE_ACCEPT) - webkit_download_set_destination(download, gtk_file_chooser_get_uri(file_chooser)); - else - webkit_download_cancel(download); - - g_object_unref(file_dialog); - - return FALSE; /* Let it propagate */ -} - static gboolean locationCb_activate(GtkEntry *location, gpointer user_data) { @@ -786,6 +774,7 @@ main(int argc, char *argv[]) window->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); window->notebook = gtk_notebook_new(); window->new_tab = gtk_button_new_from_icon_name("tab-new-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + window->downloads_tab = badwolf_downloads_tab_new(); gtk_window_set_default_size( GTK_WINDOW(window->main_window), BADWOLF_DEFAULT_WIDTH, BADWOLF_DEFAULT_HEIGHT); @@ -824,12 +813,9 @@ main(int argc, char *argv[]) gtk_notebook_popup_enable(GTK_NOTEBOOK(window->notebook)); gtk_container_add(GTK_CONTAINER(window->main_window), window->notebook); + gtk_widget_queue_draw(window->notebook); - if(argc == 1) - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, NULL, NULL)); - else - for(int i = 1; i < argc; ++i) - badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, argv[i], NULL)); + badwolf_downloads_tab_attach(window); g_signal_connect( window->main_window, "key-press-event", G_CALLBACK(main_windowCb_key_press_event), window); @@ -841,6 +827,14 @@ main(int argc, char *argv[]) gtk_widget_show(window->new_tab); gtk_widget_show_all(window->main_window); + if(argc == 1) + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, NULL, NULL)); + else + for(int i = 1; i < argc; ++i) + badwolf_new_tab(GTK_NOTEBOOK(window->notebook), new_browser(window, argv[i], NULL)); + + gtk_notebook_set_current_page(GTK_NOTEBOOK(window->notebook), 1); + gtk_main(); #if 0 diff --git a/badwolf.h b/badwolf.h index 91c05a4..7ffe965 100644 --- a/badwolf.h +++ b/badwolf.h @@ -12,6 +12,7 @@ struct Window GtkWidget *main_window; GtkWidget *notebook; GtkWidget *new_tab; + GtkWidget *downloads_tab; }; struct Client diff --git a/config.h b/config.h index ec92dda..ea728b5 100644 --- a/config.h +++ b/config.h @@ -42,6 +42,9 @@ // BADWOLF_STATUSBAR_PADDING: Amount of padding between statusbar elements #define BADWOLF_STATUSBAR_PADDING 0 +// BADWOLF_DOWNLOAD_PADDING: Amount of padding between download list row-elements +#define BADWOLF_DOWNLOAD_PADDING 5 + /* BADWOLF_DEFAULT_WIDTH / BADWOLF_DEFAULT_HEIGHT: * Used to define the default width/height of the window, * useful for floating Window Managers, probably useless in tiling ones diff --git a/downloads.c b/downloads.c new file mode 100644 index 0000000..0c1ee3d --- /dev/null +++ b/downloads.c @@ -0,0 +1,160 @@ +// BadWolf: Minimalist and privacy-oriented WebKitGTK+ browser +// Copyright © 2019 Haelwenn (lanodan) Monnier +// SPDX-License-Identifier: BSD-3-Clause + +#include "downloads.h" + +#include "badwolf.h" +#include "config.h" + +#include /* _() and other internationalization/localization helpers */ + +static void +download_stop_iconCb_clicked(GtkButton *stop_icon, gpointer user_data) +{ + (void)stop_icon; + WebKitDownload *webkit_download = (WebKitDownload *)user_data; + + webkit_download_cancel(webkit_download); +} + +void +download_new_entry(WebKitDownload *webkit_download, struct Download *download) +{ + download->error = 0; + download->container = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, BADWOLF_DOWNLOAD_PADDING); + download->progress = gtk_progress_bar_new(); + download->file_path = gtk_label_new(NULL); + download->status = gtk_label_new(_("Download starting…")); + download->icon = + gtk_image_new_from_icon_name("network-idle-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + download->stop_icon = gtk_button_new_from_icon_name("process-stop", GTK_ICON_SIZE_SMALL_TOOLBAR); + + g_signal_connect( + download->stop_icon, "clicked", G_CALLBACK(download_stop_iconCb_clicked), webkit_download); + + gtk_box_pack_start(GTK_BOX(download->container), download->icon, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(download->container), download->progress, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(download->container), download->stop_icon, FALSE, FALSE, 0); + 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_widget_show_all(download->container); +} + +void +downloadCb_created_destination(WebKitDownload *webkit_download, + gchar *destination, + gpointer user_data) +{ + (void)webkit_download; + struct Download *download = (struct Download *)user_data; + + gtk_label_set_text(GTK_LABEL(download->file_path), destination); +} + +gboolean +downloadCb_decide_destination(WebKitDownload *webkit_download, + gchar *suggested_filename, + gpointer user_data) +{ + struct Client *browser = (struct Client *)user_data; + gint chooser_response; + GtkWindow *parent_window = GTK_WINDOW(browser->window->main_window); + + GtkFileChooserNative *file_dialog = + gtk_file_chooser_native_new(NULL, parent_window, GTK_FILE_CHOOSER_ACTION_SAVE, NULL, NULL); + GtkFileChooser *file_chooser = GTK_FILE_CHOOSER(file_dialog); + + gtk_file_chooser_set_current_name(file_chooser, suggested_filename); + gtk_file_chooser_set_do_overwrite_confirmation(file_chooser, TRUE); + webkit_download_set_allow_overwrite(webkit_download, TRUE); + + chooser_response = gtk_native_dialog_run(GTK_NATIVE_DIALOG(file_dialog)); + + if(chooser_response == GTK_RESPONSE_ACCEPT) + webkit_download_set_destination(webkit_download, gtk_file_chooser_get_uri(file_chooser)); + else + webkit_download_cancel(webkit_download); + + g_object_unref(file_dialog); + + return FALSE; /* Let it propagate */ +} + +void +downloadCb_failed(WebKitDownload *webkit_download, GError *error, gpointer user_data) +{ + (void)webkit_download; + (void)error; + struct Download *download = (struct Download *)user_data; + + download->error = error; + + if(g_error_matches(error, WEBKIT_DOWNLOAD_ERROR, WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER)) + gtk_label_set_text(GTK_LABEL(download->status), _("Download cancelled")); + else + gtk_label_set_text(GTK_LABEL(download->status), _("Download error")); + + gtk_image_set_from_icon_name( + GTK_IMAGE(download->icon), "network-error-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); +} + +void +downloadCb_finished(WebKitDownload *webkit_download, gpointer user_data) +{ + (void)webkit_download; + struct Download *download = (struct Download *)user_data; + + // gtk_button_set_image(GTK_BUTTON(download->stop_icon), NULL); + gtk_widget_destroy(download->stop_icon); + + if(download->error == 0) + { + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(download->progress), 1); + gtk_label_set_text(GTK_LABEL(download->status), _("Download finished")); + gtk_image_set_from_icon_name( + GTK_IMAGE(download->icon), "network-idle-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + } + + // TODO: Send notification +} + +void +downloadCb_received_data(WebKitDownload *webkit_download, guint64 data_lenght, gpointer user_data) +{ + (void)data_lenght; + struct Download *download = (struct Download *)user_data; + gchar *format_size = g_format_size(data_lenght); + + gtk_image_set_from_icon_name( + GTK_IMAGE(download->icon), "network-receive-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_label_set_text(GTK_LABEL(download->status), format_size); + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(download->progress), + webkit_download_get_estimated_progress(webkit_download)); + + g_free(format_size); +} + +GtkWidget * +badwolf_downloads_tab_new() +{ + return gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); +} + +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, FALSE); + GtkWidget *downloads_tab_label = + gtk_image_new_from_icon_name("emblem-downloads", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_widget_set_tooltip_text(downloads_tab_label, _("Badwolf Downloads")); + gtk_notebook_set_tab_label( + GTK_NOTEBOOK(window->notebook), window->downloads_tab, downloads_tab_label); + gtk_notebook_set_menu_label_text( + GTK_NOTEBOOK(window->notebook), window->downloads_tab, _("Badwolf Downloads")); +} diff --git a/downloads.h b/downloads.h new file mode 100644 index 0000000..fa5513e --- /dev/null +++ b/downloads.h @@ -0,0 +1,28 @@ +#include "badwolf.h" + +#include + +struct Download +{ + struct Window *window; + + GtkWidget *container; + GtkWidget *icon; + GtkWidget *stop_icon; + GtkWidget *file_path; + GtkWidget *progress; + GtkWidget *status; + GError *error; +}; + +void download_new_entry(WebKitDownload *webkit_download, struct Download *download); +void +downloadCb_created_destination(WebKitDownload *download, gchar *destination, gpointer user_data); +gboolean downloadCb_decide_destination(WebKitDownload *download, + gchar *suggested_filename, + gpointer user_data); +void downloadCb_failed(WebKitDownload *webkit_download, GError *error, gpointer user_data); +void downloadCb_finished(WebKitDownload *download, gpointer user_data); +void downloadCb_received_data(WebKitDownload *download, guint64 data_lenght, gpointer user_data); +GtkWidget *badwolf_downloads_tab_new(); +void badwolf_downloads_tab_attach(struct Window *window); diff --git a/po/messages.pot b/po/messages.pot index b1717cd..360178f 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+ga60529e\n" +"Project-Id-Version: Badwolf 0.5.1+gb1ff239.download-progress\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-04-02 06:58+0200\n" +"POT-Creation-Date: 2020-05-01 00:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,51 +17,71 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: badwolf.c:772 +#: downloads.c:155 downloads.c:159 +msgid "Badwolf Downloads" +msgstr "" + +#: badwolf.c:760 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:389 +#: badwolf.c:387 msgid "Continue" msgstr "" -#: badwolf.c:339 +#: badwolf.c:337 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:96 +#: badwolf.c:94 msgid "Crashed" msgstr "" -#: badwolf.c:362 +#: downloads.c:98 +msgid "Download cancelled" +msgstr "" + +#: downloads.c:100 +msgid "Download error" +msgstr "" + +#: downloads.c:118 +msgid "Download finished" +msgstr "" + +#: downloads.c:28 +msgid "Download starting…" +msgstr "" + +#: badwolf.c:360 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:343 +#: badwolf.c:341 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:356 +#: badwolf.c:354 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:353 +#: badwolf.c:351 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:359 +#: badwolf.c:357 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:350 +#: badwolf.c:348 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:346 +#: badwolf.c:344 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -72,67 +92,67 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:701 +#: badwolf.c:689 msgid "New tab" msgstr "" -#: badwolf.c:819 +#: badwolf.c:808 msgid "Open new tab" msgstr "" -#: badwolf.c:100 +#: badwolf.c:98 msgid "Out of Memory" msgstr "" -#: badwolf.c:770 +#: badwolf.c:758 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:777 +#: badwolf.c:765 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:386 +#: badwolf.c:384 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:389 +#: badwolf.c:387 msgid "Temporarly Add Exception" msgstr "" -#: badwolf.c:586 +#: badwolf.c:574 msgid "Toggle javascript" msgstr "" -#: badwolf.c:104 +#: badwolf.c:102 msgid "Unknown Crash" msgstr "" -#: badwolf.c:627 +#: badwolf.c:615 msgid "search in current page" msgstr "" -#: badwolf.c:95 +#: badwolf.c:93 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:99 +#: badwolf.c:97 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:103 +#: badwolf.c:101 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:784 +#: badwolf.c:772 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:848 +#: badwolf.c:842 msgid "ø" msgstr "" diff --git a/version.sh b/version.sh index 318aa72..0c9d3d6 100755 --- a/version.sh +++ b/version.sh @@ -1,8 +1,9 @@ #!/bin/sh hash=$(git --git-dir="$(dirname $0)/.git" rev-parse --short HEAD 2>/dev/null) +branch=$(git --git-dir="$(dirname $0)/.git" rev-parse --abbrev-ref HEAD | sed -r 's/.*[^0-9A-Za-z-]([0-9A-Za-z-]*)$/\1/g') -if [ -n "$hash" ] +if [ -n "$hash" ] || [ -n "$branch" ] then - printf '+g%s' "$hash" + printf '+g%s.%s' "$hash" "$branch" fi echo -- cgit v1.3.1-23-gd82d From ab21dd24ad93a50e5dd6343cb0258d20358af797 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 3 May 2020 00:43:27 +0200 Subject: .editorconfig: New file --- .editorconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..cd52797 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# https://EditorConfig.org +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = tab +indent_size = tab +max_line_length = 100 -- cgit v1.3.1-23-gd82d From 96676069aaaea036dccb73f992852358a65bca47 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 3 May 2020 02:24:04 +0200 Subject: Add a logo --- Makefile | 15 +++- README.md | 2 + badwolf.c | 1 + badwolf.svg | 117 ++++++++++++++++++++++++++++++++ icons/hicolor/128x128/apps/badwolf.png | Bin 0 -> 6551 bytes icons/hicolor/256x256/apps/badwolf.png | Bin 0 -> 14810 bytes icons/hicolor/48x48/apps/badwolf.png | Bin 0 -> 1958 bytes icons/hicolor/64x64/apps/badwolf.png | Bin 0 -> 2847 bytes icons/hicolor/scalable/apps/badwolf.svg | 2 + icons_size.sh | 4 ++ keybindings.c | 1 + 11 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 badwolf.svg create mode 100644 icons/hicolor/128x128/apps/badwolf.png create mode 100644 icons/hicolor/256x256/apps/badwolf.png create mode 100644 icons/hicolor/48x48/apps/badwolf.png create mode 100644 icons/hicolor/64x64/apps/badwolf.png create mode 100644 icons/hicolor/scalable/apps/badwolf.svg create mode 100755 icons_size.sh diff --git a/Makefile b/Makefile index f8183b4..d1403cd 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,9 @@ DBG ?= PKGCONFIG ?= pkg-config MSGFMT ?= msgfmt +# for i in 48 64 128 256; do echo icons/hicolor/${i}x${i}/apps/badwolf.png; done | tr '\n' ' ' +ICON_SIZES = icons/hicolor/48x48/apps/badwolf.png icons/hicolor/64x64/apps/badwolf.png icons/hicolor/128x128/apps/badwolf.png icons/hicolor/256x256/apps/badwolf.png + DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 SRCS = uri.c uri_test.c keybindings.c badwolf.c OBJS = uri.o keybindings.o badwolf.o @@ -33,7 +36,15 @@ CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=2008 CDEPS += `$(PKGCONFIG) --cflags $(DEPS)` LIBS = `$(PKGCONFIG) --libs $(DEPS)` -all: $(EXE) $(TRANS) po/messages.pot +all: $(EXE) $(ICON_SIZES) $(TRANS) po/messages.pot + +icons/hicolor/scalable/apps/badwolf.svg: badwolf.svg + mkdir -p icons/hicolor/scalable/apps + scour --no-line-breaks --enable-id-stripping --remove-metadata $< $@ + +icons/hicolor/%/apps/badwolf.png: icons/hicolor/scalable/apps/badwolf.svg + mkdir -p `dirname $@` + rsvg-convert -a `echo $@ | cut -d/ -f3 | ./icons_size.sh` $< -o $@ po/messages.pot: $(SRCS) xgettext --keyword=_ --language=C --from-code=UTF-8 -o $@ --add-comments --sort-output --copyright-holder="Badwolf Authors " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) @@ -74,6 +85,8 @@ install: all cp -p badwolf.desktop $(DESTDIR)$(APPSDIR)/ mkdir -p $(DESTDIR)$(DOCDIR) cp -p $(DOCS) $(DESTDIR)$(DOCDIR)/ + mkdir -p $(DESTDIR)$(PREFIX)/share + cp -r icons $(DESTDIR)$(PREFIX)/share/ @printf '\nNote: An example AppArmor profile has been installed at '$(DOCDIR)/usr.bin.badwolf'\n' .PHONY: clean diff --git a/README.md b/README.md index 6ce8eef..98734e5 100644 --- a/README.md +++ b/README.md @@ -56,5 +56,7 @@ Dependencies are: Compilation is done with `make CC=${CC:-cc}`, install with `make install`. An example AppArmor profile is provided at `usr.bin.badwolf`, please do runtime checks before deploying. +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. + ## 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. diff --git a/badwolf.c b/badwolf.c index 75296e4..275b033 100644 --- a/badwolf.c +++ b/badwolf.c @@ -790,6 +790,7 @@ main(int argc, char *argv[]) gtk_window_set_default_size( GTK_WINDOW(window->main_window), BADWOLF_DEFAULT_WIDTH, BADWOLF_DEFAULT_HEIGHT); gtk_window_set_role(GTK_WINDOW(window->main_window), "browser"); + gtk_window_set_icon_name(GTK_WINDOW(window->main_window), "badwolf"); GtkCssProvider *css_provider_app = gtk_css_provider_new(); gchar *provider_path_app = g_build_filename(DATADIR, "interface.css", NULL); diff --git a/badwolf.svg b/badwolf.svg new file mode 100644 index 0000000..3635724 --- /dev/null +++ b/badwolf.svg @@ -0,0 +1,117 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/hicolor/128x128/apps/badwolf.png b/icons/hicolor/128x128/apps/badwolf.png new file mode 100644 index 0000000..e2cd289 Binary files /dev/null and b/icons/hicolor/128x128/apps/badwolf.png differ diff --git a/icons/hicolor/256x256/apps/badwolf.png b/icons/hicolor/256x256/apps/badwolf.png new file mode 100644 index 0000000..c391692 Binary files /dev/null and b/icons/hicolor/256x256/apps/badwolf.png differ diff --git a/icons/hicolor/48x48/apps/badwolf.png b/icons/hicolor/48x48/apps/badwolf.png new file mode 100644 index 0000000..0f3af2c Binary files /dev/null and b/icons/hicolor/48x48/apps/badwolf.png differ diff --git a/icons/hicolor/64x64/apps/badwolf.png b/icons/hicolor/64x64/apps/badwolf.png new file mode 100644 index 0000000..a54c7aa Binary files /dev/null and b/icons/hicolor/64x64/apps/badwolf.png differ diff --git a/icons/hicolor/scalable/apps/badwolf.svg b/icons/hicolor/scalable/apps/badwolf.svg new file mode 100644 index 0000000..cae9b3d --- /dev/null +++ b/icons/hicolor/scalable/apps/badwolf.svg @@ -0,0 +1,2 @@ + + diff --git a/icons_size.sh b/icons_size.sh new file mode 100755 index 0000000..29adf3a --- /dev/null +++ b/icons_size.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Transforms an icon size from the Icon Theme Specification to rsvg-convert(1) options +#sed -r -e 's;^([^x]*)x([^@]*)$;-w \1 -h \2;' -e 's;^([^x]*)x([^@]*)@(.*)$;-w \1 -h \2 -z \3;' +sed -r 's;^([^x]*)x([^@]*)$;-w \1 -h \2;' diff --git a/keybindings.c b/keybindings.c index e134fc4..b6806f3 100644 --- a/keybindings.c +++ b/keybindings.c @@ -46,6 +46,7 @@ badwolf_about_dialog(GtkWindow *main_window, gpointer user_data) gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_dialog), homepage); gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about_dialog), comments); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), version); + gtk_about_dialog_set_logo_icon_name(GTK_ABOUT_DIALOG(about_dialog), "badwolf"); g_signal_connect(about_dialog, "activate-link", G_CALLBACK(about_dialogCb_activate_link), window); -- cgit v1.3.1-23-gd82d From 76b542b1b833e6bd32fbc6980077ea4bc8b5a176 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 May 2020 00:08:42 +0200 Subject: README.md: Update make info, rewrite AppArmor part --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 98734e5..f502988 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Dependencies are: - A pkg-config implementation (pkgconf is recommended) - (optionnal) gettext implementation (such as GNU Gettext) -Compilation is done with `make CC=${CC:-cc}`, install with `make install`. An example AppArmor profile is provided at `usr.bin.badwolf`, please do runtime checks before deploying. +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. -- cgit v1.3.1-23-gd82d From 00e6ddaee5b24b98ce1082985ef48dc6f6f52319 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 May 2020 00:54:08 +0200 Subject: Downloads: Make it an hyperlink --- README.md | 2 +- badwolf.c | 2 +- downloads.c | 6 +++++- po/messages.pot | 28 ++++++++++++++-------------- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index f502988..22846e1 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Comparing from other small WebKit browsers for unixes found in the wild: - not queryabe by WebKit (so the web can't use it) - done in a standard format (like XBEL for bookmarks) - Static UI, no element should be added at runtime, this is to avoid potential tracking via viewport changes -- Small codebase, right now we are under 1 500 lines total +- Small codebase, should be possible to read and understand it completely over an afternoon. - Does not use modal editing (from vi) as that was designed for editing, not browsing - UTF-8 encoding by default diff --git a/badwolf.c b/badwolf.c index 84d2577..842a1e0 100644 --- a/badwolf.c +++ b/badwolf.c @@ -747,7 +747,7 @@ badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child) int main(int argc, char *argv[]) { - struct Window *window = &(struct Window){NULL, NULL, NULL}; + struct Window *window = &(struct Window){NULL, NULL, NULL, NULL}; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); bind_textdomain_codeset(PACKAGE, "UTF-8"); diff --git a/downloads.c b/downloads.c index 0c1ee3d..2443a3e 100644 --- a/downloads.c +++ b/downloads.c @@ -51,9 +51,13 @@ downloadCb_created_destination(WebKitDownload *webkit_download, gpointer user_data) { (void)webkit_download; + char *markup; struct Download *download = (struct Download *)user_data; - gtk_label_set_text(GTK_LABEL(download->file_path), destination); + markup = g_markup_printf_escaped("%s", destination, destination); + + gtk_label_set_markup(GTK_LABEL(download->file_path), markup); + g_free(markup); } gboolean diff --git a/po/messages.pot b/po/messages.pot index 360178f..ff7c89b 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+gb1ff239.download-progress\n" +"Project-Id-Version: Badwolf 0.5.1+g76b542b.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-01 00:20+0200\n" +"POT-Creation-Date: 2020-05-04 00:50+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,11 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: downloads.c:155 downloads.c:159 +#: downloads.c:159 downloads.c:163 msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:760 +#: badwolf.c:770 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" @@ -41,15 +41,15 @@ msgstr "" msgid "Crashed" msgstr "" -#: downloads.c:98 +#: downloads.c:102 msgid "Download cancelled" msgstr "" -#: downloads.c:100 +#: downloads.c:104 msgid "Download error" msgstr "" -#: downloads.c:118 +#: downloads.c:122 msgid "Download finished" msgstr "" @@ -92,11 +92,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:689 +#: badwolf.c:699 msgid "New tab" msgstr "" -#: badwolf.c:808 +#: badwolf.c:819 msgid "Open new tab" msgstr "" @@ -104,12 +104,12 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:758 +#: badwolf.c:768 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:765 +#: badwolf.c:775 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -131,7 +131,7 @@ msgstr "" msgid "Unknown Crash" msgstr "" -#: badwolf.c:615 +#: badwolf.c:625 msgid "search in current page" msgstr "" @@ -147,12 +147,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:772 +#: badwolf.c:782 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:842 +#: badwolf.c:853 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From cbd54fd0f204d02435a34464057ca6d1fb96d534 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 May 2020 00:54:40 +0200 Subject: po/fr.po: Update translation --- po/fr.po | 74 +++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/po/fr.po b/po/fr.po index da7c85c..214b382 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-03-31 05:48+0200\n" +"POT-Creation-Date: 2020-05-04 00:50+0200\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -17,16 +17,20 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:759 +#: downloads.c:159 downloads.c:163 +msgid "Badwolf Downloads" +msgstr "Téléchargements Badwolf" + +#: badwolf.c:770 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" -#: badwolf.c:384 +#: badwolf.c:387 msgid "Continue" msgstr "Continuer" -#: badwolf.c:334 +#: badwolf.c:337 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" @@ -37,37 +41,53 @@ msgstr "" "et son réseau.\n" "\n" -#: badwolf.c:95 +#: badwolf.c:94 msgid "Crashed" msgstr "Crash" -#: badwolf.c:357 +#: downloads.c:102 +msgid "Download cancelled" +msgstr "Téléchargement annulé" + +#: downloads.c:104 +msgid "Download error" +msgstr "Erreur du téléchargement" + +#: downloads.c:122 +msgid "Download finished" +msgstr "Téléchargement finit" + +#: downloads.c:28 +msgid "Download starting…" +msgstr "Démarrage du téléchargement" + +#: badwolf.c:360 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" "Erreur : Une erreur inconnue est apparue pendant la validation du " "certificat.\n" -#: badwolf.c:338 +#: badwolf.c:341 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erreur : L'autorité de certification (CA X509) est inconnue.\n" -#: badwolf.c:351 +#: badwolf.c:354 msgid "Error: The certificate has been revoked.\n" msgstr "Erreur : Le certificat à été révoqué.\n" -#: badwolf.c:348 +#: badwolf.c:351 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "Erreur : Le certificat a expiré.\n" -#: badwolf.c:354 +#: badwolf.c:357 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erreur : Le certificat est considéré comme non-sécurisé.\n" -#: badwolf.c:345 +#: badwolf.c:348 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "Erreur : Le certificat n'est pas encore valide.\n" -#: badwolf.c:341 +#: badwolf.c:344 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" @@ -80,67 +100,67 @@ msgstr "" "Navigateur WebKitGTK+ minimaliste et orienté vie privée\n" "Version WebKit au lancement: %d.%d.%d" -#: badwolf.c:688 +#: badwolf.c:699 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:781 +#: badwolf.c:819 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" -#: badwolf.c:99 +#: badwolf.c:98 msgid "Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:757 +#: badwolf.c:768 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:764 +#: badwolf.c:775 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" -#: badwolf.c:381 +#: badwolf.c:384 #, c-format msgid "TLS Error for %s." msgstr "Erreur TLS pour %s." -#: badwolf.c:384 +#: badwolf.c:387 msgid "Temporarly Add Exception" msgstr "Ajouter Temporairement une Exception" -#: badwolf.c:573 +#: badwolf.c:574 msgid "Toggle javascript" msgstr "Activer/Désactiver javascript" -#: badwolf.c:103 +#: badwolf.c:102 msgid "Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:614 +#: badwolf.c:625 msgid "search in current page" msgstr "recherche dans la page courante" -#: badwolf.c:94 +#: badwolf.c:93 msgid "the web process crashed.\n" msgstr "le processus web a cessé de fonctionner.\n" -#: badwolf.c:98 +#: badwolf.c:97 msgid "the web process exceeded the memory limit.\n" msgstr "le processus web a dépassé la limitation de mémoire.\n" -#: badwolf.c:102 +#: badwolf.c:101 msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:771 +#: badwolf.c:782 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Répertoire webkit-web-extension configuré à %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:810 +#: badwolf.c:853 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 3695453a9d0d9efaf808f84f08a682e884f75eae Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 May 2020 02:32:41 +0200 Subject: Downloads: show elapsed time --- downloads.c | 53 +++++++++++++++++++++++++++++++++++++++++++---------- po/fr.po | 54 +++++++++++++++++++++++++++++++----------------------- po/messages.pot | 56 ++++++++++++++++++++++++++++++++------------------------ 3 files changed, 106 insertions(+), 57 deletions(-) diff --git a/downloads.c b/downloads.c index 2443a3e..81a5dfc 100644 --- a/downloads.c +++ b/downloads.c @@ -18,6 +18,17 @@ download_stop_iconCb_clicked(GtkButton *stop_icon, gpointer user_data) webkit_download_cancel(webkit_download); } +void +download_format_elapsed(char *formatted, size_t formatted_size, char *format, int total) +{ + snprintf(formatted, + formatted_size, + format, + total / 3600, /* hours */ + (total % 3600) / 60, /* minutes */ + total % 60); /* seconds */ +} + void download_new_entry(WebKitDownload *webkit_download, struct Download *download) { @@ -30,6 +41,8 @@ download_new_entry(WebKitDownload *webkit_download, struct Download *download) gtk_image_new_from_icon_name("network-idle-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); 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); + g_signal_connect( download->stop_icon, "clicked", G_CALLBACK(download_stop_iconCb_clicked), webkit_download); @@ -54,7 +67,8 @@ downloadCb_created_destination(WebKitDownload *webkit_download, char *markup; struct Download *download = (struct Download *)user_data; - markup = g_markup_printf_escaped("%s", destination, destination); + markup = g_markup_printf_escaped( + "%s", destination, webkit_uri_for_display(destination)); gtk_label_set_markup(GTK_LABEL(download->file_path), markup); g_free(markup); @@ -92,16 +106,23 @@ downloadCb_decide_destination(WebKitDownload *webkit_download, void downloadCb_failed(WebKitDownload *webkit_download, GError *error, gpointer user_data) { - (void)webkit_download; - (void)error; struct Download *download = (struct Download *)user_data; + char formatted[BUFSIZ]; + int total = (int)webkit_download_get_elapsed_time(webkit_download); + char *format; download->error = error; if(g_error_matches(error, WEBKIT_DOWNLOAD_ERROR, WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER)) - gtk_label_set_text(GTK_LABEL(download->status), _("Download cancelled")); + format = _("%02i:%02i:%02i Download cancelled"); else - gtk_label_set_text(GTK_LABEL(download->status), _("Download error")); + format = _("%02i:%02i:%02i Download error"); + + download_format_elapsed(formatted, sizeof(formatted), format, total); + + gtk_label_set_text(GTK_LABEL(download->status), formatted); + + gtk_widget_destroy(download->stop_icon); gtk_image_set_from_icon_name( GTK_IMAGE(download->icon), "network-error-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); @@ -110,16 +131,22 @@ downloadCb_failed(WebKitDownload *webkit_download, GError *error, gpointer user_ void downloadCb_finished(WebKitDownload *webkit_download, gpointer user_data) { - (void)webkit_download; struct Download *download = (struct Download *)user_data; + char formatted[BUFSIZ]; + int total = (int)webkit_download_get_elapsed_time(webkit_download); + + gchar *format_size = g_format_size(webkit_download_get_received_data_length(webkit_download)); + + download_format_elapsed( + formatted, sizeof(formatted), _("%02i:%02i:%02i Download finished"), total); - // gtk_button_set_image(GTK_BUTTON(download->stop_icon), NULL); gtk_widget_destroy(download->stop_icon); if(download->error == 0) { gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(download->progress), 1); - gtk_label_set_text(GTK_LABEL(download->status), _("Download finished")); + gtk_progress_bar_set_text(GTK_PROGRESS_BAR(download->progress), format_size); + gtk_label_set_text(GTK_LABEL(download->status), formatted); gtk_image_set_from_icon_name( GTK_IMAGE(download->icon), "network-idle-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); } @@ -132,13 +159,19 @@ downloadCb_received_data(WebKitDownload *webkit_download, guint64 data_lenght, g { (void)data_lenght; struct Download *download = (struct Download *)user_data; - gchar *format_size = g_format_size(data_lenght); + char formatted[BUFSIZ]; + int total = (int)webkit_download_get_elapsed_time(webkit_download); + + gchar *format_size = g_format_size(webkit_download_get_received_data_length(webkit_download)); + + download_format_elapsed(formatted, sizeof(formatted), _("%02i:%02i:%02i Downloading…"), total); gtk_image_set_from_icon_name( GTK_IMAGE(download->icon), "network-receive-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_label_set_text(GTK_LABEL(download->status), format_size); + gtk_label_set_text(GTK_LABEL(download->status), formatted); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(download->progress), webkit_download_get_estimated_progress(webkit_download)); + gtk_progress_bar_set_text(GTK_PROGRESS_BAR(download->progress), format_size); g_free(format_size); } diff --git a/po/fr.po b/po/fr.po index 214b382..8164e1c 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-04 00:50+0200\n" +"POT-Creation-Date: 2020-05-04 02:40+0200\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -17,11 +17,31 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: downloads.c:159 downloads.c:163 +#: downloads.c:117 +#, fuzzy, c-format +msgid "%02i:%02i:%02i Download cancelled" +msgstr "%02i:%02i:%02i Téléchargement annulé" + +#: downloads.c:119 +#, fuzzy, c-format +msgid "%02i:%02i:%02i Download error" +msgstr "%02i:%02i:%02i Erreur du téléchargement" + +#: downloads.c:140 +#, fuzzy, c-format +msgid "%02i:%02i:%02i Download finished" +msgstr "%02i:%02i:%02i Téléchargement finit" + +#: downloads.c:166 +#, c-format +msgid "%02i:%02i:%02i Downloading…" +msgstr "%02i:%02i:%02i Téléchargement en cours…" + +#: downloads.c:191 downloads.c:195 msgid "Badwolf Downloads" msgstr "Téléchargements Badwolf" -#: badwolf.c:770 +#: badwolf.c:760 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" @@ -45,19 +65,7 @@ msgstr "" msgid "Crashed" msgstr "Crash" -#: downloads.c:102 -msgid "Download cancelled" -msgstr "Téléchargement annulé" - -#: downloads.c:104 -msgid "Download error" -msgstr "Erreur du téléchargement" - -#: downloads.c:122 -msgid "Download finished" -msgstr "Téléchargement finit" - -#: downloads.c:28 +#: downloads.c:39 msgid "Download starting…" msgstr "Démarrage du téléchargement" @@ -100,11 +108,11 @@ msgstr "" "Navigateur WebKitGTK+ minimaliste et orienté vie privée\n" "Version WebKit au lancement: %d.%d.%d" -#: badwolf.c:699 +#: badwolf.c:689 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:819 +#: badwolf.c:809 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" @@ -112,12 +120,12 @@ msgstr "Ouvrir un nouvel onglet" msgid "Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:768 +#: badwolf.c:758 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:775 +#: badwolf.c:765 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" @@ -139,7 +147,7 @@ msgstr "Activer/Désactiver javascript" msgid "Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:625 +#: badwolf.c:615 msgid "search in current page" msgstr "recherche dans la page courante" @@ -155,12 +163,12 @@ msgstr "le processus web a dépassé la limitation de mémoire.\n" msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:782 +#: badwolf.c:772 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Répertoire webkit-web-extension configuré à %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:853 +#: badwolf.c:843 msgid "ø" msgstr "" diff --git a/po/messages.pot b/po/messages.pot index ff7c89b..273280a 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g76b542b.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g73e576e.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-04 00:50+0200\n" +"POT-Creation-Date: 2020-05-04 02:40+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,11 +17,31 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: downloads.c:159 downloads.c:163 +#: downloads.c:117 +#, c-format +msgid "%02i:%02i:%02i Download cancelled" +msgstr "" + +#: downloads.c:119 +#, c-format +msgid "%02i:%02i:%02i Download error" +msgstr "" + +#: downloads.c:140 +#, c-format +msgid "%02i:%02i:%02i Download finished" +msgstr "" + +#: downloads.c:166 +#, c-format +msgid "%02i:%02i:%02i Downloading…" +msgstr "" + +#: downloads.c:191 downloads.c:195 msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:770 +#: badwolf.c:760 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" @@ -41,19 +61,7 @@ msgstr "" msgid "Crashed" msgstr "" -#: downloads.c:102 -msgid "Download cancelled" -msgstr "" - -#: downloads.c:104 -msgid "Download error" -msgstr "" - -#: downloads.c:122 -msgid "Download finished" -msgstr "" - -#: downloads.c:28 +#: downloads.c:39 msgid "Download starting…" msgstr "" @@ -92,11 +100,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:699 +#: badwolf.c:689 msgid "New tab" msgstr "" -#: badwolf.c:819 +#: badwolf.c:809 msgid "Open new tab" msgstr "" @@ -104,12 +112,12 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:768 +#: badwolf.c:758 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:775 +#: badwolf.c:765 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -131,7 +139,7 @@ msgstr "" msgid "Unknown Crash" msgstr "" -#: badwolf.c:625 +#: badwolf.c:615 msgid "search in current page" msgstr "" @@ -147,12 +155,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:782 +#: badwolf.c:772 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:853 +#: badwolf.c:843 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 657cacd378a1004627cf279f684663f281746916 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 May 2020 03:18:05 +0200 Subject: badwolf.desktop: Icon=badwolf --- badwolf.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badwolf.desktop b/badwolf.desktop index 2b0b21a..5bf865b 100644 --- a/badwolf.desktop +++ b/badwolf.desktop @@ -8,7 +8,7 @@ Comment[fr]=Un navigateur web minimaliste et orienté vers le respect de la vie Exec=badwolf %U GenericName=Web Browser GenericName[fr]=Navigateur Web -Icon=web-browser +Icon=badwolf Keywords=Internet;WWW;Browser;Web;WebKit;WebKitGTK Keywords[fr]=Internet;WWW;Browser;Web;Surfer;Navigateur;WebKit;WebKitGTK MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https -- cgit v1.3.1-23-gd82d From 07d0381569633d0391a7dc098f3b468cf29330c1 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 00:18:07 +0200 Subject: downloads: Make tab look & behave like a real tab --- downloads.c | 33 +++++++++++++++++++++++++++------ po/fr.po | 8 ++++---- po/messages.pot | 10 +++++----- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/downloads.c b/downloads.c index 81a5dfc..1a21ada 100644 --- a/downloads.c +++ b/downloads.c @@ -186,12 +186,33 @@ 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, FALSE); - GtkWidget *downloads_tab_label = - gtk_image_new_from_icon_name("emblem-downloads", GTK_ICON_SIZE_SMALL_TOOLBAR); - gtk_widget_set_tooltip_text(downloads_tab_label, _("Badwolf Downloads")); - gtk_notebook_set_tab_label( - GTK_NOTEBOOK(window->notebook), window->downloads_tab, downloads_tab_label); + gtk_notebook_set_tab_reorderable(GTK_NOTEBOOK(window->notebook), window->downloads_tab, TRUE); + + GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_widget_set_name(tab_box, "browser__tabbox"); + GtkWidget *icon = gtk_image_new_from_icon_name("emblem-downloads", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_widget_set_name(icon, "browser__tabbox__icon"); + GtkWidget *label = gtk_label_new(_("Badwolf Downloads")); + gtk_widget_set_name(label, "browser__tabbox__label"); + +#ifdef BADWOLF_TAB_BOX_WIDTH + gtk_widget_set_size_request(label, BADWOLF_TAB_BOX_WIDTH, -1); +#endif +#ifdef BADWOLF_TAB_LABEL_CHARWIDTH + gtk_label_set_width_chars(GTK_LABEL(label), BADWOLF_TAB_LABEL_CHARWIDTH); +#endif + gtk_widget_set_hexpand(tab_box, BADWOLF_TAB_HEXPAND); + + gtk_label_set_ellipsize(GTK_LABEL(label), BADWOLF_TAB_LABEL_ELLIPSIZE); + gtk_label_set_single_line_mode(GTK_LABEL(label), TRUE); + + gtk_box_pack_start(GTK_BOX(tab_box), icon, FALSE, FALSE, 0); + 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_menu_label_text( GTK_NOTEBOOK(window->notebook), window->downloads_tab, _("Badwolf Downloads")); + + gtk_widget_show_all(tab_box); } diff --git a/po/fr.po b/po/fr.po index 8164e1c..cc361e1 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-04 02:40+0200\n" +"POT-Creation-Date: 2020-05-11 00:19+0200\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -27,17 +27,17 @@ msgstr "%02i:%02i:%02i Téléchargement annulé" msgid "%02i:%02i:%02i Download error" msgstr "%02i:%02i:%02i Erreur du téléchargement" -#: downloads.c:140 +#: downloads.c:141 #, fuzzy, c-format msgid "%02i:%02i:%02i Download finished" msgstr "%02i:%02i:%02i Téléchargement finit" -#: downloads.c:166 +#: downloads.c:167 #, c-format msgid "%02i:%02i:%02i Downloading…" msgstr "%02i:%02i:%02i Téléchargement en cours…" -#: downloads.c:191 downloads.c:195 +#: downloads.c:195 downloads.c:212 downloads.c:215 msgid "Badwolf Downloads" msgstr "Téléchargements Badwolf" diff --git a/po/messages.pot b/po/messages.pot index 273280a..ce401ef 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g73e576e.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g226ed40.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-04 02:40+0200\n" +"POT-Creation-Date: 2020-05-11 00:19+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,17 +27,17 @@ msgstr "" msgid "%02i:%02i:%02i Download error" msgstr "" -#: downloads.c:140 +#: downloads.c:141 #, c-format msgid "%02i:%02i:%02i Download finished" msgstr "" -#: downloads.c:166 +#: downloads.c:167 #, c-format msgid "%02i:%02i:%02i Downloading…" msgstr "" -#: downloads.c:191 downloads.c:195 +#: downloads.c:195 downloads.c:212 downloads.c:215 msgid "Badwolf Downloads" msgstr "" -- cgit v1.3.1-23-gd82d From 50866af3a272a2f2138e72942f78df49a9290efa Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 01:28:57 +0200 Subject: badwolf.c: Put frames back on location & search entries --- badwolf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/badwolf.c b/badwolf.c index 842a1e0..0afb7ef 100644 --- a/badwolf.c +++ b/badwolf.c @@ -609,11 +609,9 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat gtk_label_set_ellipsize(GTK_LABEL(browser->statuslabel), BADWOLF_STATUSLABEL_ELLIPSIZE); gtk_entry_set_text(GTK_ENTRY(browser->location), target_url); - gtk_entry_set_has_frame(GTK_ENTRY(browser->location), FALSE); gtk_entry_set_input_purpose(GTK_ENTRY(browser->location), GTK_INPUT_PURPOSE_URL); gtk_entry_set_placeholder_text(GTK_ENTRY(browser->search), _("search in current page")); - gtk_entry_set_has_frame(GTK_ENTRY(browser->search), FALSE); /* signals for location entry widget */ g_signal_connect(browser->location, "activate", G_CALLBACK(locationCb_activate), browser); -- cgit v1.3.1-23-gd82d From 5da95c27a526d62de2d600d949ac4bf1f6179a9d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 01:31:54 +0200 Subject: Use a toggle-button+icon for js --- badwolf.c | 14 ++++++++------ badwolf.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/badwolf.c b/badwolf.c index 0afb7ef..00ae8d7 100644 --- a/badwolf.c +++ b/badwolf.c @@ -526,8 +526,10 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat gtk_widget_set_name(browser->toolbar, "browser__toolbar"); browser->location = gtk_entry_new(); gtk_widget_set_name(browser->location, "browser__location"); - browser->javascript = gtk_check_button_new(); + browser->javascript = gtk_toggle_button_new(); gtk_widget_set_name(browser->javascript, "browser__javascript"); + gtk_container_add(GTK_CONTAINER(browser->javascript), + gtk_image_new_from_icon_name("text-x-script", GTK_ICON_SIZE_LARGE_TOOLBAR)); browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->statusbar, "browser__statusbar"); @@ -573,16 +575,16 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat gtk_widget_set_tooltip_text(browser->javascript, _("Toggle javascript")); - gtk_box_pack_start(GTK_BOX(browser->toolbar), - GTK_WIDGET(browser->javascript), - FALSE, - FALSE, - BADWOLF_TOOLBAR_PADDING); gtk_box_pack_start(GTK_BOX(browser->toolbar), GTK_WIDGET(browser->location), TRUE, TRUE, BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + GTK_WIDGET(browser->javascript), + FALSE, + FALSE, + BADWOLF_TOOLBAR_PADDING); gtk_box_pack_start( GTK_BOX(browser->box), GTK_WIDGET(browser->toolbar), FALSE, FALSE, BADWOLF_BOX_PADDING); diff --git a/badwolf.h b/badwolf.h index 7ffe965..ad5e2d1 100644 --- a/badwolf.h +++ b/badwolf.h @@ -20,8 +20,8 @@ struct Client GtkWidget *box; GtkWidget *toolbar; - GtkWidget *javascript; GtkWidget *location; + GtkWidget *javascript; WebKitWebView *webView; struct Window *window; -- cgit v1.3.1-23-gd82d From cb774b19a095701674688a907698882490d6f21e Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 01:38:57 +0200 Subject: Allow toggling auto_load_images --- badwolf.c | 32 ++++++++++++++++++++++++++++++ badwolf.h | 1 + po/messages.pot | 60 ++++++++++++++++++++++++++++++--------------------------- 3 files changed, 65 insertions(+), 28 deletions(-) diff --git a/badwolf.c b/badwolf.c index 00ae8d7..f58d5ed 100644 --- a/badwolf.c +++ b/badwolf.c @@ -53,6 +53,7 @@ static void web_contextCb_download_started(WebKitWebContext *web_context, gpointer user_data); static gboolean locationCb_activate(GtkEntry *location, gpointer user_data); static gboolean javascriptCb_toggled(GtkButton *javascript, gpointer user_data); +static gboolean auto_load_imagesCb_toggled(GtkButton *auto_load_images, gpointer user_data); static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data); static gboolean SearchEntryCb_previous__match(GtkSearchEntry *search, gpointer user_data); static gboolean SearchEntryCb_search__changed(GtkSearchEntry *search, gpointer user_data); @@ -462,6 +463,21 @@ javascriptCb_toggled(GtkButton *javascript, gpointer user_data) return TRUE; } +static gboolean +auto_load_imagesCb_toggled(GtkButton *auto_load_images, gpointer user_data) +{ + struct Client *browser = (struct Client *)user_data; + + WebKitSettings *settings = webkit_web_view_get_settings(browser->webView); + + webkit_settings_set_auto_load_images( + settings, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(auto_load_images))); + + webkit_web_view_set_settings(browser->webView, settings); + + return TRUE; +} + static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data) { @@ -530,6 +546,10 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat gtk_widget_set_name(browser->javascript, "browser__javascript"); gtk_container_add(GTK_CONTAINER(browser->javascript), gtk_image_new_from_icon_name("text-x-script", GTK_ICON_SIZE_LARGE_TOOLBAR)); + browser->auto_load_images = gtk_toggle_button_new(); + gtk_widget_set_name(browser->auto_load_images, "browser__load_images"); + gtk_container_add(GTK_CONTAINER(browser->auto_load_images), + gtk_image_new_from_icon_name("image-x-generic", GTK_ICON_SIZE_LARGE_TOOLBAR)); browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->statusbar, "browser__statusbar"); @@ -562,6 +582,8 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(browser->javascript), webkit_settings_get_enable_javascript_markup(settings)); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(browser->auto_load_images), + webkit_settings_get_auto_load_images(settings)); browser->webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, "web-context", @@ -574,6 +596,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat gtk_widget_set_name(GTK_WIDGET(browser->webView), "browser__webView"); gtk_widget_set_tooltip_text(browser->javascript, _("Toggle javascript")); + gtk_widget_set_tooltip_text(browser->auto_load_images, _("Toggle loading images automatically")); gtk_box_pack_start(GTK_BOX(browser->toolbar), GTK_WIDGET(browser->location), @@ -585,6 +608,11 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat FALSE, FALSE, BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + GTK_WIDGET(browser->auto_load_images), + FALSE, + FALSE, + BADWOLF_TOOLBAR_PADDING); gtk_box_pack_start( GTK_BOX(browser->box), GTK_WIDGET(browser->toolbar), FALSE, FALSE, BADWOLF_BOX_PADDING); @@ -621,6 +649,10 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat /* signals for javacript toggle widget */ g_signal_connect(browser->javascript, "toggled", G_CALLBACK(javascriptCb_toggled), browser); + /* signals for auto_load_images toggle widget */ + g_signal_connect( + browser->auto_load_images, "toggled", G_CALLBACK(auto_load_imagesCb_toggled), browser); + /* signals for WebView widget */ g_signal_connect(browser->webView, "web-process-terminated", diff --git a/badwolf.h b/badwolf.h index ad5e2d1..13cf3fd 100644 --- a/badwolf.h +++ b/badwolf.h @@ -22,6 +22,7 @@ struct Client GtkWidget *toolbar; GtkWidget *location; GtkWidget *javascript; + GtkWidget *auto_load_images; WebKitWebView *webView; struct Window *window; diff --git a/po/messages.pot b/po/messages.pot index ce401ef..cf4a8f7 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g226ed40.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g5da95c2.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 00:19+0200\n" +"POT-Creation-Date: 2020-05-11 01:36+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,23 +41,23 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:760 +#: badwolf.c:792 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:387 +#: badwolf.c:388 msgid "Continue" msgstr "" -#: badwolf.c:337 +#: badwolf.c:338 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:94 +#: badwolf.c:95 msgid "Crashed" msgstr "" @@ -65,31 +65,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:360 +#: badwolf.c:361 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:341 +#: badwolf.c:342 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:354 +#: badwolf.c:355 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:351 +#: badwolf.c:352 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:357 +#: badwolf.c:358 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:348 +#: badwolf.c:349 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:344 +#: badwolf.c:345 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -100,67 +100,71 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:689 +#: badwolf.c:721 msgid "New tab" msgstr "" -#: badwolf.c:809 +#: badwolf.c:841 msgid "Open new tab" msgstr "" -#: badwolf.c:98 +#: badwolf.c:99 msgid "Out of Memory" msgstr "" -#: badwolf.c:758 +#: badwolf.c:790 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:765 +#: badwolf.c:797 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:384 +#: badwolf.c:385 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:387 +#: badwolf.c:388 msgid "Temporarly Add Exception" msgstr "" -#: badwolf.c:574 +#: badwolf.c:598 msgid "Toggle javascript" msgstr "" -#: badwolf.c:102 +#: badwolf.c:599 +msgid "Toggle loading images automatically" +msgstr "" + +#: badwolf.c:103 msgid "Unknown Crash" msgstr "" -#: badwolf.c:615 +#: badwolf.c:644 msgid "search in current page" msgstr "" -#: badwolf.c:93 +#: badwolf.c:94 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:97 +#: badwolf.c:98 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:101 +#: badwolf.c:102 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:772 +#: badwolf.c:804 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:843 +#: badwolf.c:875 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From fb3246adea4083f5d073cf8cd2d5e1ca5686ebe7 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 4 May 2020 04:41:57 +0200 Subject: Logo: increase stroke size and contrast --- Makefile | 6 +- badwolf.inkscape.svg | 164 ++++++++++++++++++++++++++++++++ badwolf.svg | 153 ++++++++++++++++------------- icons/hicolor/128x128/apps/badwolf.png | Bin 6551 -> 8682 bytes icons/hicolor/24x24/apps/badwolf.png | Bin 0 -> 1057 bytes icons/hicolor/256x256/apps/badwolf.png | Bin 14810 -> 20209 bytes icons/hicolor/32x32/apps/badwolf.png | Bin 0 -> 1525 bytes icons/hicolor/48x48/apps/badwolf.png | Bin 1958 -> 2581 bytes icons/hicolor/64x64/apps/badwolf.png | Bin 2847 -> 3715 bytes icons/hicolor/scalable/apps/badwolf.svg | 2 +- 10 files changed, 253 insertions(+), 72 deletions(-) create mode 100644 badwolf.inkscape.svg create mode 100644 icons/hicolor/24x24/apps/badwolf.png create mode 100644 icons/hicolor/32x32/apps/badwolf.png diff --git a/Makefile b/Makefile index cd09d11..18781bb 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,8 @@ DBG ?= PKGCONFIG ?= pkg-config MSGFMT ?= msgfmt -# for i in 48 64 128 256; do echo icons/hicolor/${i}x${i}/apps/badwolf.png; done | tr '\n' ' ' -ICON_SIZES = icons/hicolor/48x48/apps/badwolf.png icons/hicolor/64x64/apps/badwolf.png icons/hicolor/128x128/apps/badwolf.png icons/hicolor/256x256/apps/badwolf.png +# for i in 24 32 48 64 128 256; do echo icons/hicolor/${i}x${i}/apps/badwolf.png; done | tr '\n' ' ' +ICON_SIZES = icons/hicolor/24x24/apps/badwolf.png icons/hicolor/32x32/apps/badwolf.png icons/hicolor/48x48/apps/badwolf.png icons/hicolor/64x64/apps/badwolf.png icons/hicolor/128x128/apps/badwolf.png icons/hicolor/256x256/apps/badwolf.png DEPS = gtk+-3.0 webkit2gtk-4.0 libsoup-2.4 SRCS = uri.c uri_test.c keybindings.c downloads.c badwolf.c @@ -44,7 +44,7 @@ icons/hicolor/scalable/apps/badwolf.svg: badwolf.svg icons/hicolor/%/apps/badwolf.png: icons/hicolor/scalable/apps/badwolf.svg mkdir -p `dirname $@` - rsvg-convert -a `echo $@ | cut -d/ -f3 | ./icons_size.sh` $< -o $@ + inkscape `echo $@ | cut -d/ -f3 | ./icons_size.sh` $< -o $@ po/messages.pot: $(SRCS) xgettext --keyword=_ --language=C --from-code=UTF-8 -o $@ --add-comments --sort-output --copyright-holder="Badwolf Authors " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) diff --git a/badwolf.inkscape.svg b/badwolf.inkscape.svg new file mode 100644 index 0000000..de73138 --- /dev/null +++ b/badwolf.inkscape.svg @@ -0,0 +1,164 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/badwolf.svg b/badwolf.svg index 3635724..d2ff8e2 100644 --- a/badwolf.svg +++ b/badwolf.svg @@ -6,15 +6,11 @@ xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="64" - height="64" - version="1.1" - viewBox="0 0 16.93333 16.93333" id="svg17" - sodipodi:docname="badwolf.svg" - inkscape:version="1.0rc1 (09960d6f05, 2020-04-09)"> + viewBox="0 0 16.93333 16.93333" + version="1.1" + height="64" + width="64"> @@ -23,95 +19,116 @@ image/svg+xml - + - + + + + + + + + + x="0" + height="16.933333" + width="16.933333" + id="rect4" /> + stop-color="#139e7c" /> + stop-color="#122548" /> + gradientTransform="matrix(-2.612,0.05608289,-0.03812291,-1.775534,30.49128,-9.106413)" + r="8.4666672" + cy="-4.2398162" + cx="8.6972151" + id="b" /> + + + y2="11.681454" + x2="6.7958536" + y1="8.9934816" + x1="7.463346" + id="linearGradient874" + xlink:href="#linearGradient880" /> + clip-path="url(#clippy)" + id="g16"> + ry="0" + height="16.93333" + width="16.93333" /> + stroke="#47b79f" + d="m 21.86801,-1.9920238 a 13.40211,8.185254 0 0 1 -6.713234,7.092927 13.40211,8.185254 0 0 1 -13.41427,-0.012891 13.40211,8.185254 0 0 1 -6.676652,-7.105795 l 13.40204,0.025759 z" /> + stroke="url(#c)" + fill-rule="evenodd" + fill="#0f0805" + d="M 5.954321,19.118114 C 6.279375,16.458717 6.8910042,15.96845 5.7885535,13.873872 5.195892,12.824843 3.5059475,11.558594 2.6479315,10.539665 2.1673827,9.7904655 1.0434685,9.2171762 0.3615065,7.7493392 0.201822,6.7648665 2.5855305,8.9732112 3.2563495,8.9366162 3.5137348,8.6517205 1.6556185,6.7595682 1.8277525,6.0733512 1.97089,5.5027309 2.0400037,4.9353402 2.6089912,4.5036212 c 1.197317,-0.3311996 3.39131,2.812714 4.927271,3.260379 2.110609,-0.7248708 3.1742058,1.490123 4.8202378,1.830078 1.322712,0.1565739 3.207405,1.5936848 4.252409,2.9707628 -0.845016,0.590474 -3.044526,-0.706301 -4.410436,-0.108108 -0.538115,0.825242 1.099559,5.219231 1.386259,5.733128" /> diff --git a/icons/hicolor/128x128/apps/badwolf.png b/icons/hicolor/128x128/apps/badwolf.png index e2cd289..0fa27e1 100644 Binary files a/icons/hicolor/128x128/apps/badwolf.png and b/icons/hicolor/128x128/apps/badwolf.png differ diff --git a/icons/hicolor/24x24/apps/badwolf.png b/icons/hicolor/24x24/apps/badwolf.png new file mode 100644 index 0000000..9befcf3 Binary files /dev/null and b/icons/hicolor/24x24/apps/badwolf.png differ diff --git a/icons/hicolor/256x256/apps/badwolf.png b/icons/hicolor/256x256/apps/badwolf.png index c391692..f8e1f14 100644 Binary files a/icons/hicolor/256x256/apps/badwolf.png and b/icons/hicolor/256x256/apps/badwolf.png differ diff --git a/icons/hicolor/32x32/apps/badwolf.png b/icons/hicolor/32x32/apps/badwolf.png new file mode 100644 index 0000000..c88da40 Binary files /dev/null and b/icons/hicolor/32x32/apps/badwolf.png differ diff --git a/icons/hicolor/48x48/apps/badwolf.png b/icons/hicolor/48x48/apps/badwolf.png index 0f3af2c..8cd38e3 100644 Binary files a/icons/hicolor/48x48/apps/badwolf.png and b/icons/hicolor/48x48/apps/badwolf.png differ diff --git a/icons/hicolor/64x64/apps/badwolf.png b/icons/hicolor/64x64/apps/badwolf.png index a54c7aa..f15a58a 100644 Binary files a/icons/hicolor/64x64/apps/badwolf.png and b/icons/hicolor/64x64/apps/badwolf.png differ diff --git a/icons/hicolor/scalable/apps/badwolf.svg b/icons/hicolor/scalable/apps/badwolf.svg index cae9b3d..7d2500d 100644 --- a/icons/hicolor/scalable/apps/badwolf.svg +++ b/icons/hicolor/scalable/apps/badwolf.svg @@ -1,2 +1,2 @@ - + -- cgit v1.3.1-23-gd82d From 06b30dc68c6ab107ffea26ece270cd31c3ad9317 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 02:22:31 +0200 Subject: Use text in toggle buttons Thanks to neaunoire for the suggestion( https://merveilles.town/@neauoire/104146912977989993 ). --- badwolf.c | 10 ++++------ interface.css | 1 + po/messages.pot | 28 ++++++++++++++++------------ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/badwolf.c b/badwolf.c index f58d5ed..0fc6316 100644 --- a/badwolf.c +++ b/badwolf.c @@ -542,14 +542,12 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat gtk_widget_set_name(browser->toolbar, "browser__toolbar"); browser->location = gtk_entry_new(); gtk_widget_set_name(browser->location, "browser__location"); - browser->javascript = gtk_toggle_button_new(); + browser->javascript = gtk_toggle_button_new_with_label(_("JS")); gtk_widget_set_name(browser->javascript, "browser__javascript"); - gtk_container_add(GTK_CONTAINER(browser->javascript), - gtk_image_new_from_icon_name("text-x-script", GTK_ICON_SIZE_LARGE_TOOLBAR)); - browser->auto_load_images = gtk_toggle_button_new(); + gtk_button_set_relief(GTK_BUTTON(browser->javascript), GTK_RELIEF_NONE); + browser->auto_load_images = gtk_toggle_button_new_with_label("IMG"); gtk_widget_set_name(browser->auto_load_images, "browser__load_images"); - gtk_container_add(GTK_CONTAINER(browser->auto_load_images), - gtk_image_new_from_icon_name("image-x-generic", GTK_ICON_SIZE_LARGE_TOOLBAR)); + gtk_button_set_relief(GTK_BUTTON(browser->auto_load_images), GTK_RELIEF_NONE); browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->statusbar, "browser__statusbar"); diff --git a/interface.css b/interface.css index 2a22c9b..d7272bf 100644 --- a/interface.css +++ b/interface.css @@ -1 +1,2 @@ #browser__location, #browser__statuslabel { font-family: monospace; } +button:checked label { font-weight: bold; } diff --git a/po/messages.pot b/po/messages.pot index cf4a8f7..53f3d8e 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g5da95c2.develop\n" +"Project-Id-Version: Badwolf 0.5.1+gada0d15.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 01:36+0200\n" +"POT-Creation-Date: 2020-05-11 02:35+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:792 +#: badwolf.c:790 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" @@ -93,6 +93,10 @@ msgstr "" msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" +#: badwolf.c:545 +msgid "JS" +msgstr "" + #: keybindings.c:32 #, c-format msgid "" @@ -100,11 +104,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:721 +#: badwolf.c:719 msgid "New tab" msgstr "" -#: badwolf.c:841 +#: badwolf.c:839 msgid "Open new tab" msgstr "" @@ -112,12 +116,12 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:790 +#: badwolf.c:788 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:797 +#: badwolf.c:795 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -131,11 +135,11 @@ msgstr "" msgid "Temporarly Add Exception" msgstr "" -#: badwolf.c:598 +#: badwolf.c:596 msgid "Toggle javascript" msgstr "" -#: badwolf.c:599 +#: badwolf.c:597 msgid "Toggle loading images automatically" msgstr "" @@ -143,7 +147,7 @@ msgstr "" msgid "Unknown Crash" msgstr "" -#: badwolf.c:644 +#: badwolf.c:642 msgid "search in current page" msgstr "" @@ -159,12 +163,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:804 +#: badwolf.c:802 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:875 +#: badwolf.c:873 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 6a9289f9eb437a02d5b10f04ad70ff66f64fd045 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 02:47:25 +0200 Subject: Add IMG to gettext --- badwolf.c | 2 +- po/messages.pot | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/badwolf.c b/badwolf.c index 0fc6316..d03d735 100644 --- a/badwolf.c +++ b/badwolf.c @@ -545,7 +545,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat browser->javascript = gtk_toggle_button_new_with_label(_("JS")); gtk_widget_set_name(browser->javascript, "browser__javascript"); gtk_button_set_relief(GTK_BUTTON(browser->javascript), GTK_RELIEF_NONE); - browser->auto_load_images = gtk_toggle_button_new_with_label("IMG"); + browser->auto_load_images = gtk_toggle_button_new_with_label(_("IMG")); gtk_widget_set_name(browser->auto_load_images, "browser__load_images"); gtk_button_set_relief(GTK_BUTTON(browser->auto_load_images), GTK_RELIEF_NONE); diff --git a/po/messages.pot b/po/messages.pot index 53f3d8e..ea638ed 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+gada0d15.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g06b30dc.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 02:35+0200\n" +"POT-Creation-Date: 2020-05-11 02:47+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -93,6 +93,10 @@ msgstr "" msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" +#: badwolf.c:548 +msgid "IMG" +msgstr "" + #: badwolf.c:545 msgid "JS" msgstr "" -- cgit v1.3.1-23-gd82d From 6a06735ed8263107c224bf52397b217e5e9130f3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 03:05:20 +0200 Subject: Makefile: do not fail because of inkscape --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 18781bb..abad536 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ CFLAGS ?= -g -Wall -Wextra -Wconversion -Wsign-conversion -O2 DBG ?= PKGCONFIG ?= pkg-config MSGFMT ?= msgfmt +INKSCAPE ?= inkscape # for i in 24 32 48 64 128 256; do echo icons/hicolor/${i}x${i}/apps/badwolf.png; done | tr '\n' ' ' ICON_SIZES = icons/hicolor/24x24/apps/badwolf.png icons/hicolor/32x32/apps/badwolf.png icons/hicolor/48x48/apps/badwolf.png icons/hicolor/64x64/apps/badwolf.png icons/hicolor/128x128/apps/badwolf.png icons/hicolor/256x256/apps/badwolf.png @@ -44,7 +45,7 @@ icons/hicolor/scalable/apps/badwolf.svg: badwolf.svg icons/hicolor/%/apps/badwolf.png: icons/hicolor/scalable/apps/badwolf.svg mkdir -p `dirname $@` - inkscape `echo $@ | cut -d/ -f3 | ./icons_size.sh` $< -o $@ + $(INKSCAPE) `echo $@ | cut -d/ -f3 | ./icons_size.sh` $< -o $@ && : po/messages.pot: $(SRCS) xgettext --keyword=_ --language=C --from-code=UTF-8 -o $@ --add-comments --sort-output --copyright-holder="Badwolf Authors " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) -- cgit v1.3.1-23-gd82d From 1e5642adbb35dd225e1d9acb497d56fd6c51ff5f Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 03:10:17 +0200 Subject: Do not rebuild icons by default --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index abad536..4ddee8f 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,9 @@ CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=2008 CDEPS += `$(PKGCONFIG) --cflags $(DEPS)` LIBS = `$(PKGCONFIG) --libs $(DEPS)` -all: $(EXE) $(ICON_SIZES) $(TRANS) po/messages.pot +all: $(EXE) $(TRANS) po/messages.pot + +icons: $(ICON_SIZES) icons/hicolor/scalable/apps/badwolf.svg: badwolf.svg mkdir -p icons/hicolor/scalable/apps @@ -45,7 +47,7 @@ icons/hicolor/scalable/apps/badwolf.svg: badwolf.svg icons/hicolor/%/apps/badwolf.png: icons/hicolor/scalable/apps/badwolf.svg mkdir -p `dirname $@` - $(INKSCAPE) `echo $@ | cut -d/ -f3 | ./icons_size.sh` $< -o $@ && : + $(INKSCAPE) `echo $@ | cut -d/ -f3 | ./icons_size.sh` $< -o $@ po/messages.pot: $(SRCS) xgettext --keyword=_ --language=C --from-code=UTF-8 -o $@ --add-comments --sort-output --copyright-holder="Badwolf Authors " --package-name="$(PACKAGE)" --package-version="$(VERSION_FULL)" --msgid-bugs-address="contact+badwolf-msgid@hacktivis.me" $(SRCS) -- cgit v1.3.1-23-gd82d From 5ab0fb26069bba04612cb7b99baf6d47ea56b29d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 03:30:10 +0200 Subject: location bar at end of toolbar, still default focus --- badwolf.c | 13 ++++++++----- badwolf.h | 2 +- po/messages.pot | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/badwolf.c b/badwolf.c index d03d735..849d6aa 100644 --- a/badwolf.c +++ b/badwolf.c @@ -596,11 +596,6 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat gtk_widget_set_tooltip_text(browser->javascript, _("Toggle javascript")); gtk_widget_set_tooltip_text(browser->auto_load_images, _("Toggle loading images automatically")); - gtk_box_pack_start(GTK_BOX(browser->toolbar), - GTK_WIDGET(browser->location), - TRUE, - TRUE, - BADWOLF_TOOLBAR_PADDING); gtk_box_pack_start(GTK_BOX(browser->toolbar), GTK_WIDGET(browser->javascript), FALSE, @@ -611,6 +606,14 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat FALSE, FALSE, BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + GTK_WIDGET(browser->location), + TRUE, + TRUE, + BADWOLF_TOOLBAR_PADDING); + + gtk_container_set_focus_child(GTK_CONTAINER(browser->box), browser->toolbar); + gtk_container_set_focus_child(GTK_CONTAINER(browser->toolbar), browser->location); gtk_box_pack_start( GTK_BOX(browser->box), GTK_WIDGET(browser->toolbar), FALSE, FALSE, BADWOLF_BOX_PADDING); diff --git a/badwolf.h b/badwolf.h index 13cf3fd..21abac0 100644 --- a/badwolf.h +++ b/badwolf.h @@ -20,9 +20,9 @@ struct Client GtkWidget *box; GtkWidget *toolbar; - GtkWidget *location; GtkWidget *javascript; GtkWidget *auto_load_images; + GtkWidget *location; WebKitWebView *webView; struct Window *window; diff --git a/po/messages.pot b/po/messages.pot index ea638ed..9ad9a08 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g06b30dc.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g1e5642a.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 02:47+0200\n" +"POT-Creation-Date: 2020-05-11 03:28+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:790 +#: badwolf.c:793 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" @@ -108,11 +108,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:719 +#: badwolf.c:722 msgid "New tab" msgstr "" -#: badwolf.c:839 +#: badwolf.c:842 msgid "Open new tab" msgstr "" @@ -120,12 +120,12 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:788 +#: badwolf.c:791 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:795 +#: badwolf.c:798 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -151,7 +151,7 @@ msgstr "" msgid "Unknown Crash" msgstr "" -#: badwolf.c:642 +#: badwolf.c:645 msgid "search in current page" msgstr "" @@ -167,12 +167,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:802 +#: badwolf.c:805 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:873 +#: badwolf.c:876 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 1e28a08d0d719fae0797a184372937400f7926ee Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 03:53:00 +0200 Subject: keybindings: Esc stops loading --- badwolf.1 | 4 +++- keybindings.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/badwolf.1 b/badwolf.1 index 622faff..a72215e 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -35,7 +35,9 @@ Focuses on the search entry .It browser C-l Focuses on the location(URL) entry .It browser C-S-r / C-r, browser F5 -Reloads the current tab (with/without clearing cache) +Reloads the content in the current tab (with/without clearing cache) +.It browser Escape +Stops loading the content in the current tab .It browser F7 Toggles caret browsing. .It browser F12 diff --git a/keybindings.c b/keybindings.c index b6806f3..51aac26 100644 --- a/keybindings.c +++ b/keybindings.c @@ -136,6 +136,7 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client * switch(((GdkEventKey *)event)->keyval) { case GDK_KEY_F5: webkit_web_view_reload(browser->webView); return TRUE; + case GDK_KEY_Escape: webkit_web_view_stop_loading(browser->webView); return TRUE; case GDK_KEY_F7: toggle_caret_browsing(browser->webView); return TRUE; case GDK_KEY_F12: webkit_web_inspector_show(webkit_web_view_get_inspector(browser->webView)); -- cgit v1.3.1-23-gd82d From 372a6d6508e640121a58f6e83d81f1e8fae2ffde Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 04:35:04 +0200 Subject: Add back/forward buttons --- badwolf.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++------ badwolf.h | 2 ++ config.h | 3 +++ po/messages.pot | 62 +++++++++++++++++++++++++++--------------------------- 4 files changed, 95 insertions(+), 37 deletions(-) diff --git a/badwolf.c b/badwolf.c index 849d6aa..16970c0 100644 --- a/badwolf.c +++ b/badwolf.c @@ -54,6 +54,8 @@ static void web_contextCb_download_started(WebKitWebContext *web_context, static gboolean locationCb_activate(GtkEntry *location, gpointer user_data); static gboolean javascriptCb_toggled(GtkButton *javascript, gpointer user_data); static gboolean auto_load_imagesCb_toggled(GtkButton *auto_load_images, gpointer user_data); +static void backCb_clicked(GtkButton *back, gpointer user_data); +static void forwardCb_clicked(GtkButton *forward, gpointer user_data); static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data); static gboolean SearchEntryCb_previous__match(GtkSearchEntry *search, gpointer user_data); static gboolean SearchEntryCb_search__changed(GtkSearchEntry *search, gpointer user_data); @@ -478,6 +480,24 @@ auto_load_imagesCb_toggled(GtkButton *auto_load_images, gpointer user_data) return TRUE; } +static void +backCb_clicked(GtkButton *back, gpointer user_data) +{ + (void)back; + struct Client *browser = (struct Client *)user_data; + + webkit_web_view_go_back(browser->webView); +} + +static void +forwardCb_clicked(GtkButton *forward, gpointer user_data) +{ + (void)forward; + struct Client *browser = (struct Client *)user_data; + + webkit_web_view_go_forward(browser->webView); +} + static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data) { @@ -538,23 +558,39 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat browser->window = window; browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_widget_set_name(browser->box, "browser__box"); + + browser->toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->toolbar, "browser__toolbar"); - browser->location = gtk_entry_new(); - gtk_widget_set_name(browser->location, "browser__location"); + + browser->back = gtk_button_new_from_icon_name("go-previous-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR); + gtk_widget_set_name(browser->back, "browser__back"); + + browser->forward = gtk_button_new_from_icon_name("go-next-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_widget_set_name(browser->forward, "browser__forward"); + + GtkWidget *toolbar_separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL); + browser->javascript = gtk_toggle_button_new_with_label(_("JS")); gtk_widget_set_name(browser->javascript, "browser__javascript"); + gtk_widget_set_tooltip_text(browser->javascript, _("Toggle javascript")); gtk_button_set_relief(GTK_BUTTON(browser->javascript), GTK_RELIEF_NONE); + browser->auto_load_images = gtk_toggle_button_new_with_label(_("IMG")); gtk_widget_set_name(browser->auto_load_images, "browser__load_images"); + gtk_widget_set_tooltip_text(browser->auto_load_images, _("Toggle loading images automatically")); gtk_button_set_relief(GTK_BUTTON(browser->auto_load_images), GTK_RELIEF_NONE); + browser->location = gtk_entry_new(); + gtk_widget_set_name(browser->location, "browser__location"); + + browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->statusbar, "browser__statusbar"); - browser->statuslabel = gtk_label_new(NULL); - gtk_widget_set_name(browser->statuslabel, "browser__statuslabel"); browser->search = gtk_search_entry_new(); gtk_widget_set_name(browser->search, "browser__search"); + browser->statuslabel = gtk_label_new(NULL); + gtk_widget_set_name(browser->statuslabel, "browser__statuslabel"); setenv("GTK_THEME", ":light", 0); @@ -593,9 +629,22 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat NULL)); gtk_widget_set_name(GTK_WIDGET(browser->webView), "browser__webView"); - gtk_widget_set_tooltip_text(browser->javascript, _("Toggle javascript")); - gtk_widget_set_tooltip_text(browser->auto_load_images, _("Toggle loading images automatically")); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + GTK_WIDGET(browser->back), + FALSE, + FALSE, + BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + GTK_WIDGET(browser->forward), + FALSE, + FALSE, + BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + toolbar_separator, + FALSE, + FALSE, + BADWOLF_TOOLBAR_SEPARATOR_PADDING); gtk_box_pack_start(GTK_BOX(browser->toolbar), GTK_WIDGET(browser->javascript), FALSE, @@ -644,6 +693,10 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat gtk_entry_set_placeholder_text(GTK_ENTRY(browser->search), _("search in current page")); + /* signals for back/forward buttons */ + g_signal_connect(browser->back, "clicked", G_CALLBACK(backCb_clicked), browser); + g_signal_connect(browser->forward, "clicked", G_CALLBACK(forwardCb_clicked), browser); + /* signals for location entry widget */ g_signal_connect(browser->location, "activate", G_CALLBACK(locationCb_activate), browser); diff --git a/badwolf.h b/badwolf.h index 21abac0..66df46e 100644 --- a/badwolf.h +++ b/badwolf.h @@ -20,6 +20,8 @@ struct Client GtkWidget *box; GtkWidget *toolbar; + GtkWidget *back; + GtkWidget *forward; GtkWidget *javascript; GtkWidget *auto_load_images; GtkWidget *location; diff --git a/config.h b/config.h index ea728b5..d963cb6 100644 --- a/config.h +++ b/config.h @@ -39,6 +39,9 @@ // BADWOLF_TOOLBAR_PADDING: Amount of padding between toolbar elements #define BADWOLF_TOOLBAR_PADDING 0 +// BADWOLF_TOOLBAR_PADDING: Amount of padding between toolbar elements +#define BADWOLF_TOOLBAR_SEPARATOR_PADDING 4 + // BADWOLF_STATUSBAR_PADDING: Amount of padding between statusbar elements #define BADWOLF_STATUSBAR_PADDING 0 diff --git a/po/messages.pot b/po/messages.pot index 9ad9a08..8c93da9 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g1e5642a.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g1e28a08.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 03:28+0200\n" +"POT-Creation-Date: 2020-05-11 04:18+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,23 +41,23 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:793 +#: badwolf.c:846 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:388 +#: badwolf.c:390 msgid "Continue" msgstr "" -#: badwolf.c:338 +#: badwolf.c:340 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:95 +#: badwolf.c:97 msgid "Crashed" msgstr "" @@ -65,39 +65,39 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:361 +#: badwolf.c:363 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:342 +#: badwolf.c:344 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:355 +#: badwolf.c:357 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:352 +#: badwolf.c:354 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:358 +#: badwolf.c:360 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:349 +#: badwolf.c:351 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:345 +#: badwolf.c:347 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" -#: badwolf.c:548 +#: badwolf.c:579 msgid "IMG" msgstr "" -#: badwolf.c:545 +#: badwolf.c:574 msgid "JS" msgstr "" @@ -108,71 +108,71 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:722 +#: badwolf.c:775 msgid "New tab" msgstr "" -#: badwolf.c:842 +#: badwolf.c:895 msgid "Open new tab" msgstr "" -#: badwolf.c:99 +#: badwolf.c:101 msgid "Out of Memory" msgstr "" -#: badwolf.c:791 +#: badwolf.c:844 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:798 +#: badwolf.c:851 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:385 +#: badwolf.c:387 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:388 +#: badwolf.c:390 msgid "Temporarly Add Exception" msgstr "" -#: badwolf.c:596 +#: badwolf.c:576 msgid "Toggle javascript" msgstr "" -#: badwolf.c:597 +#: badwolf.c:581 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:103 +#: badwolf.c:105 msgid "Unknown Crash" msgstr "" -#: badwolf.c:645 +#: badwolf.c:694 msgid "search in current page" msgstr "" -#: badwolf.c:94 +#: badwolf.c:96 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:98 +#: badwolf.c:100 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:102 +#: badwolf.c:104 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:805 +#: badwolf.c:858 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:876 +#: badwolf.c:929 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 132f23976f1bb7a89140a1fe5a72fd9ee62ba2f9 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 05:01:59 +0200 Subject: interface.txt: Document the interface --- interface.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 interface.txt diff --git a/interface.txt b/interface.txt new file mode 100644 index 0000000..a8d524f --- /dev/null +++ b/interface.txt @@ -0,0 +1,41 @@ +# Badwolf +- A tablist with a new tab button at the end, right-clicking on the tablist gives you the list in a context-menu format +- Each tab contains a Browser View or the Downloads View + +## Tab Labels +- An icon to indicate if a media is playing +- The title of the web view +- A close button + +## Browser View + +The Browser View contains the following items: +- Toolbar +- WebKit WebView +- Status Bar + +### Toolbar +- Backward navigation button followed by a smaller forward navigation button +- Separator +- Javascript-markup toggler marked "JS" followed by an image-loading toggler marked "IMG" +- Potentially some future elements +- Location entry linked to the WebKit WebView, with integrated progress indication also linked to the WebKit WebView +- Potentially some future elements + +The element focused by default is the location entry. + +### Status bar +- Search entry linked to the WebKit WebView +- Potentially some future elements +- Label showing where the mouse is pointing +- Potentially some future elements + +## Downloads View + +The download view is a table contains the following items on each row corresponding to each download: +- Icon linked to the network status +- Progress bar, with integrated received-size indication +- (when downloading) Cancelling button +- Label about the current status +- Link to download destination +- Potentially some future elements -- cgit v1.3.1-23-gd82d From 50bd3815ddd9c7b705c586143817e2aec02f9dab Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 05:06:53 +0200 Subject: Makefile: DOCS+=interface.txt --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4ddee8f..8bb2511 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ OBJS_test = uri_test.o EXE = badwolf EXE_test = uri_test TRANS = fr.mo pt_BR.mo -DOCS = usr.bin.badwolf README.md KnowledgeBase.md +DOCS = usr.bin.badwolf README.md KnowledgeBase.md interface.txt CDEPS = -DDATADIR=\"$(DATADIR)\" -DPACKAGE=\"$(PACKAGE)\" -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION_FULL)\" CDEPS += `$(PKGCONFIG) --cflags $(DEPS)` -- cgit v1.3.1-23-gd82d From e2b9faa9ce66fd47a387f834f5a85582a4203086 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 05:08:06 +0200 Subject: po/fr.po: Update translations --- po/fr.po | 66 ++++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/po/fr.po b/po/fr.po index cc361e1..0fa9c63 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 00:19+0200\n" +"POT-Creation-Date: 2020-05-11 04:18+0200\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -41,16 +41,16 @@ msgstr "%02i:%02i:%02i Téléchargement en cours…" msgid "Badwolf Downloads" msgstr "Téléchargements Badwolf" -#: badwolf.c:760 +#: badwolf.c:846 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" -#: badwolf.c:387 +#: badwolf.c:390 msgid "Continue" msgstr "Continuer" -#: badwolf.c:337 +#: badwolf.c:340 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" @@ -61,7 +61,7 @@ msgstr "" "et son réseau.\n" "\n" -#: badwolf.c:94 +#: badwolf.c:97 msgid "Crashed" msgstr "Crash" @@ -69,36 +69,44 @@ msgstr "Crash" msgid "Download starting…" msgstr "Démarrage du téléchargement" -#: badwolf.c:360 +#: badwolf.c:363 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" "Erreur : Une erreur inconnue est apparue pendant la validation du " "certificat.\n" -#: badwolf.c:341 +#: badwolf.c:344 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erreur : L'autorité de certification (CA X509) est inconnue.\n" -#: badwolf.c:354 +#: badwolf.c:357 msgid "Error: The certificate has been revoked.\n" msgstr "Erreur : Le certificat à été révoqué.\n" -#: badwolf.c:351 +#: badwolf.c:354 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "Erreur : Le certificat a expiré.\n" -#: badwolf.c:357 +#: badwolf.c:360 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erreur : Le certificat est considéré comme non-sécurisé.\n" -#: badwolf.c:348 +#: badwolf.c:351 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "Erreur : Le certificat n'est pas encore valide.\n" -#: badwolf.c:344 +#: badwolf.c:347 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" +#: badwolf.c:579 +msgid "IMG" +msgstr "IMG" + +#: badwolf.c:574 +msgid "JS" +msgstr "JS" + #: keybindings.c:32 #, c-format msgid "" @@ -108,67 +116,71 @@ msgstr "" "Navigateur WebKitGTK+ minimaliste et orienté vie privée\n" "Version WebKit au lancement: %d.%d.%d" -#: badwolf.c:689 +#: badwolf.c:775 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:809 +#: badwolf.c:895 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" -#: badwolf.c:98 +#: badwolf.c:101 msgid "Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:758 +#: badwolf.c:844 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:765 +#: badwolf.c:851 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" -#: badwolf.c:384 +#: badwolf.c:387 #, c-format msgid "TLS Error for %s." msgstr "Erreur TLS pour %s." -#: badwolf.c:387 +#: badwolf.c:390 msgid "Temporarly Add Exception" msgstr "Ajouter Temporairement une Exception" -#: badwolf.c:574 +#: badwolf.c:576 msgid "Toggle javascript" msgstr "Activer/Désactiver javascript" -#: badwolf.c:102 +#: badwolf.c:581 +msgid "Toggle loading images automatically" +msgstr "Chargement des images automatiquement" + +#: badwolf.c:105 msgid "Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:615 +#: badwolf.c:694 msgid "search in current page" msgstr "recherche dans la page courante" -#: badwolf.c:93 +#: badwolf.c:96 msgid "the web process crashed.\n" msgstr "le processus web a cessé de fonctionner.\n" -#: badwolf.c:97 +#: badwolf.c:100 msgid "the web process exceeded the memory limit.\n" msgstr "le processus web a dépassé la limitation de mémoire.\n" -#: badwolf.c:101 +#: badwolf.c:104 msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:772 +#: badwolf.c:858 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Répertoire webkit-web-extension configuré à %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:843 +#: badwolf.c:929 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 871b245a7b498734d0246ae5c03897787cc428e2 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 08:26:39 +0200 Subject: Fix typo on Temporarily --- badwolf.c | 2 +- po/fr.po | 7 +++-- po/messages.pot | 6 ++-- po/pt_BR.po | 97 ++++++++++++++++++++++++++++++++++++++++----------------- 4 files changed, 77 insertions(+), 35 deletions(-) diff --git a/badwolf.c b/badwolf.c index 16970c0..610b696 100644 --- a/badwolf.c +++ b/badwolf.c @@ -387,7 +387,7 @@ WebViewCb_load_failed_with_tls_errors(WebKitWebView *web_view, _("TLS Error for %s."), failing_text); gtk_dialog_add_buttons( - GTK_DIALOG(dialog), _("Temporarly Add Exception"), 1, _("Continue"), 0, NULL); + GTK_DIALOG(dialog), _("Temporarily Add Exception"), 1, _("Continue"), 0, NULL); gtk_dialog_set_default_response(GTK_DIALOG(dialog), 0); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), "%s\n", error_details); diff --git a/po/fr.po b/po/fr.po index 0fa9c63..df9552a 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 04:18+0200\n" +"POT-Creation-Date: 2020-05-11 08:29+0200\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -144,7 +144,8 @@ msgid "TLS Error for %s." msgstr "Erreur TLS pour %s." #: badwolf.c:390 -msgid "Temporarly Add Exception" +#, fuzzy +msgid "Temporarily Add Exception" msgstr "Ajouter Temporairement une Exception" #: badwolf.c:576 @@ -153,7 +154,7 @@ msgstr "Activer/Désactiver javascript" #: badwolf.c:581 msgid "Toggle loading images automatically" -msgstr "Chargement des images automatiquement" +msgstr "" #: badwolf.c:105 msgid "Unknown Crash" diff --git a/po/messages.pot b/po/messages.pot index 8c93da9..df7e4a6 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g1e28a08.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g0a6037d.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 04:18+0200\n" +"POT-Creation-Date: 2020-05-11 08:30+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -136,7 +136,7 @@ msgid "TLS Error for %s." msgstr "" #: badwolf.c:390 -msgid "Temporarly Add Exception" +msgid "Temporarily Add Exception" msgstr "" #: badwolf.c:576 diff --git a/po/pt_BR.po b/po/pt_BR.po index d05d459..709c77e 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.4.0+g607300e\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-03-31 05:48+0200\n" +"POT-Creation-Date: 2020-05-11 08:30+0200\n" "PO-Revision-Date: 2020-01-20 22:17-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" @@ -16,16 +16,40 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: badwolf.c:759 +#: downloads.c:117 +#, c-format +msgid "%02i:%02i:%02i Download cancelled" +msgstr "" + +#: downloads.c:119 +#, c-format +msgid "%02i:%02i:%02i Download error" +msgstr "" + +#: downloads.c:141 +#, c-format +msgid "%02i:%02i:%02i Download finished" +msgstr "" + +#: downloads.c:167 +#, c-format +msgid "%02i:%02i:%02i Downloading…" +msgstr "" + +#: downloads.c:195 downloads.c:212 downloads.c:215 +msgid "Badwolf Downloads" +msgstr "" + +#: badwolf.c:846 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit %d.%d.%d\n" -#: badwolf.c:384 +#: badwolf.c:390 msgid "Continue" msgstr "Continuar" -#: badwolf.c:334 +#: badwolf.c:340 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" @@ -35,42 +59,54 @@ msgstr "" "segurança da conexão. Talvez você deva verificar a sua máquina e rede.\n" "\n" -#: badwolf.c:95 +#: badwolf.c:97 #, fuzzy msgid "Crashed" msgstr "Erro" -#: badwolf.c:357 +#: downloads.c:39 +msgid "Download starting…" +msgstr "" + +#: badwolf.c:363 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" "Erro: Algum erro desconhecido ocorreu enquanto validava o certificado.\n" -#: badwolf.c:338 +#: badwolf.c:344 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erro: A Autoridade de Certificados X509 é desconhecida.\n" -#: badwolf.c:351 +#: badwolf.c:357 msgid "Error: The certificate has been revoked.\n" msgstr "Erro: O certificado foi revogado.\n" -#: badwolf.c:348 +#: badwolf.c:354 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" "Erro: O certificado foi expirado. Verifique o relógio do seu sistema.\n" -#: badwolf.c:354 +#: badwolf.c:360 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erro: O certificado é considerado inseguro.\n" -#: badwolf.c:345 +#: badwolf.c:351 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" "Erro: O certificado não é válido ainda. Verifique o relógio do seu sistema.\n" -#: badwolf.c:341 +#: badwolf.c:347 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erro: A identidade não confere com a esperada.\n" +#: badwolf.c:579 +msgid "IMG" +msgstr "" + +#: badwolf.c:574 +msgid "JS" +msgstr "" + #: keybindings.c:32 #, fuzzy, c-format msgid "" @@ -78,69 +114,74 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "Navegador orientado pela privacidade e minimalismo" -#: badwolf.c:688 +#: badwolf.c:775 msgid "New tab" msgstr "Nova aba" -#: badwolf.c:781 +#: badwolf.c:895 msgid "Open new tab" msgstr "Abrir uma Nova aba" -#: badwolf.c:99 +#: badwolf.c:101 #, fuzzy msgid "Out of Memory" msgstr "Sem memória" -#: badwolf.c:757 +#: badwolf.c:844 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Rodando versão %s do Badwolf\n" -#: badwolf.c:764 +#: badwolf.c:851 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit: %d.%d.%d\n" -#: badwolf.c:381 +#: badwolf.c:387 #, c-format msgid "TLS Error for %s." msgstr "Erro TLS para %s." -#: badwolf.c:384 -msgid "Temporarly Add Exception" +#: badwolf.c:390 +#, fuzzy +msgid "Temporarily Add Exception" msgstr "Temporáriamente adicionar exceção" -#: badwolf.c:573 +#: badwolf.c:576 msgid "Toggle javascript" msgstr "Habilitar Javascript" -#: badwolf.c:103 +#: badwolf.c:581 +msgid "Toggle loading images automatically" +msgstr "" + +#: badwolf.c:105 #, fuzzy msgid "Unknown Crash" msgstr "Erro desconhecido" -#: badwolf.c:614 +#: badwolf.c:694 msgid "search in current page" msgstr "buscar na página atual" -#: badwolf.c:94 +#: badwolf.c:96 msgid "the web process crashed.\n" msgstr "o processo web travou.\n" -#: badwolf.c:98 +#: badwolf.c:100 msgid "the web process exceeded the memory limit.\n" msgstr "o processo web excedeu o limite de memória.\n" -#: badwolf.c:102 +#: badwolf.c:104 msgid "the web process terminated for an unknown reason.\n" msgstr "o processo web terminou por uma razão desconhecida.\n" -#: badwolf.c:771 +#: badwolf.c:858 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "diretório de extensões configurado para: %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:810 +#: badwolf.c:929 msgid "ø" msgstr "ø" -- cgit v1.3.1-23-gd82d From 80751fafa0b2600e17c8d880f267d8afd36c9108 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 11 May 2020 09:35:13 +0200 Subject: Add print button --- badwolf.c | 24 ++++++++++++++++++++++++ interface.txt | 2 ++ 2 files changed, 26 insertions(+) diff --git a/badwolf.c b/badwolf.c index 610b696..a94c56d 100644 --- a/badwolf.c +++ b/badwolf.c @@ -56,6 +56,7 @@ static gboolean javascriptCb_toggled(GtkButton *javascript, gpointer user_data); static gboolean auto_load_imagesCb_toggled(GtkButton *auto_load_images, gpointer user_data); static void backCb_clicked(GtkButton *back, gpointer user_data); static void forwardCb_clicked(GtkButton *forward, gpointer user_data); +static void printCb_clicked(GtkButton *forward, gpointer user_data); static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data); static gboolean SearchEntryCb_previous__match(GtkSearchEntry *search, gpointer user_data); static gboolean SearchEntryCb_search__changed(GtkSearchEntry *search, gpointer user_data); @@ -498,6 +499,18 @@ forwardCb_clicked(GtkButton *forward, gpointer user_data) webkit_web_view_go_forward(browser->webView); } +static void +printCb_clicked(GtkButton *print, gpointer user_data) +{ + (void)print; + struct Client *browser = (struct Client *)user_data; + + WebKitPrintOperation *print_operation = webkit_print_operation_new(browser->webView); + + webkit_print_operation_run_dialog(print_operation, GTK_WINDOW(browser->window)); +} + + static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data) { @@ -584,6 +597,9 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat browser->location = gtk_entry_new(); gtk_widget_set_name(browser->location, "browser__location"); + GtkWidget *print = gtk_button_new_from_icon_name("document-print-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_widget_set_name(browser->back, "browser__print"); + browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->statusbar, "browser__statusbar"); @@ -660,6 +676,11 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat TRUE, TRUE, BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), + print, + FALSE, + FALSE, + BADWOLF_TOOLBAR_PADDING); gtk_container_set_focus_child(GTK_CONTAINER(browser->box), browser->toolbar); gtk_container_set_focus_child(GTK_CONTAINER(browser->toolbar), browser->location); @@ -707,6 +728,9 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat g_signal_connect( browser->auto_load_images, "toggled", G_CALLBACK(auto_load_imagesCb_toggled), browser); + /* signals for print button */ + g_signal_connect(print, "clicked", G_CALLBACK(printCb_clicked), browser); + /* signals for WebView widget */ g_signal_connect(browser->webView, "web-process-terminated", diff --git a/interface.txt b/interface.txt index a8d524f..76d9526 100644 --- a/interface.txt +++ b/interface.txt @@ -21,6 +21,8 @@ The Browser View contains the following items: - Potentially some future elements - Location entry linked to the WebKit WebView, with integrated progress indication also linked to the WebKit WebView - Potentially some future elements +- Print button +- Potentially some future elements The element focused by default is the location entry. -- cgit v1.3.1-23-gd82d From 1d1a739cb869a73391759d8d7653b337c8ee8d01 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 12 May 2020 07:10:49 +0200 Subject: Add Ctrl-p keybinding --- badwolf.c | 11 +++-------- keybindings.c | 4 ++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/badwolf.c b/badwolf.c index a94c56d..3a6085e 100644 --- a/badwolf.c +++ b/badwolf.c @@ -510,7 +510,6 @@ printCb_clicked(GtkButton *print, gpointer user_data) webkit_print_operation_run_dialog(print_operation, GTK_WINDOW(browser->window)); } - static gboolean SearchEntryCb_next__match(GtkSearchEntry *search, gpointer user_data) { @@ -597,10 +596,10 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat browser->location = gtk_entry_new(); gtk_widget_set_name(browser->location, "browser__location"); - GtkWidget *print = gtk_button_new_from_icon_name("document-print-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + GtkWidget *print = + gtk_button_new_from_icon_name("document-print-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_widget_set_name(browser->back, "browser__print"); - browser->statusbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->statusbar, "browser__statusbar"); browser->search = gtk_search_entry_new(); @@ -676,11 +675,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat TRUE, TRUE, BADWOLF_TOOLBAR_PADDING); - gtk_box_pack_start(GTK_BOX(browser->toolbar), - print, - FALSE, - FALSE, - BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start(GTK_BOX(browser->toolbar), print, FALSE, FALSE, BADWOLF_TOOLBAR_PADDING); gtk_container_set_focus_child(GTK_CONTAINER(browser->box), browser->toolbar); gtk_container_set_focus_child(GTK_CONTAINER(browser->toolbar), browser->location); diff --git a/keybindings.c b/keybindings.c index 51aac26..75860ed 100644 --- a/keybindings.c +++ b/keybindings.c @@ -100,6 +100,10 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client * case GDK_KEY_0: webkit_web_view_set_zoom_level(WEBKIT_WEB_VIEW(browser->webView), 1); return TRUE; + case GDK_KEY_p: + webkit_print_operation_run_dialog(webkit_print_operation_new(browser->webView), + GTK_WINDOW(browser->window)); + return TRUE; } } else -- cgit v1.3.1-23-gd82d From 5608fd85c5b633693bdd6f1761cd3a5c8b95afb3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 12 May 2020 07:11:06 +0200 Subject: formatting --- badwolf.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/badwolf.c b/badwolf.c index 3a6085e..65a2816 100644 --- a/badwolf.c +++ b/badwolf.c @@ -571,11 +571,11 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat browser->box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_widget_set_name(browser->box, "browser__box"); - browser->toolbar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(browser->toolbar, "browser__toolbar"); - browser->back = gtk_button_new_from_icon_name("go-previous-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR); + browser->back = + gtk_button_new_from_icon_name("go-previous-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR); gtk_widget_set_name(browser->back, "browser__back"); browser->forward = gtk_button_new_from_icon_name("go-next-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); @@ -644,12 +644,8 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat NULL)); gtk_widget_set_name(GTK_WIDGET(browser->webView), "browser__webView"); - - gtk_box_pack_start(GTK_BOX(browser->toolbar), - GTK_WIDGET(browser->back), - FALSE, - FALSE, - BADWOLF_TOOLBAR_PADDING); + gtk_box_pack_start( + GTK_BOX(browser->toolbar), GTK_WIDGET(browser->back), FALSE, FALSE, BADWOLF_TOOLBAR_PADDING); gtk_box_pack_start(GTK_BOX(browser->toolbar), GTK_WIDGET(browser->forward), FALSE, -- cgit v1.3.1-23-gd82d From a51378143e420e0fa391ab37b01f319a1f464853 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Tue, 12 May 2020 07:15:44 +0200 Subject: badwolf.1: document ctrl-p --- badwolf.1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/badwolf.1 b/badwolf.1 index a72215e..d25674b 100644 --- a/badwolf.1 +++ b/badwolf.1 @@ -44,6 +44,8 @@ Toggles caret browsing. Opens the web inspector. .It browser C-[ / C-] Go back/forward in current tab’s history +.It browser C-p +Print the current page. (spawns a dialog) .It any A-Left / A-Right Go to the previous/next tab .It any F1 -- cgit v1.3.1-23-gd82d From 10008e9331cb2c77b874bfd51c1159c89f23385d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 15 May 2020 02:06:55 +0200 Subject: badwolf: Make close button larger --- badwolf.c | 2 +- po/messages.pot | 62 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/badwolf.c b/badwolf.c index 65a2816..795cfb2 100644 --- a/badwolf.c +++ b/badwolf.c @@ -136,7 +136,7 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(tab_box, "browser__tabbox"); GtkWidget *close = - gtk_button_new_from_icon_name("window-close-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR); + gtk_button_new_from_icon_name("window-close-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR); gtk_widget_set_name(close, "browser__tabbox__close"); GtkWidget *label = gtk_label_new(title); gtk_widget_set_name(label, "browser__tabbox__label"); diff --git a/po/messages.pot b/po/messages.pot index df7e4a6..80ef3b6 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g0a6037d.develop\n" +"Project-Id-Version: Badwolf 0.5.1+ga513781.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 08:30+0200\n" +"POT-Creation-Date: 2020-05-15 01:49+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,23 +41,23 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:846 +#: badwolf.c:861 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:390 +#: badwolf.c:391 msgid "Continue" msgstr "" -#: badwolf.c:340 +#: badwolf.c:341 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:97 +#: badwolf.c:98 msgid "Crashed" msgstr "" @@ -65,39 +65,39 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:363 +#: badwolf.c:364 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:344 +#: badwolf.c:345 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:357 +#: badwolf.c:358 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:354 +#: badwolf.c:355 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:360 +#: badwolf.c:361 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:351 +#: badwolf.c:352 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:347 +#: badwolf.c:348 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" -#: badwolf.c:579 +#: badwolf.c:591 msgid "IMG" msgstr "" -#: badwolf.c:574 +#: badwolf.c:586 msgid "JS" msgstr "" @@ -108,71 +108,71 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:775 +#: badwolf.c:790 msgid "New tab" msgstr "" -#: badwolf.c:895 +#: badwolf.c:910 msgid "Open new tab" msgstr "" -#: badwolf.c:101 +#: badwolf.c:102 msgid "Out of Memory" msgstr "" -#: badwolf.c:844 +#: badwolf.c:859 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:851 +#: badwolf.c:866 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:387 +#: badwolf.c:388 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:390 +#: badwolf.c:391 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:576 +#: badwolf.c:588 msgid "Toggle javascript" msgstr "" -#: badwolf.c:581 +#: badwolf.c:593 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:105 +#: badwolf.c:106 msgid "Unknown Crash" msgstr "" -#: badwolf.c:694 +#: badwolf.c:706 msgid "search in current page" msgstr "" -#: badwolf.c:96 +#: badwolf.c:97 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:100 +#: badwolf.c:101 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:104 +#: badwolf.c:105 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:858 +#: badwolf.c:873 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:929 +#: badwolf.c:944 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From ebf0355bf2cd55b966a45171b140bb4b0a43a691 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 15 May 2020 06:04:39 +0200 Subject: Use mnemonic for javascript and auto_load_images --- badwolf.c | 4 ++-- po/fr.po | 72 ++++++++++++++++++++++++++++----------------------------- po/messages.pot | 20 ++++++++-------- po/pt_BR.po | 72 ++++++++++++++++++++++++++++----------------------------- 4 files changed, 84 insertions(+), 84 deletions(-) diff --git a/badwolf.c b/badwolf.c index 795cfb2..29553e1 100644 --- a/badwolf.c +++ b/badwolf.c @@ -583,12 +583,12 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat GtkWidget *toolbar_separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL); - browser->javascript = gtk_toggle_button_new_with_label(_("JS")); + browser->javascript = gtk_toggle_button_new_with_mnemonic(_("_JS")); gtk_widget_set_name(browser->javascript, "browser__javascript"); gtk_widget_set_tooltip_text(browser->javascript, _("Toggle javascript")); gtk_button_set_relief(GTK_BUTTON(browser->javascript), GTK_RELIEF_NONE); - browser->auto_load_images = gtk_toggle_button_new_with_label(_("IMG")); + browser->auto_load_images = gtk_toggle_button_new_with_mnemonic(_("_IMG")); gtk_widget_set_name(browser->auto_load_images, "browser__load_images"); gtk_widget_set_tooltip_text(browser->auto_load_images, _("Toggle loading images automatically")); gtk_button_set_relief(GTK_BUTTON(browser->auto_load_images), GTK_RELIEF_NONE); diff --git a/po/fr.po b/po/fr.po index df9552a..d41f044 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.3.0+gd88f2e7\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 08:29+0200\n" +"POT-Creation-Date: 2020-05-15 06:00+0200\n" "PO-Revision-Date: 2019-12-22 00:57+0100\n" "Last-Translator: Haelwenn (lanodan) Monnier \n" "Language-Team: French\n" @@ -41,16 +41,16 @@ msgstr "%02i:%02i:%02i Téléchargement en cours…" msgid "Badwolf Downloads" msgstr "Téléchargements Badwolf" -#: badwolf.c:846 +#: badwolf.c:861 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit à la compilation: %d.%d.%d\n" -#: badwolf.c:390 +#: badwolf.c:391 msgid "Continue" msgstr "Continuer" -#: badwolf.c:340 +#: badwolf.c:341 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" @@ -61,7 +61,7 @@ msgstr "" "et son réseau.\n" "\n" -#: badwolf.c:97 +#: badwolf.c:98 msgid "Crashed" msgstr "Crash" @@ -69,44 +69,36 @@ msgstr "Crash" msgid "Download starting…" msgstr "Démarrage du téléchargement" -#: badwolf.c:363 +#: badwolf.c:364 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" "Erreur : Une erreur inconnue est apparue pendant la validation du " "certificat.\n" -#: badwolf.c:344 +#: badwolf.c:345 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erreur : L'autorité de certification (CA X509) est inconnue.\n" -#: badwolf.c:357 +#: badwolf.c:358 msgid "Error: The certificate has been revoked.\n" msgstr "Erreur : Le certificat à été révoqué.\n" -#: badwolf.c:354 +#: badwolf.c:355 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "Erreur : Le certificat a expiré.\n" -#: badwolf.c:360 +#: badwolf.c:361 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erreur : Le certificat est considéré comme non-sécurisé.\n" -#: badwolf.c:351 +#: badwolf.c:352 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "Erreur : Le certificat n'est pas encore valide.\n" -#: badwolf.c:347 +#: badwolf.c:348 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erreur : L'identité ne correspond pas à celle attendue.\n" -#: badwolf.c:579 -msgid "IMG" -msgstr "IMG" - -#: badwolf.c:574 -msgid "JS" -msgstr "JS" - #: keybindings.c:32 #, c-format msgid "" @@ -116,72 +108,80 @@ msgstr "" "Navigateur WebKitGTK+ minimaliste et orienté vie privée\n" "Version WebKit au lancement: %d.%d.%d" -#: badwolf.c:775 +#: badwolf.c:790 msgid "New tab" msgstr "Nouvel onglet" -#: badwolf.c:895 +#: badwolf.c:910 msgid "Open new tab" msgstr "Ouvrir un nouvel onglet" -#: badwolf.c:101 +#: badwolf.c:102 msgid "Out of Memory" msgstr "Dépassement Mémoire" -#: badwolf.c:844 +#: badwolf.c:859 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Version de Badwolf: %s\n" -#: badwolf.c:851 +#: badwolf.c:866 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Version WebKit au lancement: %d.%d.%d\n" -#: badwolf.c:387 +#: badwolf.c:388 #, c-format msgid "TLS Error for %s." msgstr "Erreur TLS pour %s." -#: badwolf.c:390 +#: badwolf.c:391 #, fuzzy msgid "Temporarily Add Exception" msgstr "Ajouter Temporairement une Exception" -#: badwolf.c:576 +#: badwolf.c:588 msgid "Toggle javascript" msgstr "Activer/Désactiver javascript" -#: badwolf.c:581 +#: badwolf.c:593 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:105 +#: badwolf.c:106 msgid "Unknown Crash" msgstr "Crash inconnu" -#: badwolf.c:694 +#: badwolf.c:591 +msgid "_IMG" +msgstr "_IMG" + +#: badwolf.c:586 +msgid "_JS" +msgstr "_JS" + +#: badwolf.c:706 msgid "search in current page" msgstr "recherche dans la page courante" -#: badwolf.c:96 +#: badwolf.c:97 msgid "the web process crashed.\n" msgstr "le processus web a cessé de fonctionner.\n" -#: badwolf.c:100 +#: badwolf.c:101 msgid "the web process exceeded the memory limit.\n" msgstr "le processus web a dépassé la limitation de mémoire.\n" -#: badwolf.c:104 +#: badwolf.c:105 msgid "the web process terminated for an unknown reason.\n" msgstr "le processus web s’est interrompu pour une raison inconnue.\n" -#: badwolf.c:858 +#: badwolf.c:873 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "Répertoire webkit-web-extension configuré à %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:929 +#: badwolf.c:944 msgid "ø" msgstr "" diff --git a/po/messages.pot b/po/messages.pot index 80ef3b6..eb52fe4 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+ga513781.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g10008e9.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-15 01:49+0200\n" +"POT-Creation-Date: 2020-05-15 06:00+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -93,14 +93,6 @@ msgstr "" msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" -#: badwolf.c:591 -msgid "IMG" -msgstr "" - -#: badwolf.c:586 -msgid "JS" -msgstr "" - #: keybindings.c:32 #, c-format msgid "" @@ -151,6 +143,14 @@ msgstr "" msgid "Unknown Crash" msgstr "" +#: badwolf.c:591 +msgid "_IMG" +msgstr "" + +#: badwolf.c:586 +msgid "_JS" +msgstr "" + #: badwolf.c:706 msgid "search in current page" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 709c77e..f87a852 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.4.0+g607300e\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-11 08:30+0200\n" +"POT-Creation-Date: 2020-05-15 06:00+0200\n" "PO-Revision-Date: 2020-01-20 22:17-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" @@ -40,16 +40,16 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:846 +#: badwolf.c:861 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit %d.%d.%d\n" -#: badwolf.c:390 +#: badwolf.c:391 msgid "Continue" msgstr "Continuar" -#: badwolf.c:340 +#: badwolf.c:341 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" @@ -59,7 +59,7 @@ msgstr "" "segurança da conexão. Talvez você deva verificar a sua máquina e rede.\n" "\n" -#: badwolf.c:97 +#: badwolf.c:98 #, fuzzy msgid "Crashed" msgstr "Erro" @@ -68,45 +68,37 @@ msgstr "Erro" msgid "Download starting…" msgstr "" -#: badwolf.c:363 +#: badwolf.c:364 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" "Erro: Algum erro desconhecido ocorreu enquanto validava o certificado.\n" -#: badwolf.c:344 +#: badwolf.c:345 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erro: A Autoridade de Certificados X509 é desconhecida.\n" -#: badwolf.c:357 +#: badwolf.c:358 msgid "Error: The certificate has been revoked.\n" msgstr "Erro: O certificado foi revogado.\n" -#: badwolf.c:354 +#: badwolf.c:355 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" "Erro: O certificado foi expirado. Verifique o relógio do seu sistema.\n" -#: badwolf.c:360 +#: badwolf.c:361 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erro: O certificado é considerado inseguro.\n" -#: badwolf.c:351 +#: badwolf.c:352 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" "Erro: O certificado não é válido ainda. Verifique o relógio do seu sistema.\n" -#: badwolf.c:347 +#: badwolf.c:348 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erro: A identidade não confere com a esperada.\n" -#: badwolf.c:579 -msgid "IMG" -msgstr "" - -#: badwolf.c:574 -msgid "JS" -msgstr "" - #: keybindings.c:32 #, fuzzy, c-format msgid "" @@ -114,74 +106,82 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "Navegador orientado pela privacidade e minimalismo" -#: badwolf.c:775 +#: badwolf.c:790 msgid "New tab" msgstr "Nova aba" -#: badwolf.c:895 +#: badwolf.c:910 msgid "Open new tab" msgstr "Abrir uma Nova aba" -#: badwolf.c:101 +#: badwolf.c:102 #, fuzzy msgid "Out of Memory" msgstr "Sem memória" -#: badwolf.c:844 +#: badwolf.c:859 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Rodando versão %s do Badwolf\n" -#: badwolf.c:851 +#: badwolf.c:866 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit: %d.%d.%d\n" -#: badwolf.c:387 +#: badwolf.c:388 #, c-format msgid "TLS Error for %s." msgstr "Erro TLS para %s." -#: badwolf.c:390 +#: badwolf.c:391 #, fuzzy msgid "Temporarily Add Exception" msgstr "Temporáriamente adicionar exceção" -#: badwolf.c:576 +#: badwolf.c:588 msgid "Toggle javascript" msgstr "Habilitar Javascript" -#: badwolf.c:581 +#: badwolf.c:593 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:105 +#: badwolf.c:106 #, fuzzy msgid "Unknown Crash" msgstr "Erro desconhecido" -#: badwolf.c:694 +#: badwolf.c:591 +msgid "_IMG" +msgstr "" + +#: badwolf.c:586 +msgid "_JS" +msgstr "" + +#: badwolf.c:706 msgid "search in current page" msgstr "buscar na página atual" -#: badwolf.c:96 +#: badwolf.c:97 msgid "the web process crashed.\n" msgstr "o processo web travou.\n" -#: badwolf.c:100 +#: badwolf.c:101 msgid "the web process exceeded the memory limit.\n" msgstr "o processo web excedeu o limite de memória.\n" -#: badwolf.c:104 +#: badwolf.c:105 msgid "the web process terminated for an unknown reason.\n" msgstr "o processo web terminou por uma razão desconhecida.\n" -#: badwolf.c:858 +#: badwolf.c:873 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "diretório de extensões configurado para: %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:929 +#: badwolf.c:944 msgid "ø" msgstr "ø" -- cgit v1.3.1-23-gd82d From f74132929d008a5b07f7143e876c68e27cf33cf2 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 16 May 2020 06:49:56 +0200 Subject: badwolf: disable back/forward when useless --- badwolf.c | 12 +++++++++++ po/messages.pot | 62 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 43 insertions(+), 31 deletions(-) diff --git a/badwolf.c b/badwolf.c index 29553e1..a00840e 100644 --- a/badwolf.c +++ b/badwolf.c @@ -48,6 +48,8 @@ static gboolean WebViewCb_decide_policy(WebKitWebView *web_view, WebKitPolicyDecision *decision, WebKitPolicyDecisionType decision_type, gpointer user_data); +static void +WebViewCb_load_changed(WebKitWebView *webView, WebKitLoadEvent load_event, gpointer user_data); static void web_contextCb_download_started(WebKitWebContext *web_context, WebKitDownload *download, gpointer user_data); @@ -332,6 +334,15 @@ WebViewCb_decide_policy(WebKitWebView *web_view, return TRUE; } +static void +WebViewCb_load_changed(WebKitWebView *webView, WebKitLoadEvent load_event, gpointer user_data) +{ + struct Client *browser = (struct Client *)user_data; + + gtk_widget_set_sensitive(browser->back, webkit_web_view_can_go_back(browser->webView)); + gtk_widget_set_sensitive(browser->forward, webkit_web_view_can_go_forward(browser->webView)); +} + static char * detail_tls_certificate_flags(GTlsCertificateFlags tls_errors) { @@ -753,6 +764,7 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat "load-failed-with-tls-errors", G_CALLBACK(WebViewCb_load_failed_with_tls_errors), browser); + g_signal_connect(browser->webView, "load-changed", G_CALLBACK(WebViewCb_load_changed), browser); /* signals for WebView's WebContext */ g_signal_connect(G_OBJECT(web_context), diff --git a/po/messages.pot b/po/messages.pot index eb52fe4..48f4402 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g10008e9.develop\n" +"Project-Id-Version: Badwolf 0.5.1+gb30f00ef.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-15 06:00+0200\n" +"POT-Creation-Date: 2020-05-16 06:59+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,23 +41,23 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:861 +#: badwolf.c:873 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:391 +#: badwolf.c:402 msgid "Continue" msgstr "" -#: badwolf.c:341 +#: 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:98 +#: badwolf.c:100 msgid "Crashed" msgstr "" @@ -65,31 +65,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:364 +#: badwolf.c:375 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:345 +#: badwolf.c:356 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:358 +#: badwolf.c:369 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:355 +#: badwolf.c:366 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:361 +#: badwolf.c:372 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:352 +#: badwolf.c:363 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:348 +#: 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:790 +#: badwolf.c:802 msgid "New tab" msgstr "" -#: badwolf.c:910 +#: badwolf.c:922 msgid "Open new tab" msgstr "" -#: badwolf.c:102 +#: badwolf.c:104 msgid "Out of Memory" msgstr "" -#: badwolf.c:859 +#: badwolf.c:871 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:866 +#: badwolf.c:878 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:388 +#: badwolf.c:399 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:391 +#: badwolf.c:402 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:588 +#: badwolf.c:599 msgid "Toggle javascript" msgstr "" -#: badwolf.c:593 +#: badwolf.c:604 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:106 +#: badwolf.c:108 msgid "Unknown Crash" msgstr "" -#: badwolf.c:591 +#: badwolf.c:602 msgid "_IMG" msgstr "" -#: badwolf.c:586 +#: badwolf.c:597 msgid "_JS" msgstr "" -#: badwolf.c:706 +#: badwolf.c:717 msgid "search in current page" msgstr "" -#: badwolf.c:97 +#: badwolf.c:99 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:101 +#: badwolf.c:103 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:105 +#: badwolf.c:107 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:873 +#: badwolf.c:885 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:944 +#: badwolf.c:956 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From cac1bac24900a80d25b58000f1cbb8dd1ef98fa6 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 17 May 2020 16:11:21 +0200 Subject: badwolf: gcc-10 fix --- badwolf.c | 3 +-- badwolf.h | 4 ++-- po/messages.pot | 62 ++++++++++++++++++++++++++++----------------------------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/badwolf.c b/badwolf.c index a00840e..31fef7b 100644 --- a/badwolf.c +++ b/badwolf.c @@ -16,11 +16,10 @@ #include /* malloc() */ #include /* access() */ +gchar *web_extensions_directory; const gchar *homepage = "https://hacktivis.me/projects/badwolf"; const gchar *version = VERSION; -gchar *web_extensions_directory; - static gboolean WebViewCb_close(WebKitWebView *webView, gpointer user_data); static gboolean WebViewCb_web_process_terminated(WebKitWebView *webView, WebKitWebProcessTerminationReason reason, diff --git a/badwolf.h b/badwolf.h index 66df46e..7911c33 100644 --- a/badwolf.h +++ b/badwolf.h @@ -4,8 +4,8 @@ #include #include -const gchar *homepage; -const gchar *version; +extern const gchar *homepage; +extern const gchar *version; struct Window { diff --git a/po/messages.pot b/po/messages.pot index 48f4402..7852647 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+gb30f00ef.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g446353a.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-16 06:59+0200\n" +"POT-Creation-Date: 2020-05-17 16:13+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,23 +41,23 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:873 +#: badwolf.c:872 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:402 +#: badwolf.c:401 msgid "Continue" msgstr "" -#: badwolf.c:352 +#: badwolf.c:351 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:100 +#: badwolf.c:99 msgid "Crashed" msgstr "" @@ -65,31 +65,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:375 +#: badwolf.c:374 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:356 +#: badwolf.c:355 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:369 +#: badwolf.c:368 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:366 +#: badwolf.c:365 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:372 +#: badwolf.c:371 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:363 +#: badwolf.c:362 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:359 +#: badwolf.c:358 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:802 +#: badwolf.c:801 msgid "New tab" msgstr "" -#: badwolf.c:922 +#: badwolf.c:921 msgid "Open new tab" msgstr "" -#: badwolf.c:104 +#: badwolf.c:103 msgid "Out of Memory" msgstr "" -#: badwolf.c:871 +#: badwolf.c:870 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:878 +#: badwolf.c:877 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:399 +#: badwolf.c:398 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:402 +#: badwolf.c:401 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:599 +#: badwolf.c:598 msgid "Toggle javascript" msgstr "" -#: badwolf.c:604 +#: badwolf.c:603 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:108 +#: badwolf.c:107 msgid "Unknown Crash" msgstr "" -#: badwolf.c:602 +#: badwolf.c:601 msgid "_IMG" msgstr "" -#: badwolf.c:597 +#: badwolf.c:596 msgid "_JS" msgstr "" -#: badwolf.c:717 +#: badwolf.c:716 msgid "search in current page" msgstr "" -#: badwolf.c:99 +#: badwolf.c:98 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:103 +#: badwolf.c:102 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:107 +#: badwolf.c:106 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:885 +#: badwolf.c:884 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:956 +#: badwolf.c:955 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 56b481b25f1bca5d911ea1045d7e9afb73cc57db Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 17 May 2020 16:16:20 +0200 Subject: WebViewCb_load_changed: Clear warnings --- badwolf.c | 2 ++ po/messages.pot | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/badwolf.c b/badwolf.c index 31fef7b..f9fbcc7 100644 --- a/badwolf.c +++ b/badwolf.c @@ -336,6 +336,8 @@ WebViewCb_decide_policy(WebKitWebView *web_view, static void WebViewCb_load_changed(WebKitWebView *webView, WebKitLoadEvent load_event, gpointer user_data) { + (void)webView; + (void)load_event; struct Client *browser = (struct Client *)user_data; gtk_widget_set_sensitive(browser->back, webkit_web_view_can_go_back(browser->webView)); diff --git a/po/messages.pot b/po/messages.pot index 7852647..44a2935 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.5.1+g446353a.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-17 16:13+0200\n" +"POT-Creation-Date: 2020-05-17 16:14+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,16 +41,16 @@ msgstr "" msgid "Badwolf Downloads" msgstr "" -#: badwolf.c:872 +#: badwolf.c:874 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:401 +#: badwolf.c:403 msgid "Continue" msgstr "" -#: badwolf.c:351 +#: badwolf.c:353 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" @@ -65,31 +65,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:374 +#: badwolf.c:376 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:355 +#: badwolf.c:357 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:368 +#: badwolf.c:370 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:365 +#: badwolf.c:367 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:371 +#: badwolf.c:373 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:362 +#: badwolf.c:364 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:358 +#: badwolf.c:360 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -100,11 +100,11 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:801 +#: badwolf.c:803 msgid "New tab" msgstr "" -#: badwolf.c:921 +#: badwolf.c:923 msgid "Open new tab" msgstr "" @@ -112,30 +112,30 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:870 +#: badwolf.c:872 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:877 +#: badwolf.c:879 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:398 +#: badwolf.c:400 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:401 +#: badwolf.c:403 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:598 +#: badwolf.c:600 msgid "Toggle javascript" msgstr "" -#: badwolf.c:603 +#: badwolf.c:605 msgid "Toggle loading images automatically" msgstr "" @@ -143,15 +143,15 @@ msgstr "" msgid "Unknown Crash" msgstr "" -#: badwolf.c:601 +#: badwolf.c:603 msgid "_IMG" msgstr "" -#: badwolf.c:596 +#: badwolf.c:598 msgid "_JS" msgstr "" -#: badwolf.c:716 +#: badwolf.c:718 msgid "search in current page" msgstr "" @@ -167,12 +167,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:884 +#: badwolf.c:886 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:955 +#: badwolf.c:957 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From f25fc898af62389579deb66fb313ee4e036bb474 Mon Sep 17 00:00:00 2001 From: Pedro Lucas Porcellis Date: Sun, 17 May 2020 20:23:07 -0300 Subject: Update pt-BR translation --- po/messages.pot | 4 +-- po/pt_BR.po | 94 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 48 insertions(+), 50 deletions(-) diff --git a/po/messages.pot b/po/messages.pot index 44a2935..3df5cea 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g446353a.develop\n" +"Project-Id-Version: Badwolf 0.5.1+g46ea951.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-17 16:14+0200\n" +"POT-Creation-Date: 2020-05-18 03:06+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/pt_BR.po b/po/pt_BR.po index f87a852..9f54980 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 0.4.0+g607300e\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-15 06:00+0200\n" -"PO-Revision-Date: 2020-01-20 22:17-0300\n" +"POT-Creation-Date: 2020-05-18 03:06+0200\n" +"PO-Revision-Date: 2020-05-17 20:18-0300\n" "Last-Translator: Pedro Lucas Porcellis \n" "Language-Team: Brazilian Portuguese\n" "Language: pt_BR\n" @@ -19,37 +19,37 @@ msgstr "" #: downloads.c:117 #, c-format msgid "%02i:%02i:%02i Download cancelled" -msgstr "" +msgstr "%02i:%02i:%02i Transferência Cancelada" #: downloads.c:119 #, c-format msgid "%02i:%02i:%02i Download error" -msgstr "" +msgstr "%02i:%02i:%02i Erro durante a transferência" #: downloads.c:141 #, c-format msgid "%02i:%02i:%02i Download finished" -msgstr "" +msgstr "%02i:%02i:%02i Transferência Concluída" #: downloads.c:167 #, c-format msgid "%02i:%02i:%02i Downloading…" -msgstr "" +msgstr "%02i:%02i:%02i Baixando…" #: downloads.c:195 downloads.c:212 downloads.c:215 msgid "Badwolf Downloads" -msgstr "" +msgstr "Transferências do Badwolf" -#: badwolf.c:861 +#: badwolf.c:874 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit %d.%d.%d\n" -#: badwolf.c:391 +#: badwolf.c:403 msgid "Continue" msgstr "Continuar" -#: badwolf.c:341 +#: badwolf.c:353 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" @@ -59,129 +59,127 @@ msgstr "" "segurança da conexão. Talvez você deva verificar a sua máquina e rede.\n" "\n" -#: badwolf.c:98 -#, fuzzy +#: badwolf.c:99 msgid "Crashed" msgstr "Erro" #: downloads.c:39 msgid "Download starting…" -msgstr "" +msgstr "Transferência Iniciada…" -#: badwolf.c:364 +#: badwolf.c:376 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" "Erro: Algum erro desconhecido ocorreu enquanto validava o certificado.\n" -#: badwolf.c:345 +#: badwolf.c:357 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "Erro: A Autoridade de Certificados X509 é desconhecida.\n" -#: badwolf.c:358 +#: badwolf.c:370 msgid "Error: The certificate has been revoked.\n" msgstr "Erro: O certificado foi revogado.\n" -#: badwolf.c:355 +#: badwolf.c:367 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" "Erro: O certificado foi expirado. Verifique o relógio do seu sistema.\n" -#: badwolf.c:361 +#: badwolf.c:373 msgid "Error: The certificate is considered to be insecure.\n" msgstr "Erro: O certificado é considerado inseguro.\n" -#: badwolf.c:352 +#: badwolf.c:364 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" "Erro: O certificado não é válido ainda. Verifique o relógio do seu sistema.\n" -#: badwolf.c:348 +#: badwolf.c:360 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "Erro: A identidade não confere com a esperada.\n" #: keybindings.c:32 -#, fuzzy, c-format +#, c-format msgid "" "Minimalist and privacy-oriented WebKitGTK+ browser\n" "Runtime WebKit version: %d.%d.%d" -msgstr "Navegador orientado pela privacidade e minimalismo" +msgstr "" +"Navegador orientado pela privacidade e minimalismo\n" +"Versão do WebKit: %d.%d.%d" -#: badwolf.c:790 +#: badwolf.c:803 msgid "New tab" msgstr "Nova aba" -#: badwolf.c:910 +#: badwolf.c:923 msgid "Open new tab" msgstr "Abrir uma Nova aba" -#: badwolf.c:102 -#, fuzzy +#: badwolf.c:103 msgid "Out of Memory" msgstr "Sem memória" -#: badwolf.c:859 +#: badwolf.c:872 #, c-format msgid "Running Badwolf version: %s\n" msgstr "Rodando versão %s do Badwolf\n" -#: badwolf.c:866 +#: badwolf.c:879 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "Versão do WebKit: %d.%d.%d\n" -#: badwolf.c:388 +#: badwolf.c:400 #, c-format msgid "TLS Error for %s." msgstr "Erro TLS para %s." -#: badwolf.c:391 -#, fuzzy +#: badwolf.c:403 msgid "Temporarily Add Exception" -msgstr "Temporáriamente adicionar exceção" +msgstr "Adicionar exceção temporária" -#: badwolf.c:588 +#: badwolf.c:600 msgid "Toggle javascript" msgstr "Habilitar Javascript" -#: badwolf.c:593 +#: badwolf.c:605 msgid "Toggle loading images automatically" -msgstr "" +msgstr "Habilitar carregamento de imagens automático" -#: badwolf.c:106 -#, fuzzy +#: badwolf.c:107 msgid "Unknown Crash" msgstr "Erro desconhecido" -#: badwolf.c:591 +#: badwolf.c:603 msgid "_IMG" -msgstr "" +msgstr "_IMG" -#: badwolf.c:586 +#: badwolf.c:598 msgid "_JS" -msgstr "" +msgstr "_JS" -#: badwolf.c:706 +#: badwolf.c:718 msgid "search in current page" msgstr "buscar na página atual" -#: badwolf.c:97 +#: badwolf.c:98 msgid "the web process crashed.\n" msgstr "o processo web travou.\n" -#: badwolf.c:101 +#: badwolf.c:102 msgid "the web process exceeded the memory limit.\n" msgstr "o processo web excedeu o limite de memória.\n" -#: badwolf.c:105 +#: badwolf.c:106 msgid "the web process terminated for an unknown reason.\n" msgstr "o processo web terminou por uma razão desconhecida.\n" -#: badwolf.c:873 +#: badwolf.c:886 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "diretório de extensões configurado para: %s\n" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:944 +#: badwolf.c:957 msgid "ø" -msgstr "ø" +msgstr "" -- cgit v1.3.1-23-gd82d From ec3bb620f155109c7646252500c8638a472d359c Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 18 May 2020 04:00:53 +0200 Subject: badwolf.c: drop unbinded right-click on toolbox This is because of a GtkNotebook bug, which I'm not sure is even gonna get fixed in GTK3. Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/2758 --- badwolf.c | 42 +++++++++++++++++++++++++++++++++++++++--- po/messages.pot | 28 ++++++++++++++-------------- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/badwolf.c b/badwolf.c index f9fbcc7..54dcf53 100644 --- a/badwolf.c +++ b/badwolf.c @@ -570,6 +570,16 @@ SearchEntryCb_stop__search(GtkSearchEntry *search, gpointer user_data) return TRUE; } +static gboolean +widgetCb_drop_button3_event(GtkWidget *widget, GdkEvent *event, gpointer user_data) +{ + (void)widget; + (void)user_data; + + // Button3 being right-click on right-handed mode, left-click on left-handed mode + return ((GdkEventButton *)event)->button == 3; +} + struct Client * new_browser(struct Window *window, const gchar *target_url, WebKitWebView *related_web_view) { @@ -720,19 +730,45 @@ new_browser(struct Window *window, const gchar *target_url, WebKitWebView *relat /* signals for back/forward buttons */ g_signal_connect(browser->back, "clicked", G_CALLBACK(backCb_clicked), browser); g_signal_connect(browser->forward, "clicked", G_CALLBACK(forwardCb_clicked), browser); - - /* signals for location entry widget */ - g_signal_connect(browser->location, "activate", G_CALLBACK(locationCb_activate), browser); + /* prevents GtkNotebook from spawning it's context-menu */ + g_signal_connect( + browser->back, "button-press-event", G_CALLBACK(widgetCb_drop_button3_event), NULL); + g_signal_connect( + browser->back, "button-release-event", G_CALLBACK(widgetCb_drop_button3_event), NULL); + g_signal_connect( + browser->forward, "button-press-event", G_CALLBACK(widgetCb_drop_button3_event), NULL); + g_signal_connect( + browser->forward, "button-release-event", G_CALLBACK(widgetCb_drop_button3_event), NULL); /* signals for javacript toggle widget */ g_signal_connect(browser->javascript, "toggled", G_CALLBACK(javascriptCb_toggled), browser); + /* prevents GtkNotebook from spawning it's context-menu */ + g_signal_connect( + browser->javascript, "button-press-event", G_CALLBACK(widgetCb_drop_button3_event), NULL); + g_signal_connect( + browser->javascript, "button-release-event", G_CALLBACK(widgetCb_drop_button3_event), NULL); /* signals for auto_load_images toggle widget */ g_signal_connect( browser->auto_load_images, "toggled", G_CALLBACK(auto_load_imagesCb_toggled), browser); + /* prevents GtkNotebook from spawning it's context-menu */ + g_signal_connect(browser->auto_load_images, + "button-press-event", + G_CALLBACK(widgetCb_drop_button3_event), + NULL); + g_signal_connect(browser->auto_load_images, + "button-release-event", + G_CALLBACK(widgetCb_drop_button3_event), + NULL); + + /* signals for location entry widget */ + g_signal_connect(browser->location, "activate", G_CALLBACK(locationCb_activate), browser); /* signals for print button */ g_signal_connect(print, "clicked", G_CALLBACK(printCb_clicked), browser); + /* prevents GtkNotebook from spawning it's context-menu */ + g_signal_connect(print, "button-press-event", G_CALLBACK(widgetCb_drop_button3_event), NULL); + g_signal_connect(print, "button-release-event", G_CALLBACK(widgetCb_drop_button3_event), NULL); /* signals for WebView widget */ g_signal_connect(browser->webView, diff --git a/po/messages.pot b/po/messages.pot index 3df5cea..115f3b4 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Badwolf 0.5.1+g46ea951.develop\n" +"Project-Id-Version: Badwolf 0.5.1+gf25fc89.HEAD\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2020-05-18 03:06+0200\n" +"POT-Creation-Date: 2020-05-18 04:14+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:874 +#: badwolf.c:910 #, 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:803 +#: badwolf.c:839 msgid "New tab" msgstr "" -#: badwolf.c:923 +#: badwolf.c:959 msgid "Open new tab" msgstr "" @@ -112,12 +112,12 @@ msgstr "" msgid "Out of Memory" msgstr "" -#: badwolf.c:872 +#: badwolf.c:908 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:879 +#: badwolf.c:915 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" @@ -131,11 +131,11 @@ msgstr "" msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:600 +#: badwolf.c:610 msgid "Toggle javascript" msgstr "" -#: badwolf.c:605 +#: badwolf.c:615 msgid "Toggle loading images automatically" msgstr "" @@ -143,15 +143,15 @@ msgstr "" msgid "Unknown Crash" msgstr "" -#: badwolf.c:603 +#: badwolf.c:613 msgid "_IMG" msgstr "" -#: badwolf.c:598 +#: badwolf.c:608 msgid "_JS" msgstr "" -#: badwolf.c:718 +#: badwolf.c:728 msgid "search in current page" msgstr "" @@ -167,12 +167,12 @@ msgstr "" msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:886 +#: badwolf.c:922 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:957 +#: badwolf.c:993 msgid "ø" msgstr "" -- cgit v1.3.1-23-gd82d From 1dbcade1d73cc2e45c61663cc97da17ddec7eb04 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 15 May 2020 05:20:58 +0200 Subject: Bump to 1.0.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8bb2511..f371a28 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # - Usage of += for appending to a variable PACKAGE = Badwolf -VERSION = 0.5.1 +VERSION = 1.0.0 VERSION_FULL = $(VERSION)`./version.sh` PREFIX ?= /usr/local -- cgit v1.3.1-23-gd82d