Add 'core management' menu

This commit is contained in:
jdgleaver 2020-06-11 14:12:20 +01:00
parent 479a3ab9a3
commit 42ad070a1d
17 changed files with 304 additions and 56 deletions

View File

@ -524,6 +524,10 @@ MSG_HASH(
MENU_ENUM_LABEL_CORE_UPDATER_LIST,
"core_updater_list"
)
MSG_HASH(
MENU_ENUM_LABEL_CORE_MANAGER_LIST,
"core_manager_list"
)
MSG_HASH(
MENU_ENUM_LABEL_CPU_ARCHITECTURE,
"system_information_cpu_architecture"
@ -760,6 +764,10 @@ MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST,
"core_updater"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_CORE_MANAGER_LIST,
"deferred_core_manager_list"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_CURSOR_MANAGER_LIST,
"deferred_cursor_manager_list"

View File

@ -2544,6 +2544,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_VIDEO_ALLOW_ROTATE,
"Allow cores to set rotation. When disabled, rotation requests are ignored. Useful for setups that manually rotate the screen."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CORE_MANAGER_LIST,
"Manage Cores"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CORE_MANAGER_LIST,
"Perform offline maintenance tasks on installed cores (backup, restore, delete, etc.) and view core information."
)
/* Settings > Configuration */

View File

@ -259,6 +259,8 @@ GENERIC_DEFERRED_PUSH(deferred_push_manual_content_scan_dat_file, DISPLAYLIST_
GENERIC_DEFERRED_PUSH(deferred_push_core_restore_backup_list, DISPLAYLIST_CORE_RESTORE_BACKUP_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_core_delete_backup_list, DISPLAYLIST_CORE_DELETE_BACKUP_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_core_manager_list, DISPLAYLIST_CORE_MANAGER_LIST)
GENERIC_DEFERRED_PUSH(deferred_push_file_browser_select_sideload_core, DISPLAYLIST_FILE_BROWSER_SELECT_SIDELOAD_CORE)
static int deferred_push_cursor_manager_list_deferred(
@ -879,6 +881,7 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_MANUAL_CONTENT_SCAN_DAT_FILE, deferred_push_manual_content_scan_dat_file},
{MENU_ENUM_LABEL_DEFERRED_CORE_RESTORE_BACKUP_LIST, deferred_push_core_restore_backup_list},
{MENU_ENUM_LABEL_DEFERRED_CORE_DELETE_BACKUP_LIST, deferred_push_core_delete_backup_list},
{MENU_ENUM_LABEL_DEFERRED_CORE_MANAGER_LIST, deferred_push_core_manager_list},
{MENU_ENUM_LABEL_SIDELOAD_CORE_LIST, deferred_push_file_browser_select_sideload_core},
{MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION_DETECT_CORE, deferred_archive_action_detect_core},
{MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION, deferred_archive_action},
@ -1279,6 +1282,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_ENUM_LABEL_DEFERRED_CORE_DELETE_BACKUP_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_core_delete_backup_list);
break;
case MENU_ENUM_LABEL_DEFERRED_CORE_MANAGER_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_core_manager_list);
break;
case MENU_ENUM_LABEL_SIDELOAD_CORE_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_file_browser_select_sideload_core);
break;

View File

@ -471,6 +471,31 @@ static void menu_action_setting_disp_set_label_core_updater_entry(
}
#endif
static void menu_action_setting_disp_set_label_core_manager_entry(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *s, size_t len,
const char *path,
char *s2, size_t len2)
{
const char *alt = NULL;
*s = '\0';
*w = 0;
menu_entries_get_at_offset(list, i, NULL,
NULL, NULL, NULL, &alt);
if (alt)
strlcpy(s2, alt, len2);
/* TODO: Once core-specific 'block online updates'
* settings are implemented, the 'value' string will
* be used to indicate whether updates are enabled
* or disabled */
}
static void menu_action_setting_disp_set_label_input_desc(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
@ -1586,6 +1611,16 @@ static int menu_cbs_init_bind_get_string_representation_compare_label(
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_manual_content_scan_core_name);
break;
#ifdef HAVE_NETWORKING
case MENU_ENUM_LABEL_CORE_UPDATER_ENTRY:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_core_updater_entry);
break;
#endif
case MENU_ENUM_LABEL_CORE_MANAGER_ENTRY:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_core_manager_entry);
break;
default:
return - 1;
}
@ -1673,12 +1708,6 @@ static int menu_cbs_init_bind_get_string_representation_compare_type(
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_core);
break;
#ifdef HAVE_NETWORKING
case FILE_TYPE_DOWNLOAD_CORE:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_core_updater_entry);
break;
#endif
case FILE_TYPE_PLAIN:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_plain);

