summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/menu.c13
-rw-r--r--apps/menu.h1
2 files changed, 9 insertions, 5 deletions
diff --git a/apps/menu.c b/apps/menu.c
index 4686289375..412aca7f9b 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -176,7 +176,7 @@ static void menu_get_icon(int selected_item, void * data, ICON * icon)
176static void init_menu_lists(const struct menu_item_ex *menu, 176static void init_menu_lists(const struct menu_item_ex *menu,
177 struct gui_synclist *lists, int selected, bool callback) 177 struct gui_synclist *lists, int selected, bool callback)
178{ 178{
179 int i, count = (menu->flags&MENU_COUNT_MASK)>>MENU_COUNT_SHIFT; 179 int i, count = MENU_GET_COUNT(menu->flags);
180 menu_callback_type menu_callback = NULL; 180 menu_callback_type menu_callback = NULL;
181 ICON icon = NOICON; 181 ICON icon = NOICON;
182 current_subitems_count = 0; 182 current_subitems_count = 0;
@@ -557,7 +557,10 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
557 if (temp->flags&MENU_FUNC_CHECK_RETVAL) 557 if (temp->flags&MENU_FUNC_CHECK_RETVAL)
558 { 558 {
559 if (return_value == temp->function->exit_value) 559 if (return_value == temp->function->exit_value)
560 return return_value; 560 {
561 done = true;
562 ret = return_value;
563 }
561 } 564 }
562 break; 565 break;
563 } 566 }
@@ -572,7 +575,8 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
572 if (in_stringlist) 575 if (in_stringlist)
573 { 576 {
574 action_signalscreenchange(); 577 action_signalscreenchange();
575 return selected; 578 done = true;
579 ret = selected;
576 } 580 }
577 else if (stack_top < MAX_MENUS) 581 else if (stack_top < MAX_MENUS)
578 { 582 {
@@ -689,8 +693,7 @@ static void init_oldmenu(const struct menu_item_ex *menu,
689 (void)callback; 693 (void)callback;
690 gui_synclist_init(lists, oldmenuwrapper_getname, 694 gui_synclist_init(lists, oldmenuwrapper_getname,
691 (void*)(intptr_t)menu->value, false, 1); 695 (void*)(intptr_t)menu->value, false, 1);
692 gui_synclist_set_nb_items(lists, 696 gui_synclist_set_nb_items(lists, MENU_GET_COUNT(menu->flags));
693 (menu->flags&MENU_COUNT_MASK)>>MENU_COUNT_SHIFT);
694 gui_synclist_limit_scroll(lists, true); 697 gui_synclist_limit_scroll(lists, true);
695 gui_synclist_select_item(lists, selected); 698 gui_synclist_select_item(lists, selected);
696} 699}
diff --git a/apps/menu.h b/apps/menu.h
index 6d7d113c8c..ded25500bf 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -61,6 +61,7 @@ struct menu_func {
61#define MENU_COUNT_MASK 0xFFF 61#define MENU_COUNT_MASK 0xFFF
62#define MENU_COUNT_SHIFT 8 62#define MENU_COUNT_SHIFT 8
63#define MENU_ITEM_COUNT(c) ((c&MENU_COUNT_MASK)<<MENU_COUNT_SHIFT) 63#define MENU_ITEM_COUNT(c) ((c&MENU_COUNT_MASK)<<MENU_COUNT_SHIFT)
64#define MENU_GET_COUNT(flags) ((flags>>MENU_COUNT_SHIFT)&MENU_COUNT_MASK)
64 65
65struct menu_item_ex { 66struct menu_item_ex {
66 unsigned int flags; /* above defines */ 67 unsigned int flags; /* above defines */