Reapply "Allow Start button to quick manage media playlists (#17948)"

This reverts commit f877adb5d9.
This commit is contained in:
libretroadmin 2025-05-27 12:40:32 +02:00
parent f877adb5d9
commit 5cb15e1cd7
6 changed files with 153 additions and 33 deletions

View File

@ -112,6 +112,11 @@ int menu_cbs_init_bind_label(menu_file_list_cbs_t *cbs,
{
switch (cbs->enum_idx)
{
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
case MENU_ENUM_LABEL_GOTO_FAVORITES:
case MENU_ENUM_LABEL_GOTO_IMAGES:
case MENU_ENUM_LABEL_GOTO_MUSIC:
case MENU_ENUM_LABEL_GOTO_VIDEO:
case MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY:
BIND_ACTION_LABEL(cbs, action_bind_label_playlist_collection_entry);
break;

View File

@ -8634,6 +8634,7 @@ static int action_ok_delete_playlist(const char *path,
{
playlist_t *playlist = playlist_get_cached();
struct menu_state *menu_st = menu_state_get_ptr();
menu_entry_t entry;
if (!playlist)
return -1;
@ -8646,7 +8647,12 @@ static int action_ok_delete_playlist(const char *path,
menu_st->driver_ctx->environ_cb(MENU_ENVIRON_RESET_HORIZONTAL_LIST,
NULL, menu_st->userdata);
return action_cancel_pop_default(NULL, NULL, 0, 0);
MENU_ENTRY_INITIALIZE(entry);
menu_entry_get(&entry, 0, 0, NULL, false);
/* Ozone sidebar quick manager needs 'MENU_ACTION_CANCEL' instead
* of 'action_cancel_pop_default' to return back to sidebar cleanly */
return menu_entry_action(&entry, 0, MENU_ACTION_CANCEL);
}
#ifdef HAVE_NETWORKING

View File

@ -897,6 +897,13 @@ static int menu_cbs_init_bind_start_compare_label(menu_file_list_cbs_t *cbs)
case MENU_ENUM_LABEL_MENU_WALLPAPER:
BIND_ACTION_START(cbs, action_start_menu_wallpaper);
break;
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
case MENU_ENUM_LABEL_GOTO_FAVORITES:
case MENU_ENUM_LABEL_GOTO_IMAGES:
case MENU_ENUM_LABEL_GOTO_MUSIC:
case MENU_ENUM_LABEL_GOTO_VIDEO:
BIND_ACTION_START(cbs, action_ok_push_playlist_manager_settings);
break;
default:
return -1;
}

View File

@ -3273,6 +3273,28 @@ static void ozone_draw_cursor(
alpha);
}
const enum msg_hash_enums ozone_system_tabs_label[OZONE_SYSTEM_TAB_LAST] = {
MENU_ENUM_LABEL_MAIN_MENU,
MENU_ENUM_LABEL_SETTINGS_TAB,
MENU_ENUM_LABEL_HISTORY_TAB,
MENU_ENUM_LABEL_FAVORITES_TAB,
#ifdef HAVE_IMAGEVIEWER
MENU_ENUM_LABEL_IMAGES_TAB,
#endif
MENU_ENUM_LABEL_MUSIC_TAB,
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
MENU_ENUM_LABEL_VIDEO_TAB,
#endif
#ifdef HAVE_NETWORKING
MENU_ENUM_LABEL_NETPLAY_TAB,
#endif
MENU_ENUM_LABEL_ADD_TAB,
MENU_ENUM_LABEL_CONTENTLESS_CORES_TAB,
#ifdef HAVE_LIBRETRODB
MENU_ENUM_LABEL_EXPLORE_TAB
#endif
};
static void ozone_draw_sidebar(
ozone_handle_t *ozone,
gfx_display_t *p_disp,
@ -7678,6 +7700,10 @@ static void ozone_set_thumbnail_content(void *data, const char *s)
break;
default:
if ( string_ends_with(playlist_get_conf_path(pl), FILE_PATH_CONTENT_MUSIC_HISTORY)
|| string_ends_with(playlist_get_conf_path(pl), FILE_PATH_CONTENT_VIDEO_HISTORY))
ozone->flags &= ~OZONE_FLAG_WANT_THUMBNAIL_BAR;
else
ozone->flags |= OZONE_FLAG_WANT_THUMBNAIL_BAR;
break;
}
@ -7931,7 +7957,21 @@ static bool ozone_manage_available(ozone_handle_t *ozone, size_t current_selecti
switch (last_entry.type)
{
case FILE_TYPE_PLAYLIST_COLLECTION:
case FILE_TYPE_RPL_ENTRY:
return true;
default:
break;
}
switch (last_entry.enum_idx)
{
case MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY:
case MENU_ENUM_LABEL_GOTO_FAVORITES:
case MENU_ENUM_LABEL_GOTO_IMAGES:
case MENU_ENUM_LABEL_GOTO_MUSIC:
case MENU_ENUM_LABEL_GOTO_VIDEO:
return true;
default:
break;
}
return false;
}
@ -8131,22 +8171,58 @@ static enum menu_action ozone_parse_menu_entry_action(
if (ozone->flags & OZONE_FLAG_CURSOR_IN_SIDEBAR)
{
char playlist_path[PATH_MAX_LENGTH];
ssize_t list_selection;
/* If cursor is active, ensure we target
* an on screen category */
size_t tab_selection = (ozone->flags & OZONE_FLAG_CURSOR_MODE)
? ozone_get_onscreen_category_selection(ozone)
: ozone->categories_selection_ptr;
if (tab_selection < (size_t)(ozone->system_tab_end + 1))
if (!ozone_manage_available(ozone, ozone->selection))
break;
new_selection = tab_selection - ozone->system_tab_end - 1;
list_selection = tab_selection - ozone->system_tab_end - 1;
new_action = MENU_ACTION_ACCESSIBILITY_SPEAK_TITLE;
if (list_selection < 0)
{
enum msg_hash_enums value_idx = ozone_system_tabs_label[tab_selection];
const char *tab_title;
switch (value_idx)
{
case MENU_ENUM_LABEL_HISTORY_TAB:
tab_title = FILE_PATH_CONTENT_HISTORY;
break;
case MENU_ENUM_LABEL_FAVORITES_TAB:
tab_title = FILE_PATH_CONTENT_FAVORITES;
break;
case MENU_ENUM_LABEL_IMAGES_TAB:
tab_title = FILE_PATH_CONTENT_IMAGE_HISTORY;
break;
case MENU_ENUM_LABEL_MUSIC_TAB:
tab_title = FILE_PATH_CONTENT_MUSIC_HISTORY;
break;
case MENU_ENUM_LABEL_VIDEO_TAB:
tab_title = FILE_PATH_CONTENT_VIDEO_HISTORY;
break;
default:
tab_title = "";
break;
}
if (string_is_empty(tab_title))
break;
fill_pathname_join(playlist_path,
"",
tab_title,
sizeof(playlist_path));
}
else
fill_pathname_join(playlist_path,
settings->paths.directory_playlist,
ozone->horizontal_list.list[new_selection].path,
ozone->horizontal_list.list[list_selection].path,
sizeof(playlist_path));
generic_action_ok_displaylist_push(

View File

@ -4321,7 +4321,7 @@ static unsigned menu_displaylist_parse_playlists(
{
if (settings->bools.menu_content_show_favorites)
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES),
FILE_PATH_CONTENT_FAVORITES,
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES),
MENU_ENUM_LABEL_GOTO_FAVORITES,
MENU_SETTING_ACTION, 0, 0, NULL))
@ -4329,7 +4329,7 @@ static unsigned menu_displaylist_parse_playlists(
if (settings->bools.menu_content_show_history)
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_HISTORY),
FILE_PATH_CONTENT_HISTORY,
msg_hash_to_str(MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY),
MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY,
MENU_SETTING_ACTION, 0, 0, NULL))
@ -4339,7 +4339,7 @@ static unsigned menu_displaylist_parse_playlists(
{
if (settings->bools.menu_content_show_history)
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_HISTORY),
FILE_PATH_CONTENT_HISTORY,
msg_hash_to_str(MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY),
MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY,
MENU_SETTING_ACTION, 0, 0, NULL))
@ -4347,7 +4347,7 @@ static unsigned menu_displaylist_parse_playlists(
if (settings->bools.menu_content_show_favorites)
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES),
FILE_PATH_CONTENT_FAVORITES,
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES),
MENU_ENUM_LABEL_GOTO_FAVORITES,
MENU_SETTING_ACTION, 0, 0, NULL))
@ -4357,7 +4357,7 @@ static unsigned menu_displaylist_parse_playlists(
if (settings->bools.menu_content_show_images)
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_IMAGES),
FILE_PATH_CONTENT_IMAGE_HISTORY,
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_IMAGES),
MENU_ENUM_LABEL_GOTO_IMAGES,
MENU_SETTING_ACTION, 0, 0, NULL))
@ -4365,7 +4365,7 @@ static unsigned menu_displaylist_parse_playlists(
if (settings->bools.menu_content_show_music)
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_MUSIC),
FILE_PATH_CONTENT_MUSIC_HISTORY,
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_MUSIC),
MENU_ENUM_LABEL_GOTO_MUSIC,
MENU_SETTING_ACTION, 0, 0, NULL))
@ -4374,7 +4374,7 @@ static unsigned menu_displaylist_parse_playlists(
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
if (settings->bools.menu_content_show_video)
if (menu_entries_append(info_list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_VIDEO),
FILE_PATH_CONTENT_VIDEO_HISTORY,
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_VIDEO),
MENU_ENUM_LABEL_GOTO_VIDEO,
MENU_SETTING_ACTION, 0, 0, NULL))
@ -4971,6 +4971,7 @@ static bool menu_displaylist_parse_playlist_manager_settings(
* (i.e. it is not relevant for history/favourites) */
if ( !is_content_history
&& !string_is_equal(playlist_file, FILE_PATH_CONTENT_FAVORITES))
{
menu_entries_append(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_DEFAULT_CORE),
msg_hash_to_str(MENU_ENUM_LABEL_PLAYLIST_MANAGER_DEFAULT_CORE),
@ -4983,6 +4984,7 @@ static bool menu_displaylist_parse_playlist_manager_settings(
msg_hash_to_str(MENU_ENUM_LABEL_PLAYLIST_MANAGER_RESET_CORES),
MENU_ENUM_LABEL_PLAYLIST_MANAGER_RESET_CORES,
MENU_SETTING_ACTION_PLAYLIST_MANAGER_RESET_CORES, 0, 0, NULL);
}
/* Refresh playlist */
if (playlist_scan_refresh_enabled(playlist))
@ -13704,12 +13706,15 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
&ret);
if (count == 0)
{
if (menu_entries_append(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_HISTORY_AVAILABLE),
msg_hash_to_str(MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE),
MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE,
MENU_INFO_MESSAGE, 0, 0, NULL))
count++;
info->flags &= ~MD_FLAG_NEED_PUSH_NO_PLAYLIST_ENTRIES;
}
}
ret = 0;
@ -13744,7 +13749,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
MENU_INFO_MESSAGE, 0, 0, NULL))
count++;
info->flags &= ~MD_FLAG_NEED_PUSH_NO_PLAYLIST_ENTRIES;
ret = 0;
}
ret = 0;
@ -15208,29 +15212,33 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{
if (settings->bools.menu_content_show_favorites)
if (menu_entries_append(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES),
FILE_PATH_CONTENT_FAVORITES,
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES),
MENU_ENUM_LABEL_GOTO_FAVORITES,
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
if (settings->bools.menu_content_show_history)
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(info->list,
if (menu_entries_append(info->list,
FILE_PATH_CONTENT_HISTORY,
msg_hash_to_str(MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY),
MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY,
PARSE_ACTION, false) == 0)
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
}
else
{
if (settings->bools.menu_content_show_history)
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(info->list,
if (menu_entries_append(info->list,
FILE_PATH_CONTENT_HISTORY,
msg_hash_to_str(MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY),
MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY,
PARSE_ACTION, false) == 0)
MENU_SETTING_ACTION, 0, 0, NULL))
count++;
if (settings->bools.menu_content_show_favorites)
if (menu_entries_append(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES),
FILE_PATH_CONTENT_FAVORITES,
msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES),
MENU_ENUM_LABEL_GOTO_FAVORITES,
MENU_SETTING_ACTION, 0, 0, NULL))

