mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 16:20:27 +00:00
You can now rename playlist entries
This commit is contained in:
parent
fd0c9fb9c1
commit
147374c9c1
@ -2033,6 +2033,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Cheat Filename")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Preset Filename")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"接口")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -2033,6 +2033,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"金手指檔案")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"目前檔案")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"接口")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -2033,6 +2033,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Cheat-Dateiname")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Vorlagen-Dateiname")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Netzwerk-Karte")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -1922,6 +1922,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Cheat Filename")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Preset Filename")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Interface")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -2053,6 +2053,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Nom du fichier de triche")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Nom du fichier de pré-réglage")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Interface")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -1910,6 +1910,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Cheat Filename")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Preset Filename")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Interfaccia")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -2079,6 +2079,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Cheat Filename")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Preset Filename")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"インタフェース")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -2033,6 +2033,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"치트 파일명")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"프리셋 파일명")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"인터페이스")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -1920,6 +1920,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Cheat Filename")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Preset Filename")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Interface")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -2725,6 +2725,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Nome de Arquivo de Predefinição"
|
||||
)
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Interface"
|
||||
)
|
||||
|
@ -2023,6 +2023,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Nome do Arquivo de Trapaça")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Nome de Arquivo Pré-Definido")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Interface")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -2068,6 +2068,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Имя чита")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Имя настроек")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Интерфейс")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -2089,6 +2089,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Cheat Filename")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Preset Filename")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Interface")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -2051,6 +2051,8 @@ MSG_HASH(MSG_INPUT_CHEAT_FILENAME,
|
||||
"Cheat Filename")
|
||||
MSG_HASH(MSG_INPUT_PRESET_FILENAME,
|
||||
"Preset Filename")
|
||||
MSG_HASH(MSG_INPUT_RENAME_ENTRY,
|
||||
"Rename Title")
|
||||
MSG_HASH(MSG_INTERFACE,
|
||||
"Interface")
|
||||
MSG_HASH(MSG_INTERNAL_STORAGE,
|
||||
|
@ -1823,6 +1823,37 @@ static int action_ok_cheat(const char *path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void menu_input_st_string_cb_rename_entry(void *userdata,
|
||||
const char *str)
|
||||
{
|
||||
if (str && *str)
|
||||
{
|
||||
const char *label = menu_input_dialog_get_buffer();
|
||||
|
||||
if (!string_is_empty(label))
|
||||
{
|
||||
playlist_t *tmp_playlist = NULL;
|
||||
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
||||
size_t new_selection_ptr = menu_input_dialog_get_kb_idx();
|
||||
|
||||
if (tmp_playlist)
|
||||
{
|
||||
playlist_update(tmp_playlist,
|
||||
new_selection_ptr,
|
||||
NULL,
|
||||
label,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
playlist_write_file(tmp_playlist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
menu_input_dialog_end();
|
||||
}
|
||||
|
||||
static void menu_input_st_string_cb_save_preset(void *userdata,
|
||||
const char *str)
|
||||
{
|
||||
@ -3019,6 +3050,22 @@ default_action_ok_cmd_func(action_ok_disk_cycle_tray_status, CMD_EVENT_DISK_EJEC
|
||||
default_action_ok_cmd_func(action_ok_shader_apply_changes, CMD_EVENT_SHADERS_APPLY_CHANGES )
|
||||
default_action_ok_cmd_func(action_ok_add_to_favorites, CMD_EVENT_ADD_TO_FAVORITES)
|
||||
|
||||
static int action_ok_rename_entry(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
menu_input_ctx_line_t line;
|
||||
|
||||
line.label = msg_hash_to_str(MSG_INPUT_RENAME_ENTRY);
|
||||
line.label_setting = label;
|
||||
line.type = type;
|
||||
line.idx = (unsigned)entry_idx;
|
||||
line.cb = menu_input_st_string_cb_rename_entry;
|
||||
|
||||
if (!menu_input_dialog_start(&line))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_ok_delete_entry(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
@ -4141,7 +4188,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
|
||||
BIND_ACTION_OK(cbs, action_ok_screenshot);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_PLAYLIST_ENTRY_RENAME:
|
||||
BIND_ACTION_OK(cbs, action_ok_delete_entry);
|
||||
BIND_ACTION_OK(cbs, action_ok_rename_entry);
|
||||
break;
|
||||
case MENU_ENUM_LABEL_DELETE_ENTRY:
|
||||
BIND_ACTION_OK(cbs, action_ok_delete_entry);
|
||||
|
@ -3003,12 +3003,10 @@ static int menu_displaylist_parse_horizontal_content_actions(
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_RUN),
|
||||
MENU_ENUM_LABEL_RUN, FILE_TYPE_PLAYLIST_ENTRY, 0, idx);
|
||||
|
||||
#if 0
|
||||
menu_entries_append_enum(info->list,
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_RENAME),
|
||||
msg_hash_to_str(MENU_ENUM_LABEL_PLAYLIST_ENTRY_RENAME),
|
||||
MENU_ENUM_LABEL_PLAYLIST_ENTRY_RENAME, FILE_TYPE_PLAYLIST_ENTRY, 0, idx);
|
||||
#endif
|
||||
|
||||
if (settings->bools.playlist_entry_remove)
|
||||
menu_entries_append_enum(info->list,
|
||||
|
@ -286,6 +286,7 @@ enum msg_hash_enums
|
||||
MSG_INPUT_CHEAT,
|
||||
MSG_INPUT_PRESET_FILENAME,
|
||||
MSG_INPUT_CHEAT_FILENAME,
|
||||
MSG_INPUT_RENAME_ENTRY,
|
||||
MSG_REMAP_FILE_SAVED_SUCCESSFULLY,
|
||||
MSG_REMAP_FILE_REMOVED_SUCCESSFULLY,
|
||||
MSG_SHADER_PRESET_SAVED_SUCCESSFULLY,
|
||||
|
@ -291,12 +291,8 @@ bool playlist_push(playlist_t *playlist,
|
||||
static char base_path[255] = {0};
|
||||
fill_pathname_base_noext(base_path, core_path, sizeof(base_path));
|
||||
core_name = base_path;
|
||||
RARCH_LOG("core_name is now: %s\n", core_name);
|
||||
}
|
||||
|
||||
RARCH_LOG("core_name: %s.\n", string_is_empty(core_name) ? "N/A" : core_name);
|
||||
RARCH_LOG("core_path: %s.\n", string_is_empty(core_path) ? "N/A" : core_path);
|
||||
|
||||
if (string_is_empty(core_path) || string_is_empty(core_name))
|
||||
{
|
||||
RARCH_ERR("cannot push NULL or empty core name into the playlist.\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user