More core updater improvements

This commit is contained in:
jdgleaver 2020-05-28 17:48:18 +01:00
parent dd65d901ee
commit 044bd03a13
11 changed files with 210 additions and 79 deletions

View File

@ -732,6 +732,10 @@ MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST,
"deferred_core_settings_list"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_CORE_INFORMATION_LIST,
"deferred_core_information_list"
)
MSG_HASH(
MENU_ENUM_LABEL_DEFERRED_CORE_UPDATER_LIST,
"core_updater"

View File

@ -134,7 +134,6 @@ generic_deferred_push(deferred_push_video_layout_path, DISPLAYLIST_
generic_deferred_push(deferred_push_video_font_path, DISPLAYLIST_FONTS)
generic_deferred_push(deferred_push_xmb_font_path, DISPLAYLIST_FONTS)
generic_deferred_push(deferred_push_content_history_path, DISPLAYLIST_CONTENT_HISTORY)
generic_deferred_push(deferred_push_core_information, DISPLAYLIST_CORE_INFO)
generic_deferred_push(deferred_push_disc_information, DISPLAYLIST_DISC_INFO)
generic_deferred_push(deferred_push_system_information, DISPLAYLIST_SYSTEM_INFO)
generic_deferred_push(deferred_push_network_information, DISPLAYLIST_NETWORK_INFO)
@ -146,6 +145,7 @@ generic_deferred_push(deferred_user_binds_list, DISPLAYLIST_
generic_deferred_push(deferred_push_accounts_list, DISPLAYLIST_ACCOUNTS_LIST)
generic_deferred_push(deferred_push_driver_settings_list, DISPLAYLIST_DRIVER_SETTINGS_LIST)
generic_deferred_push(deferred_push_core_settings_list, DISPLAYLIST_CORE_SETTINGS_LIST)
generic_deferred_push(deferred_push_core_information_list, DISPLAYLIST_CORE_INFO)
generic_deferred_push(deferred_push_video_settings_list, DISPLAYLIST_VIDEO_SETTINGS_LIST)
generic_deferred_push(deferred_push_video_fullscreen_mode_settings_list, DISPLAYLIST_VIDEO_FULLSCREEN_MODE_SETTINGS_LIST)
generic_deferred_push(deferred_push_video_windowed_mode_settings_list, DISPLAYLIST_VIDEO_WINDOWED_MODE_SETTINGS_LIST)
@ -705,6 +705,7 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_LIST, deferred_push_browse_url_list},
{MENU_ENUM_LABEL_DEFERRED_BROWSE_URL_START, deferred_push_browse_url_start},
{MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST, deferred_push_core_settings_list},
{MENU_ENUM_LABEL_DEFERRED_CORE_INFORMATION_LIST, deferred_push_core_information_list},
{MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST, deferred_push_configuration_settings_list},
{MENU_ENUM_LABEL_DEFERRED_SAVING_SETTINGS_LIST, deferred_push_saving_settings_list},
{MENU_ENUM_LABEL_DEFERRED_MIXER_STREAM_SETTINGS_LIST, deferred_push_mixer_stream_settings_list},
@ -757,7 +758,6 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
{MENU_ENUM_LABEL_DEFERRED_INPUT_HAPTIC_FEEDBACK_SETTINGS_LIST, deferred_push_input_haptic_feedback_settings_list},
{MENU_ENUM_LABEL_DEFERRED_AI_SERVICE_SETTINGS_LIST, deferred_push_ai_service_settings_list},
{MENU_ENUM_LABEL_DEFERRED_ACCESSIBILITY_SETTINGS_LIST, deferred_push_accessibility_settings_list},
{MENU_ENUM_LABEL_CORE_INFORMATION, deferred_push_core_information},
{MENU_ENUM_LABEL_DISC_INFORMATION, deferred_push_disc_information},
{MENU_ENUM_LABEL_SYSTEM_INFORMATION, deferred_push_system_information},
{MENU_ENUM_LABEL_DEFERRED_RPL_ENTRY_ACTIONS, deferred_push_rpl_entry_actions},
@ -1246,6 +1246,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
case MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_core_settings_list);
break;
case MENU_ENUM_LABEL_DEFERRED_CORE_INFORMATION_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_core_information_list);
break;
case MENU_ENUM_LABEL_DEFERRED_DUMP_DISC_LIST:
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_dump_disk_list);
break;