View File

@ -436,6 +436,8 @@ static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl)
return MENU_ENUM_LABEL_DEFERRED_VIDEO_SHADER_PRESET_REMOVE_LIST;
case ACTION_OK_DL_MANUAL_CONTENT_SCAN_LIST:
return MENU_ENUM_LABEL_DEFERRED_MANUAL_CONTENT_SCAN_LIST;
case ACTION_OK_DL_CORE_MANAGER_LIST:
return MENU_ENUM_LABEL_DEFERRED_CORE_MANAGER_LIST;
default:
break;
}
@ -1264,6 +1266,7 @@ int generic_action_ok_displaylist_push(const char *path,
case ACTION_OK_DL_SHADER_PRESET_SAVE:
case ACTION_OK_DL_CDROM_INFO_LIST:
case ACTION_OK_DL_MANUAL_CONTENT_SCAN_LIST:
case ACTION_OK_DL_CORE_MANAGER_LIST:
ACTION_OK_DL_LBL(action_ok_dl_to_enum(action_type), DISPLAYLIST_GENERIC);
break;
case ACTION_OK_DL_CDROM_INFO_DETAIL_LIST:
@ -4979,6 +4982,7 @@ DEFAULT_ACTION_OK_FUNC(action_ok_rgui_menu_theme_preset, ACTION_OK_DL_RGUI_MENU_
DEFAULT_ACTION_OK_FUNC(action_ok_pl_thumbnails_updater_list, ACTION_OK_DL_PL_THUMBNAILS_UPDATER_LIST)
DEFAULT_ACTION_OK_FUNC(action_ok_push_manual_content_scan_list, ACTION_OK_DL_MANUAL_CONTENT_SCAN_LIST)
DEFAULT_ACTION_OK_FUNC(action_ok_manual_content_scan_dat_file, ACTION_OK_DL_MANUAL_CONTENT_SCAN_DAT_FILE)
DEFAULT_ACTION_OK_FUNC(action_ok_push_core_manager_list, ACTION_OK_DL_CORE_MANAGER_LIST)
static int action_ok_open_uwp_permission_settings(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
@ -6706,6 +6710,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_LATENCY_SETTINGS, action_ok_push_latency_settings_list},
{MENU_ENUM_LABEL_CORE_SETTINGS, action_ok_push_core_settings_list},
{MENU_ENUM_LABEL_CORE_INFORMATION, action_ok_push_core_information_list},
{MENU_ENUM_LABEL_CORE_MANAGER_ENTRY, action_ok_push_core_information_list},
{MENU_ENUM_LABEL_CORE_RESTORE_BACKUP_LIST, action_ok_push_core_restore_backup_list},
{MENU_ENUM_LABEL_CORE_DELETE_BACKUP_LIST, action_ok_push_core_delete_backup_list},
{MENU_ENUM_LABEL_CONFIGURATION_SETTINGS, action_ok_push_configuration_settings_list},
@ -6805,6 +6810,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_MIDI_SETTINGS, action_ok_midi_list},
{MENU_ENUM_LABEL_SCREEN_RESOLUTION, action_ok_video_resolution},
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_DEFAULT_CORE, action_ok_playlist_default_core},
{MENU_ENUM_LABEL_CORE_MANAGER_LIST, action_ok_push_core_manager_list},
};
for (i = 0; i < ARRAY_SIZE(ok_list); i++)

View File

