mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Move menu_action_ok of MENU_FILE_DIRECTORY and MENU_FILE_CARCHIVE
over to menu_entries_cbs.c
This commit is contained in:
parent
ad9e618ec6
commit
aa1e56fd29
@ -852,26 +852,6 @@ static int menu_action_ok(const char *menu_path,
|
||||
menu_entries_pop_stack(driver.menu->menu_stack, setting->name);
|
||||
|
||||
return 0;
|
||||
case MENU_FILE_DIRECTORY:
|
||||
case MENU_FILE_CARCHIVE:
|
||||
|
||||
{
|
||||
char cat_path[PATH_MAX];
|
||||
|
||||
if (type == MENU_FILE_CARCHIVE && !strcmp(menu_label, "detect_core_list"))
|
||||
{
|
||||
file_list_push(driver.menu->menu_stack, path, "load_open_zip",
|
||||
0, driver.menu->selection_ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path));
|
||||
menu_entries_push(driver.menu->menu_stack,
|
||||
cat_path, menu_label, type, driver.menu->selection_ptr);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -214,6 +214,51 @@ static int action_ok_core_load(const char *path,
|
||||
#endif
|
||||
}
|
||||
|
||||
static int action_ok_compressed_archive_push(const char *path,
|
||||
const char *label, unsigned type, size_t index)
|
||||
{
|
||||
const char *menu_path = NULL;
|
||||
const char *menu_label = NULL;
|
||||
char cat_path[PATH_MAX];
|
||||
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
file_list_get_last(driver.menu->menu_stack, &menu_path, &menu_label, NULL);
|
||||
|
||||
if (!strcmp(menu_label, "detect_core_list"))
|
||||
{
|
||||
file_list_push(driver.menu->menu_stack, path, "load_open_zip",
|
||||
0, driver.menu->selection_ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path));
|
||||
menu_entries_push(driver.menu->menu_stack,
|
||||
cat_path, menu_label, type, driver.menu->selection_ptr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_ok_directory_push(const char *path,
|
||||
const char *label, unsigned type, size_t index)
|
||||
{
|
||||
const char *menu_path = NULL;
|
||||
const char *menu_label = NULL;
|
||||
char cat_path[PATH_MAX];
|
||||
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
file_list_get_last(driver.menu->menu_stack, &menu_path, &menu_label, NULL);
|
||||
|
||||
fill_pathname_join(cat_path, menu_path, path, sizeof(cat_path));
|
||||
menu_entries_push(driver.menu->menu_stack,
|
||||
cat_path, menu_label, type, driver.menu->selection_ptr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Bind the OK callback function */
|
||||
|
||||
static int menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
||||
@ -243,6 +288,10 @@ static int menu_entries_cbs_init_bind_ok(menu_file_list_cbs_t *cbs,
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
else if (type == MENU_FILE_DIRECTORY)
|
||||
cbs->action_ok = action_ok_directory_push;
|
||||
else if (type == MENU_FILE_CARCHIVE)
|
||||
cbs->action_ok = action_ok_compressed_archive_push;
|
||||
else
|
||||
return -1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user