View File

@ -426,6 +426,51 @@ static void menu_action_setting_disp_set_label_menu_file_core(
strlcpy(s2, alt, len2);
}
#ifdef HAVE_NETWORKING
static void menu_action_setting_disp_set_label_core_updater_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)
{
core_updater_list_t *core_list = core_updater_list_get_cached();
const core_updater_list_entry_t *entry = NULL;
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);
/* Search for specified core */
if (core_list &&
core_updater_list_get_filename(core_list, path, &entry) &&
!string_is_empty(entry->local_core_path))
{
core_info_ctx_find_t core_info;
/* Check whether core is installed
* > Note: We search core_info here instead
* of calling path_is_valid() since we don't
* want to perform disk access every frame */
core_info.inf = NULL;
core_info.path = entry->local_core_path;
if (core_info_find(&core_info, entry->local_core_path))
{
strlcpy(s, "[#]", len);
*w = (unsigned)STRLEN_CONST("[#]");
}
}
}
#endif
static void menu_action_setting_disp_set_label_input_desc(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
@ -972,25 +1017,6 @@ static void menu_action_setting_disp_set_label_menu_file_filter(
path, "(FILTER)", s2, len2);
}
static void menu_action_setting_disp_set_label_menu_file_url_core(
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;
strlcpy(s, "(CORE)", len);
menu_entries_get_at_offset(list, i, NULL,
NULL, NULL, NULL, &alt);
*w = (unsigned)strlen(s);
if (alt)
strlcpy(s2, alt, len2);
}
static void menu_action_setting_disp_set_label_menu_file_rdb(
file_list_t* list,
unsigned *w, unsigned type, unsigned i,
@ -1647,6 +1673,12 @@ 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);
@ -1715,10 +1747,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_filter);
break;
case FILE_TYPE_DOWNLOAD_CORE:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_url_core);
break;
case FILE_TYPE_RDB:
BIND_ACTION_GET_VALUE(cbs,
menu_action_setting_disp_set_label_menu_file_rdb);

View File

