tagtree: Add menu item "Show in Files"

Quickly reveal a database item in the File Browser.
In case of entire tables, the first entry will be revealed.

Change-Id: I4191f27ea2ab7cacbe375719314d7eb23301fd07
This commit is contained in:
Christian Soffke 2026-04-07 03:31:57 +02:00
parent e405858b9e
commit 5ac105c837
2 changed files with 15 additions and 3 deletions

View file

@ -899,6 +899,10 @@ static bool onplay_load_plugin(void *param)
static int reveal(void)
{
#ifdef HAVE_TAGCACHE
if (!prepare_database_sel(NULL))
return 0;
#endif
if (!file_exists(selected_file.path))
{
splash(HZ*2, ID2P(LANG_FILE_NOT_FOUND));
@ -912,7 +916,7 @@ static int reveal(void)
}
MENUITEM_FUNCTION(reveal_item, 0, ID2P(LANG_SHOW_IN_FILES),
reveal, NULL, Icon_file_view_menu);
reveal, clipboard_callback, Icon_file_view_menu);
MENUITEM_FUNCTION(list_viewers_item, 0, ID2P(LANG_ONPLAY_OPEN_WITH),
list_viewers, clipboard_callback, Icon_NOICON);
MENUITEM_FUNCTION_W_PARAM(properties_item, 0, ID2P(LANG_PROPERTIES),
@ -1049,7 +1053,8 @@ static int clipboard_callback(int action,
if (selected_file.context == CONTEXT_ID3DB)
{
if (this_item == &track_info_item ||
this_item == &pictureflow_item)
this_item == &pictureflow_item ||
this_item == &reveal_item)
return action;
return ACTION_EXIT_MENUITEM;
}
@ -1104,7 +1109,9 @@ static int clipboard_callback(int action,
if (*tree_get_context()->dirfilter != SHOW_M3U)
return action;
}
else if (this_item == &delete_file_item)
else if (this_item == &delete_file_item ||
(this_item == &reveal_item &&
selected_file.context == CONTEXT_WPS))
return action;
#if LCD_DEPTH > 1
else if (this_item == &set_backdrop_item)
@ -1178,6 +1185,7 @@ MAKE_ONPLAYMENU( tree_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
&rename_file_item, &clipboard_cut_item, &clipboard_copy_item,
&clipboard_paste_item, &delete_file_item, &delete_dir_item,
&list_viewers_item, &create_dir_item, &properties_item, &track_info_item,
&reveal_item,
#ifdef HAVE_TAGCACHE
&pictureflow_item,
#endif

View file

@ -975,6 +975,10 @@ static int dirbrowse(void)
return exit_to_new_screen(GO_TO_ROOT);
break;
case ONPLAY_REVEAL_FILE:
return exit_to_new_screen(GO_TO_FILEBROWSER);
break;
case ONPLAY_OK:
restore = do_restore_display;
break;