playlist catalog: sort independently from file browser

Allow independent sorting of playlists in the
playlist catalog, using the context menu.

You may want to usually sort playlists by their date
(modified), but sort audio tracks alphabetically.
This is now possible without having to constantly
adjust a setting.

The fact that 'Sort Files' applied to both the file
browser and playlist catalog seems more like a side
effect of the implementation, rather than behavior
that is wanted. Additionally, the 'By Type' sorting
makes no sense when only a single type is displayed.

Since many of the other File View settings don't
apply to the playlist catalog, hide the menu there.

Change-Id: Ic35038015d0860998ae117f472ce23ce3bc80cfa
This commit is contained in:
Christian Soffke 2025-04-18 20:37:51 +02:00 committed by Solomon Peachy
parent 6e06319988
commit 4346a1e8e7
10 changed files with 62 additions and 7 deletions

View file

@ -157,9 +157,11 @@ MAKE_MENU(currentplaylist_settings_menu, ID2P(LANG_CURRENT_PLAYLIST),
&show_shuffled_adding_options,
&show_queue_options);
MENUITEM_SETTING(sort_playlists, &global_settings.sort_playlists, NULL);
MAKE_MENU(playlist_settings, ID2P(LANG_PLAYLISTS), NULL,
Icon_Playlist,
&viewer_settings_menu, &recursive_dir_insert, &currentplaylist_settings_menu);
&sort_playlists, &viewer_settings_menu, &recursive_dir_insert,
&currentplaylist_settings_menu);
MAKE_MENU(playlist_options, ID2P(LANG_PLAYLISTS), NULL,
Icon_Playlist,
&view_cur_playlist, &save_playlist,

View file

@ -220,10 +220,13 @@ static int filemenu_callback(int action,
{
(void)this_list;
/* Show File View menu in Settings or File Browser,
but not in Database or Playlist Catalog */
if (action == ACTION_REQUEST_MENUITEM &&
this_item == &file_menu &&
get_onplay_context() == CONTEXT_ID3DB &&
get_current_activity() != ACTIVITY_SETTINGS)
get_current_activity() != ACTIVITY_SETTINGS &&
(get_onplay_context() != CONTEXT_TREE
|| *tree_get_context()->dirfilter == SHOW_M3U))
return ACTION_EXIT_MENUITEM;
return action;