@ -307,6 +307,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_list, MENU_
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_download_core, MENU_ENUM_SUBLABEL_DOWNLOAD_CORE)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_update_installed_cores, MENU_ENUM_SUBLABEL_UPDATE_INSTALLED_CORES)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_sideload_core_list, MENU_ENUM_SUBLABEL_SIDELOAD_CORE_LIST)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_core_manager_list, MENU_ENUM_SUBLABEL_CORE_MANAGER_LIST)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_load_disc, MENU_ENUM_SUBLABEL_LOAD_DISC)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_dump_disc, MENU_ENUM_SUBLABEL_DUMP_DISC)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_content_list, MENU_ENUM_SUBLABEL_LOAD_CONTENT_LIST)
@ -1379,14 +1380,6 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
return 0;
}
#ifdef HAVE_NETWORKING
if (type == FILE_TYPE_DOWNLOAD_CORE)
{
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_updater_entry);
return 0;
}
#endif
/* Hotkey binds require special handling
* > Only the 'enable_hotkey' entry has a sublabel */
if ((cbs->enum_idx >= MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN) &&
@ -1402,8 +1395,14 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
switch (cbs->enum_idx)
{
case MENU_ENUM_LABEL_FILE_BROWSER_CORE:
case MENU_ENUM_LABEL_CORE_MANAGER_ENTRY:
BIND_ACTION_SUBLABEL(cbs, menu_action_sublabel_file_browser_core);
break;
#ifdef HAVE_NETWORKING
case MENU_ENUM_LABEL_CORE_UPDATER_ENTRY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_updater_entry);
break;
#endif
case MENU_ENUM_LABEL_ADD_TO_MIXER:
case MENU_ENUM_LABEL_ADD_TO_MIXER_AND_COLLECTION:
#ifdef HAVE_AUDIOMIXER
@ -2686,6 +2685,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_UPDATE_INSTALLED_CORES:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_update_installed_cores);
break;
case MENU_ENUM_LABEL_CORE_MANAGER_LIST:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_manager_list);
break;
case MENU_ENUM_LABEL_VIDEO_POST_FILTER_RECORD:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_post_filter_record);
break;

View File

@ -379,6 +379,47 @@ static int action_get_title_deferred_core_delete_backup_list(
s, len);
}
static int action_get_core_information_list(
const char *path, const char *label, unsigned menu_type, char *s, size_t len)
{
core_info_t *core_info = NULL;
/* Check whether we are parsing information for a
* core updater/manager entry or the currently loaded core */
if ((menu_type == FILE_TYPE_DOWNLOAD_CORE) ||
(menu_type == MENU_SETTING_ACTION_CORE_MANAGER_OPTIONS))
{
const char *core_path = path;
core_info_ctx_find_t core_info_finder;
if (string_is_empty(core_path))
goto error;
/* Core updater/manager entry - search for
* corresponding core info */
core_info_finder.inf = NULL;
core_info_finder.path = core_path;
if (core_info_find(&core_info_finder))
core_info = core_info_finder.inf;
}
else
core_info_get_current_core(&core_info);
if (!core_info || string_is_empty(core_info->display_name))
goto error;
/* Copy display name */
strlcpy(s, core_info->display_name, len);
return 1;
error:
/* An unknown error has occurred - just set the
* title to the legacy 'Core Information' string */
strlcpy(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFORMATION), len);
return 0;
}
DEFAULT_TITLE_MACRO(action_get_quick_menu_override_options, MENU_ENUM_LABEL_VALUE_QUICK_MENU_OVERRIDE_OPTIONS)
DEFAULT_TITLE_MACRO(action_get_user_accounts_cheevos_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_RETRO_ACHIEVEMENTS)
DEFAULT_TITLE_MACRO(action_get_user_accounts_youtube_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_YOUTUBE)
@ -391,6 +432,7 @@ DEFAULT_TITLE_MACRO(action_get_netplay_list, MENU_ENUM_LABEL_
DEFAULT_TITLE_MACRO(action_get_online_thumbnails_updater_list, MENU_ENUM_LABEL_VALUE_THUMBNAILS_UPDATER_LIST)
DEFAULT_TITLE_MACRO(action_get_online_pl_thumbnails_updater_list, MENU_ENUM_LABEL_VALUE_PL_THUMBNAILS_UPDATER_LIST)
DEFAULT_TITLE_MACRO(action_get_core_updater_list, MENU_ENUM_LABEL_VALUE_CORE_UPDATER_LIST)
DEFAULT_TITLE_MACRO(action_get_core_manager_list, MENU_ENUM_LABEL_VALUE_CORE_MANAGER_LIST)
DEFAULT_TITLE_MACRO(action_get_add_content_list, MENU_ENUM_LABEL_VALUE_ADD_CONTENT_LIST)
DEFAULT_TITLE_MACRO(action_get_configurations_list, MENU_ENUM_LABEL_VALUE_CONFIGURATIONS_LIST)
DEFAULT_TITLE_MACRO(action_get_core_options_list, MENU_ENUM_LABEL_VALUE_CORE_OPTIONS)
@ -407,7 +449,6 @@ DEFAULT_TITLE_MACRO(action_get_playlist_manager_list, MENU_ENUM_LABEL_
DEFAULT_TITLE_MACRO(action_get_input_hotkey_binds_settings_list,MENU_ENUM_LABEL_VALUE_INPUT_HOTKEY_BINDS)
DEFAULT_TITLE_MACRO(action_get_driver_settings_list, MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_core_settings_list, MENU_ENUM_LABEL_VALUE_CORE_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_core_information_list, MENU_ENUM_LABEL_VALUE_CORE_INFORMATION)
DEFAULT_TITLE_MACRO(action_get_video_settings_list, MENU_ENUM_LABEL_VALUE_VIDEO_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_video_fullscreen_mode_settings_list, MENU_ENUM_LABEL_VALUE_VIDEO_FULLSCREEN_MODE_SETTINGS)
DEFAULT_TITLE_MACRO(action_get_video_windowed_mode_settings_list, MENU_ENUM_LABEL_VALUE_VIDEO_WINDOWED_MODE_SETTINGS)
@ -893,6 +934,8 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
action_get_title_overlay},
{MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST,
action_get_core_updater_list},
{MENU_ENUM_LABEL_DEFERRED_CORE_MANAGER_LIST,
action_get_core_manager_list},
{MENU_ENUM_LABEL_CONFIGURATIONS_LIST,
action_get_configurations_list},
{MENU_ENUM_LABEL_ADD_CONTENT_LIST,
@ -1189,6 +1232,9 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_core_updater_list);
break;
case MENU_ENUM_LABEL_DEFERRED_CORE_MANAGER_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_core_manager_list);
break;
case MENU_ENUM_LABEL_ADD_CONTENT_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_add_content_list);
break;

