mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 22:13:51 +00:00
Add 'back' to file browser
This commit is contained in:
parent
3d90049aea
commit
056199c574
@ -735,6 +735,19 @@ static void menu_action_setting_disp_set_label_menu_file_directory(
|
||||
path, "(DIR)", s2, len2);
|
||||
}
|
||||
|
||||
static void menu_action_setting_disp_set_label_menu_file_parent_directory(
|
||||
file_list_t* list,
|
||||
unsigned *w, unsigned type, unsigned i,
|
||||
const char *label,
|
||||
char *s, size_t len,
|
||||
const char *entry_label,
|
||||
const char *path,
|
||||
char *s2, size_t len2)
|
||||
{
|
||||
menu_action_setting_generic_disp_set_label(w, s, len,
|
||||
path, NULL, s2, len2);
|
||||
}
|
||||
|
||||
static void menu_action_setting_disp_set_label_menu_file_carchive(
|
||||
file_list_t* list,
|
||||
unsigned *w, unsigned type, unsigned i,
|
||||
@ -1094,6 +1107,10 @@ static int menu_cbs_init_bind_get_string_representation_compare_type(
|
||||
BIND_ACTION_GET_VALUE(cbs,
|
||||
menu_action_setting_disp_set_label_menu_file_directory);
|
||||
break;
|
||||
case MENU_FILE_PARENT_DIRECTORY:
|
||||
BIND_ACTION_GET_VALUE(cbs,
|
||||
menu_action_setting_disp_set_label_menu_file_parent_directory);
|
||||
break;
|
||||
case MENU_FILE_CARCHIVE:
|
||||
BIND_ACTION_GET_VALUE(cbs,
|
||||
menu_action_setting_disp_set_label_menu_file_carchive);
|
||||
|
@ -242,6 +242,19 @@ int generic_action_ok_displaylist_push(const char *path,
|
||||
strlcpy(menu->scratch_buf, path, sizeof(menu->scratch_buf));
|
||||
strlcpy(menu->scratch2_buf, menu_path, sizeof(menu->scratch2_buf));
|
||||
break;
|
||||
case ACTION_OK_DL_PARENT_DIRECTORY_PUSH:
|
||||
{
|
||||
char parent_dir[PATH_MAX];
|
||||
|
||||
fill_pathname_parent_dir(parent_dir, action_path, sizeof(parent_dir));
|
||||
fill_pathname_parent_dir(parent_dir, parent_dir, sizeof(parent_dir));
|
||||
|
||||
info.type = type;
|
||||
info.directory_ptr = idx;
|
||||
info_path = parent_dir;
|
||||
info_label = menu_label;
|
||||
}
|
||||
break;
|
||||
case ACTION_OK_DL_DIRECTORY_PUSH:
|
||||
info.type = type;
|
||||
info.directory_ptr = idx;
|
||||
@ -1388,6 +1401,13 @@ static int action_ok_shader_parameters(const char *path,
|
||||
entry_idx, ACTION_OK_DL_SHADER_PARAMETERS);
|
||||
}
|
||||
|
||||
int action_ok_parent_directory_push(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
return generic_action_ok_displaylist_push(path, label, type, idx,
|
||||
entry_idx, ACTION_OK_DL_PARENT_DIRECTORY_PUSH);
|
||||
}
|
||||
|
||||
int action_ok_directory_push(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
@ -2090,6 +2110,9 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
|
||||
case MENU_FILE_CONFIG:
|
||||
BIND_ACTION_OK(cbs, action_ok_config_load);
|
||||
break;
|
||||
case MENU_FILE_PARENT_DIRECTORY:
|
||||
BIND_ACTION_OK(cbs, action_ok_parent_directory_push);
|
||||
break;
|
||||
case MENU_FILE_DIRECTORY:
|
||||
BIND_ACTION_OK(cbs, action_ok_directory_push);
|
||||
break;
|
||||
|
@ -397,6 +397,7 @@ static int menu_cbs_init_bind_right_compare_type(menu_file_list_cbs_t *cbs,
|
||||
break;
|
||||
case MENU_FILE_PLAIN:
|
||||
case MENU_FILE_DIRECTORY:
|
||||
case MENU_FILE_PARENT_DIRECTORY:
|
||||
case MENU_FILE_CARCHIVE:
|
||||
case MENU_FILE_IN_CARCHIVE:
|
||||
case MENU_FILE_CORE:
|
||||
|
@ -66,6 +66,7 @@ typedef enum
|
||||
MENU_FILE_NONE = 0,
|
||||
MENU_FILE_PLAIN,
|
||||
MENU_FILE_DIRECTORY,
|
||||
MENU_FILE_PARENT_DIRECTORY,
|
||||
MENU_FILE_PATH,
|
||||
MENU_FILE_DEVICE,
|
||||
MENU_FILE_CORE,
|
||||
|
@ -56,6 +56,7 @@ enum
|
||||
ACTION_OK_DL_CONFIGURATIONS_LIST,
|
||||
ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH,
|
||||
ACTION_OK_DL_COMPRESSED_ARCHIVE_PUSH_DETECT_CORE,
|
||||
ACTION_OK_DL_PARENT_DIRECTORY_PUSH,
|
||||
ACTION_OK_DL_DIRECTORY_PUSH,
|
||||
ACTION_OK_DL_DATABASE_MANAGER_LIST,
|
||||
ACTION_OK_DL_CURSOR_MANAGER_LIST,
|
||||
|
@ -2082,6 +2082,17 @@ static int menu_displaylist_parse_generic(menu_displaylist_info_t *info, bool ho
|
||||
menu_hash_to_str(MENU_LABEL_USE_THIS_DIRECTORY),
|
||||
MENU_FILE_USE_DIRECTORY, 0 ,0);
|
||||
|
||||
{
|
||||
char out_dir[PATH_MAX_LENGTH];
|
||||
fill_pathname_parent_dir(out_dir, info->path, sizeof(out_dir));
|
||||
|
||||
if (out_dir[0] != '\0')
|
||||
{
|
||||
menu_entries_push(info->list, "..", info->path,
|
||||
MENU_FILE_PARENT_DIRECTORY, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!str_list)
|
||||
{
|
||||
const char *str = path_is_compressed
|
||||
|
Loading…
x
Reference in New Issue
Block a user