[1890] 2008-11-01 Carles Pina i Estany <[email protected]>

Robert Millan <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1890
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1890
Author:   robertmh
Date:     2008-11-01 12:42:27 +0000 (Sat, 01 Nov 2008)

Log Message:
-----------
2008-11-01  Carles Pina i Estany  <[email protected]>

        * normal/menu.c (run_menu): Add Previous and Next Page keys in menu.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/normal/menu.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2008-10-29 19:24:11 UTC (rev 1889)
+++ trunk/grub2/ChangeLog	2008-11-01 12:42:27 UTC (rev 1890)
@@ -1,3 +1,7 @@
+2008-11-01  Carles Pina i Estany  <[email protected]>
+
+	* normal/menu.c (run_menu): Add Previous and Next Page keys in menu.
+
 2008-10-29  Guillem Jover <[email protected]>
 
 	* disk/lvm.c (grub_lvm_scan_device): Fix error recovery by delaying the

Modified: trunk/grub2/normal/menu.c
===================================================================
--- trunk/grub2/normal/menu.c	2008-10-29 19:24:11 UTC (rev 1889)
+++ trunk/grub2/normal/menu.c	2008-11-01 12:42:27 UTC (rev 1890)
@@ -457,6 +457,57 @@
 		    }
 		}
 	      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':
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.