tagtree: Add menu item "Show in Files"

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Thu, 16 Apr 2026 21:04:47 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 5ac105c837ca697427f8e71c024387957b1378ed
Author: Christian Soffke <[email protected]>
Date:   Tue Apr 7 03:31:57 2026 +0200

    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

diff --git a/apps/onplay.c b/apps/onplay.c
index 974a65298d..82b5ab8931 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -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
diff --git a/apps/tree.c b/apps/tree.c
index 5df204bbf2..387a070e3a 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -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;
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs