2008-11-01 Carles Pina i Estany <carles@pina.cat>

* normal/menu.c (run_menu): Add Previous and Next Page keys in menu.
This commit is contained in:
robertmh 2008-11-01 12:42:27 +00:00
parent de4fa71c6c
commit 1432e95890
2 changed files with 55 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2008-11-01 Carles Pina i Estany <carles@pina.cat>
* normal/menu.c (run_menu): Add Previous and Next Page keys in menu.
2008-10-29 Guillem Jover <guillem.jover@nokia.com>
* disk/lvm.c (grub_lvm_scan_device): Fix error recovery by delaying the

View file

@ -458,6 +458,57 @@ run_menu (grub_menu_t menu, int nested)
}
break;
case GRUB_TERM_PPAGE:
if (first == 0)
{
offset = 0;
}
else
{
first -= GRUB_TERM_NUM_ENTRIES;
if (first < 0)
{
offset += first;
first = 0;
}
}
print_entries (menu, first, offset);
break;
case GRUB_TERM_NPAGE:
if (offset == 0)
{
offset += GRUB_TERM_NUM_ENTRIES - 1;
if (first + offset >= menu->size)
{
offset = menu->size - first - 1;
}
}
else
{
first += GRUB_TERM_NUM_ENTRIES;
if (first + offset >= menu->size)
{
first -= GRUB_TERM_NUM_ENTRIES;
offset += GRUB_TERM_NUM_ENTRIES;
if (offset > menu->size - 1 ||
offset > GRUB_TERM_NUM_ENTRIES - 1)
{
offset = menu->size - first - 1;
}
if (offset > GRUB_TERM_NUM_ENTRIES)
{
first += offset - GRUB_TERM_NUM_ENTRIES + 1;
offset = GRUB_TERM_NUM_ENTRIES - 1;
}
}
}
print_entries (menu, first, offset);
break;
case '\n':
case '\r':
case 6: