]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-11-01 Carles Pina i Estany <carles@pina.cat>
authorrobertmh <robertmh@localhost>
Sat, 1 Nov 2008 12:42:27 +0000 (12:42 +0000)
committerrobertmh <robertmh@localhost>
Sat, 1 Nov 2008 12:42:27 +0000 (12:42 +0000)
        * normal/menu.c (run_menu): Add Previous and Next Page keys in menu.

ChangeLog
normal/menu.c

index 430a37b78e43544d58d7c6e270a760d6b44d0e3a..efc26e947c167d329aa803ec177fb4d0b068fea6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index d6fc0a33e56df61263ee8b20b581cf7857b7cb87..103aa6f15741f518d87596dc9c4d952b5a7ea906 100644 (file)
@@ -457,6 +457,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':