View File

@ -661,9 +661,27 @@ static void task_pl_manager_clean_playlist_handler(retro_task_t *task)
playlist_write_file(pl_manager->playlist);
/* Update progress display */
task_free_title(task);
_len = strlcpy(task_title,
msg_hash_to_str(MSG_PLAYLIST_MANAGER_PLAYLIST_CLEANED),
sizeof(task_title));
if (string_starts_with(FILE_PATH_CONTENT_FAVORITES, pl_manager->playlist_name))
strlcpy(task_title + _len, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FAVORITES_TAB),
sizeof(task_title) - _len);
else if (string_starts_with(FILE_PATH_CONTENT_HISTORY, pl_manager->playlist_name))
strlcpy(task_title + _len, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_HISTORY_TAB),
sizeof(task_title) - _len);
else if (string_starts_with(FILE_PATH_CONTENT_IMAGE_HISTORY, pl_manager->playlist_name))
strlcpy(task_title + _len, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_IMAGES_TAB),
sizeof(task_title) - _len);
else if (string_starts_with(FILE_PATH_CONTENT_MUSIC_HISTORY, pl_manager->playlist_name))
strlcpy(task_title + _len, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MUSIC_TAB),
sizeof(task_title) - _len);
else if (string_starts_with(FILE_PATH_CONTENT_VIDEO_HISTORY, pl_manager->playlist_name))
strlcpy(task_title + _len, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_VIDEO_TAB),
sizeof(task_title) - _len);
else
strlcpy(task_title + _len, pl_manager->playlist_name,
sizeof(task_title) - _len);