diff options
| Commit | 8b68bc3f5747f295988edcdf7a5edc64a9417b11 (patch) | |
|---|---|---|
| Author | 2022-07-17 20:09:47 +0300 | |
| Committer | 2022-07-17 20:09:47 +0300 | |
| Files | e08b07e5898e54abc8e7428efd891e6c33d95edb | |
| goodwolf-8b68bc3f5747f295988edcdf7a5edc64a9417b11.tar goodwolf-8b68bc3f5747f295988edcdf7a5edc64a9417b11.tar.gz goodwolf-8b68bc3f5747f295988edcdf7a5edc64a9417b11.zip | ||
| Parent | 57d648e05d9d091a7d8d6f6dbfda2561c47b3a7c (diff) | |
badwolf: Brought back context label with the switch -cl
2 files changed, 52 insertions, 36 deletions
| -rw-r--r-- | badwolf.c | 20 | ||||
| -rw-r--r-- | po/messages.pot | 68 |
@@ -28,6 +28,7 @@ GtkTreeModel *bookmarks_completion_model; static gboolean tabs_no_label = false; static gboolean tabs_constant = false; +static gboolean tabs_context_label = false; static gboolean tray_enabled = false; static gboolean alt_useragent = false; static int custom_favicon_size = 30; @@ -174,7 +175,7 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) /* flawfinder: ignore. bound checks are done */ char context_id_str[BADWOLF_CTX_SIZ] = {0, 0, 0, 0, 0, 0, 0}; - fmt_context_id(browser->context_id, context_id_str); + fmt_context_id(browser->context_id, context_id_str, 1); GtkWidget *tab_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_name(tab_box, "browser__tabbox"); @@ -182,6 +183,14 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) GtkWidget *close = gtk_button_new_from_icon_name("window-close-symbolic", GTK_ICON_SIZE_LARGE_TOOLBAR); gtk_widget_set_name(close, "browser__tabbox__close"); + GtkWidget *context_label; + GtkWidget *context_label_event_box; + if (tabs_context_label) { + context_label = gtk_label_new(context_id_str); + gtk_widget_set_name(context_label, "browser__tabbox__context_label"); + context_label_event_box = gtk_event_box_new(); + gtk_container_add(GTK_CONTAINER(context_label_event_box), context_label); + } GtkWidget *favicon = gtk_image_new_from_surface(scale_favicon(webkit_web_view_get_favicon(browser->webView))); gtk_widget_set_name(favicon, "browser__tabbox__favicon"); @@ -208,6 +217,11 @@ badwolf_new_tab_box(const gchar *title, struct Client *browser) gtk_label_set_ellipsize(GTK_LABEL(label), BADWOLF_TAB_LABEL_ELLIPSIZE); gtk_label_set_single_line_mode(GTK_LABEL(label), TRUE); + if (tabs_context_label) { + gtk_label_set_single_line_mode(GTK_LABEL(context_label), TRUE); + gtk_box_pack_start(GTK_BOX(tab_box), context_label_event_box, TRUE, TRUE, 0); + } + gtk_box_pack_start(GTK_BOX(tab_box), favicon_event_box, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(tab_box), playing_event_box, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(tab_box), label_event_box, TRUE, TRUE, 0); @@ -753,7 +767,7 @@ new_browser(struct Window *window, const gchar *target_url, struct Client *old_b if (persistent_storage) { char context_id_str[BADWOLF_CTX_SIZ] = {0, 0, 0, 0, 0, 0, 0}; if (separated_storage) { - fmt_context_id(browser->context_id, context_id_str); + fmt_context_id(browser->context_id, context_id_str, 0); g_mkdir_with_parents( g_build_filename(g_get_user_config_dir(), "badwolf", context_id_str, NULL), 0755); @@ -1247,6 +1261,8 @@ main(int argc, char *argv[]) while (argc > 1 && argv[1][0] == '-') { if (argv[1][1] == 'n' && argv[1][2] == 'l') tabs_no_label = TRUE; + else if (argv[1][1] == 'c' && argv[1][2] == 'l') + tabs_context_label = TRUE; else if (argv[1][1] == 'c') tabs_constant = TRUE; else if (argv[1][1] == 't') diff --git a/po/messages.pot b/po/messages.pot index f89be0b..74c9427 100644 --- a/po/messages.pot +++ b/po/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Badwolf 1.2.0+g6e9679c.develop\n" "Report-Msgid-Bugs-To: contact+badwolf-msgid@hacktivis.me\n" -"POT-Creation-Date: 2022-07-17 19:36+0300\n" +"POT-Creation-Date: 2022-07-17 20:07+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -74,23 +74,23 @@ msgstr "" msgid "Bookmarks: unable to parse file \"%s\"\n" msgstr "" -#: badwolf.c:1158 +#: badwolf.c:1172 #, c-format msgid "Buildtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:483 +#: badwolf.c:497 msgid "Continue" msgstr "" -#: badwolf.c:428 +#: badwolf.c:442 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:112 +#: badwolf.c:113 msgid "Crashed" msgstr "" @@ -98,31 +98,31 @@ msgstr "" msgid "Download starting…" msgstr "" -#: badwolf.c:451 +#: badwolf.c:465 msgid "Error: Some unknown error occurred validating the certificate.\n" msgstr "" -#: badwolf.c:432 +#: badwolf.c:446 msgid "Error: The X509 Certificate Authority is unknown.\n" msgstr "" -#: badwolf.c:445 +#: badwolf.c:459 msgid "Error: The certificate has been revoked.\n" msgstr "" -#: badwolf.c:442 +#: badwolf.c:456 msgid "Error: The certificate has expired. Check your system's clock.\n" msgstr "" -#: badwolf.c:448 +#: badwolf.c:462 msgid "Error: The certificate is considered to be insecure.\n" msgstr "" -#: badwolf.c:439 +#: badwolf.c:453 msgid "Error: The certificate isn't valid yet. Check your system's clock.\n" msgstr "" -#: badwolf.c:435 +#: badwolf.c:449 msgid "Error: The given identity doesn't match the expected one.\n" msgstr "" @@ -133,99 +133,99 @@ msgid "" "Runtime WebKit version: %d.%d.%d" msgstr "" -#: badwolf.c:999 +#: badwolf.c:1013 msgid "New tab" msgstr "" -#: badwolf.c:1228 +#: badwolf.c:1242 msgid "Open new tab" msgstr "" -#: badwolf.c:116 +#: badwolf.c:117 msgid "Out of Memory" msgstr "" -#: badwolf.c:1156 +#: badwolf.c:1170 #, c-format msgid "Running Badwolf version: %s\n" msgstr "" -#: badwolf.c:1163 +#: badwolf.c:1177 #, c-format msgid "Runtime WebKit version: %d.%d.%d\n" msgstr "" -#: badwolf.c:480 +#: badwolf.c:494 #, c-format msgid "TLS Error for %s." msgstr "" -#: badwolf.c:483 +#: badwolf.c:497 msgid "Temporarily Add Exception" msgstr "" -#: badwolf.c:717 +#: badwolf.c:731 msgid "Toggle javascript" msgstr "" -#: badwolf.c:722 +#: badwolf.c:736 msgid "Toggle loading images automatically" msgstr "" -#: badwolf.c:120 +#: badwolf.c:121 msgid "Unknown Crash" msgstr "" -#: badwolf.c:720 +#: badwolf.c:734 msgid "_IMG" msgstr "" -#: badwolf.c:715 +#: badwolf.c:729 msgid "_JS" msgstr "" -#: badwolf.c:1077 +#: badwolf.c:1091 #, c-format msgid "badwolf: content-filter loaded, adding to content-manager…\n" msgstr "" -#: badwolf.c:1097 badwolf.c:1104 +#: badwolf.c:1111 badwolf.c:1118 #, c-format msgid "badwolf: failed to compile content-filters.json, err: [%d] %s\n" msgstr "" -#: badwolf.c:1065 badwolf.c:1070 +#: badwolf.c:1079 badwolf.c:1084 #, c-format msgid "badwolf: failed to load content-filter, err: [%d] %s\n" msgstr "" -#: badwolf.c:1184 +#: badwolf.c:1198 #, c-format msgid "content-filters file set to: %s\n" msgstr "" -#: badwolf.c:887 +#: badwolf.c:901 msgid "search in current page" msgstr "" -#: badwolf.c:111 +#: badwolf.c:112 msgid "the web process crashed.\n" msgstr "" -#: badwolf.c:115 +#: badwolf.c:116 msgid "the web process exceeded the memory limit.\n" msgstr "" -#: badwolf.c:119 +#: badwolf.c:120 msgid "the web process terminated for an unknown reason.\n" msgstr "" -#: badwolf.c:1170 +#: badwolf.c:1184 #, c-format msgid "webkit-web-extension directory set to: %s\n" msgstr "" #. TRANSLATOR Ignore this entry. Done for forcing Unicode in xgettext. -#: badwolf.c:1291 +#: badwolf.c:1307 msgid "ø" msgstr "" |