diff --git a/menu/cbs/menu_cbs_label.c b/menu/cbs/menu_cbs_label.c index e5a745b5f0..17844f38aa 100644 --- a/menu/cbs/menu_cbs_label.c +++ b/menu/cbs/menu_cbs_label.c @@ -112,11 +112,6 @@ 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; diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index c21ba3f6fd..74359f8ffe 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -8634,7 +8634,6 @@ 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; @@ -8647,12 +8646,7 @@ static int action_ok_delete_playlist(const char *path, menu_st->driver_ctx->environ_cb(MENU_ENVIRON_RESET_HORIZONTAL_LIST, NULL, menu_st->userdata); - 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); + return action_cancel_pop_default(NULL, NULL, 0, 0); } #ifdef HAVE_NETWORKING diff --git a/menu/cbs/menu_cbs_start.c b/menu/cbs/menu_cbs_start.c index aee83b8cbe..3a07faa3b2 100644 --- a/menu/cbs/menu_cbs_start.c +++ b/menu/cbs/menu_cbs_start.c @@ -897,13 +897,6 @@ 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; } diff --git a/menu/drivers/ozone.c b/menu/drivers/ozone.c index 25ade5cfcd..6d21595d02 100644 --- a/menu/drivers/ozone.c +++ b/menu/drivers/ozone.c @@ -3273,28 +3273,6 @@ 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, @@ -7700,11 +7678,7 @@ 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; + ozone->flags |= OZONE_FLAG_WANT_THUMBNAIL_BAR; break; } } @@ -7957,21 +7931,7 @@ 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; } @@ -8171,59 +8131,23 @@ 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 (!ozone_manage_available(ozone, ozone->selection)) + if (tab_selection < (size_t)(ozone->system_tab_end + 1)) break; - list_selection = tab_selection - ozone->system_tab_end - 1; - new_action = MENU_ACTION_ACCESSIBILITY_SPEAK_TITLE; + new_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[list_selection].path, - sizeof(playlist_path)); + fill_pathname_join(playlist_path, + settings->paths.directory_playlist, + ozone->horizontal_list.list[new_selection].path, + sizeof(playlist_path)); generic_action_ok_displaylist_push( playlist_path, diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 7217d34450..022406b13f 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -4321,7 +4321,7 @@ static unsigned menu_displaylist_parse_playlists( { if (settings->bools.menu_content_show_favorites) if (menu_entries_append(info_list, - FILE_PATH_CONTENT_FAVORITES, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_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, - FILE_PATH_CONTENT_HISTORY, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LOAD_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, - FILE_PATH_CONTENT_HISTORY, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_LOAD_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, - FILE_PATH_CONTENT_FAVORITES, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_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, - FILE_PATH_CONTENT_IMAGE_HISTORY, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_IMAGES), 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, - FILE_PATH_CONTENT_MUSIC_HISTORY, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_MUSIC), 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, - FILE_PATH_CONTENT_VIDEO_HISTORY, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_VIDEO), msg_hash_to_str(MENU_ENUM_LABEL_GOTO_VIDEO), MENU_ENUM_LABEL_GOTO_VIDEO, MENU_SETTING_ACTION, 0, 0, NULL)) @@ -4971,20 +4971,18 @@ 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), MENU_ENUM_LABEL_PLAYLIST_MANAGER_DEFAULT_CORE, MENU_SETTING_PLAYLIST_MANAGER_DEFAULT_CORE, 0, 0, NULL); - /* Reset core associations */ - menu_entries_append(list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_RESET_CORES), - 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); - } + /* Reset core associations */ + menu_entries_append(list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_MANAGER_RESET_CORES), + 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)) @@ -13706,18 +13704,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; + ret = 0; /* Playlists themselves are sorted * > Display lists generated from playlists * must never be sorted */ @@ -13749,6 +13744,7 @@ 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; @@ -15212,33 +15208,29 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, { if (settings->bools.menu_content_show_favorites) if (menu_entries_append(info->list, - FILE_PATH_CONTENT_FAVORITES, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_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_entries_append(info->list, - FILE_PATH_CONTENT_HISTORY, - msg_hash_to_str(MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY), + if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(info->list, MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY, - MENU_SETTING_ACTION, 0, 0, NULL)) + PARSE_ACTION, false) == 0) count++; } else { if (settings->bools.menu_content_show_history) - if (menu_entries_append(info->list, - FILE_PATH_CONTENT_HISTORY, - msg_hash_to_str(MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY), + if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(info->list, MENU_ENUM_LABEL_LOAD_CONTENT_HISTORY, - MENU_SETTING_ACTION, 0, 0, NULL)) + PARSE_ACTION, false) == 0) count++; if (settings->bools.menu_content_show_favorites) if (menu_entries_append(info->list, - FILE_PATH_CONTENT_FAVORITES, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_GOTO_FAVORITES), msg_hash_to_str(MENU_ENUM_LABEL_GOTO_FAVORITES), MENU_ENUM_LABEL_GOTO_FAVORITES, MENU_SETTING_ACTION, 0, 0, NULL)) diff --git a/tasks/task_playlist_manager.c b/tasks/task_playlist_manager.c index 0cfb1cfbd7..d26933a8ed 100644 --- a/tasks/task_playlist_manager.c +++ b/tasks/task_playlist_manager.c @@ -661,29 +661,11 @@ 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); + strlcpy(task_title + _len, pl_manager->playlist_name, + sizeof(task_title) - _len); task_set_title(task, strdup(task_title)); }