mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
Display number of cores updated when updating installed cores
This commit is contained in:
parent
3d80838754
commit
d2e2c289a6
3 changed files with 39 additions and 8 deletions
|
@ -880,6 +880,10 @@ MSG_HASH(
|
|||
MSG_ALL_CORES_UPDATED,
|
||||
"All installed cores at latest version"
|
||||
)
|
||||
MSG_HASH(
|
||||
MSG_NUM_CORES_UPDATED,
|
||||
"cores updated: "
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_MENU_SCALE_FACTOR,
|
||||
"Menu Scale Factor"
|
||||
|
|
|
@ -1902,7 +1902,7 @@ enum msg_hash_enums
|
|||
MSG_SCANNING_CORES,
|
||||
MSG_CHECKING_CORE,
|
||||
MSG_ALL_CORES_UPDATED,
|
||||
|
||||
MSG_NUM_CORES_UPDATED,
|
||||
|
||||
MENU_LABEL(VIDEO_SHADER_PARAMETERS),
|
||||
MENU_LABEL(VIDEO_SHADER_PRESET_PARAMETERS),
|
||||
|
|
|
@ -108,6 +108,7 @@ typedef struct update_installed_cores_handle
|
|||
size_t list_size;
|
||||
size_t list_index;
|
||||
size_t installed_index;
|
||||
unsigned num_updated;
|
||||
enum update_installed_cores_status status;
|
||||
} update_installed_cores_handle_t;
|
||||
|
||||
|
@ -309,9 +310,10 @@ static void task_core_updater_get_list_handler(retro_task_t *task)
|
|||
|
||||
/* Enable menu refresh, if required */
|
||||
#if defined(RARCH_INTERNAL) && defined(HAVE_MENU)
|
||||
menu_entries_ctl(
|
||||
MENU_ENTRIES_CTL_UNSET_REFRESH,
|
||||
&list_handle->refresh_menu);
|
||||
if (list_handle->refresh_menu)
|
||||
menu_entries_ctl(
|
||||
MENU_ENTRIES_CTL_UNSET_REFRESH,
|
||||
&list_handle->refresh_menu);
|
||||
#endif
|
||||
}
|
||||
/* fall-through */
|
||||
|
@ -1078,6 +1080,9 @@ static void task_update_installed_cores_handler(retro_task_t *task)
|
|||
|
||||
task_set_title(task, strdup(task_title));
|
||||
|
||||
/* Increment 'updated cores' counter */
|
||||
update_installed_handle->num_updated++;
|
||||
|
||||
/* Wait for download to complete */
|
||||
update_installed_handle->status = UPDATE_INSTALLED_CORES_WAIT_DOWNLOAD;
|
||||
}
|
||||
|
@ -1110,10 +1115,31 @@ static void task_update_installed_cores_handler(retro_task_t *task)
|
|||
/* Set final task title */
|
||||
task_free_title(task);
|
||||
|
||||
task_set_title(task,
|
||||
(update_installed_handle->list_size > 0) ?
|
||||
strdup(msg_hash_to_str(MSG_ALL_CORES_UPDATED)) :
|
||||
strdup(msg_hash_to_str(MSG_CORE_LIST_FAILED)));
|
||||
/* > Check whether core list was fetched
|
||||
* successfully */
|
||||
if (update_installed_handle->list_size > 0)
|
||||
{
|
||||
/* > Check whether a non-zero number of cores
|
||||
* were updated */
|
||||
if (update_installed_handle->num_updated > 0)
|
||||
{
|
||||
char task_title[PATH_MAX_LENGTH];
|
||||
|
||||
task_title[0] = '\0';
|
||||
|
||||
snprintf(
|
||||
task_title, sizeof(task_title), "%s [%s%u]",
|
||||
msg_hash_to_str(MSG_ALL_CORES_UPDATED),
|
||||
msg_hash_to_str(MSG_NUM_CORES_UPDATED),
|
||||
update_installed_handle->num_updated);
|
||||
|
||||
task_set_title(task, strdup(task_title));
|
||||
}
|
||||
else
|
||||
task_set_title(task, strdup(msg_hash_to_str(MSG_ALL_CORES_UPDATED)));
|
||||
}
|
||||
else
|
||||
task_set_title(task, strdup(msg_hash_to_str(MSG_CORE_LIST_FAILED)));
|
||||
}
|
||||
/* fall-through */
|
||||
default:
|
||||
|
@ -1161,6 +1187,7 @@ void task_push_update_installed_cores(void)
|
|||
update_installed_handle->list_size = 0;
|
||||
update_installed_handle->list_index = 0;
|
||||
update_installed_handle->installed_index = 0;
|
||||
update_installed_handle->num_updated = 0;
|
||||
update_installed_handle->status = UPDATE_INSTALLED_CORES_BEGIN;
|
||||
|
||||
if (!update_installed_handle->core_list)
|
||||
|
|
Loading…
Add table
Reference in a new issue