If we are inside online updater screen and go back ingame and then

go back to the menu, we would become stuck inside this menu because
there were no entries. This has now been fixed
This commit is contained in:
twinaphex 2019-04-23 23:35:52 +02:00
parent f573626144
commit 70d0bd5092
3 changed files with 79 additions and 21 deletions

View File

@ -4626,9 +4626,17 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
case DISPLAYLIST_CORE_CONTENT:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
#ifdef HAVE_NETWORKING
print_buf_lines(info->list, menu->core_buf, "",
count = print_buf_lines(info->list, menu->core_buf, "",
(int)menu->core_len,
FILE_TYPE_DOWNLOAD_CORE_CONTENT, true, false);
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);
info->need_push = true;
info->need_refresh = true;
info->need_clear = true;
@ -4646,8 +4654,17 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
strlcpy(new_label, str_list->elems[0].data, sizeof(new_label));
if (str_list->elems[1].data)
strlcpy(menu->core_buf, str_list->elems[1].data, menu->core_len);
print_buf_lines(info->list, menu->core_buf, new_label,
count = print_buf_lines(info->list, menu->core_buf, new_label,
(int)menu->core_len, FILE_TYPE_DOWNLOAD_URL, false, false);
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);
info->need_push = true;
info->need_refresh = true;
info->need_clear = true;
@ -4668,8 +4685,17 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
fill_pathname_join(new_label,
settings->paths.network_buildbot_assets_url,
"cores", sizeof(new_label));
print_buf_lines(info->list, menu->core_buf, new_label,
count = print_buf_lines(info->list, menu->core_buf, new_label,
(int)menu->core_len, FILE_TYPE_DOWNLOAD_URL, true, false);
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);
info->need_push = true;
info->need_refresh = true;
info->need_clear = true;
@ -4679,8 +4705,16 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
case DISPLAYLIST_CORES_UPDATER:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
#ifdef HAVE_NETWORKING
print_buf_lines(info->list, menu->core_buf, "",
count = print_buf_lines(info->list, menu->core_buf, "",
(int)menu->core_len, FILE_TYPE_DOWNLOAD_CORE, true, true);
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);
info->need_push = true;
info->need_refresh = true;
info->need_clear = true;
@ -4689,9 +4723,17 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
case DISPLAYLIST_THUMBNAILS_UPDATER:
#ifdef HAVE_NETWORKING
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
print_buf_lines(info->list, menu->core_buf, "",
count = print_buf_lines(info->list, menu->core_buf, "",
(int)menu->core_len, FILE_TYPE_DOWNLOAD_THUMBNAIL_CONTENT,
true, false);
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);
info->need_push = true;
info->need_refresh = true;
info->need_clear = true;
@ -4700,9 +4742,17 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
case DISPLAYLIST_LAKKA:
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
#ifdef HAVE_NETWORKING
print_buf_lines(info->list, menu->core_buf, "",
count = print_buf_lines(info->list, menu->core_buf, "",
(int)menu->core_len, FILE_TYPE_DOWNLOAD_LAKKA,
true, false);
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);
info->need_push = true;
info->need_refresh = true;
info->need_clear = true;

View File

@ -42,23 +42,17 @@
#include "../tasks/task_file_transfer.h"
#include "../tasks/tasks_internal.h"
void print_buf_lines(file_list_t *list, char *buf,
unsigned print_buf_lines(file_list_t *list, char *buf,
const char *label, int buf_size,
enum msg_file_type type, bool append, bool extended)
{
char c;
int i, j = 0;
unsigned count = 0;
int i, j = 0;
char *line_start = buf;
if (!buf || !buf_size)
{
menu_entries_append_enum(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);
return;
}
return 0;
for (i = 0; i < buf_size; i++)
{
@ -102,20 +96,32 @@ void print_buf_lines(file_list_t *list, char *buf,
if (extended)
{
if (append)
menu_entries_append_enum(list, core_pathname, "",
MENU_ENUM_LABEL_URL_ENTRY, type, 0, 0);
{
if (menu_entries_append_enum(list, core_pathname, "",
MENU_ENUM_LABEL_URL_ENTRY, type, 0, 0))
count++;
}
else
{
menu_entries_prepend(list, core_pathname, "",
MENU_ENUM_LABEL_URL_ENTRY, type, 0, 0);
count++;
}
}
else
{
if (append)
menu_entries_append_enum(list, line_start, label,
MENU_ENUM_LABEL_URL_ENTRY, type, 0, 0);
{
if (menu_entries_append_enum(list, line_start, label,
MENU_ENUM_LABEL_URL_ENTRY, type, 0, 0))
count++;
}
else
{
menu_entries_prepend(list, line_start, label,
MENU_ENUM_LABEL_URL_ENTRY, type, 0, 0);
count++;
}
}
switch (type)
@ -178,6 +184,8 @@ void print_buf_lines(file_list_t *list, char *buf,
file_list_sort_on_alt(list);
/* If the buffer was completely full, and didn't end
* with a newline, just ignore the partial last line. */
return count;
}
void cb_net_generic_subdir(retro_task_t *task,

View File

@ -29,7 +29,7 @@
RETRO_BEGIN_DECLS
void print_buf_lines(file_list_t *list, char *buf,
unsigned print_buf_lines(file_list_t *list, char *buf,
const char *label, int buf_size,
enum msg_file_type type, bool append, bool extended);