diff options
| author | Heiko Schocher <hs@denx.de> | 2012-01-16 21:13:20 +0000 | 
|---|---|---|
| committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2012-02-12 10:11:24 +0100 | 
| commit | e0611dd97bb38ba341b3479974eb2a3271de380e (patch) | |
| tree | 3c2de4b1d9ea4b61d753284b6a2121651fa89352 | |
| parent | 9c3483113de1204118a1b252bf4c81b899dd12b4 (diff) | |
| download | olio-uboot-2014.01-e0611dd97bb38ba341b3479974eb2a3271de380e.tar.xz olio-uboot-2014.01-e0611dd97bb38ba341b3479974eb2a3271de380e.zip | |
common, menu: add statusline support
add the possibility to show a statusline when printing a menu
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
| -rw-r--r-- | common/menu.c | 8 | ||||
| -rw-r--r-- | doc/README.menu | 5 | ||||
| -rw-r--r-- | include/menu.h | 1 | 
3 files changed, 14 insertions, 0 deletions
| diff --git a/common/menu.c b/common/menu.c index 3b1e0d082..754a9f9d0 100644 --- a/common/menu.c +++ b/common/menu.c @@ -113,6 +113,13 @@ static inline void *menu_item_destroy(struct menu *m,  	return NULL;  } +void __menu_display_statusline(struct menu *m) +{ +	return; +} +void menu_display_statusline(struct menu *m) +	__attribute__ ((weak, alias("__menu_display_statusline"))); +  /*   * Display a menu so the user can make a choice of an item. First display its   * title, if any, and then each item in the menu. @@ -123,6 +130,7 @@ static inline void menu_display(struct menu *m)  		puts(m->title);  		putc('\n');  	} +	menu_display_statusline(m);  	menu_items_iter(m, menu_item_print, NULL);  } diff --git a/doc/README.menu b/doc/README.menu index 0dad6a2cb..4ddf91491 100644 --- a/doc/README.menu +++ b/doc/README.menu @@ -69,6 +69,11 @@ int menu_get_choice(struct menu *m, void **choice);   */  int menu_destroy(struct menu *m); +/* + * menu_display_statusline(struct menu *m); + * shows a statusline for every menu_display call. + */ +void menu_display_statusline(struct menu *m);  Example Code  ------------ diff --git a/include/menu.h b/include/menu.h index cf14a9cca..b806a02b5 100644 --- a/include/menu.h +++ b/include/menu.h @@ -26,5 +26,6 @@ int menu_default_set(struct menu *m, char *item_key);  int menu_get_choice(struct menu *m, void **choice);  int menu_item_add(struct menu *m, char *item_key, void *item_data);  int menu_destroy(struct menu *m); +void menu_display_statusline(struct menu *m);  #endif /* __MENU_H__ */ |