diff options
-rw-r--r-- | apps/debug_menu.c | 2 | ||||
-rw-r--r-- | apps/lang/english.lang | 14 | ||||
-rw-r--r-- | apps/menu.c | 22 | ||||
-rw-r--r-- | apps/menu.h | 1 | ||||
-rw-r--r-- | apps/onplay.c | 9 | ||||
-rw-r--r-- | apps/playlist_viewer.c | 2 |
6 files changed, 40 insertions, 10 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index be77699d7e..48e67b575b 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -2390,7 +2390,7 @@ bool debug_menu(void) }; m=menu_init( items, sizeof items / sizeof(struct menu_item), NULL, - NULL, NULL, NULL); + "Debug Menu", NULL, NULL); result = menu_run(m); menu_exit(m); diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 336beec32e..69900c5e6a 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -10727,3 +10727,17 @@ *: "" </voice> </phrase> +<phrase> + id: LANG_ONPLAY_MENU_TITLE + desc: title for the onplay menus + user: + <source> + *: "Context Menu" + </source> + <dest> + *: "Context Menu" + </dest> + <voice> + *: "Context Menu" + </voice> +</phrase> diff --git a/apps/menu.c b/apps/menu.c index b1ba9ea0e0..34a6d0e8b9 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -61,6 +61,7 @@ /* needed for the old menu system */ struct menu { struct menu_item* items; + char *title; int count; int (*callback)(int, int); int current_selection; @@ -659,9 +660,6 @@ static int menu_find_free(void) int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int), const char *button1, const char *button2, const char *button3) { - (void)button1; - (void)button2; - (void)button3; int menu=menu_find_free(); if(menu==-1)/* Out of menus */ return -1; @@ -669,6 +667,9 @@ int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, in menus[menu].count = count; menus[menu].callback = callback; menus[menu].current_selection = 0; + if ((button2 == NULL) && (button3 == NULL)) + menus[menu].title = button1; + else menus[menu].title = NULL; return menu; } @@ -702,6 +703,14 @@ static char* oldmenuwrapper_getname(int selected_item, unsigned char* desc = menus[(intptr_t)data].items[selected_item].desc; return P2STR(desc); } + +#ifdef HAVE_LCD_BITMAP +static void oldmenu_get_icon(int selected_item, void * data, ICON * icon) +{ + *icon = bitmap_icons_6x8[Icon_Menu_functioncall]; +} +#endif + static void init_oldmenu(const struct menu_item_ex *menu, struct gui_synclist *lists, int selected, bool callback) { @@ -711,6 +720,11 @@ static void init_oldmenu(const struct menu_item_ex *menu, gui_synclist_set_nb_items(lists, MENU_GET_COUNT(menu->flags)); gui_synclist_limit_scroll(lists, true); gui_synclist_select_item(lists, selected); +#ifdef HAVE_LCD_BITMAP + gui_synclist_set_title(lists, menus[menu->value].title, + bitmap_icons_6x8[Icon_Submenu_Entered]); + gui_synclist_set_icon_callback(lists, oldmenu_get_icon); +#endif } static void menu_talk_selected(int m) @@ -729,7 +743,7 @@ int menu_show(int m) { oldmenuwrapper_callback, oldmenuwrapper_getname, - (void*)(intptr_t)m, Icon_NOICON + (void*)(intptr_t)m, Icon_Submenu }; menu.flags = (MENU_TYPE_MASK&MT_OLD_MENU) | MENU_DYNAMIC_DESC | diff --git a/apps/menu.h b/apps/menu.h index 365af536e9..a86155374e 100644 --- a/apps/menu.h +++ b/apps/menu.h @@ -189,6 +189,7 @@ struct menu_item { bool (*function) (void); /* return true if USB was connected */ }; +/* if button2 == button3 == NULL, button1 is the menu title */ int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int), const char *button1, const char *button2, const char *button3); diff --git a/apps/onplay.c b/apps/onplay.c index fb3ed24cfb..573511d44d 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -107,7 +107,7 @@ static bool bookmark_menu(void) } } - m=menu_init( items, i, NULL, NULL, NULL, NULL ); + m=menu_init( items, i, NULL, str(LANG_BOOKMARK_MENU), NULL, NULL ); #ifdef HAVE_LCD_CHARCELLS status_set_param(true); @@ -256,7 +256,7 @@ static bool cat_playlist_options(void) i++; } - m = menu_init( items, i, NULL, NULL, NULL, NULL ); + m = menu_init( items, i, NULL, str(LANG_CATALOG), NULL, NULL ); result = menu_show(m); if(result >= 0) ret = items[result].function(); @@ -373,7 +373,7 @@ static bool playlist_options(void) } } - m = menu_init( items, i, NULL, NULL, NULL, NULL ); + m = menu_init( items, i, NULL, str(LANG_PLAYLIST_MENU), NULL, NULL ); result = menu_show(m); if (result >= 0 && result < pstart) ret = items[result].function(); @@ -1048,7 +1048,8 @@ int onplay(char* file, int attr, int from) /* DIY menu handling, since we want to exit after selection */ if (i) { - m = menu_init( items, i, onplay_callback, NULL, NULL, NULL ); + m = menu_init( items, i, onplay_callback, + str(LANG_ONPLAY_MENU_TITLE), NULL, NULL ); #ifdef HAVE_TAGCACHE do { diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index aae2101754..d065ad32ce 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -440,7 +440,7 @@ static int onplay_menu(int index) items[i].desc = ID2P(LANG_CATALOG_ADD_TO_NEW); i++; - m = menu_init(items, i, NULL, NULL, NULL, NULL); + m = menu_init(items, i, NULL, str(LANG_PLAYLIST_MENU), NULL, NULL); result = menu_show(m); if (result == MENU_ATTACHED_USB) { |