Freeldr will not load a UI if Timeout = 0, and will instead immediately load the default OS.

svn path=/trunk/; revision=12149
This commit is contained in:
Alex Ionescu 2004-12-16 07:09:33 +00:00
parent d986574df1
commit 25c4daa164
3 changed files with 29 additions and 6 deletions

View file

@ -37,7 +37,6 @@
#include <cmdline.h>
#include <machine.h>
VOID RunLoader(VOID)
{
UCHAR SettingName[80];
@ -63,13 +62,15 @@ VOID RunLoader(VOID)
MachConsGetCh();
return;
}
TimeOut = GetTimeOut();
if (!UiInitialize())
if (!UiInitialize(TimeOut))
{
printf("Press any key to reboot.\n");
MachConsGetCh();
return;
}
if (!InitOperatingSystemList(&OperatingSystemSectionNames, &OperatingSystemDisplayNames, &OperatingSystemCount))
{
@ -84,7 +85,6 @@ VOID RunLoader(VOID)
}
DefaultOperatingSystem = GetDefaultOperatingSystem(OperatingSystemSectionNames, OperatingSystemCount);
TimeOut = GetTimeOut();
//
// Find all the message box settings and run them
@ -93,6 +93,12 @@ VOID RunLoader(VOID)
for (;;)
{
/* If Timeout is 0, don't even bother loading any gui */
if (!UserInterfaceUp) {
goto NoGui;
}
// Redraw the backdrop
UiDrawBackdrop();
@ -102,6 +108,8 @@ VOID RunLoader(VOID)
UiMessageBox("Press ENTER to reboot.\n");
goto reboot;
}
NoGui:
TimeOut = -1;
DefaultOperatingSystem = SelectedOperatingSystem;
@ -123,7 +131,6 @@ VOID RunLoader(VOID)
// Install the drive mapper according to this sections drive mappings
DriveMapMapDrivesInSection(OperatingSystemSectionNames[SelectedOperatingSystem]);
if (stricmp(SettingValue, "ReactOS") == 0)
{
LoadAndBootReactOS(OperatingSystemSectionNames[SelectedOperatingSystem]);

View file

@ -54,7 +54,7 @@ extern UCHAR UiMonthNames[12][15];
// User Interface Functions
//
///////////////////////////////////////////////////////////////////////////////////////
BOOL UiInitialize(VOID); // Initialize User-Interface
BOOL UiInitialize(BOOLEAN ShowGui); // Initialize User-Interface
VOID UiUnInitialize(PUCHAR BootText); // Un-initialize User-Interface
VOID UiDrawBackdrop(VOID); // Fills the entire screen with a backdrop
VOID UiFillArea(U32 Left, U32 Top, U32 Right, U32 Bottom, UCHAR FillChar, UCHAR Attr /* Color Attributes */); // Fills the area specified with FillChar and Attr

View file

@ -59,13 +59,23 @@ BOOL UiUseSpecialEffects = FALSE; // Tells us if we should use fade effects
UCHAR UiMonthNames[12][15] = { "January ", "February ", "March ", "April ", "May ", "June ", "July ", "August ", "September ", "October ", "November ", "December " };
BOOL UiInitialize(VOID)
BOOL UiInitialize(BOOLEAN ShowGui)
{
U32 SectionId;
UCHAR DisplayModeText[260];
UCHAR SettingText[260];
U32 Depth;
if (!ShowGui) {
if (!TuiInitialize())
{
MachVideoSetDisplayMode(NULL, FALSE);
return FALSE;
}
UserInterfaceUp = FALSE;
return TRUE;
}
DbgPrint((DPRINT_UI, "Initializing User Interface.\n"));
DbgPrint((DPRINT_UI, "Reading in UI settings from [Display] section.\n"));
@ -210,6 +220,8 @@ VOID UiUnInitialize(PUCHAR BootText)
VOID UiDrawBackdrop(VOID)
{
if (!UserInterfaceUp) return;
if (VideoTextMode == UiDisplayMode)
{
TuiDrawBackdrop();
@ -288,6 +300,8 @@ VOID UiDrawCenteredText(U32 Left, U32 Top, U32 Right, U32 Bottom, PUCHAR TextStr
VOID UiDrawStatusText(PUCHAR StatusText)
{
if (!UserInterfaceUp) return;
if (VideoTextMode == UiDisplayMode)
{
TuiDrawStatusText(StatusText);
@ -453,6 +467,8 @@ UCHAR UiTextToFillStyle(PUCHAR FillStyleText)
VOID UiDrawProgressBarCenter(U32 Position, U32 Range, PUCHAR ProgressText)
{
if (!UserInterfaceUp) return;
if (VideoTextMode == UiDisplayMode)
{
TuiDrawProgressBarCenter(Position, Range, ProgressText);