[FREELDR] Remove ShowBootOptions from Menu code

This removes a dependency of UI code to boot options code by getting rid of a call to DisplayBootTimeOptions() from within the menu code.
Instead this is now handled by MainBootMenuKeyPressFilter.
This commit is contained in:
Timo Kreuzer 2024-10-02 21:18:13 +02:00
parent 9daef292e9
commit ebcf3f23aa
12 changed files with 4 additions and 28 deletions

View file

@ -340,6 +340,7 @@ MainBootMenuKeyPressFilter(
{ {
case KEY_F8: case KEY_F8:
DoOptionsMenu(&((OperatingSystemItem*)Context)[SelectedMenuItem]); DoOptionsMenu(&((OperatingSystemItem*)Context)[SelectedMenuItem]);
DisplayBootTimeOptions();
return TRUE; return TRUE;
#ifdef HAS_OPTION_MENU_EDIT_CMDLINE #ifdef HAS_OPTION_MENU_EDIT_CMDLINE
@ -433,7 +434,6 @@ VOID RunLoader(VOID)
if (!UiDisplayMenu("Please select the operating system to start:", if (!UiDisplayMenu("Please select the operating system to start:",
"For troubleshooting and advanced startup options for " "For troubleshooting and advanced startup options for "
"ReactOS, press F8.", "ReactOS, press F8.",
TRUE,
OperatingSystemDisplayNames, OperatingSystemDisplayNames,
OperatingSystemCount, OperatingSystemCount,
DefaultOperatingSystem, DefaultOperatingSystem,

View file

@ -126,7 +126,6 @@ VOID OptionMenuCustomBoot(VOID)
OperatingSystemItem OperatingSystem; OperatingSystemItem OperatingSystem;
if (!UiDisplayMenu("Please choose a boot method:", NULL, if (!UiDisplayMenu("Please choose a boot method:", NULL,
FALSE,
CustomBootMenuList, CustomBootMenuList,
RTL_NUMBER_OF(CustomBootMenuList), RTL_NUMBER_OF(CustomBootMenuList),
0, -1, 0, -1,

View file

@ -211,7 +211,6 @@ typedef struct tagUI_MENU_INFO
{ {
PCSTR MenuHeader; PCSTR MenuHeader;
PCSTR MenuFooter; PCSTR MenuFooter;
BOOLEAN ShowBootOptions;
PCSTR* MenuItemList; PCSTR* MenuItemList;
ULONG MenuItemCount; ULONG MenuItemCount;
@ -236,7 +235,6 @@ BOOLEAN
UiDisplayMenu( UiDisplayMenu(
IN PCSTR MenuHeader, IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[], IN PCSTR MenuItemList[],
IN ULONG MenuItemCount, IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem, IN ULONG DefaultMenuItem,
@ -293,7 +291,6 @@ typedef struct tagUIVTBL
BOOLEAN (*DisplayMenu)( BOOLEAN (*DisplayMenu)(
IN PCSTR MenuHeader, IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[], IN PCSTR MenuItemList[],
IN ULONG MenuItemCount, IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem, IN ULONG DefaultMenuItem,

View file

@ -93,7 +93,6 @@ BOOLEAN
NoUiDisplayMenu( NoUiDisplayMenu(
IN PCSTR MenuHeader, IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[], IN PCSTR MenuItemList[],
IN ULONG MenuItemCount, IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem, IN ULONG DefaultMenuItem,

View file

@ -149,7 +149,6 @@ BOOLEAN
TuiDisplayMenu( TuiDisplayMenu(
IN PCSTR MenuHeader, IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[], IN PCSTR MenuItemList[],
IN ULONG MenuItemCount, IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem, IN ULONG DefaultMenuItem,

View file

@ -95,7 +95,6 @@ VOID DoOptionsMenu(IN OperatingSystemItem* OperatingSystem)
CHAR DebugChannelString[100]; CHAR DebugChannelString[100];
if (!UiDisplayMenu("Select an option:", NULL, if (!UiDisplayMenu("Select an option:", NULL,
TRUE,
OptionsMenuList, OptionsMenuList,
sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]), sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]),
11, // Use "Start ReactOS normally" as default; see the switch below. 11, // Use "Start ReactOS normally" as default; see the switch below.

View file

@ -139,7 +139,6 @@ BOOLEAN
UiDisplayMenu( UiDisplayMenu(
IN PCSTR MenuHeader, IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[], IN PCSTR MenuItemList[],
IN ULONG MenuItemCount, IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem, IN ULONG DefaultMenuItem,

View file

@ -56,7 +56,7 @@ BOOLEAN MiniTuiInitialize(VOID)
VOID MiniTuiDrawBackdrop(VOID) VOID MiniTuiDrawBackdrop(VOID)
{ {
/* Fill in a black background */ /* Fill in a black background */
TuiFillArea(0, 0, UiScreenWidth - 1, UiScreenHeight - 1, TuiFillArea(0, 0, UiScreenWidth - 1, UiScreenHeight - 3,
UiBackdropFillStyle, UiBackdropFillStyle,
ATTR(UiBackdropFgColor, UiBackdropBgColor)); ATTR(UiBackdropFgColor, UiBackdropBgColor));
@ -225,12 +225,6 @@ MiniTuiDrawMenu(
ATTR(UiMenuFgColor, UiMenuBgColor)); ATTR(UiMenuFgColor, UiMenuBgColor));
} }
/* Display the boot options if needed */
if (MenuInfo->ShowBootOptions)
{
DisplayBootTimeOptions();
}
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
} }

View file

@ -163,7 +163,6 @@ BOOLEAN
NoUiDisplayMenu( NoUiDisplayMenu(
IN PCSTR MenuHeader, IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[], IN PCSTR MenuItemList[],
IN ULONG MenuItemCount, IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem, IN ULONG DefaultMenuItem,

View file

@ -275,7 +275,7 @@ VOID TuiDrawBackdrop(VOID)
TuiFillArea(0, TuiFillArea(0,
TUI_TITLE_BOX_CHAR_HEIGHT, TUI_TITLE_BOX_CHAR_HEIGHT,
UiScreenWidth - 1, UiScreenWidth - 1,
UiScreenHeight - 2, UiScreenHeight - 3,
UiBackdropFillStyle, UiBackdropFillStyle,
ATTR(UiBackdropFgColor, UiBackdropBgColor)); ATTR(UiBackdropFgColor, UiBackdropBgColor));

View file

@ -30,7 +30,6 @@ BOOLEAN
TuiDisplayMenu( TuiDisplayMenu(
IN PCSTR MenuHeader, IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[], IN PCSTR MenuItemList[],
IN ULONG MenuItemCount, IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem, IN ULONG DefaultMenuItem,
@ -80,7 +79,6 @@ TuiDisplayMenu(
/* Setup the MENU_INFO structure */ /* Setup the MENU_INFO structure */
MenuInformation.MenuHeader = MenuHeader; MenuInformation.MenuHeader = MenuHeader;
MenuInformation.MenuFooter = MenuFooter; MenuInformation.MenuFooter = MenuFooter;
MenuInformation.ShowBootOptions = ShowBootOptions;
MenuInformation.MenuItemList = MenuItemList; MenuInformation.MenuItemList = MenuItemList;
MenuInformation.MenuItemCount = MenuItemCount; MenuInformation.MenuItemCount = MenuItemCount;
MenuInformation.MenuTimeRemaining = MenuTimeOut; MenuInformation.MenuTimeRemaining = MenuTimeOut;
@ -219,12 +217,6 @@ TuiDrawMenu(
/* Update the status bar */ /* Update the status bar */
UiVtbl.DrawStatusText("Use \x18 and \x19 to select, then press ENTER."); UiVtbl.DrawStatusText("Use \x18 and \x19 to select, then press ENTER.");
/* Display the boot options if needed */
if (MenuInfo->ShowBootOptions)
{
DisplayBootTimeOptions();
}
VideoCopyOffScreenBufferToVRAM(); VideoCopyOffScreenBufferToVRAM();
} }

View file

@ -605,7 +605,6 @@ BOOLEAN
UiDisplayMenu( UiDisplayMenu(
IN PCSTR MenuHeader, IN PCSTR MenuHeader,
IN PCSTR MenuFooter OPTIONAL, IN PCSTR MenuFooter OPTIONAL,
IN BOOLEAN ShowBootOptions,
IN PCSTR MenuItemList[], IN PCSTR MenuItemList[],
IN ULONG MenuItemCount, IN ULONG MenuItemCount,
IN ULONG DefaultMenuItem, IN ULONG DefaultMenuItem,
@ -615,7 +614,7 @@ UiDisplayMenu(
IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL, IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
IN PVOID Context OPTIONAL) IN PVOID Context OPTIONAL)
{ {
return UiVtbl.DisplayMenu(MenuHeader, MenuFooter, ShowBootOptions, return UiVtbl.DisplayMenu(MenuHeader, MenuFooter,
MenuItemList, MenuItemCount, DefaultMenuItem, MenuItemList, MenuItemCount, DefaultMenuItem,
MenuTimeOut, SelectedMenuItem, CanEscape, MenuTimeOut, SelectedMenuItem, CanEscape,
KeyPressFilter, Context); KeyPressFilter, Context);