summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-09-05 12:59:29 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-09-05 12:59:29 +0200
commitd79712f82ebafe62c68d28ef244089b614bc1306 (patch)
tree544dc5c4453595a5ec0d42d9abba7537975d48e5 /common
parent2c8c801c674eb8ad05f54a49b427318fc5ae9d90 (diff)
parent0e21e17614135b641228ae482a46c2b944f6b8de (diff)
downloadbarebox-d79712f82ebafe62c68d28ef244089b614bc1306.tar.gz
barebox-d79712f82ebafe62c68d28ef244089b614bc1306.tar.xz
Merge branch 'for-next/menu'
Diffstat (limited to 'common')
-rw-r--r--common/menu.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/menu.c b/common/menu.c
index 9f536d6aee..97c6b184bd 100644
--- a/common/menu.c
+++ b/common/menu.c
@@ -314,6 +314,23 @@ int menu_show(struct menu *m)
m->auto_select = -1;
switch (ch) {
+ case '0' ... '9': {
+ struct menu_entry *me;
+ int num = ch - '0';
+ int next_num = m->selected->num + 10;
+ if (!num)
+ num = 10;
+
+ if (ch_previous == ch && next_num <= m->nb_entries)
+ num = next_num;
+
+ me = menu_entry_get_by_num(m, num);
+ if (me) {
+ m->selected = me;
+ repaint = 1;
+ }
+ break;
+ }
case KEY_UP:
m->selected = list_entry(m->selected->list.prev, struct menu_entry,
list);