@ -210,6 +210,8 @@ static enum msg_hash_enums action_ok_dl_to_enum(unsigned lbl)
return MENU_ENUM_LABEL_DEFERRED_DRIVER_SETTINGS_LIST;
case ACTION_OK_DL_CORE_SETTINGS_LIST:
return MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST;
case ACTION_OK_DL_CORE_INFORMATION_LIST:
return MENU_ENUM_LABEL_DEFERRED_CORE_INFORMATION_LIST;
case ACTION_OK_DL_VIDEO_SETTINGS_LIST:
return MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST;
case ACTION_OK_DL_VIDEO_SYNCHRONIZATION_SETTINGS_LIST:
@ -1106,6 +1108,7 @@ int generic_action_ok_displaylist_push(const char *path,
case ACTION_OK_DL_LATENCY_SETTINGS_LIST:
case ACTION_OK_DL_DRIVER_SETTINGS_LIST:
case ACTION_OK_DL_CORE_SETTINGS_LIST:
case ACTION_OK_DL_CORE_INFORMATION_LIST:
case ACTION_OK_DL_VIDEO_SETTINGS_LIST:
case ACTION_OK_DL_VIDEO_SYNCHRONIZATION_SETTINGS_LIST:
case ACTION_OK_DL_VIDEO_FULLSCREEN_MODE_SETTINGS_LIST:
@ -5144,6 +5147,7 @@ default_action_ok_func(action_ok_push_video_scaling_settings_list, ACTION_OK_DL_
default_action_ok_func(action_ok_push_video_output_settings_list, ACTION_OK_DL_VIDEO_OUTPUT_SETTINGS_LIST)
default_action_ok_func(action_ok_push_configuration_settings_list, ACTION_OK_DL_CONFIGURATION_SETTINGS_LIST)
default_action_ok_func(action_ok_push_core_settings_list, ACTION_OK_DL_CORE_SETTINGS_LIST)
default_action_ok_func(action_ok_push_core_information_list, ACTION_OK_DL_CORE_INFORMATION_LIST)
default_action_ok_func(action_ok_push_audio_settings_list, ACTION_OK_DL_AUDIO_SETTINGS_LIST)
default_action_ok_func(action_ok_push_audio_output_settings_list, ACTION_OK_DL_AUDIO_OUTPUT_SETTINGS_LIST)
default_action_ok_func(action_ok_push_audio_resampler_settings_list, ACTION_OK_DL_AUDIO_RESAMPLER_SETTINGS_LIST)
@ -6463,21 +6467,38 @@ static int action_ok_netplay_disconnect(const char *path,
static int action_ok_core_delete(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
const char *path_core = path_get(RARCH_PATH_CORE);
char *core_path = !string_is_empty(path_core)
? strdup(path_core) : NULL;
const char *core_path = label;
const char *core = NULL;
const char *running_core_path = NULL;
const char *running_core = NULL;
if (!core_path)
return 0;
if (string_is_empty(core_path))
return -1;
generic_action_ok_command(CMD_EVENT_UNLOAD_CORE);
menu_entries_flush_stack(0, 0);
/* Get core file name */
core = path_basename(core_path);
if (string_is_empty(core))
return -1;
if (filestream_delete(core_path) != 0) { }
/* Get running core file name */
running_core_path = path_get(RARCH_PATH_CORE);
if (!string_is_empty(running_core_path))
running_core = path_basename(running_core_path);
free(core_path);
/* Check if core to be deleted is currently
* running - if so, unload it */
if (!string_is_empty(running_core) &&
string_is_equal(core, running_core))
generic_action_ok_command(CMD_EVENT_UNLOAD_CORE);
return 0;
/* Delete core file */
filestream_delete(core_path);
/* Reload core info files */
command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
/* Return to higher level menu */
return action_cancel_pop_default(NULL, NULL, 0, 0);
}
static int action_ok_delete_playlist(const char *path,
@ -6841,6 +6862,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_AUDIO_RESAMPLER_SETTINGS, action_ok_push_audio_resampler_settings_list},
{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_CONFIGURATION_SETTINGS, action_ok_push_configuration_settings_list},
{MENU_ENUM_LABEL_PLAYLIST_SETTINGS, action_ok_push_playlist_settings_list},
{MENU_ENUM_LABEL_PLAYLIST_MANAGER_LIST, action_ok_push_playlist_manager_list},
@ -6858,7 +6880,6 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
{MENU_ENUM_LABEL_CORE_OPTIONS, action_ok_push_default},
{MENU_ENUM_LABEL_CORE_CHEAT_OPTIONS, action_ok_push_default},
{MENU_ENUM_LABEL_CORE_INPUT_REMAPPING_OPTIONS, action_ok_push_default},
{MENU_ENUM_LABEL_CORE_INFORMATION, action_ok_push_default},
{MENU_ENUM_LABEL_DISC_INFORMATION, action_ok_push_default},
{MENU_ENUM_LABEL_SYSTEM_INFORMATION, action_ok_push_default},
{MENU_ENUM_LABEL_NETWORK_INFORMATION, action_ok_push_default},

View File

@ -44,14 +44,18 @@
#include "../../config.def.h"
#ifdef HAVE_NETWORKING
#include "../../core_updater_list.h"
#endif
#ifndef BIND_ACTION_START
#define BIND_ACTION_START(cbs, name) (cbs)->action_start = (name)
#endif
/* Forward declarations */
int generic_action_ok_command(enum event_command cmd);
int action_ok_push_playlist_manager_settings(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx);
int action_ok_push_core_information_list(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx);
#ifdef HAVE_AUDIOMIXER
static int action_start_audio_mixer_stream_volume(
@ -469,6 +473,28 @@ static int action_start_load_core(
return ret;
}
#ifdef HAVE_NETWORKING
static int action_start_core_updater_entry(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
{
core_updater_list_t *core_list = core_updater_list_get_cached();
const core_updater_list_entry_t *entry = NULL;
/* If specified core is installed, go to core
* information menu */
if (core_list &&
core_updater_list_get_filename(core_list, path, &entry) &&
!string_is_empty(entry->local_core_path) &&
path_is_valid(entry->local_core_path))
return action_ok_push_core_information_list(
entry->local_core_path, label, type, idx, entry_idx);
/* Otherwise do nothing */
return 0;
}
#endif
static int action_start_lookup_setting(
const char *path, const char *label,
unsigned type, size_t idx, size_t entry_idx)
@ -605,6 +631,11 @@ static int menu_cbs_init_bind_start_compare_type(menu_file_list_cbs_t *cbs,
case FILE_TYPE_PLAYLIST_COLLECTION:
BIND_ACTION_START(cbs, action_ok_push_playlist_manager_settings);
break;
#ifdef HAVE_NETWORKING
case FILE_TYPE_DOWNLOAD_CORE:
BIND_ACTION_START(cbs, action_start_core_updater_entry);
break;
#endif
default:
return -1;
}

View File

@ -324,7 +324,6 @@ default_title_macro(action_get_user_accounts_youtube_list, MENU_ENUM_LABEL_
default_title_macro(action_get_user_accounts_twitch_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_TWITCH)
default_title_macro(action_get_download_core_content_list, MENU_ENUM_LABEL_VALUE_DOWNLOAD_CORE_CONTENT)
default_title_macro(action_get_user_accounts_list, MENU_ENUM_LABEL_VALUE_ACCOUNTS_LIST)
default_title_macro(action_get_core_information_list, MENU_ENUM_LABEL_VALUE_CORE_INFORMATION)
default_title_macro(action_get_core_list, MENU_ENUM_LABEL_VALUE_CORE_LIST)
default_title_macro(action_get_online_updater_list, MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER)
default_title_macro(action_get_netplay_list, MENU_ENUM_LABEL_VALUE_NETPLAY)
@ -347,6 +346,7 @@ 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)
@ -657,6 +657,7 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
title_info_list_t info_list[] = {
{MENU_ENUM_LABEL_DEFERRED_REMAPPINGS_PORT_LIST, action_get_title_remap_port},
{MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST, action_get_core_settings_list},
{MENU_ENUM_LABEL_DEFERRED_CORE_INFORMATION_LIST, action_get_core_information_list},
{MENU_ENUM_LABEL_DEFERRED_DUMP_DISC_LIST, action_get_dump_disc_list},
{MENU_ENUM_LABEL_DEFERRED_LOAD_DISC_LIST, action_get_load_disc_list},
{MENU_ENUM_LABEL_DEFERRED_CONFIGURATION_SETTINGS_LIST, action_get_configuration_settings_list },
@ -823,8 +824,6 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
action_get_database_manager_list},
{MENU_ENUM_LABEL_CURSOR_MANAGER_LIST,
action_get_cursor_manager_list},
{MENU_ENUM_LABEL_CORE_INFORMATION,
action_get_core_information_list},
{MENU_ENUM_LABEL_CORE_LIST,
action_get_core_list},
{MENU_ENUM_LABEL_LOAD_CONTENT_SPECIAL,
@ -1112,9 +1111,6 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_CURSOR_MANAGER_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_cursor_manager_list);
break;
case MENU_ENUM_LABEL_CORE_INFORMATION:
BIND_ACTION_GET_TITLE(cbs, action_get_core_information_list);
break;
case MENU_ENUM_LABEL_CORE_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_core_list);
break;
@ -1213,6 +1209,9 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_core_settings_list);
break;
case MENU_ENUM_LABEL_DEFERRED_CORE_INFORMATION_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_core_information_list);
break;
case MENU_ENUM_LABEL_DEFERRED_INPUT_SETTINGS_LIST:
BIND_ACTION_GET_TITLE(cbs, action_get_input_settings_list);
break;

View File

@ -7614,8 +7614,7 @@ static void materialui_populate_entries(
* Note: MENU_ENUM_LABEL_FAVORITES is always set
* as the 'label' when navigating directories after
* selecting load content */
mui->is_file_list = mui->is_core_updater_list ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SCAN_DIRECTORY)) ||
mui->is_file_list = string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SCAN_DIRECTORY)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_SCAN_FILE)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_IMAGES_LIST)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MUSIC_LIST)) ||
@ -8991,6 +8990,10 @@ static int materialui_pointer_up(void *userdata,
return materialui_pointer_up_swipe_horz_plain_list(
mui, entry, height, header_height, y,
selection, true);
/* If this is the core updater list, swipes are used
* to open the core information menu */
else if (mui->is_core_updater_list)
return materialui_menu_entry_action(mui, entry, selection, MENU_ACTION_START);
/* In all other cases, just perform a normal 'left'
* navigation event */
else
@ -9015,6 +9018,10 @@ static int materialui_pointer_up(void *userdata,
return materialui_pointer_up_swipe_horz_plain_list(
mui, entry, height, header_height, y,
selection, false);
/* If this is the core updater list, swipes are used
* to open the core information menu */
else if (mui->is_core_updater_list)
return materialui_menu_entry_action(mui, entry, selection, MENU_ACTION_START);
/* In all other cases, just perform a normal 'right'
* navigation event */
else
@ -9150,6 +9157,10 @@ static void materialui_list_insert(
node->icon_texture_index = MUI_TEXTURE_SETTINGS;
node->has_icon = true;
break;
case MENU_SETTING_ACTION_CORE_DELETE:
node->icon_texture_index = MUI_TEXTURE_REMOVE;
node->has_icon = true;
break;
default:
if (
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_INFORMATION_LIST)) ||
@ -9241,7 +9252,8 @@ static void materialui_list_insert(
node->icon_texture_index = MUI_TEXTURE_SHADERS;
node->has_icon = true;
}
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CORE_LIST)))
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CORE_LIST)) ||
string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_CORE_INFORMATION)))
{
node->icon_texture_index = MUI_TEXTURE_CORES;
node->has_icon = true;

View File

@ -111,6 +111,7 @@ enum
ACTION_OK_DL_CHEAT_DETAILS_SETTINGS_LIST,
ACTION_OK_DL_CHEAT_SEARCH_SETTINGS_LIST,
ACTION_OK_DL_CORE_SETTINGS_LIST,
ACTION_OK_DL_CORE_INFORMATION_LIST,
ACTION_OK_DL_INPUT_HOTKEY_BINDS_LIST,
ACTION_OK_DL_RECORDING_SETTINGS_LIST,
ACTION_OK_DL_PLAYLIST_SETTINGS_LIST,

View File

@ -129,32 +129,56 @@ struct menu_displaylist_state
static struct menu_displaylist_state menu_displist_st;
static int menu_displaylist_parse_core_info(file_list_t *list)
static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info)
{
char tmp[PATH_MAX_LENGTH];
unsigned i, count = 0;
core_info_t *core_info = NULL;
const char *core_path = NULL;
settings_t *settings = config_get_ptr();
bool menu_show_core_updater = settings->bools.menu_show_core_updater;
tmp[0] = '\0';
core_info_get_current_core(&core_info);
/* Check whether we are parsing information for a
* core updater entry or the currently loaded core */
if (info->type == FILE_TYPE_DOWNLOAD_CORE)
{
core_info_ctx_find_t core_info_finder;
core_path = info->path;
/* Core updater 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_path))
core_info = core_info_finder.inf;
}
else
if (core_info_get_current_core(&core_info))
core_path = core_info->path;
if (!core_info || !core_info->config_data)
{
if (menu_entries_append_enum(list,
if (menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE_INFORMATION_AVAILABLE),
msg_hash_to_str(MENU_ENUM_LABEL_NO_CORE_INFORMATION_AVAILABLE),
MENU_ENUM_LABEL_NO_CORE_INFORMATION_AVAILABLE,
0, 0, 0))
count++;
if (menu_entries_append_enum(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_DELETE),
msg_hash_to_str(MENU_ENUM_LABEL_CORE_DELETE),
MENU_ENUM_LABEL_CORE_DELETE,
MENU_SETTING_ACTION_CORE_DELETE, 0, 0))
count++;
if (menu_show_core_updater &&
!string_is_empty(core_path))
{
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++;
}
return count;
}
@ -188,7 +212,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
": ",
info_list[i].name,
sizeof(tmp));
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
@ -203,7 +227,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp),
core_info->categories_list, ", ");
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
}
@ -216,7 +240,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp),
core_info->authors_list, ", ");
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
}
@ -229,7 +253,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp),
core_info->permissions_list, ", ");
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
}
@ -242,7 +266,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp),
core_info->licenses_list, ", ");
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
}
@ -255,7 +279,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp),
core_info->supported_extensions_list, ", ");
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
}
@ -268,7 +292,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
sizeof(tmp));
string_list_join_concat(tmp, sizeof(tmp),
core_info->required_hw_api_list, ", ");
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
}
@ -296,7 +320,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
": ",
sizeof(tmp));
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
@ -320,7 +344,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_NAME)
);
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY,
MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
@ -334,7 +358,7 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
{
strlcpy(tmp,
core_info->note_list->elems[i].data, sizeof(tmp));
if (menu_entries_append_enum(list, tmp, "",
if (menu_entries_append_enum(info->list, tmp, "",
MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0))
count++;
}
@ -342,15 +366,16 @@ static int menu_displaylist_parse_core_info(file_list_t *list)
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#else
if (menu_show_core_updater)
{
if (menu_entries_append_enum(list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_DELETE),
msg_hash_to_str(MENU_ENUM_LABEL_CORE_DELETE),
MENU_ENUM_LABEL_CORE_DELETE,
MENU_SETTING_ACTION_CORE_DELETE, 0, 0))
count++;
}
if (menu_show_core_updater &&
!string_is_empty(core_path))
{
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
return count;
@ -8878,7 +8903,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
info->need_push = true;
info->need_refresh = true;
info->need_clear = true;
break;
case DISPLAYLIST_THUMBNAILS_UPDATER:
@ -9371,7 +9395,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
break;
case DISPLAYLIST_CORE_INFO:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
count = menu_displaylist_parse_core_info(info->list);
count = menu_displaylist_parse_core_info(info);
info->need_push = true;
break;
case DISPLAYLIST_CORE_OPTIONS:

View File

@ -1391,6 +1391,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_DEFERRED_AUDIO_SYNCHRONIZATION_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_AUDIO_MIXER_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_CORE_SETTINGS_LIST,
MENU_ENUM_LABEL_DEFERRED_CORE_INFORMATION_LIST,
MENU_ENUM_LABEL_DEFERRED_USER_BINDS_LIST,
MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST,
MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_TWITCH_LIST,

View File

@ -442,6 +442,15 @@ error:
/* Download core */
/*****************/
static void cb_task_core_updater_download(
retro_task_t *task, void *task_data,
void *user_data, const char *err)
{
/* Reload core info files
* > This must be done on the main thread */
command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
}
static void cb_decompress_task_core_updater_download(
retro_task_t *task, void *task_data,
void *user_data, const char *err)
@ -757,9 +766,6 @@ static void task_core_updater_download_handler(retro_task_t *task)
task_title[0] = '\0';
/* Reload core info files */
command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
/* Set final task title */
task_free_title(task);
@ -894,6 +900,7 @@ void *task_push_core_updater_download(
task->title = strdup(task_title);
task->alternative_look = true;
task->progress = 0;
task->callback = cb_task_core_updater_download;
/* Push task */
task_queue_push(task);