View File

@ -9118,6 +9118,7 @@ static void materialui_list_insert(
break;
case FILE_TYPE_DOWNLOAD_CORE:
case FILE_TYPE_CORE:
case MENU_SETTING_ACTION_CORE_MANAGER_OPTIONS:
node->icon_texture_index = MUI_TEXTURE_CORES;
node->has_icon = true;
break;
@ -9549,6 +9550,7 @@ static void materialui_list_insert(
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CHEAT_DELETE)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_SHADER_PARAMETERS)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_PLAYLIST_MANAGER_LIST)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CORE_MANAGER_LIST)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SETTINGS))
)
{

View File

@ -129,6 +129,7 @@ uintptr_t ozone_entries_icon_get_texture(ozone_handle_t *ozone,
case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE:
case MENU_ENUM_LABEL_REMAP_FILE_SAVE_CORE:
case MENU_ENUM_LABEL_SET_CORE_ASSOCIATION:
case MENU_ENUM_LABEL_CORE_INFORMATION:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CORE];
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
case MENU_ENUM_LABEL_SUBSYSTEM_SETTINGS:
@ -379,7 +380,6 @@ uintptr_t ozone_entries_icon_get_texture(ozone_handle_t *ozone,
case MENU_SETTING_ACTION_LOADSTATE:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_LOADSTATE];
case FILE_TYPE_RDB_ENTRY:
case MENU_SETTING_ACTION_CORE_INFORMATION:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CORE_INFO];
case MENU_SETTING_ACTION_CORE_OPTIONS:
return ozone->icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_CORE_OPTIONS];

View File

