mirror of
https://github.com/ventoy/Ventoy.git
synced 2025-10-04 17:26:18 +00:00
Show the directory path in the return menu for TreeView mode and Browser mode.
This commit is contained in:
@@ -520,13 +520,13 @@ grub_err_t ventoy_cmd_browser_dir(grub_extcmd_context_t ctxt, int argc, char **a
|
||||
|
||||
if (g_tree_view_menu_style == 0)
|
||||
{
|
||||
browser_ssprintf(&mbuf, "menuentry \"%-10s [../]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n}\n", "<--");
|
||||
browser_ssprintf(&mbuf, "menuentry \"%-10s [(%s)%s/..]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n}\n", "<--", args[0], g_menu_path_buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
browser_ssprintf(&mbuf, "menuentry \"[../]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n}\n");
|
||||
browser_ssprintf(&mbuf, "menuentry \"[(%s)%s/..]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n}\n", args[0], g_menu_path_buf);
|
||||
}
|
||||
|
||||
for (i = 1; i >= 0; i--)
|
||||
|
@@ -2295,8 +2295,8 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
|
||||
{
|
||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
||||
"menuentry \"[Return to ListView]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo '%s ...' \n"
|
||||
"}\n", "return");
|
||||
" echo 'return ...' \n"
|
||||
"}\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2350,16 +2350,16 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
|
||||
if (g_tree_view_menu_style == 0)
|
||||
{
|
||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
||||
"menuentry \"%-10s [../]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
"menuentry \"%-10s [%s/..]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n"
|
||||
"}\n", "<--");
|
||||
"}\n", "<--", node->dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos,
|
||||
"menuentry \"[../]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo '%s ...' \n"
|
||||
"}\n", "return");
|
||||
"menuentry \"[%s/..]\" --class=\"vtoyret\" VTOY_RET {\n "
|
||||
" echo 'return ...' \n"
|
||||
"}\n", node->dir);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2397,7 +2397,7 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
|
||||
|
||||
if (node != &g_img_iterator_head)
|
||||
{
|
||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, "%s", "}\n");
|
||||
vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, "}\n");
|
||||
}
|
||||
|
||||
node->done = 1;
|
||||
|
@@ -313,8 +313,8 @@ extern int g_ventoy_debug;
|
||||
void ventoy_debug(const char *fmt, ...);
|
||||
#define debug(fmt, args...) if (g_ventoy_debug) ventoy_debug("[VTOY]: "fmt, ##args)
|
||||
|
||||
#define vtoy_ssprintf(buf, pos, fmt, ...) \
|
||||
pos += grub_snprintf(buf + pos, VTOY_MAX_SCRIPT_BUF - pos, fmt, __VA_ARGS__)
|
||||
#define vtoy_ssprintf(buf, pos, fmt, args...) \
|
||||
pos += grub_snprintf(buf + pos, VTOY_MAX_SCRIPT_BUF - pos, fmt, ##args)
|
||||
|
||||
#define browser_ssprintf(mbuf, fmt, args...) \
|
||||
(mbuf)->pos += grub_snprintf((mbuf)->buf + (mbuf)->pos, (mbuf)->max - (mbuf)->pos, fmt, ##args)
|
||||
|
Reference in New Issue
Block a user