From 07cd36e27cc877a002a6b822615d2f53fb271f44 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 2 Feb 2017 04:00:55 +0100 Subject: [PATCH] Create Filebrowser settings --- intl/msg_hash_chs.h | 2 +- intl/msg_hash_de.h | 2 +- intl/msg_hash_es.c | 2 +- intl/msg_hash_fr.h | 2 +- intl/msg_hash_it.h | 2 +- intl/msg_hash_ja.h | 2 +- intl/msg_hash_nl.h | 2 +- intl/msg_hash_pt.c | 2 +- intl/msg_hash_ru.h | 2 +- intl/msg_hash_us.h | 6 +++--- intl/msg_hash_vn.c | 2 -- menu/cbs/menu_cbs_deferred_push.c | 10 ++++++++++ menu/menu_displaylist.c | 25 ++++++++++++++++++------- menu/menu_displaylist.h | 1 + menu/widgets/menu_filebrowser.c | 12 +----------- menu/widgets/menu_filebrowser.h | 5 +---- 16 files changed, 43 insertions(+), 36 deletions(-) diff --git a/intl/msg_hash_chs.h b/intl/msg_hash_chs.h index f6c5cfb0e2..45f76410e6 100644 --- a/intl/msg_hash_chs.h +++ b/intl/msg_hash_chs.h @@ -950,7 +950,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, "菜单驱动") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE, "限制菜单帧率") -MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, /* TODO/FIXME - update */ "菜单文件浏览器") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_LINEAR_FILTER, "菜单线性过滤") diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index c6e1a54e28..4ce91e66be 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -475,7 +475,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE, "Drossle Menübildwiederholrate") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, - "Menü-Dateibrowsereinstellungen") + "Einstellungen") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_INPUT_SWAP_OK_CANCEL, "Wechsle Ok & Zurück Tasten im Menü") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_LINEAR_FILTER, diff --git a/intl/msg_hash_es.c b/intl/msg_hash_es.c index a24795218e..e0dd01e278 100644 --- a/intl/msg_hash_es.c +++ b/intl/msg_hash_es.c @@ -1808,7 +1808,7 @@ const char *msg_hash_to_str_es(enum msg_hash_enums msg) return "Ajustes de bases de datos"; case MENU_ENUM_LABEL_VALUE_MENU_DRIVER: return "Controlador de menú"; - case MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS: + case MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS: /* TODO/FIXME - update */ return "Navegador de archivos del menú"; case MENU_ENUM_LABEL_VALUE_MENU_SETTINGS: return "Menú"; diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 1b0c7ccccf..0353b3b727 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -854,7 +854,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, "Pilote de menu") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE, "Throttle Menu Framerate") -MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, /* TODO/FIXME - update */ "Navigateur de fichiers") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_LINEAR_FILTER, "Filtre linéaire") diff --git a/intl/msg_hash_it.h b/intl/msg_hash_it.h index b04ff78c72..5e70bbd83e 100644 --- a/intl/msg_hash_it.h +++ b/intl/msg_hash_it.h @@ -824,7 +824,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, "Driver Menù") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE, "Frequenza fotogrammi del menù") -MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, /* TODO/FIXME - update */ "Seleziona file") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_LINEAR_FILTER, "Filtro lineare del menù") diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index e414f2e2ba..6db28d28ee 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -951,7 +951,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, "メニューのドライバ") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE, "メニューのフレームレートを減速") -MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, /* TODO/FIXME - update */ "メニューファイルブラウザー") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_LINEAR_FILTER, "メニューのリニアフィルター") diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 5c972e83b4..f391307e89 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -861,7 +861,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE, "Throttle Menu Framerate") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, - "Menu Bestandsbeheer") + "Instellingen") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_LINEAR_FILTER, "Menu Linear Filter") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SETTINGS, diff --git a/intl/msg_hash_pt.c b/intl/msg_hash_pt.c index 715cdc1cb8..f7d75bde45 100644 --- a/intl/msg_hash_pt.c +++ b/intl/msg_hash_pt.c @@ -1246,7 +1246,7 @@ const char *msg_hash_to_str_pt(enum msg_hash_enums msg) return "Databases"; case MENU_ENUM_LABEL_VALUE_MENU_DRIVER: return "Driver de Menu"; - case MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS: + case MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS: /* TODO/FIXME - Update */ return "Menu de Navegação"; case MENU_ENUM_LABEL_VALUE_MENU_SETTINGS: return "Menu"; diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 5e97035d0e..b372e4b6c0 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -866,7 +866,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE, "Throttle Menu Framerate") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, - "Menu File Browser") + "Settings") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_LINEAR_FILTER, "Menu Linear Filter") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SETTINGS, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 1342740a01..c87b112a5e 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -937,7 +937,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE, "Throttle Menu Framerate") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, - "Menu File Browser") + "Settings") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_LINEAR_FILTER, "Menu Linear Filter") MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SETTINGS, @@ -2418,9 +2418,9 @@ MSG_HASH(MENU_ENUM_SUBLABEL_SYSTEM_INFORMATION, MSG_HASH(MENU_ENUM_SUBLABEL_QUIT_RETROARCH, "Quit the program.") MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_WINDOW_WIDTH, - "Lets you set custom width size for the display window. Leaving it at 0 will attempt to scale the window as large as possible.") + "Set the custom width size for the display window. Leaving it at 0 will attempt to scale the window as large as possible.") MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_WINDOW_HEIGHT, - "Lets you set custom height size for the display window. Leaving it at 0 will attempt to scale the window as large as possible.") + "Set the custom height size for the display window. Leaving it at 0 will attempt to scale the window as large as possible.") MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_MESSAGE_POS_X, "Specify custom X axis position for onscreen text.") MSG_HASH(MENU_ENUM_SUBLABEL_VIDEO_MESSAGE_POS_Y, diff --git a/intl/msg_hash_vn.c b/intl/msg_hash_vn.c index 9876398abb..a1cb09f66b 100644 --- a/intl/msg_hash_vn.c +++ b/intl/msg_hash_vn.c @@ -2542,8 +2542,6 @@ const char *msg_hash_to_str_vn(enum msg_hash_enums msg) return "Menu Driver"; case MENU_ENUM_LABEL_VALUE_MENU_ENUM_THROTTLE_FRAMERATE: return "Throttle Menu Framerate"; - case MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS: - return "Menu File Browser"; case MENU_ENUM_LABEL_VALUE_MENU_LINEAR_FILTER: return "Menu Linear Filter"; case MENU_ENUM_LABEL_VALUE_MENU_SETTINGS: diff --git a/menu/cbs/menu_cbs_deferred_push.c b/menu/cbs/menu_cbs_deferred_push.c index 47067720b1..c7ab0c147f 100644 --- a/menu/cbs/menu_cbs_deferred_push.c +++ b/menu/cbs/menu_cbs_deferred_push.c @@ -158,6 +158,11 @@ static int deferred_push_onscreen_overlay_settings_list(menu_displaylist_info_t return deferred_push_dlist(info, DISPLAYLIST_ONSCREEN_OVERLAY_SETTINGS_LIST); } +static int deferred_push_menu_file_browser_settings_list(menu_displaylist_info_t *info) +{ + return deferred_push_dlist(info, DISPLAYLIST_MENU_FILE_BROWSER_SETTINGS_LIST); +} + static int deferred_push_menu_settings_list(menu_displaylist_info_t *info) { return deferred_push_dlist(info, DISPLAYLIST_MENU_SETTINGS_LIST); @@ -911,6 +916,11 @@ static int menu_cbs_init_bind_deferred_push_compare_label( BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_onscreen_overlay_settings_list); return 0; } + if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MENU_FILE_BROWSER_SETTINGS_LIST))) + { + BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_menu_file_browser_settings_list); + return 0; + } if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_MENU_SETTINGS_LIST))) { BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_menu_settings_list); diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index a6c45f1446..e189422d47 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3912,7 +3912,6 @@ static void menu_displaylist_parse_playlist_history( bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) { size_t i; - bool extensions_honored = false; menu_ctx_displaylist_t disp_list; #ifdef HAVE_SHADER_MANAGER video_shader_ctx_t shader_info; @@ -4015,6 +4014,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) case DISPLAYLIST_ONSCREEN_DISPLAY_SETTINGS_LIST: case DISPLAYLIST_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST: case DISPLAYLIST_ONSCREEN_OVERLAY_SETTINGS_LIST: + case DISPLAYLIST_MENU_FILE_BROWSER_SETTINGS_LIST: case DISPLAYLIST_MENU_SETTINGS_LIST: case DISPLAYLIST_USER_INTERFACE_SETTINGS_LIST: case DISPLAYLIST_RETRO_ACHIEVEMENTS_SETTINGS_LIST: @@ -4409,9 +4409,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_AUTO_REMAPS_ENABLE, PARSE_ONLY_BOOL, false); - menu_displaylist_parse_settings_enum(menu, info, - MENU_ENUM_LABEL_SHOW_HIDDEN_FILES, - PARSE_ONLY_BOOL, false); info->need_refresh = true; info->need_push = true; @@ -4539,6 +4536,17 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_OVERLAY_SCALE, PARSE_ONLY_FLOAT, false); + info->need_refresh = true; + info->need_push = true; + break; + case DISPLAYLIST_MENU_FILE_BROWSER_SETTINGS_LIST: + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_SHOW_HIDDEN_FILES, + PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABLE, + PARSE_ONLY_BOOL, false); + info->need_refresh = true; info->need_push = true; break; @@ -5417,6 +5425,11 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_BROWSE_URL_LIST, MENU_SETTING_ACTION, 0, 0); #endif + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS), + msg_hash_to_str(MENU_ENUM_LABEL_MENU_FILE_BROWSER_SETTINGS), + MENU_ENUM_LABEL_MENU_FILE_BROWSER_SETTINGS, + MENU_SETTING_ACTION, 0, 0); info->need_push = true; info->need_refresh = true; @@ -6328,8 +6341,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) case DISPLAYLIST_REMAP_FILES: case DISPLAYLIST_RECORD_CONFIG_FILES: case DISPLAYLIST_CONFIG_FILES: - extensions_honored = true; - /* fall-through */ case DISPLAYLIST_DEFAULT: case DISPLAYLIST_CORES_DETECTED: case DISPLAYLIST_CONTENT_HISTORY: @@ -6343,7 +6354,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) } else { - filebrowser_parse(info, type, extensions_honored); + filebrowser_parse(info, type); info->need_refresh = true; info->need_push = true; } diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index 043ff81356..11774301ca 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -122,6 +122,7 @@ enum menu_displaylist_ctl_state DISPLAYLIST_ONSCREEN_OVERLAY_SETTINGS_LIST, DISPLAYLIST_ONSCREEN_DISPLAY_SETTINGS_LIST, DISPLAYLIST_ONSCREEN_NOTIFICATIONS_SETTINGS_LIST, + DISPLAYLIST_MENU_FILE_BROWSER_SETTINGS_LIST, DISPLAYLIST_MENU_SETTINGS_LIST, DISPLAYLIST_USER_INTERFACE_SETTINGS_LIST, DISPLAYLIST_RETRO_ACHIEVEMENTS_SETTINGS_LIST, diff --git a/menu/widgets/menu_filebrowser.c b/menu/widgets/menu_filebrowser.c index bd20f21f54..f302d2244e 100644 --- a/menu/widgets/menu_filebrowser.c +++ b/menu/widgets/menu_filebrowser.c @@ -53,7 +53,7 @@ void filebrowser_set_type(enum filebrowser_enums type) filebrowser_types = type; } -void filebrowser_parse(void *data, unsigned type_data, bool extensions_honored) +void filebrowser_parse(void *data, unsigned type_data) { size_t i, list_size; struct string_list *str_list = NULL; @@ -73,9 +73,6 @@ void filebrowser_parse(void *data, unsigned type_data, bool extensions_honored) msg_hash_to_str(MENU_ENUM_LABEL_SCAN_FILE))) filter_ext = false; - if (extensions_honored) - filter_ext = true; - if (path_is_compressed) str_list = file_archive_get_file_list(info->path, info->exts); else @@ -274,13 +271,6 @@ void filebrowser_parse(void *data, unsigned type_data, bool extensions_honored) if (filebrowser_types == FILEBROWSER_SCAN_DIR) goto end; - if (!extensions_honored && files_count > 0) - menu_entries_prepend(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABLE), - msg_hash_to_str(MENU_ENUM_LABEL_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABLE), - MENU_ENUM_LABEL_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABLE, - 0, 0 ,0); - end: menu_entries_prepend(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PARENT_DIRECTORY), diff --git a/menu/widgets/menu_filebrowser.h b/menu/widgets/menu_filebrowser.h index 9fc950bbdd..c1d3794b59 100644 --- a/menu/widgets/menu_filebrowser.h +++ b/menu/widgets/menu_filebrowser.h @@ -20,8 +20,6 @@ #include #include -#include - #include RETRO_BEGIN_DECLS @@ -41,8 +39,7 @@ void filebrowser_clear_type(void); void filebrowser_set_type(enum filebrowser_enums type); -void filebrowser_parse(void *data, unsigned type, - bool extensions_honored); +void filebrowser_parse(void *data, unsigned type); RETRO_END_DECLS