Add option to allow or prevent removal of playlist entries

This commit is contained in:
Ryunam 2016-12-27 13:20:41 +01:00
parent e5f9c4d713
commit ebded84b67
8 changed files with 34 additions and 1 deletions

View File

@ -416,6 +416,7 @@ static bool bundle_assets_extract_enable = false;
#endif
static const bool def_history_list_enable = true;
static const bool def_playlist_entry_remove = true;
static const unsigned int def_user_language = 0;

View File

@ -836,6 +836,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("savestate_auto_load", &settings->savestate_auto_load, true, savestate_auto_load, false);
SETTING_BOOL("savestate_thumbnail_enable", &settings->savestate_thumbnail_enable, true, savestate_thumbnail_enable, false);
SETTING_BOOL("history_list_enable", &settings->history_list_enable, true, def_history_list_enable, false);
SETTING_BOOL("playlist_entry_remove", &settings->playlist_entry_remove, true, def_playlist_entry_remove, false);
SETTING_BOOL("game_specific_options", &settings->game_specific_options, true, default_game_specific_options, false);
SETTING_BOOL("auto_overrides_enable", &settings->auto_overrides_enable, true, default_auto_overrides_enable, false);
SETTING_BOOL("auto_remaps_enable", &settings->auto_remaps_enable, true, default_auto_remaps_enable, false);

View File

@ -421,6 +421,7 @@ typedef struct settings
bool auto_screenshot_filename;
bool history_list_enable;
bool playlist_entry_remove;
bool rewind_enable;
size_t rewind_buffer_size;
unsigned rewind_granularity;

View File

@ -165,6 +165,8 @@ MSG_HASH(MENU_ENUM_LABEL_CONTENT_DATABASE_DIRECTORY,
"content_database_path")
MSG_HASH(MENU_ENUM_LABEL_CONTENT_HISTORY_SIZE,
"content_history_size")
MSG_HASH(MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE,
"playlist_entry_remove")
MSG_HASH(MENU_ENUM_LABEL_CONTENT_SETTINGS,
"quick_menu")
MSG_HASH(MENU_ENUM_LABEL_CORE_ASSETS_DIRECTORY,

View File

@ -478,6 +478,8 @@ MSG_HASH(
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONTENT_HISTORY_SIZE,
"History List Size")
MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE,
"Allow to remove entries")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS,
"Quick Menu")
MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_ASSETS_DIR,

View File

@ -2788,7 +2788,9 @@ static int menu_displaylist_parse_horizontal_content_actions(
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RUN),
msg_hash_to_str(MENU_ENUM_LABEL_RUN),
MENU_ENUM_LABEL_RUN, FILE_TYPE_PLAYLIST_ENTRY, 0, idx);
menu_entries_append_enum(info->list,
if (settings->playlist_entry_remove)
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,
@ -4288,6 +4290,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
ret = menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_CONTENT_HISTORY_SIZE,
PARSE_ONLY_UINT, false);
ret = menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_PLAYLIST_ENTRY_REMOVE,
PARSE_ONLY_BOOL, false);
menu_displaylist_parse_playlist_associations(info);
info->need_push = true;

View File

@ -5440,6 +5440,26 @@ static bool setting_append_list(
menu_settings_list_current_add_range(list, list_info, 0, 0, 1.0, true, false);
END_SUB_GROUP(list, list_info, parent_group);
START_SUB_GROUP(list, list_info, "Playlist", &group_info, &subgroup_info, parent_group);
CONFIG_BOOL(
list, list_info,
&settings->playlist_entry_remove,
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,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler,
SD_FLAG_NONE);
END_SUB_GROUP(list, list_info, parent_group);
END_GROUP(list, list_info, parent_group);
break;
case SETTINGS_LIST_CHEEVOS:

View File

@ -704,6 +704,7 @@ enum msg_hash_enums
/* Playlists */
MENU_LABEL(HISTORY_LIST_ENABLE),
MENU_LABEL(CONTENT_HISTORY_SIZE),
MENU_LABEL(PLAYLIST_ENTRY_REMOVE),
MENU_LABEL(MENU_THROTTLE_FRAMERATE),
MENU_LABEL(NO_ACHIEVEMENTS_TO_DISPLAY),
MENU_LABEL(NO_ENTRIES_TO_DISPLAY),