summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-07-26 23:48:25 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2020-07-27 03:55:58 +0000
commita898f361825c8319819a3cb08272e9e79d5aeb8f (patch)
tree5274e14c14c18cd09d4fee7dbabe11b342591f81
parent796eba4c8195f64c7e3f6943d34e0876cbbfd2ff (diff)
downloadrockbox-a898f36.tar.gz
rockbox-a898f36.zip
Do_menu allow VOICE_ONLY strings
Enable Voice_Blank and other Voice only LANG_IDs to be used in menus Change-Id: I3432ed00963617e9f92cd52228bf00e0a776523a
-rw-r--r--apps/menu.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/menu.c b/apps/menu.c
index 1e0cb3668f..fefc8fca2b 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -97,6 +97,7 @@ static const char* get_menu_item_name(int selected_item,
char *buffer,
size_t buffer_len)
{
+ const char *name;
const struct menu_item_ex *menu = (const struct menu_item_ex *)data;
int type = (menu->flags&MENU_TYPE_MASK);
selected_item = get_menu_selection(selected_item, menu);
@@ -105,9 +106,17 @@ static const char* get_menu_item_name(int selected_item,
if (type == MT_RETURN_ID)
{
if (menu->flags&MENU_DYNAMIC_DESC)
- return menu->menu_get_name_and_icon->list_get_name(selected_item,
+ {
+ name = menu->menu_get_name_and_icon->list_get_name(selected_item,
menu->menu_get_name_and_icon->list_get_name_data, buffer, buffer_len);
- return menu->strings[selected_item];
+ }
+ else
+ name = menu->strings[selected_item];
+
+ if (P2ID((unsigned char *)name) > VOICEONLY_DELIMITER)
+ name = "";
+
+ return name;
}
if (type == MT_MENU)
menu = menu->submenus[selected_item];