Add option to show 'remove playlist entry' only on history/favourites

This commit is contained in:
jdgleaver 2019-06-04 11:27:37 +01:00
parent 1120a7e490
commit 80c9475fa4
10 changed files with 98 additions and 19 deletions

View File

@ -78,7 +78,6 @@ static const int crt_switch_resolution_super = 2560;
static const int crt_switch_center_adjust = 0;
static const bool def_history_list_enable = true;
static const bool def_playlist_entry_remove = true;
static const bool def_playlist_entry_rename = true;
static const unsigned int def_user_language = 0;
@ -747,6 +746,8 @@ static const unsigned playlist_show_inline_core_name = PLAYLIST_INLINE_CORE_DISP
/* Specifies which runtime record to use on playlist sublabels */
static const unsigned playlist_sublabel_runtime_type = PLAYLIST_RUNTIME_PER_CORE;
static const unsigned playlist_entry_remove_enable = PLAYLIST_ENTRY_REMOVE_ENABLE_ALL;
#endif
static const bool scan_without_core_match = false;

View File

@ -1590,7 +1590,6 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("savestate_auto_load", &settings->bools.savestate_auto_load, true, savestate_auto_load, false);
SETTING_BOOL("savestate_thumbnail_enable", &settings->bools.savestate_thumbnail_enable, true, savestate_thumbnail_enable, false);
SETTING_BOOL("history_list_enable", &settings->bools.history_list_enable, true, def_history_list_enable, false);
SETTING_BOOL("playlist_entry_remove", &settings->bools.playlist_entry_remove, true, def_playlist_entry_remove, false);
SETTING_BOOL("playlist_entry_rename", &settings->bools.playlist_entry_rename, true, def_playlist_entry_rename, false);
SETTING_BOOL("game_specific_options", &settings->bools.game_specific_options, true, default_game_specific_options, false);
SETTING_BOOL("auto_overrides_enable", &settings->bools.auto_overrides_enable, true, default_auto_overrides_enable, false);
@ -1837,6 +1836,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
#endif
#ifdef HAVE_MENU
SETTING_UINT("playlist_entry_remove_enable", &settings->uints.playlist_entry_remove_enable, true, playlist_entry_remove_enable, false);
SETTING_UINT("playlist_show_inline_core_name", &settings->uints.playlist_show_inline_core_name, true, playlist_show_inline_core_name, false);
SETTING_UINT("playlist_sublabel_runtime_type", &settings->uints.playlist_sublabel_runtime_type, true, playlist_sublabel_runtime_type, false);
#endif

View File

@ -276,7 +276,6 @@ typedef struct settings
bool set_supports_no_game_enable;
bool auto_screenshot_filename;
bool history_list_enable;
bool playlist_entry_remove;
bool playlist_entry_rename;
bool rewind_enable;
bool vrr_runloop_enable;
@ -478,6 +477,7 @@ typedef struct settings
unsigned menu_rgui_particle_effect;
unsigned menu_ticker_type;
unsigned playlist_entry_remove_enable;
unsigned playlist_show_inline_core_name;
unsigned playlist_sublabel_runtime_type;

View File

@ -910,9 +910,11 @@ static uint32_t gfx_ctx_drm_get_flags(void *data)
BIT32_SET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT);
if (string_is_equal(video_driver_get_ident(), "glcore"))
{
#ifdef HAVE_SLANG
BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_SLANG);
#endif
}
else
BIT32_SET(flags, GFX_CTX_FLAGS_SHADERS_GLSL);

View File

@ -202,7 +202,7 @@ MSG_HASH(MENU_ENUM_LABEL_CONTENT_DATABASE_DIRECTORY,
MSG_HASH(MENU_ENUM_LABEL_CONTENT_HISTORY_SIZE,
"content_history_size")
MSG_HASH(MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE,
"playlist_entry_remove")
"playlist_entry_remove_enable")
MSG_HASH(MENU_ENUM_LABEL_CONTENT_SETTINGS,
"quick_menu")
MSG_HASH(MENU_ENUM_LABEL_CORE_ASSETS_DIRECTORY,

View File

@ -8627,6 +8627,18 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_NEVER,
"Never"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV,
"History & Favorites"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_ALL,
"All Playlists"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_NONE,
"OFF"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLIST_SORT_ALPHABETICAL,
"Sort playlists alphabetically"

View File

@ -349,6 +349,14 @@ enum playlist_inline_core_display_type
PLAYLIST_INLINE_CORE_DISPLAY_LAST
};
enum playlist_entry_remove_enable_type
{
PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV = 0,
PLAYLIST_ENTRY_REMOVE_ENABLE_ALL,
PLAYLIST_ENTRY_REMOVE_ENABLE_NONE,
PLAYLIST_ENTRY_REMOVE_ENABLE_LAST
};
typedef uintptr_t menu_texture_item;
typedef struct menu_display_ctx_clearcolor

