Move "View" option for playlists up one level

The "View" option for playlists/.m3u files is currently part of the "Current Playlist" submenu even though it refers to the selected file/playlist and has nothing to do with the current playlist. It has been relocated to the context menu of the playlist file where it makes more sense and is easier to get to.

Change-Id: I806ed46a7315293d7d20f29ed004cc8ab58cdcb7
This commit is contained in:
Christian Soffke 2021-03-10 13:53:28 +01:00
parent 73ec3971f7
commit b3b8310e4e
2 changed files with 17 additions and 16 deletions

View file

@ -644,17 +644,10 @@ MENUITEM_FUNCTION(replace_pl_item, MENU_FUNC_USEPARAM, ID2P(LANG_CLEAR_LIST_AND_
playlist_insert_func, (intptr_t*)PLAYLIST_REPLACE,
NULL, Icon_Playlist);
/* others */
MENUITEM_FUNCTION(view_playlist_item, 0, ID2P(LANG_VIEW),
view_playlist, NULL,
treeplaylist_callback, Icon_Playlist);
MAKE_ONPLAYMENU( tree_playlist_menu, ID2P(LANG_CURRENT_PLAYLIST),
treeplaylist_callback, Icon_Playlist,
/* view */
&view_playlist_item,
/* insert */
&i_pl_item, &i_first_pl_item, &i_last_pl_item,
&i_shuf_pl_item, &i_last_shuf_pl_item,
@ -684,14 +677,6 @@ static int treeplaylist_callback(int action,
return action;
}
}
else if (this_item == &view_playlist_item)
{
if ((selected_file_attr & FILE_ATTR_MASK) == FILE_ATTR_M3U &&
context == CONTEXT_TREE)
{
return action;
}
}
else if (this_item == &i_pl_item)
{
if (global_status.resume_index != -1)
@ -1679,10 +1664,15 @@ MAKE_ONPLAYMENU( wps_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
&pitch_screen_item,
#endif
);
MENUITEM_FUNCTION(view_playlist_item, 0, ID2P(LANG_VIEW),
view_playlist, NULL,
onplaymenu_callback, Icon_Playlist);
/* used when onplay() is not called in the CONTEXT_WPS context */
MAKE_ONPLAYMENU( tree_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
onplaymenu_callback, Icon_file_view_menu,
&tree_playlist_menu, &cat_playlist_menu,
&view_playlist_item, &tree_playlist_menu, &cat_playlist_menu,
&rename_file_item, &clipboard_cut_item, &clipboard_copy_item,
&clipboard_paste_item, &delete_file_item, &delete_dir_item,
#if LCD_DEPTH > 1
@ -1708,6 +1698,15 @@ static int onplaymenu_callback(int action,
return ACTION_STD_CANCEL;
}
break;
case ACTION_REQUEST_MENUITEM:
if (this_item == &view_playlist_item)
{
if ((selected_file_attr & FILE_ATTR_MASK) == FILE_ATTR_M3U &&
context == CONTEXT_TREE)
return action;
}
return ACTION_EXIT_MENUITEM;
break;
case ACTION_EXIT_MENUITEM:
return ACTION_EXIT_AFTER_THIS_MENUITEM;
break;

View file

@ -119,6 +119,8 @@ The \setting{Context Menu} contains the following options (unless otherwise note
each option pertains both to files and directories):
\begin{description}
\item [View.]
Displays the contents of the selected playlist file.
\item [Current Playlist.]
Enters the \setting{Current Playlist Submenu} (see \reference{ref:currentplaylist_submenu}).
\item [Playlist Catalogue.]