https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ebcf3f23aaa9417c7d0b268021aa0e21d33a762b

commit ebcf3f23aaa9417c7d0b268021aa0e21d33a762b
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Wed Oct 2 21:18:13 2024 +0200
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Tue Feb 4 16:45:48 2025 +0200

    [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.
---
 boot/freeldr/freeldr/bootmgr.c         | 2 +-
 boot/freeldr/freeldr/custom.c          | 1 -
 boot/freeldr/freeldr/include/ui.h      | 3 ---
 boot/freeldr/freeldr/include/ui/noui.h | 1 -
 boot/freeldr/freeldr/include/ui/tui.h  | 1 -
 boot/freeldr/freeldr/options.c         | 1 -
 boot/freeldr/freeldr/ui/directui.c     | 1 -
 boot/freeldr/freeldr/ui/minitui.c      | 8 +-------
 boot/freeldr/freeldr/ui/noui.c         | 1 -
 boot/freeldr/freeldr/ui/tui.c          | 2 +-
 boot/freeldr/freeldr/ui/tuimenu.c      | 8 --------
 boot/freeldr/freeldr/ui/ui.c           | 3 +--
 12 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/boot/freeldr/freeldr/bootmgr.c b/boot/freeldr/freeldr/bootmgr.c
index 0fe04a55813..b0494083d75 100644
--- a/boot/freeldr/freeldr/bootmgr.c
+++ b/boot/freeldr/freeldr/bootmgr.c
@@ -340,6 +340,7 @@ MainBootMenuKeyPressFilter(
     {
     case KEY_F8:
         DoOptionsMenu(&((OperatingSystemItem*)Context)[SelectedMenuItem]);
+        DisplayBootTimeOptions();
         return TRUE;
 
 #ifdef HAS_OPTION_MENU_EDIT_CMDLINE
@@ -433,7 +434,6 @@ VOID RunLoader(VOID)
         if (!UiDisplayMenu("Please select the operating system to start:",
                            "For troubleshooting and advanced startup options 
for "
                                "ReactOS, press F8.",
-                           TRUE,
                            OperatingSystemDisplayNames,
                            OperatingSystemCount,
                            DefaultOperatingSystem,
diff --git a/boot/freeldr/freeldr/custom.c b/boot/freeldr/freeldr/custom.c
index f0e984deb66..7519d2d7fa5 100644
--- a/boot/freeldr/freeldr/custom.c
+++ b/boot/freeldr/freeldr/custom.c
@@ -126,7 +126,6 @@ VOID OptionMenuCustomBoot(VOID)
     OperatingSystemItem OperatingSystem;
 
     if (!UiDisplayMenu("Please choose a boot method:", NULL,
-                       FALSE,
                        CustomBootMenuList,
                        RTL_NUMBER_OF(CustomBootMenuList),
                        0, -1,
diff --git a/boot/freeldr/freeldr/include/ui.h 
b/boot/freeldr/freeldr/include/ui.h
index ee613a9ad42..cedc2fa922a 100644
--- a/boot/freeldr/freeldr/include/ui.h
+++ b/boot/freeldr/freeldr/include/ui.h
@@ -211,7 +211,6 @@ typedef struct tagUI_MENU_INFO
 {
     PCSTR   MenuHeader;
     PCSTR   MenuFooter;
-    BOOLEAN ShowBootOptions;
 
     PCSTR*  MenuItemList;
     ULONG   MenuItemCount;
@@ -236,7 +235,6 @@ BOOLEAN
 UiDisplayMenu(
     IN PCSTR MenuHeader,
     IN PCSTR MenuFooter OPTIONAL,
-    IN BOOLEAN ShowBootOptions,
     IN PCSTR MenuItemList[],
     IN ULONG MenuItemCount,
     IN ULONG DefaultMenuItem,
@@ -293,7 +291,6 @@ typedef struct tagUIVTBL
     BOOLEAN (*DisplayMenu)(
         IN PCSTR MenuHeader,
         IN PCSTR MenuFooter OPTIONAL,
-        IN BOOLEAN ShowBootOptions,
         IN PCSTR MenuItemList[],
         IN ULONG MenuItemCount,
         IN ULONG DefaultMenuItem,
diff --git a/boot/freeldr/freeldr/include/ui/noui.h 
b/boot/freeldr/freeldr/include/ui/noui.h
index df986bfd178..ac6524dec54 100644
--- a/boot/freeldr/freeldr/include/ui/noui.h
+++ b/boot/freeldr/freeldr/include/ui/noui.h
@@ -93,7 +93,6 @@ BOOLEAN
 NoUiDisplayMenu(
     IN PCSTR MenuHeader,
     IN PCSTR MenuFooter OPTIONAL,
-    IN BOOLEAN ShowBootOptions,
     IN PCSTR MenuItemList[],
     IN ULONG MenuItemCount,
     IN ULONG DefaultMenuItem,
diff --git a/boot/freeldr/freeldr/include/ui/tui.h 
b/boot/freeldr/freeldr/include/ui/tui.h
index 9017c0b4ef6..4a3f3e25ef9 100644
--- a/boot/freeldr/freeldr/include/ui/tui.h
+++ b/boot/freeldr/freeldr/include/ui/tui.h
@@ -149,7 +149,6 @@ BOOLEAN
 TuiDisplayMenu(
     IN PCSTR MenuHeader,
     IN PCSTR MenuFooter OPTIONAL,
-    IN BOOLEAN ShowBootOptions,
     IN PCSTR MenuItemList[],
     IN ULONG MenuItemCount,
     IN ULONG DefaultMenuItem,
diff --git a/boot/freeldr/freeldr/options.c b/boot/freeldr/freeldr/options.c
index 9a604bf90b3..27eb1dda090 100644
--- a/boot/freeldr/freeldr/options.c
+++ b/boot/freeldr/freeldr/options.c
@@ -95,7 +95,6 @@ VOID DoOptionsMenu(IN OperatingSystemItem* OperatingSystem)
     CHAR  DebugChannelString[100];
 
     if (!UiDisplayMenu("Select an option:", NULL,
-                       TRUE,
                        OptionsMenuList,
                        sizeof(OptionsMenuList) / sizeof(OptionsMenuList[0]),
                        11, // Use "Start ReactOS normally" as default; see the 
switch below.
diff --git a/boot/freeldr/freeldr/ui/directui.c 
b/boot/freeldr/freeldr/ui/directui.c
index 197061927d2..7788fa1e84d 100644
--- a/boot/freeldr/freeldr/ui/directui.c
+++ b/boot/freeldr/freeldr/ui/directui.c
@@ -139,7 +139,6 @@ BOOLEAN
 UiDisplayMenu(
     IN PCSTR MenuHeader,
     IN PCSTR MenuFooter OPTIONAL,
-    IN BOOLEAN ShowBootOptions,
     IN PCSTR MenuItemList[],
     IN ULONG MenuItemCount,
     IN ULONG DefaultMenuItem,
diff --git a/boot/freeldr/freeldr/ui/minitui.c 
b/boot/freeldr/freeldr/ui/minitui.c
index d44aef6bc67..1ca4e8b5062 100644
--- a/boot/freeldr/freeldr/ui/minitui.c
+++ b/boot/freeldr/freeldr/ui/minitui.c
@@ -56,7 +56,7 @@ BOOLEAN MiniTuiInitialize(VOID)
 VOID MiniTuiDrawBackdrop(VOID)
 {
     /* Fill in a black background */
-    TuiFillArea(0, 0, UiScreenWidth - 1, UiScreenHeight - 1,
+    TuiFillArea(0, 0, UiScreenWidth - 1, UiScreenHeight - 3,
                 UiBackdropFillStyle,
                 ATTR(UiBackdropFgColor, UiBackdropBgColor));
 
@@ -225,12 +225,6 @@ MiniTuiDrawMenu(
                         ATTR(UiMenuFgColor, UiMenuBgColor));
     }
 
-    /* Display the boot options if needed */
-    if (MenuInfo->ShowBootOptions)
-    {
-        DisplayBootTimeOptions();
-    }
-
     VideoCopyOffScreenBufferToVRAM();
 }
 
diff --git a/boot/freeldr/freeldr/ui/noui.c b/boot/freeldr/freeldr/ui/noui.c
index e79598bec63..80fefea0c9a 100644
--- a/boot/freeldr/freeldr/ui/noui.c
+++ b/boot/freeldr/freeldr/ui/noui.c
@@ -163,7 +163,6 @@ BOOLEAN
 NoUiDisplayMenu(
     IN PCSTR MenuHeader,
     IN PCSTR MenuFooter OPTIONAL,
-    IN BOOLEAN ShowBootOptions,
     IN PCSTR MenuItemList[],
     IN ULONG MenuItemCount,
     IN ULONG DefaultMenuItem,
diff --git a/boot/freeldr/freeldr/ui/tui.c b/boot/freeldr/freeldr/ui/tui.c
index 5960dcd5d44..80c5e3b0100 100644
--- a/boot/freeldr/freeldr/ui/tui.c
+++ b/boot/freeldr/freeldr/ui/tui.c
@@ -275,7 +275,7 @@ VOID TuiDrawBackdrop(VOID)
     TuiFillArea(0,
                 TUI_TITLE_BOX_CHAR_HEIGHT,
                 UiScreenWidth - 1,
-                UiScreenHeight - 2,
+                UiScreenHeight - 3,
                 UiBackdropFillStyle,
                 ATTR(UiBackdropFgColor, UiBackdropBgColor));
 
diff --git a/boot/freeldr/freeldr/ui/tuimenu.c 
b/boot/freeldr/freeldr/ui/tuimenu.c
index 7559380389c..ff6f95e1128 100644
--- a/boot/freeldr/freeldr/ui/tuimenu.c
+++ b/boot/freeldr/freeldr/ui/tuimenu.c
@@ -30,7 +30,6 @@ BOOLEAN
 TuiDisplayMenu(
     IN PCSTR MenuHeader,
     IN PCSTR MenuFooter OPTIONAL,
-    IN BOOLEAN ShowBootOptions,
     IN PCSTR MenuItemList[],
     IN ULONG MenuItemCount,
     IN ULONG DefaultMenuItem,
@@ -80,7 +79,6 @@ TuiDisplayMenu(
     /* Setup the MENU_INFO structure */
     MenuInformation.MenuHeader = MenuHeader;
     MenuInformation.MenuFooter = MenuFooter;
-    MenuInformation.ShowBootOptions = ShowBootOptions;
     MenuInformation.MenuItemList = MenuItemList;
     MenuInformation.MenuItemCount = MenuItemCount;
     MenuInformation.MenuTimeRemaining = MenuTimeOut;
@@ -219,12 +217,6 @@ TuiDrawMenu(
     /* Update the status bar */
     UiVtbl.DrawStatusText("Use \x18 and \x19 to select, then press ENTER.");
 
-    /* Display the boot options if needed */
-    if (MenuInfo->ShowBootOptions)
-    {
-        DisplayBootTimeOptions();
-    }
-
     VideoCopyOffScreenBufferToVRAM();
 }
 
diff --git a/boot/freeldr/freeldr/ui/ui.c b/boot/freeldr/freeldr/ui/ui.c
index 2583517e847..3496921cb53 100644
--- a/boot/freeldr/freeldr/ui/ui.c
+++ b/boot/freeldr/freeldr/ui/ui.c
@@ -605,7 +605,6 @@ BOOLEAN
 UiDisplayMenu(
     IN PCSTR MenuHeader,
     IN PCSTR MenuFooter OPTIONAL,
-    IN BOOLEAN ShowBootOptions,
     IN PCSTR MenuItemList[],
     IN ULONG MenuItemCount,
     IN ULONG DefaultMenuItem,
@@ -615,7 +614,7 @@ UiDisplayMenu(
     IN UiMenuKeyPressFilterCallback KeyPressFilter OPTIONAL,
     IN PVOID Context OPTIONAL)
 {
-    return UiVtbl.DisplayMenu(MenuHeader, MenuFooter, ShowBootOptions,
+    return UiVtbl.DisplayMenu(MenuHeader, MenuFooter,
                               MenuItemList, MenuItemCount, DefaultMenuItem,
                               MenuTimeOut, SelectedMenuItem, CanEscape,
                               KeyPressFilter, Context);

Reply via email to