1
0
Fork 0

[bookmarks] Added option "document.browse.links.hierbox_goto" . Refs #237

Option is similar to "document.browse.links.target_blank".
It is for hierbox dialogs with a "Go to" button.
This commit is contained in:
Witold Filipczyk 2023-06-20 14:40:02 +02:00
parent f85f899a7f
commit a98470adcb
2 changed files with 26 additions and 1 deletions

View File

@ -16,6 +16,7 @@
#include "bfu/msgbox.h"
#include "bfu/text.h"
#include "config/kbdbind.h"
#include "dialogs/menu.h"
#include "intl/libintl.h"
#include "protocol/uri.h"
#include "session/task.h"
@ -522,7 +523,23 @@ push_hierbox_goto_button(struct dialog_data *dlg_data,
struct uri *uri = box->ops->get_uri(item);
if (uri) {
goto_uri(ses, uri);
int how = get_opt_int("document.browse.links.hierbox_goto", ses);
switch (how) {
default:
case 0:
goto_uri(ses, uri);
break;
case 1:
open_uri_in_new_tab(ses, uri, 0, 0);
break;
case 2:
open_uri_in_new_tab(ses, uri, 1, 0);
break;
case 3:
open_uri_in_new_window(ses, uri, NULL, ENV_ANY, CACHE_MODE_NORMAL, TASK_NONE);
break;
}
done_uri(uri);
}

View File

@ -330,6 +330,14 @@ static union option_info config_options_info[] = {
N_("Highlight links to directories in FTP and local directory "
"listing.")),
INIT_OPT_INT("document.browse.links", N_("Handling of hierbox's Go to button"),
"hierbox_goto", OPT_ZERO, 0, 3, 0,
N_("Define how to handle hierbox's Go to button. For example in bookmarks manager:\n"
"0 means open link in current tab\n"
"1 means open link in new tab in foreground\n"
"2 means open link in new tab in background\n"
"3 means open link in new window")),
INIT_OPT_BOOL("document.browse.links", N_("Number links"),
"numbering", OPT_ZERO, 0,
N_("Display numbers next to the links.")),