Create DISPLAYLIST_PROCESS
This commit is contained in:
parent
e8eaa54218
commit
77c583ae47
|
@ -49,7 +49,7 @@ static int deferred_push_dlist(menu_displaylist_info_t *info, unsigned val)
|
||||||
{
|
{
|
||||||
if (!menu_displaylist_ctl(val, info))
|
if (!menu_displaylist_ctl(val, info))
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
menu_displaylist_push_list_process(info);
|
menu_displaylist_ctl(DISPLAYLIST_PROCESS, info);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,13 +41,13 @@ static int action_info_default(unsigned type, const char *label)
|
||||||
menu_hash_to_str(MENU_LABEL_INFO_SCREEN),
|
menu_hash_to_str(MENU_LABEL_INFO_SCREEN),
|
||||||
sizeof(info.label));
|
sizeof(info.label));
|
||||||
|
|
||||||
if (menu_displaylist_ctl(DISPLAYLIST_HELP, &info))
|
if (!menu_displaylist_ctl(DISPLAYLIST_HELP, &info))
|
||||||
{
|
|
||||||
menu_displaylist_push_list_process(&info);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (!menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int menu_cbs_init_bind_info(menu_file_list_cbs_t *cbs,
|
int menu_cbs_init_bind_info(menu_file_list_cbs_t *cbs,
|
||||||
|
|
|
@ -431,11 +431,11 @@ int generic_action_ok_displaylist_push(const char *path,
|
||||||
if (info_path)
|
if (info_path)
|
||||||
strlcpy(info.path, info_path, sizeof(info.path));
|
strlcpy(info.path, info_path, sizeof(info.path));
|
||||||
|
|
||||||
if (!menu_displaylist_ctl(dl_type, &info))
|
if (menu_displaylist_ctl(dl_type, &info))
|
||||||
return menu_cbs_exit();
|
if (menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info))
|
||||||
|
|
||||||
menu_displaylist_push_list_process(&info);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
return menu_cbs_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_load_with_detect_core_wrapper(size_t idx, size_t entry_idx,
|
static int file_load_with_detect_core_wrapper(size_t idx, size_t entry_idx,
|
||||||
|
|
|
@ -399,7 +399,7 @@ bool generic_menu_init_list(void *data)
|
||||||
info.list = selection_buf;
|
info.list = selection_buf;
|
||||||
|
|
||||||
if (menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info))
|
if (menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info))
|
||||||
menu_displaylist_push_list_process(&info);
|
menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1080,7 +1080,7 @@ static void xmb_init_horizontal_list(xmb_handle_t *xmb)
|
||||||
strlcpy(info.exts, "lpl", sizeof(info.exts));
|
strlcpy(info.exts, "lpl", sizeof(info.exts));
|
||||||
|
|
||||||
if (menu_displaylist_ctl(DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL, &info))
|
if (menu_displaylist_ctl(DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL, &info))
|
||||||
menu_displaylist_push_list_process(&info);
|
menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_toggle_horizontal_list(xmb_handle_t *xmb)
|
static void xmb_toggle_horizontal_list(xmb_handle_t *xmb)
|
||||||
|
@ -2691,7 +2691,7 @@ static int deferred_push_content_actions(menu_displaylist_info_t *info)
|
||||||
if (!menu_displaylist_ctl(
|
if (!menu_displaylist_ctl(
|
||||||
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, info))
|
DISPLAYLIST_HORIZONTAL_CONTENT_ACTIONS, info))
|
||||||
return -1;
|
return -1;
|
||||||
menu_displaylist_push_list_process(info);
|
menu_displaylist_ctl(DISPLAYLIST_PROCESS, info);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2801,11 +2801,14 @@ static bool xmb_menu_init_list(void *data)
|
||||||
info.label, info.type, info.flags, 0);
|
info.label, info.type, info.flags, 0);
|
||||||
|
|
||||||
info.list = selection_buf;
|
info.list = selection_buf;
|
||||||
menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info);
|
|
||||||
|
if (!menu_displaylist_ctl(DISPLAYLIST_MAIN_MENU, &info))
|
||||||
|
return false;
|
||||||
|
|
||||||
info.need_push = true;
|
info.need_push = true;
|
||||||
|
|
||||||
menu_displaylist_push_list_process(&info);
|
if (!menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info))
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1330,15 +1330,14 @@ static bool zarch_menu_init_list(void *data)
|
||||||
event_cmd_ctl(EVENT_CMD_HISTORY_INIT, NULL);
|
event_cmd_ctl(EVENT_CMD_HISTORY_INIT, NULL);
|
||||||
|
|
||||||
info.list = selection_buf;
|
info.list = selection_buf;
|
||||||
menu_displaylist_ctl(DISPLAYLIST_HISTORY, &info);
|
|
||||||
|
|
||||||
|
if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, &info))
|
||||||
|
{
|
||||||
info.need_push = true;
|
info.need_push = true;
|
||||||
|
return menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info);
|
||||||
|
}
|
||||||
|
|
||||||
(void)ret;
|
return false;
|
||||||
|
|
||||||
menu_displaylist_push_list_process(&info);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_ctx_driver_t menu_ctx_zarch = {
|
menu_ctx_driver_t menu_ctx_zarch = {
|
||||||
|
|
|
@ -2571,6 +2571,26 @@ static void menu_displaylist_parse_playlist_associations(menu_displaylist_info_t
|
||||||
string_list_free(stcores);
|
string_list_free(stcores);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool menu_displaylist_push_list_process(menu_displaylist_info_t *info)
|
||||||
|
{
|
||||||
|
if (!info)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (info->need_sort)
|
||||||
|
file_list_sort_on_alt(info->list);
|
||||||
|
|
||||||
|
if (info->need_refresh)
|
||||||
|
menu_entries_ctl(MENU_ENTRIES_CTL_REFRESH, info->list);
|
||||||
|
|
||||||
|
if (info->need_push)
|
||||||
|
{
|
||||||
|
menu_driver_ctl(RARCH_MENU_CTL_POPULATE_ENTRIES, info);
|
||||||
|
ui_companion_driver_notify_list_loaded(info->list, info->menu_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist_info_t *info)
|
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist_info_t *info)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -2584,6 +2604,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
|
||||||
menu_handle_t *menu = NULL;
|
menu_handle_t *menu = NULL;
|
||||||
settings_t *settings = NULL;
|
settings_t *settings = NULL;
|
||||||
|
|
||||||
|
if (type == DISPLAYLIST_PROCESS)
|
||||||
|
return menu_displaylist_push_list_process(info);
|
||||||
|
|
||||||
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -3111,8 +3134,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
|
||||||
if (string_is_equal(info->path, "content_history.lpl"))
|
if (string_is_equal(info->path, "content_history.lpl"))
|
||||||
{
|
{
|
||||||
if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, info))
|
if (menu_displaylist_ctl(DISPLAYLIST_HISTORY, info))
|
||||||
menu_displaylist_push_list_process(info);
|
return menu_displaylist_push_list_process(info);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3432,23 +3455,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_displaylist_push_list_process(menu_displaylist_info_t *info)
|
|
||||||
{
|
|
||||||
if (!info)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (info->need_sort)
|
|
||||||
file_list_sort_on_alt(info->list);
|
|
||||||
|
|
||||||
if (info->need_refresh)
|
|
||||||
menu_entries_ctl(MENU_ENTRIES_CTL_REFRESH, info->list);
|
|
||||||
|
|
||||||
if (info->need_push)
|
|
||||||
{
|
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_POPULATE_ENTRIES, info);
|
|
||||||
ui_companion_driver_notify_list_loaded(info->list, info->menu_list);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
|
int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
|
||||||
|
|
|
@ -114,7 +114,8 @@ enum menu_displaylist_ctl_state
|
||||||
DISPLAYLIST_SCAN_DIRECTORY_LIST,
|
DISPLAYLIST_SCAN_DIRECTORY_LIST,
|
||||||
DISPLAYLIST_ARCHIVE_ACTION,
|
DISPLAYLIST_ARCHIVE_ACTION,
|
||||||
DISPLAYLIST_ARCHIVE_ACTION_DETECT_CORE,
|
DISPLAYLIST_ARCHIVE_ACTION_DETECT_CORE,
|
||||||
DISPLAYLIST_CORE_CONTENT
|
DISPLAYLIST_CORE_CONTENT,
|
||||||
|
DISPLAYLIST_PROCESS
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct menu_displaylist_info
|
typedef struct menu_displaylist_info
|
||||||
|
@ -138,8 +139,6 @@ typedef struct menu_displaylist_info
|
||||||
|
|
||||||
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist_info_t *info);
|
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist_info_t *info);
|
||||||
|
|
||||||
void menu_displaylist_push_list_process(menu_displaylist_info_t *info);
|
|
||||||
|
|
||||||
int menu_displaylist_push(file_list_t *list, file_list_t *menu_list);
|
int menu_displaylist_push(file_list_t *list, file_list_t *menu_list);
|
||||||
|
|
||||||
int menu_displaylist_parse_settings(void *data, menu_displaylist_info_t *info,
|
int menu_displaylist_parse_settings(void *data, menu_displaylist_info_t *info,
|
||||||
|
|
|
@ -664,7 +664,7 @@ static int menu_input_key_bind_set_mode_common(
|
||||||
menu_hash_to_str(MENU_LABEL_CUSTOM_BIND), sizeof(info.label));
|
menu_hash_to_str(MENU_LABEL_CUSTOM_BIND), sizeof(info.label));
|
||||||
|
|
||||||
if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info))
|
if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info))
|
||||||
menu_displaylist_push_list_process(&info);
|
menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info);
|
||||||
break;
|
break;
|
||||||
case MENU_INPUT_BIND_ALL:
|
case MENU_INPUT_BIND_ALL:
|
||||||
menu_input->binds.target = &settings->input.binds
|
menu_input->binds.target = &settings->input.binds
|
||||||
|
@ -680,7 +680,7 @@ static int menu_input_key_bind_set_mode_common(
|
||||||
sizeof(info.label));
|
sizeof(info.label));
|
||||||
|
|
||||||
if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info))
|
if (menu_displaylist_ctl(DISPLAYLIST_INFO, &info))
|
||||||
menu_displaylist_push_list_process(&info);
|
menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1785,7 +1785,7 @@ int menu_action_handle_setting(rarch_setting_t *setting,
|
||||||
strlcpy(info.label, name, sizeof(info.label));
|
strlcpy(info.label, name, sizeof(info.label));
|
||||||
|
|
||||||
if (menu_displaylist_ctl(DISPLAYLIST_GENERIC, &info))
|
if (menu_displaylist_ctl(DISPLAYLIST_GENERIC, &info))
|
||||||
menu_displaylist_push_list_process(&info);
|
menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info);
|
||||||
}
|
}
|
||||||
/* fall-through. */
|
/* fall-through. */
|
||||||
case ST_BOOL:
|
case ST_BOOL:
|
||||||
|
@ -2878,7 +2878,7 @@ void general_write_handler(void *data)
|
||||||
menu_hash_to_str(MENU_LABEL_HELP), sizeof(info.label));
|
menu_hash_to_str(MENU_LABEL_HELP), sizeof(info.label));
|
||||||
|
|
||||||
if (menu_displaylist_ctl(DISPLAYLIST_GENERIC, &info))
|
if (menu_displaylist_ctl(DISPLAYLIST_GENERIC, &info))
|
||||||
menu_displaylist_push_list_process(&info);
|
menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info);
|
||||||
menu_setting_set_with_string_representation(setting, "false");
|
menu_setting_set_with_string_representation(setting, "false");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue