diff options
Diffstat (limited to 'apps')
-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) | |||
2390 | }; | 2390 | }; |
2391 | 2391 | ||
2392 | m=menu_init( items, sizeof items / sizeof(struct menu_item), NULL, | 2392 | m=menu_init( items, sizeof items / sizeof(struct menu_item), NULL, |
2393 | NULL, NULL, NULL); | 2393 | "Debug Menu", NULL, NULL); |
2394 | result = menu_run(m); | 2394 | result = menu_run(m); |
2395 | menu_exit(m); | 2395 | menu_exit(m); |
2396 | 2396 | ||
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 @@ | |||
10727 | *: "" | 10727 | *: "" |
10728 | </voice> | 10728 | </voice> |
10729 | </phrase> | 10729 | </phrase> |
10730 | <phrase> | ||
10731 | id: LANG_ONPLAY_MENU_TITLE | ||
10732 | desc: title for the onplay menus | ||
10733 | user: | ||
10734 | <source> | ||
10735 | *: "Context Menu" | ||
10736 | </source> | ||
10737 | <dest> | ||
10738 | *: "Context Menu" | ||
10739 | </dest> | ||
10740 | <voice> | ||
10741 | *: "Context Menu" | ||
10742 | </voice> | ||
10743 | </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 @@ | |||
61 | /* needed for the old menu system */ | 61 | /* needed for the old menu system */ |
62 | struct menu { | 62 | struct menu { |
63 | struct menu_item* items; | 63 | struct menu_item* items; |
64 | char *title; | ||
64 | int count; | 65 | int count; |
65 | int (*callback)(int, int); | 66 | int (*callback)(int, int); |
66 | int current_selection; | 67 | int current_selection; |
@@ -659,9 +660,6 @@ static int menu_find_free(void) | |||
659 | int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int), | 660 | int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, int), |
660 | const char *button1, const char *button2, const char *button3) | 661 | const char *button1, const char *button2, const char *button3) |
661 | { | 662 | { |
662 | (void)button1; | ||
663 | (void)button2; | ||
664 | (void)button3; | ||
665 | int menu=menu_find_free(); | 663 | int menu=menu_find_free(); |
666 | if(menu==-1)/* Out of menus */ | 664 | if(menu==-1)/* Out of menus */ |
667 | return -1; | 665 | return -1; |
@@ -669,6 +667,9 @@ int menu_init(const struct menu_item* mitems, int count, int (*callback)(int, in | |||
669 | menus[menu].count = count; | 667 | menus[menu].count = count; |
670 | menus[menu].callback = callback; | 668 | menus[menu].callback = callback; |
671 | menus[menu].current_selection = 0; | 669 | menus[menu].current_selection = 0; |
670 | if ((button2 == NULL) && (button3 == NULL)) | ||
671 | menus[menu].title = button1; | ||
672 | else menus[menu].title = NULL; | ||
672 | return menu; | 673 | return menu; |
673 | } | 674 | } |
674 | 675 | ||
@@ -702,6 +703,14 @@ static char* oldmenuwrapper_getname(int selected_item, | |||
702 | unsigned char* desc = menus[(intptr_t)data].items[selected_item].desc; | 703 | unsigned char* desc = menus[(intptr_t)data].items[selected_item].desc; |
703 | return P2STR(desc); | 704 | return P2STR(desc); |
704 | } | 705 | } |
706 | |||
707 | #ifdef HAVE_LCD_BITMAP | ||
708 | static void oldmenu_get_icon(int selected_item, void * data, ICON * icon) | ||
709 | { | ||
710 | *icon = bitmap_icons_6x8[Icon_Menu_functioncall]; | ||
711 | } | ||
712 | #endif | ||
713 | |||
705 | static void init_oldmenu(const struct menu_item_ex *menu, | 714 | static void init_oldmenu(const struct menu_item_ex *menu, |
706 | struct gui_synclist *lists, int selected, bool callback) | 715 | struct gui_synclist *lists, int selected, bool callback) |
707 | { | 716 | { |
@@ -711,6 +720,11 @@ static void init_oldmenu(const struct menu_item_ex *menu, | |||
711 | gui_synclist_set_nb_items(lists, MENU_GET_COUNT(menu->flags)); | 720 | gui_synclist_set_nb_items(lists, MENU_GET_COUNT(menu->flags)); |
712 | gui_synclist_limit_scroll(lists, true); | 721 | gui_synclist_limit_scroll(lists, true); |
713 | gui_synclist_select_item(lists, selected); | 722 | gui_synclist_select_item(lists, selected); |
723 | #ifdef HAVE_LCD_BITMAP | ||
724 | gui_synclist_set_title(lists, menus[menu->value].title, | ||
725 | bitmap_icons_6x8[Icon_Submenu_Entered]); | ||
726 | gui_synclist_set_icon_callback(lists, oldmenu_get_icon); | ||
727 | #endif | ||
714 | } | 728 | } |
715 | 729 | ||
716 | static void menu_talk_selected(int m) | 730 | static void menu_talk_selected(int m) |
@@ -729,7 +743,7 @@ int menu_show(int m) | |||
729 | { | 743 | { |
730 | oldmenuwrapper_callback, | 744 | oldmenuwrapper_callback, |
731 | oldmenuwrapper_getname, | 745 | oldmenuwrapper_getname, |
732 | (void*)(intptr_t)m, Icon_NOICON | 746 | (void*)(intptr_t)m, Icon_Submenu |
733 | }; | 747 | }; |
734 | 748 | ||
735 | menu.flags = (MENU_TYPE_MASK&MT_OLD_MENU) | MENU_DYNAMIC_DESC | | 749 | 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 { | |||
189 | bool (*function) (void); /* return true if USB was connected */ | 189 | bool (*function) (void); /* return true if USB was connected */ |
190 | }; | 190 | }; |
191 | 191 | ||
192 | /* if button2 == button3 == NULL, button1 is the menu title */ | ||
192 | int menu_init(const struct menu_item* mitems, int count, | 193 | int menu_init(const struct menu_item* mitems, int count, |
193 | int (*callback)(int, int), | 194 | int (*callback)(int, int), |
194 | const char *button1, const char *button2, const char *button3); | 195 | 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) | |||
107 | } | 107 | } |
108 | } | 108 | } |
109 | 109 | ||
110 | m=menu_init( items, i, NULL, NULL, NULL, NULL ); | 110 | m=menu_init( items, i, NULL, str(LANG_BOOKMARK_MENU), NULL, NULL ); |
111 | 111 | ||
112 | #ifdef HAVE_LCD_CHARCELLS | 112 | #ifdef HAVE_LCD_CHARCELLS |
113 | status_set_param(true); | 113 | status_set_param(true); |
@@ -256,7 +256,7 @@ static bool cat_playlist_options(void) | |||
256 | i++; | 256 | i++; |
257 | } | 257 | } |
258 | 258 | ||
259 | m = menu_init( items, i, NULL, NULL, NULL, NULL ); | 259 | m = menu_init( items, i, NULL, str(LANG_CATALOG), NULL, NULL ); |
260 | result = menu_show(m); | 260 | result = menu_show(m); |
261 | if(result >= 0) | 261 | if(result >= 0) |
262 | ret = items[result].function(); | 262 | ret = items[result].function(); |
@@ -373,7 +373,7 @@ static bool playlist_options(void) | |||
373 | } | 373 | } |
374 | } | 374 | } |
375 | 375 | ||
376 | m = menu_init( items, i, NULL, NULL, NULL, NULL ); | 376 | m = menu_init( items, i, NULL, str(LANG_PLAYLIST_MENU), NULL, NULL ); |
377 | result = menu_show(m); | 377 | result = menu_show(m); |
378 | if (result >= 0 && result < pstart) | 378 | if (result >= 0 && result < pstart) |
379 | ret = items[result].function(); | 379 | ret = items[result].function(); |
@@ -1048,7 +1048,8 @@ int onplay(char* file, int attr, int from) | |||
1048 | /* DIY menu handling, since we want to exit after selection */ | 1048 | /* DIY menu handling, since we want to exit after selection */ |
1049 | if (i) | 1049 | if (i) |
1050 | { | 1050 | { |
1051 | m = menu_init( items, i, onplay_callback, NULL, NULL, NULL ); | 1051 | m = menu_init( items, i, onplay_callback, |
1052 | str(LANG_ONPLAY_MENU_TITLE), NULL, NULL ); | ||
1052 | #ifdef HAVE_TAGCACHE | 1053 | #ifdef HAVE_TAGCACHE |
1053 | do | 1054 | do |
1054 | { | 1055 | { |
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) | |||
440 | items[i].desc = ID2P(LANG_CATALOG_ADD_TO_NEW); | 440 | items[i].desc = ID2P(LANG_CATALOG_ADD_TO_NEW); |
441 | i++; | 441 | i++; |
442 | 442 | ||
443 | m = menu_init(items, i, NULL, NULL, NULL, NULL); | 443 | m = menu_init(items, i, NULL, str(LANG_PLAYLIST_MENU), NULL, NULL); |
444 | result = menu_show(m); | 444 | result = menu_show(m); |
445 | if (result == MENU_ATTACHED_USB) | 445 | if (result == MENU_ATTACHED_USB) |
446 | { | 446 | { |