@ -2252,7 +2252,6 @@ static uintptr_t stripes_icon_get_id(stripes_handle_t *stripes,
case MENU_SETTING_ACTION_LOADSTATE:
return stripes->textures.list[STRIPES_TEXTURE_LOADSTATE];
case FILE_TYPE_RDB_ENTRY:
case MENU_SETTING_ACTION_CORE_INFORMATION:
return stripes->textures.list[STRIPES_TEXTURE_CORE_INFO];
case MENU_SETTING_ACTION_CORE_OPTIONS:
case MENU_ENUM_LABEL_SET_CORE_ASSOCIATION:

View File

@ -2535,6 +2535,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
case MENU_ENUM_LABEL_SAVE_CURRENT_CONFIG_OVERRIDE_CORE:
case MENU_ENUM_LABEL_REMAP_FILE_SAVE_CORE:
case MENU_ENUM_LABEL_SET_CORE_ASSOCIATION:
case MENU_ENUM_LABEL_CORE_INFORMATION:
return xmb->textures.list[XMB_TEXTURE_CORE];
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
case MENU_ENUM_LABEL_SUBSYSTEM_SETTINGS:
@ -2777,7 +2778,6 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
case MENU_SETTING_ACTION_LOADSTATE:
return xmb->textures.list[XMB_TEXTURE_LOADSTATE];
case FILE_TYPE_RDB_ENTRY:
case MENU_SETTING_ACTION_CORE_INFORMATION:
return xmb->textures.list[XMB_TEXTURE_CORE_INFO];
case MENU_SETTING_ACTION_CORE_OPTIONS:
return xmb->textures.list[XMB_TEXTURE_CORE_OPTIONS];

View File

@ -144,6 +144,7 @@ enum
ACTION_OK_DL_DATABASE_MANAGER_LIST,
ACTION_OK_DL_CURSOR_MANAGER_LIST,
ACTION_OK_DL_CORE_UPDATER_LIST,
ACTION_OK_DL_CORE_MANAGER_LIST,
ACTION_OK_DL_THUMBNAILS_UPDATER_LIST,
ACTION_OK_DL_PL_THUMBNAILS_UPDATER_LIST,
ACTION_OK_DL_BROWSE_URL_LIST,

View File

@ -139,14 +139,20 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
unsigned i, count = 0;
core_info_t *core_info = NULL;
const char *core_path = NULL;
#if !(defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
settings_t *settings = config_get_ptr();
bool kiosk_mode_enable = settings->bools.kiosk_mode_enable;
#if defined(HAVE_NETWORKING) && defined(HAVE_ONLINE_UPDATER)
bool menu_show_core_updater = settings->bools.menu_show_core_updater;
#endif
#endif
tmp[0] = '\0';
/* Check whether we are parsing information for a
* core updater entry or the currently loaded core */
if (info->type == FILE_TYPE_DOWNLOAD_CORE)
* core updater/manager entry or the currently loaded core */
if ((info->type == FILE_TYPE_DOWNLOAD_CORE) ||
(info->type == MENU_SETTING_ACTION_CORE_MANAGER_OPTIONS))
{
core_info_ctx_find_t core_info_finder;
@ -358,10 +364,8 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
end:
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#else
if (menu_show_core_updater &&
!string_is_empty(core_path))
#if !(defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
if (!string_is_empty(core_path) && !kiosk_mode_enable)
{
/* Backup core */
if (menu_entries_append_enum(info->list,
@ -387,13 +391,20 @@ end:
MENU_SETTING_ACTION_CORE_DELETE_BACKUP, 0, 0))
count++;
/* Delete core */
if (menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_DELETE),
core_path,
MENU_ENUM_LABEL_CORE_DELETE,
MENU_SETTING_ACTION_CORE_DELETE, 0, 0))
count++;
/* Delete core
* > Only add this option if online updater is
* enabled/activated, otherwise user could end
* up in a situation where a core cannot be
* restored */
#if defined(HAVE_NETWORKING) && defined(HAVE_ONLINE_UPDATER)
if (menu_show_core_updater)
if (menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_DELETE),
core_path,
MENU_ENUM_LABEL_CORE_DELETE,
MENU_SETTING_ACTION_CORE_DELETE, 0, 0))
count++;
#endif
}
#endif
@ -489,6 +500,67 @@ static unsigned menu_displaylist_parse_core_backup_list(
return count;
}
static unsigned menu_displaylist_parse_core_manager_list(
menu_displaylist_info_t *info)
{
unsigned count = 0;
core_info_list_t *core_info_list = NULL;
#if !(defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
settings_t *settings = config_get_ptr();
bool kiosk_mode_enable = settings->bools.kiosk_mode_enable;
#endif
/* Get core list */
core_info_get_list(&core_info_list);
if (core_info_list)
{
core_info_t *core_info = NULL;
size_t menu_index = 0;
size_t i;
/* Sort cores alphabetically */
core_info_qsort(core_info_list, CORE_INFO_LIST_SORT_DISPLAY_NAME);
/* Loop through cores */
for (i = 0; i < core_info_list->count; i++)
{
core_info = NULL;
core_info = core_info_get(core_info_list, i);
if (core_info)
{
if (menu_entries_append_enum(info->list,
core_info->path,
"",
MENU_ENUM_LABEL_CORE_MANAGER_ENTRY,
MENU_SETTING_ACTION_CORE_MANAGER_OPTIONS,
0, 0))
{
file_list_set_alt_at_offset(
info->list, menu_index, core_info->display_name);
menu_index++;
count++;
}
}
}
}
/* Add 'sideload core' entry */
#if !(defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
if (!kiosk_mode_enable)
if (menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SIDELOAD_CORE_LIST),
msg_hash_to_str(MENU_ENUM_LABEL_SIDELOAD_CORE_LIST),
MENU_ENUM_LABEL_SIDELOAD_CORE_LIST,
MENU_SETTING_ACTION, 0, 0))
count++;
#endif
return count;
}
static unsigned menu_displaylist_parse_system_info(file_list_t *list)
{
int controller;
@ -7385,6 +7457,13 @@ unsigned menu_displaylist_build_list(
false) == 0)
count++;
}
if (menu_entries_append_enum(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_MANAGER_LIST),
msg_hash_to_str(MENU_ENUM_LABEL_CORE_MANAGER_LIST),
MENU_ENUM_LABEL_CORE_MANAGER_LIST,
MENU_SETTING_ACTION, 0, 0))
count++;
}
break;
case DISPLAYLIST_CONFIGURATION_SETTINGS_LIST:
@ -9577,6 +9656,33 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
info->need_refresh = true;
info->need_push = true;
break;
case DISPLAYLIST_CORE_MANAGER_LIST:
{
/* When a core is deleted, the number of items in
* the core manager list will change. We therefore
* have to cache the last set menu size, and reset
* the navigation pointer if the current size is
* different */
static size_t prev_count = 0;
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
count = menu_displaylist_parse_core_manager_list(info);
if (count == 0)
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ENTRIES_TO_DISPLAY),
msg_hash_to_str(MENU_ENUM_LABEL_NO_ENTRIES_TO_DISPLAY),
MENU_ENUM_LABEL_NO_ENTRIES_TO_DISPLAY,
FILE_TYPE_NONE, 0, 0);
if (count != prev_count)
{
info->need_refresh = true;
info->need_navigation_clear = true;
prev_count = count;
}
info->need_push = true;
}
break;
case DISPLAYLIST_CORE_OPTIONS:
{
/* Number of displayed options is dynamic. If user opens

View File

@ -95,6 +95,7 @@ enum menu_displaylist_ctl_state
DISPLAYLIST_CORES_SUPPORTED,
DISPLAYLIST_CORES_COLLECTION_SUPPORTED,
DISPLAYLIST_CORES_UPDATER,
DISPLAYLIST_CORE_MANAGER_LIST,
DISPLAYLIST_THUMBNAILS_UPDATER,
DISPLAYLIST_PL_THUMBNAILS_UPDATER,
DISPLAYLIST_LAKKA,

View File

@ -100,7 +100,7 @@ enum menu_settings_type
MENU_SETTING_ACTION_CORE_OPTIONS,
MENU_SETTING_ACTION_CORE_INPUT_REMAPPING_OPTIONS,
MENU_SETTING_ACTION_CORE_CHEAT_OPTIONS,
MENU_SETTING_ACTION_CORE_INFORMATION,
MENU_SETTING_ACTION_CORE_MANAGER_OPTIONS,
MENU_SETTING_ACTION_CORE_DISK_OPTIONS,
MENU_SETTING_ACTION_CORE_SHADER_OPTIONS,
MENU_SETTING_ACTION_SAVESTATE,

View File

@ -692,6 +692,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_SYSTEM_INFO_ENTRY,
MENU_ENUM_LABEL_SYSTEM_INFO_CONTROLLER_ENTRY,
MENU_ENUM_LABEL_CORE_INFO_ENTRY,
MENU_ENUM_LABEL_CORE_MANAGER_ENTRY,
MENU_ENUM_LABEL_PLAYLIST_ENTRY,
MENU_LABEL(START_VIDEO_PROCESSOR),
@ -1343,6 +1344,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS,
MENU_ENUM_LABEL_DEFERRED_CORE_LIST,
MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST,
MENU_ENUM_LABEL_DEFERRED_CORE_MANAGER_LIST,
MENU_ENUM_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST,
MENU_ENUM_LABEL_DEFERRED_PL_THUMBNAILS_UPDATER_LIST,
MENU_ENUM_LABEL_DEFERRED_RECORDING_SETTINGS_LIST,
@ -1896,6 +1898,7 @@ enum msg_hash_enums
MENU_LABEL(FAVORITES),
MENU_LABEL(START_CORE),
MENU_LABEL(CORE_UPDATER_LIST),
MENU_LABEL(CORE_MANAGER_LIST),
MENU_LABEL(CORE_UPDATER_AUTO_EXTRACT_ARCHIVE),
MENU_LABEL(CORE_UPDATER_SHOW_EXPERIMENTAL_CORES),
MENU_LABEL(CORE_UPDATER_BUILDBOT_URL),

View File

@ -3194,35 +3194,66 @@ static int generic_menu_iterate(
if (cbs && cbs->enum_idx != MSG_UNKNOWN)
{
#ifdef HAVE_NETWORKING
/* Core updater entries require special treatment */
if (cbs->enum_idx == MENU_ENUM_LABEL_CORE_UPDATER_ENTRY)
/* Core updater/manager entries require special treatment */
switch (cbs->enum_idx)
{
core_updater_list_t *core_list = core_updater_list_get_cached();
const core_updater_list_entry_t *entry = NULL;
const char *path = NULL;
#ifdef HAVE_NETWORKING
case MENU_ENUM_LABEL_CORE_UPDATER_ENTRY:
{
core_updater_list_t *core_list = core_updater_list_get_cached();
const core_updater_list_entry_t *entry = NULL;
const char *path = NULL;
/* Get core path */
menu_entries_get_at_offset(selection_buf, selection,
&path, NULL, NULL, NULL, NULL);
/* Get core path */
menu_entries_get_at_offset(selection_buf, selection,
&path, NULL, NULL, NULL, NULL);
/* Search for specified core */
if (core_list && path &&
core_updater_list_get_filename(core_list, path, &entry) &&
!string_is_empty(entry->description))
strlcpy(menu->menu_state_msg, entry->description,
sizeof(menu->menu_state_msg));
else
strlcpy(menu->menu_state_msg,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE),
sizeof(menu->menu_state_msg));
/* Search for specified core */
if (core_list && path &&
core_updater_list_get_filename(core_list, path, &entry) &&
!string_is_empty(entry->description))
strlcpy(menu->menu_state_msg, entry->description,
sizeof(menu->menu_state_msg));
else
strlcpy(menu->menu_state_msg,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE),
sizeof(menu->menu_state_msg));
ret = 0;
}
else
ret = 0;
}
break;
#endif
ret = menu_hash_get_help_enum(cbs->enum_idx,
menu->menu_state_msg, sizeof(menu->menu_state_msg));
case MENU_ENUM_LABEL_CORE_MANAGER_ENTRY:
{
const char *path = NULL;
core_info_ctx_find_t core_info;
/* Get core path */
menu_entries_get_at_offset(selection_buf, selection,
&path, NULL, NULL, NULL, NULL);
/* Search for specified core */
core_info.inf = NULL;
core_info.path = path;
if (path &&
core_info_find(&core_info) &&
!string_is_empty(core_info.inf->description))
strlcpy(menu->menu_state_msg, core_info.inf->description,
sizeof(menu->menu_state_msg));
else
strlcpy(menu->menu_state_msg,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE),
sizeof(menu->menu_state_msg));
ret = 0;
}
break;
default:
ret = menu_hash_get_help_enum(cbs->enum_idx,
menu->menu_state_msg, sizeof(menu->menu_state_msg));
break;
}
#ifdef HAVE_ACCESSIBILITY
if ( (iterate_type != last_iterate_type) &&