Quick fixes and improvements to BlDisplayBootMenu()
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 26s
Builds / ExectOS (i686) (push) Successful in 25s

This commit is contained in:
Rafal Kupiec 2023-12-23 10:14:42 +01:00
parent 10aaf7e24e
commit 0c5f2d18b6
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -1063,8 +1063,7 @@ BlDisplayBootMenu()
EfiSystemTable->BootServices->SetTimer(TimerEvent, TimerCancel, 0); EfiSystemTable->BootServices->SetTimer(TimerEvent, TimerCancel, 0);
/* Remove the timer message */ /* Remove the timer message */
BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4); BlClearConsoleLine(Handle.PosY + Handle.Height + 4);
BlConsolePrint(L" ", TimeOut);
} }
/* Read key stroke */ /* Read key stroke */
@ -1073,6 +1072,12 @@ BlDisplayBootMenu()
if(Key.ScanCode == 0x03 || Key.UnicodeChar == 0x0D) if(Key.ScanCode == 0x03 || Key.UnicodeChar == 0x0D)
{ {
/* ENTER or RightArrow key pressed, boot the highlighted OS */ /* ENTER or RightArrow key pressed, boot the highlighted OS */
BlSetConsoleAttributes(Handle.DialogColor | Handle.TextColor);
BlClearConsoleLine(Handle.PosY + Handle.Height + 4);
BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4);
BlConsolePrint(L"Booting '%S' now...", MenuEntries[HighligtedEntryId].EntryName);
/* Boot the highlighted (chosen) OS */
BlDisplayInfoDialog(L"XTLDR", L"Booting highlighted OS ..."); BlDisplayInfoDialog(L"XTLDR", L"Booting highlighted OS ...");
/* Break from boot menu event loop to redraw whole boot menu */ /* Break from boot menu event loop to redraw whole boot menu */
@ -1150,16 +1155,17 @@ BlDisplayBootMenu()
if(TimeOut > 0) if(TimeOut > 0)
{ {
/* Update a message and decrease timeout value */ /* Update a message and decrease timeout value */
BlClearConsoleLine(Handle.PosY + Handle.Height + 4);
BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4); BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4);
BlConsolePrint(L"The highlighted position will be booted automatically in %ld seconds. ", TimeOut); BlConsolePrint(L"The highlighted position will be booted automatically in %ld seconds.", TimeOut);
TimeOut--; TimeOut--;
} }
else if(TimeOut == 0) else if(TimeOut == 0)
{ {
/* Time out expired, update a message */ /* Time out expired, update a message */
BlClearConsoleLine(Handle.PosY + Handle.Height + 4);
BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4); BlSetCursorPosition(4, Handle.PosY + Handle.Height + 4);
BlConsolePrint(L"Booting '%S' now... ", BlConsolePrint(L"Booting '%S' now...", MenuEntries[HighligtedEntryId].EntryName);
MenuEntries[HighligtedEntryId].EntryName);
/* Disable the timer just in case booting OS fails */ /* Disable the timer just in case booting OS fails */
TimeOut = -1; TimeOut = -1;