diff --git a/config.def.h b/config.def.h index 9129be07b3..29c44fbc75 100644 --- a/config.def.h +++ b/config.def.h @@ -332,6 +332,7 @@ #ifdef HAVE_OZONE #define DEFAULT_OZONE_COLLAPSE_SIDEBAR false +#define DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME true #endif static bool quick_menu_show_take_screenshot = true; diff --git a/configuration.c b/configuration.c index 5e953bf650..7d6a983e36 100644 --- a/configuration.c +++ b/configuration.c @@ -1625,6 +1625,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, #ifdef HAVE_OZONE SETTING_BOOL("ozone_collapse_sidebar", &settings->bools.ozone_collapse_sidebar, true, DEFAULT_OZONE_COLLAPSE_SIDEBAR, false); + SETTING_BOOL("ozone_truncate_playlist_name", &settings->bools.ozone_truncate_playlist_name, true, DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME, false); #endif SETTING_BOOL("log_to_file", &settings->bools.log_to_file, true, DEFAULT_LOG_TO_FILE, false); SETTING_OVERRIDE(RARCH_OVERRIDE_SETTING_LOG_TO_FILE); diff --git a/configuration.h b/configuration.h index 3ce9b2e576..4b67bcc1dc 100644 --- a/configuration.h +++ b/configuration.h @@ -338,6 +338,7 @@ typedef struct settings bool vibrate_on_keypress; bool enable_device_vibration; bool ozone_collapse_sidebar; + bool ozone_truncate_playlist_name; bool log_to_file; bool log_to_file_timestamp; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index b1a9ab7cbd..0fa15a8a3e 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -699,6 +699,8 @@ MSG_HASH(MENU_ENUM_LABEL_OZONE_MENU_COLOR_THEME, "ozone_menu_color_theme") MSG_HASH(MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR, "ozone_collapse_sidebar") +MSG_HASH(MENU_ENUM_LABEL_OZONE_TRUNCATE_PLAYLIST_NAME, + "ozone_truncate_playlist_name") MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME, "materialui_menu_color_theme") MSG_HASH(MENU_ENUM_LABEL_MATERIALUI_MENU_FOOTER_OPACITY, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index d48d061259..5423a7c9d0 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -8755,6 +8755,14 @@ MSG_HASH( MENU_ENUM_SUBLABEL_OZONE_COLLAPSE_SIDEBAR, "Have the left sidebar always collapsed." ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_OZONE_TRUNCATE_PLAYLIST_NAME, + "Truncate Playlist names" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_OZONE_TRUNCATE_PLAYLIST_NAME, + "When enabled, will remove the system names from the playlists. For example, display 'PlayStation' instead of 'Sony - PlayStation'. Changes require a restart to take effect." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME, "Use preferred system color theme" diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 4a9a4e82b3..c319675bb5 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -459,6 +459,7 @@ default_sublabel_macro(action_bind_sublabel_menu_xmb_thumbnail_scale_factor, default_sublabel_macro(action_bind_sublabel_menu_color_theme, MENU_ENUM_SUBLABEL_MATERIALUI_MENU_COLOR_THEME) default_sublabel_macro(action_bind_sublabel_ozone_menu_color_theme, MENU_ENUM_SUBLABEL_OZONE_MENU_COLOR_THEME) default_sublabel_macro(action_bind_sublabel_ozone_collapse_sidebar, MENU_ENUM_SUBLABEL_OZONE_COLLAPSE_SIDEBAR) +default_sublabel_macro(action_bind_sublabel_ozone_truncate_playlist_name, MENU_ENUM_SUBLABEL_OZONE_TRUNCATE_PLAYLIST_NAME) default_sublabel_macro(action_bind_sublabel_menu_use_preferred_system_color_theme, MENU_ENUM_SUBLABEL_MENU_USE_PREFERRED_SYSTEM_COLOR_THEME) default_sublabel_macro(action_bind_sublabel_menu_wallpaper_opacity, MENU_ENUM_SUBLABEL_MENU_WALLPAPER_OPACITY) default_sublabel_macro(action_bind_sublabel_menu_framebuffer_opacity, MENU_ENUM_SUBLABEL_MENU_FRAMEBUFFER_OPACITY) @@ -1526,6 +1527,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_collapse_sidebar); break; + case MENU_ENUM_LABEL_OZONE_TRUNCATE_PLAYLIST_NAME: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_ozone_truncate_playlist_name); + break; case MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME: case MENU_ENUM_LABEL_XMB_MENU_COLOR_THEME: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_color_theme); diff --git a/menu/drivers/ozone/ozone_sidebar.c b/menu/drivers/ozone/ozone_sidebar.c index 79d6ba59fa..7711205ee5 100644 --- a/menu/drivers/ozone/ozone_sidebar.c +++ b/menu/drivers/ozone/ozone_sidebar.c @@ -573,6 +573,7 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone) char title_noext[255]; char *chr; bool hyphen_found; + settings_t *settings = config_get_ptr(); size_t list_size = ozone_list_get_size(ozone, MENU_LIST_HORIZONTAL); @@ -687,7 +688,7 @@ void ozone_context_reset_horizontal_list(ozone_handle_t *ozone) chr = title_noext; hyphen_found = false; - while (true) + while (settings->bools.ozone_truncate_playlist_name) { /* Check for "- " */ if (*chr == '-' && *(chr + 1) == ' ') diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 67a4779090..3f473c8dd4 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5059,6 +5059,7 @@ unsigned menu_displaylist_build_list(file_list_t *list, enum menu_displaylist_ct {MENU_ENUM_LABEL_XMB_MENU_COLOR_THEME, PARSE_ONLY_UINT}, {MENU_ENUM_LABEL_OZONE_MENU_COLOR_THEME, PARSE_ONLY_UINT}, {MENU_ENUM_LABEL_OZONE_COLLAPSE_SIDEBAR, PARSE_ONLY_BOOL}, + {MENU_ENUM_LABEL_OZONE_TRUNCATE_PLAYLIST_NAME, PARSE_ONLY_BOOL}, {MENU_ENUM_LABEL_MATERIALUI_ICONS_ENABLE, PARSE_ONLY_BOOL}, {MENU_ENUM_LABEL_MATERIALUI_MENU_COLOR_THEME, PARSE_ONLY_UINT}, {MENU_ENUM_LABEL_MATERIALUI_MENU_HEADER_OPACITY, PARSE_ONLY_FLOAT}, @@ -6693,6 +6694,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, {MENU_ENUM_LABEL_PLAYLIST_SUBLABEL_RUNTIME_TYPE, PARSE_ONLY_UINT}, {MENU_ENUM_LABEL_PLAYLIST_FUZZY_ARCHIVE_MATCH, PARSE_ONLY_BOOL}, {MENU_ENUM_LABEL_SCAN_WITHOUT_CORE_MATCH, PARSE_ONLY_BOOL}, + {MENU_ENUM_LABEL_OZONE_TRUNCATE_PLAYLIST_NAME, PARSE_ONLY_BOOL}, }; for (i = 0; i < ARRAY_SIZE(build_list); i++) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 1b418e0109..94a7736778 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -13472,6 +13472,26 @@ static bool setting_append_list( SD_FLAG_NONE ); +#ifdef HAVE_OZONE + if (string_is_equal(settings->arrays.menu_driver, "ozone")) + { + CONFIG_BOOL( + list, list_info, + &settings->bools.ozone_truncate_playlist_name, + MENU_ENUM_LABEL_OZONE_TRUNCATE_PLAYLIST_NAME, + MENU_ENUM_LABEL_VALUE_OZONE_TRUNCATE_PLAYLIST_NAME, + DEFAULT_OZONE_TRUNCATE_PLAYLIST_NAME, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + } +#endif + END_SUB_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group); diff --git a/msg_hash.h b/msg_hash.h index cd6354c3f7..b8b1135c53 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -957,6 +957,7 @@ enum msg_hash_enums MENU_LABEL(XMB_MENU_COLOR_THEME), MENU_LABEL(OZONE_MENU_COLOR_THEME), MENU_LABEL(OZONE_COLLAPSE_SIDEBAR), + MENU_LABEL(OZONE_TRUNCATE_PLAYLIST_NAME), MENU_LABEL(MATERIALUI_MENU_COLOR_THEME), MENU_LABEL(QUICK_MENU_OVERRIDE_OPTIONS), MENU_LABEL(QUICK_MENU_SHOW_TAKE_SCREENSHOT),