View File

@ -2042,13 +2042,34 @@ static int menu_displaylist_parse_horizontal_content_actions(
MENU_ENUM_LABEL_RENAME_ENTRY,
FILE_TYPE_PLAYLIST_ENTRY, 0, idx);
if (settings->bools.playlist_entry_remove &&
!settings->bools.kiosk_mode_enable)
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DELETE_ENTRY),
msg_hash_to_str(MENU_ENUM_LABEL_DELETE_ENTRY),
MENU_ENUM_LABEL_DELETE_ENTRY,
MENU_SETTING_ACTION_DELETE_ENTRY, 0, 0);
if (!settings->bools.kiosk_mode_enable)
{
bool remove_entry_enabled = false;
if (settings->uints.playlist_entry_remove_enable == PLAYLIST_ENTRY_REMOVE_ENABLE_ALL)
remove_entry_enabled = true;
else if (settings->uints.playlist_entry_remove_enable == PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV)
{
char system[PATH_MAX_LENGTH];
system[0] = '\0';
menu_driver_get_thumbnail_system(system, sizeof(system));
if (!string_is_empty(system))
remove_entry_enabled = string_is_equal(system, "history") ||
string_is_equal(system, "favorites") ||
string_is_equal(system, "images_history") ||
string_is_equal(system, "music_history") ||
string_is_equal(system, "video_history");
}
if (remove_entry_enabled)
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DELETE_ENTRY),
msg_hash_to_str(MENU_ENUM_LABEL_DELETE_ENTRY),
MENU_ENUM_LABEL_DELETE_ENTRY,
MENU_SETTING_ACTION_DELETE_ENTRY, 0, 0);
}
if (settings->bools.quick_menu_show_add_to_favorites)
{
@ -5628,7 +5649,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{MENU_ENUM_LABEL_HISTORY_LIST_ENABLE, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_CONTENT_HISTORY_SIZE, PARSE_ONLY_UINT},
{MENU_ENUM_LABEL_PLAYLIST_ENTRY_RENAME, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE, PARSE_ONLY_UINT},
{MENU_ENUM_LABEL_PLAYLIST_SORT_ALPHABETICAL, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_PLAYLIST_USE_OLD_FORMAT, PARSE_ONLY_BOOL},
{MENU_ENUM_LABEL_PLAYLIST_SHOW_INLINE_CORE_NAME, PARSE_ONLY_UINT},

View File

@ -3862,6 +3862,36 @@ static void setting_get_string_representation_uint_playlist_inline_core_display_
}
}
static void setting_get_string_representation_uint_playlist_entry_remove_enable(
rarch_setting_t *setting,
char *s, size_t len)
{
if (!setting)
return;
switch (*setting->value.target.unsigned_integer)
{
case PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV),
len);
break;
case PLAYLIST_ENTRY_REMOVE_ENABLE_ALL:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_ALL),
len);
break;
case PLAYLIST_ENTRY_REMOVE_ENABLE_NONE:
strlcpy(s,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_NONE),
len);
break;
}
}
#if defined(_3DS)
static void setting_get_string_representation_uint_video_3ds_display_mode(
rarch_setting_t *setting,
@ -13016,20 +13046,21 @@ static bool setting_append_list(
general_read_handler,
SD_FLAG_NONE);
CONFIG_BOOL(
CONFIG_UINT(
list, list_info,
&settings->bools.playlist_entry_remove,
&settings->uints.playlist_entry_remove_enable,
MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE,
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE,
def_playlist_entry_remove,
MENU_ENUM_LABEL_VALUE_OFF,
MENU_ENUM_LABEL_VALUE_ON,
playlist_entry_remove_enable,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler,
SD_FLAG_NONE);
general_read_handler);
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_uint_playlist_entry_remove_enable;
menu_settings_list_current_add_range(list, list_info, 0, PLAYLIST_ENTRY_REMOVE_ENABLE_LAST-1, 1, true, true);
CONFIG_BOOL(
list, list_info,

View File

@ -2376,6 +2376,10 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_ALWAYS,
MENU_ENUM_LABEL_VALUE_PLAYLIST_INLINE_CORE_DISPLAY_NEVER,
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_HIST_FAV,
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_ALL,
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_NONE,
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_CORE,
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_RUNTIME,
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED,