fix a bug in the option --speed for the command serial, fix the cursor position after displaying the menu, add the keys v and ^ to move the corsor in the menu.

This commit is contained in:
okuji 2000-09-01 22:47:21 +00:00
parent fa8456816f
commit 6728379880
6 changed files with 65 additions and 15 deletions

View file

@ -1,3 +1,30 @@
2000-09-02 OKUJI Yoshinori <okuji@gnu.org>
* stage2/stage2.c (run_menu): Don't use either `p' or `n' to
move the cursor, because `p' is already used for another
purpose (password).
(run_menu) [SUPPORT_SERIAL]: Don't set the variables DISP_UP and
DISP_DOWN at the start time. Instead, set them just before using
them actually, because TERMINAL may change when running a menu.
2000-09-01 Klaus Reichl <Klaus.Reichl@alcatel.at>
* stage2/stage2.c (run_menu): Setup and use disp_up, disp_down
depending on the terminal mode.
(run_menu): Allow '^' (resp. 'p') and 'v' (resp 'n') keys we
described in our help above (resp. authors preferences).
2000-08-31 Klaus Reichl <Klaus.Reichl@alcatel.at>
* stage2/stage2.c (set_line): Go back one char, which is
consistent with the original situation, when a timeout was
running.
(run_menu): If GRUB_TIMEOUT is stopped don't loop busy over
CHECKKEY, just relax in GETKEY.
* stage2/builtins.c (serial_func): --speed handling: corrected
typo: set SPEED instead of PORT.
2000-08-31 OKUJI Yoshinori <okuji@gnu.org>
* stage2/builtins.c (terminal_func): Added two new options,

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020.
.TH GRUB-INSTALL "8" "August 2000" "grub-install (GNU GRUB 0.5.96)" FSF
.TH GRUB-INSTALL "8" "September 2000" "grub-install (GNU GRUB 0.5.96)" FSF
.SH NAME
grub-install \- install GRUB on your drive
.SH SYNOPSIS

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020.
.TH GRUB "8" "August 2000" "grub (GNU GRUB 0.5.96)" FSF
.TH GRUB "8" "September 2000" "grub (GNU GRUB 0.5.96)" FSF
.SH NAME
grub \- the grub shell
.SH SYNOPSIS

View file

@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.020.
.TH MBCHK "1" "August 2000" "mbchk (GNU GRUB 0.5.96)" FSF
.TH MBCHK "1" "September 2000" "mbchk (GNU GRUB 0.5.96)" FSF
.SH NAME
mbchk \- check the format of a Multiboot kernel
.SH SYNOPSIS

View file

@ -2695,7 +2695,7 @@ serial_func (char *arg, int flags)
if (! safe_parse_maxint (&p, &num))
return 1;
port = (unsigned short) num;
speed = (unsigned short) num;
}
else if (grub_memcmp (arg, "--word=", sizeof ("--word=") - 1) == 0)
{

View file

@ -195,6 +195,8 @@ set_line (int y, int entryno, int attr, char *menu_entries)
set_attrib (attr);
}
}
gotoxy (74, y);
}
/* Set the attribute of the line Y to normal state. */
@ -235,7 +237,9 @@ run_menu (char *menu_entries, char *config_entries, int num_entries,
{
int c, time1, time2 = -1, first_entry = 0;
char *cur_entry = 0;
int disp_up = DISP_UP;
int disp_down = DISP_DOWN;
/*
* Main loop for menu UI.
*/
@ -243,8 +247,8 @@ run_menu (char *menu_entries, char *config_entries, int num_entries,
restart:
while (entryno > 11)
{
first_entry ++;
entryno --;
first_entry++;
entryno--;
}
/* If SHOW_MENU is false, don't display the menu until ESC is pressed. */
@ -300,12 +304,24 @@ restart:
#ifdef GRUB_UTIL
grub_printf ("\n\
Use the up and down arrows to select which entry is highlighted.\n");
#else
#else /* ! GRUB_UTIL */
# ifdef SUPPORT_SERIAL
if (terminal & TERMINAL_CONSOLE)
{
disp_up = DISP_UP;
disp_down = DISP_DOWN;
}
else
{
disp_up = ACS_UARROW;
disp_down = ACS_DARROW;
}
# endif /* SUPPORT_SERIAL */
grub_printf ("\n\
Use the %c and %c keys to select which entry is highlighted.\n",
DISP_UP, DISP_DOWN);
#endif
disp_up, disp_down);
#endif /* ! GRUB_UTIL */
if (! auth && password)
{
printf ("\
@ -337,7 +353,7 @@ restart:
while (1)
{
/* initilize to NULL just in case... */
/* Initialize to NULL just in case... */
cur_entry = NULL;
if (grub_timeout >= 0 && (time1 = getrtsecs()) != time2 && time1 != 0xFF)
@ -356,7 +372,12 @@ restart:
grub_timeout--;
}
if (checkkey () != -1)
/* Check for a keypress, however if TIMEOUT has been expired
(GRUB_TIMEOUT == -1) relax in GETKEY even if no key has been
pressed.
This avoids polling (relevant in the grub-shell and later on
in grub if interrupt driven I/O is done). */
if ((checkkey () != -1) || (grub_timeout == -1))
{
c = translate_keycode (getkey ());
@ -369,7 +390,9 @@ restart:
gotoxy (74, 4 + entryno);
}
if (c == 16)
/* We told them above (at least in SUPPORT_SERIAL) to use
'^' or 'v' so accept these keys. */
if (c == 16 || c == '^')
{
if (entryno > 0)
{
@ -386,7 +409,7 @@ restart:
set_line_highlight (4, first_entry + entryno, menu_entries);
}
}
if (c == 14 && (first_entry + entryno + 1) < num_entries)
if ((c == 14 || c == 'v') && first_entry + entryno + 1 < num_entries)
{
if (entryno < 11)
{