(menu_cbs_select.c) Hook up ST_DIR

This commit is contained in:
twinaphex 2015-08-05 10:16:46 +02:00
parent 6bdfc2f200
commit afcf53aaef
3 changed files with 27 additions and 1 deletions

View File

@ -365,7 +365,7 @@ static int action_ok_shader_parameters(const char *path,
return menu_displaylist_push_list(&info, DISPLAYLIST_GENERIC);
}
static int action_ok_push_generic_list(const char *path,
int action_ok_push_generic_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
menu_displaylist_info_t info = {0};

View File

@ -87,6 +87,12 @@ static int action_select_input_desc(const char *path, const char *label, unsigne
return action_right_input_desc(type, label, true);
}
static int action_select_push_generic_list(const char *path, const char *label, unsigned type,
size_t idx)
{
return action_ok_push_generic_list(path, label, type, idx, 0 /* unused */);
}
static int menu_cbs_init_bind_select_compare_type(
menu_file_list_cbs_t *cbs, unsigned type)
{
@ -119,6 +125,20 @@ static int menu_cbs_init_bind_select_compare_type(
return 0;
}
static int menu_cbs_init_bind_select_compare_label(menu_file_list_cbs_t *cbs,
const char *label, uint32_t hash, const char *elem0)
{
rarch_setting_t *setting = menu_setting_find(label);
if (setting && setting->browser_selection_type == ST_DIR)
{
cbs->action_select = action_select_push_generic_list;
return 0;
}
return -1;
}
int menu_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx,
const char *elem0, const char *elem1,
@ -129,6 +149,9 @@ int menu_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
cbs->action_select = action_select_default;
if (menu_cbs_init_bind_select_compare_label(cbs, label, label_hash, elem0) == 0)
return 0;
if (menu_cbs_init_bind_select_compare_type(cbs, type) == 0)
return 0;

View File

@ -33,6 +33,9 @@ extern char core_updater_path[PATH_MAX_LENGTH];
/* Function callbacks */
int action_ok_push_generic_list(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx);
int action_ok_path_use_directory(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx);