RGUI: 'Use This Directory' cleanup (#17450)

This commit is contained in:
sonninnos 2025-01-21 03:02:55 +02:00 committed by GitHub
parent 54debca4a3
commit 1c724f5355
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 16 deletions

View File

@ -9429,6 +9429,13 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
BIND_ACTION_OK(cbs, action_ok_menu_wallpaper_load);
break;
case FILE_TYPE_USE_DIRECTORY:
if ( cbs->enum_idx == MSG_UNKNOWN
&& string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES)))
BIND_ACTION_OK(cbs, action_ok_file_load_with_detect_core);
else if (cbs->enum_idx == MSG_UNKNOWN
&& string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_DISK_IMAGE_APPEND)))
BIND_ACTION_OK(cbs, action_ok_disk_image_append);
else
BIND_ACTION_OK(cbs, action_ok_path_use_directory);
break;
#ifdef HAVE_LIBRETRODB
@ -9581,8 +9588,8 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
{
BIND_ACTION_OK(cbs, action_ok_database_manager_list);
}
/* TODO/FIXME - refactor this */
else if (string_is_equal(menu_label, "Horizontal Menu"))
else if (string_is_equal(menu_label,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_HORIZONTAL_MENU)))
{
BIND_ACTION_OK(cbs, action_ok_database_manager_list);
}
@ -9642,9 +9649,9 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
{
switch (cbs->enum_idx)
{
case MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE:
case MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
case MENU_ENUM_LABEL_FAVORITES:
case MENU_ENUM_LABEL_DEFERRED_ARCHIVE_OPEN_DETECT_CORE:
#ifdef HAVE_COMPRESSION
if (type == FILE_TYPE_IN_CARCHIVE)
{
@ -9669,10 +9676,9 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
}
else
{
if (
string_is_equal(menu_label, "deferred_archive_open_detect_core") ||
string_is_equal(menu_label, "downloaded_file_detect_core_list") ||
string_is_equal(menu_label, "favorites")
if ( string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_ARCHIVE_ACTION_DETECT_CORE))
|| string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST))
|| string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES))
)
{
#ifdef HAVE_COMPRESSION
@ -9686,11 +9692,11 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs,
BIND_ACTION_OK(cbs, action_ok_file_load_with_detect_core);
}
}
else if (string_is_equal(menu_label, "disk_image_append"))
else if (string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_DISK_IMAGE_APPEND)))
{
BIND_ACTION_OK(cbs, action_ok_disk_image_append);
}
else if (string_is_equal(menu_label, "subsystem_add"))
else if (string_is_equal(menu_label, msg_hash_to_str(MENU_ENUM_LABEL_SUBSYSTEM_ADD)))
{
BIND_ACTION_OK(cbs, action_ok_subsystem_add);
}

View File

@ -317,7 +317,7 @@ static int filebrowser_parse(
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USE_THIS_DIRECTORY),
msg_hash_to_str(MENU_ENUM_LABEL_USE_THIS_DIRECTORY),
MSG_UNKNOWN,
FILE_TYPE_PLAIN, 0, FILE_TYPE_USE_DIRECTORY);
FILE_TYPE_USE_DIRECTORY, 0, FILE_TYPE_USE_DIRECTORY);
break;
}