[USETUP] Massage the USETUP interface code.

- The "intro" page is renamed into the "Welcome" page, because its corresponding resource indeed is the welcome screen;
- Because the "setup start" page can only be displayed once, move it out of the while-loop, and use its result as the initial value of the 'Page' variable.
- Remove unneeded _PAGE_NUMBER_DEFINED guards;
- Add a DPRINT in the RepairUpdateFlag case of RegistryPage() (because we don't implement yet a correct upgrading or repairing of the registry).
- In InstallIntroPage(), display the page itself only if needed (i.e. after all the validation checks & repair/update or unattended checks are done). Similar modifications are done also in DeviceSettingsPage(), SelectPartitionPage()
- Turn both CheckUnattendedSetup() and UpdateKBLayout() into static functions.
- Fix the code of ScsiControllerPage() so that it can be compiled if needed, and add a dummy OemDriverPage().

svn path=/branches/setup_improvements/; revision=74575
This commit is contained in:
Hermès Bélusca-Maïto 2017-05-15 01:48:19 +00:00
parent 7886ad46db
commit 38e20b638f
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
27 changed files with 113 additions and 86 deletions

View file

@ -1629,7 +1629,7 @@ MUI_PAGE bgBGPages[] =
bgBGLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
bgBGWelcomePageEntries
},
{

View file

@ -1616,7 +1616,7 @@ MUI_PAGE bnBDPages[] =
bnBDLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
bnBDWelcomePageEntries
},
{

View file

@ -1624,7 +1624,7 @@ MUI_PAGE csCZPages[] =
csCZLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
csCZWelcomePageEntries
},
{

View file

@ -1630,7 +1630,7 @@ MUI_PAGE daDKPages[] =
daDKLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
daDKWelcomePageEntries
},
{

View file

@ -1620,7 +1620,7 @@ MUI_PAGE deDEPages[] =
deDELanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
deDEWelcomePageEntries
},
{

View file

@ -1633,7 +1633,7 @@ MUI_PAGE elGRPages[] =
elGRLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
elGRWelcomePageEntries
},
{

View file

@ -1616,7 +1616,7 @@ MUI_PAGE enUSPages[] =
enUSLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
enUSWelcomePageEntries
},
{

View file

@ -1620,7 +1620,7 @@ MUI_PAGE esESPages[] =
esESLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
esESWelcomePageEntries
},
{

View file

@ -1614,7 +1614,7 @@ MUI_PAGE etEEPages[] =
etEELanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
etEEWelcomePageEntries
},
{

View file

@ -1635,7 +1635,7 @@ MUI_PAGE frFRPages[] =
frFRLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
frFRWelcomePageEntries
},
{

View file

@ -1617,7 +1617,7 @@ MUI_PAGE heILPages[] =
heILLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
heILWelcomePageEntries
},
{

View file

@ -1623,7 +1623,7 @@ MUI_PAGE itITPages[] =
itITLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
itITWelcomePageEntries
},
{

View file

@ -1618,7 +1618,7 @@ MUI_PAGE jaJPPages[] =
jaJPLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
jaJPWelcomePageEntries
},
{

View file

@ -1626,7 +1626,7 @@ MUI_PAGE ltLTPages[] =
ltLTLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
ltLTWelcomePageEntries
},
{

View file

@ -1509,7 +1509,7 @@ MUI_PAGE msMYPages[] =
msMYLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
msMYWelcomePageEntries
},
{

View file

@ -1644,7 +1644,7 @@ MUI_PAGE nlNLPages[] =
nlNLLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
nlNLWelcomePageEntries
},
{

View file

@ -1627,7 +1627,7 @@ MUI_PAGE plPLPages[] =
plPLLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
plPLWelcomePageEntries
},
{

View file

@ -1648,7 +1648,7 @@ MUI_PAGE ptBRPages[] =
ptBRLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
ptBRWelcomePageEntries
},
{

View file

@ -1670,7 +1670,7 @@ MUI_PAGE roROPages[] =
roROLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
roROWelcomePageEntries
},
{

View file

@ -1617,7 +1617,7 @@ MUI_PAGE ruRUPages[] =
ruRULanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
ruRUWelcomePageEntries
},
{

View file

@ -1628,7 +1628,7 @@ MUI_PAGE skSKPages[] =
skSKLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
skSKWelcomePageEntries
},
{

View file

@ -1621,7 +1621,7 @@ MUI_PAGE sqALPages[] =
sqALLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
sqALWelcomePageEntries
},
{

View file

@ -1624,7 +1624,7 @@ MUI_PAGE svSEPages[] =
svSELanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
svSEWelcomePageEntries
},
{

View file

@ -1597,7 +1597,7 @@ MUI_PAGE trTRPages[] =
trTRLanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
trTRWelcomePageEntries
},
{

View file

@ -1624,7 +1624,7 @@ MUI_PAGE ukUAPages[] =
ukUALanguagePageEntries
},
{
START_PAGE,
WELCOME_PAGE,
ukUAWelcomePageEntries
},
{

View file

@ -420,7 +420,7 @@ ConfirmQuit(PINPUT_RECORD Ir)
}
VOID
static VOID
CheckUnattendedSetup(VOID)
{
WCHAR UnattendInfPath[MAX_PATH];
@ -593,7 +593,7 @@ CheckUnattendedSetup(VOID)
}
VOID
static VOID
UpdateKBLayout(VOID)
{
PGENERIC_LIST_ENTRY ListEntry;
@ -633,7 +633,7 @@ UpdateKBLayout(VOID)
/*
* Displays the LanguagePage.
*
* Next pages: IntroPage, QuitPage
* Next pages: WelcomePage, QuitPage
*
* SIDEEFFECTS
* Init SelectedLanguageId
@ -656,7 +656,7 @@ LanguagePage(PINPUT_RECORD Ir)
if (LanguageList == NULL)
{
PopupError("Setup failed to initialize available translations", NULL, NULL, POPUP_WAIT_NONE);
return INTRO_PAGE;
return WELCOME_PAGE;
}
}
@ -670,7 +670,7 @@ LanguagePage(PINPUT_RECORD Ir)
if (GenericListHasSingleEntry(LanguageList))
{
LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF);
return INTRO_PAGE;
return WELCOME_PAGE;
}
InitGenericListUi(&ListUi, LanguageList);
@ -734,7 +734,7 @@ LanguagePage(PINPUT_RECORD Ir)
/* Load the font */
SetConsoleCodePage();
return INTRO_PAGE;
return WELCOME_PAGE;
}
else if ((Ir->Event.KeyEvent.uChar.AsciiChar > 0x60) && (Ir->Event.KeyEvent.uChar.AsciiChar < 0x7b))
{
@ -765,7 +765,7 @@ LanguagePage(PINPUT_RECORD Ir)
}
}
return INTRO_PAGE;
return WELCOME_PAGE;
}
@ -930,7 +930,7 @@ SetupStartPage(PINPUT_RECORD Ir)
/*
* Displays the IntroPage.
* Displays the WelcomePage.
*
* Next pages:
* InstallIntroPage (default)
@ -942,9 +942,9 @@ SetupStartPage(PINPUT_RECORD Ir)
* Number of the next page.
*/
static PAGE_NUMBER
IntroPage(PINPUT_RECORD Ir)
WelcomePage(PINPUT_RECORD Ir)
{
MUIDisplayPage(START_PAGE);
MUIDisplayPage(WELCOME_PAGE);
while (TRUE)
{
@ -972,7 +972,7 @@ IntroPage(PINPUT_RECORD Ir)
}
}
return INTRO_PAGE;
return WELCOME_PAGE;
}
@ -980,7 +980,7 @@ IntroPage(PINPUT_RECORD Ir)
* Displays the License page.
*
* Next page:
* IntroPage (default)
* WelcomePage (default)
*
* RETURNS
* Number of the next page.
@ -996,7 +996,7 @@ LicensePage(PINPUT_RECORD Ir)
if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return INTRO_PAGE;
return WELCOME_PAGE;
}
}
@ -1041,7 +1041,7 @@ RepairIntroPage(PINPUT_RECORD Ir)
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
{
return INTRO_PAGE;
return WELCOME_PAGE;
}
}
@ -1063,8 +1063,6 @@ RepairIntroPage(PINPUT_RECORD Ir)
static PAGE_NUMBER
InstallIntroPage(PINPUT_RECORD Ir)
{
MUIDisplayPage(INSTALL_INTRO_PAGE);
if (RepairUpdateFlag)
{
//return SELECT_PARTITION_PAGE;
@ -1072,9 +1070,9 @@ InstallIntroPage(PINPUT_RECORD Ir)
}
if (IsUnattendedSetup)
{
return SELECT_PARTITION_PAGE;
}
MUIDisplayPage(INSTALL_INTRO_PAGE);
while (TRUE)
{
@ -1103,19 +1101,20 @@ InstallIntroPage(PINPUT_RECORD Ir)
static PAGE_NUMBER
ScsiControllerPage(PINPUT_RECORD Ir)
{
SetTextXY(6, 8, "Setup detected the following mass storage devices:");
// MUIDisplayPage(SCSI_CONTROLLER_PAGE);
CONSOLE_SetTextXY(6, 8, "Setup detected the following mass storage devices:");
/* FIXME: print loaded mass storage driver descriptions */
#if 0
SetTextXY(8, 10, "TEST device");
CONSOLE_SetTextXY(8, 10, "TEST device");
#endif
SetStatusText(" ENTER = Continue F3 = Quit");
CONSOLE_SetStatusText(" ENTER = Continue F3 = Quit");
while (TRUE)
{
ConInKey(Ir);
CONSOLE_ConInKey(Ir);
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
@ -1133,6 +1132,38 @@ ScsiControllerPage(PINPUT_RECORD Ir)
return SCSI_CONTROLLER_PAGE;
}
static PAGE_NUMBER
OemDriverPage(PINPUT_RECORD Ir)
{
// MUIDisplayPage(OEM_DRIVER_PAGE);
CONSOLE_SetTextXY(6, 8, "This is the OEM driver page!");
/* FIXME: Implement!! */
CONSOLE_SetStatusText(" ENTER = Continue F3 = Quit");
while (TRUE)
{
CONSOLE_ConInKey(Ir);
if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */
{
if (ConfirmQuit(Ir) == TRUE)
return QUIT_PAGE;
break;
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
return DEVICE_SETTINGS_PAGE;
}
}
return OEM_DRIVER_PAGE;
}
#endif
@ -1161,7 +1192,6 @@ static PAGE_NUMBER
DeviceSettingsPage(PINPUT_RECORD Ir)
{
static ULONG Line = 16;
MUIDisplayPage(DEVICE_SETTINGS_PAGE);
/* Initialize the computer settings list */
if (ComputerList == NULL)
@ -1208,21 +1238,21 @@ DeviceSettingsPage(PINPUT_RECORD Ir)
}
}
if (RepairUpdateFlag)
return SELECT_PARTITION_PAGE;
// if (IsUnattendedSetup)
// return SELECT_PARTITION_PAGE;
MUIDisplayPage(DEVICE_SETTINGS_PAGE);
CONSOLE_SetTextXY(25, 11, GetListEntryText(GetCurrentListEntry((ComputerList))));
CONSOLE_SetTextXY(25, 12, GetListEntryText(GetCurrentListEntry((DisplayList))));
CONSOLE_SetTextXY(25, 13, GetListEntryText(GetCurrentListEntry((KeyboardList))));
CONSOLE_SetTextXY(25, 14, GetListEntryText(GetCurrentListEntry((LayoutList))));
CONSOLE_SetTextXY(25, 11, GetListEntryText(GetCurrentListEntry(ComputerList)));
CONSOLE_SetTextXY(25, 12, GetListEntryText(GetCurrentListEntry(DisplayList)));
CONSOLE_SetTextXY(25, 13, GetListEntryText(GetCurrentListEntry(KeyboardList)));
CONSOLE_SetTextXY(25, 14, GetListEntryText(GetCurrentListEntry(LayoutList)));
CONSOLE_InvertTextXY(24, Line, 48, 1);
if (RepairUpdateFlag)
{
return SELECT_PARTITION_PAGE;
}
while (TRUE)
{
CONSOLE_ConInKey(Ir);
@ -1509,8 +1539,6 @@ SelectPartitionPage(PINPUT_RECORD Ir)
PARTLIST_UI ListUi;
ULONG Error;
MUIDisplayPage(SELECT_PARTITION_PAGE);
if (PartitionList == NULL)
{
PartitionList = CreatePartitionList();
@ -1530,6 +1558,8 @@ SelectPartitionPage(PINPUT_RECORD Ir)
FormatState = Start;
}
MUIDisplayPage(SELECT_PARTITION_PAGE);
InitPartitionListUi(&ListUi, PartitionList,
2,
23,
@ -3180,9 +3210,8 @@ CheckFileSystemPage(PINPUT_RECORD Ir)
}
static
VOID
BuildInstallPaths(PWCHAR InstallDir,
static VOID
BuildInstallPaths(PWSTR InstallDir,
PDISKENTRY DiskEntry,
PPARTENTRY PartEntry)
{
@ -4033,6 +4062,8 @@ RegistryPage(PINPUT_RECORD Ir)
if (RepairUpdateFlag)
{
// FIXME!
DPRINT1("FIXME: Updating / repairing the registry is NOT implemented yet!\n");
return SUCCESS_PAGE;
}
@ -4872,37 +4903,36 @@ RunUSetup(VOID)
/* Hide the cursor */
CONSOLE_SetCursorType(TRUE, FALSE);
Page = START_PAGE;
/* Global Initialization page */
CONSOLE_ClearScreen();
CONSOLE_Flush();
Page = SetupStartPage(&Ir);
while (Page != REBOOT_PAGE && Page != RECOVERY_PAGE)
{
CONSOLE_ClearScreen();
CONSOLE_Flush();
//CONSOLE_SetUnderlinedTextXY(4, 3, " ReactOS " KERNEL_VERSION_STR " Setup ");
//CONSOLE_Flush();
// CONSOLE_SetUnderlinedTextXY(4, 3, " ReactOS " KERNEL_VERSION_STR " Setup ");
// CONSOLE_Flush();
switch (Page)
{
/* Start page */
case START_PAGE:
Page = SetupStartPage(&Ir);
break;
/* Language page */
case LANGUAGE_PAGE:
Page = LanguagePage(&Ir);
break;
/* Welcome page */
case WELCOME_PAGE:
Page = WelcomePage(&Ir);
break;
/* License page */
case LICENSE_PAGE:
Page = LicensePage(&Ir);
break;
/* Intro page */
case INTRO_PAGE:
Page = IntroPage(&Ir);
break;
/* Install pages */
case INSTALL_INTRO_PAGE:
Page = InstallIntroPage(&Ir);

View file

@ -102,17 +102,17 @@ extern BOOLEAN InfGetStringField(PINFCONTEXT Context,
#define SetupGetMultiSzFieldW InfGetMultiSzField
#define SetupGetStringFieldW InfGetStringField
#ifndef _PAGE_NUMBER_DEFINED
#define _PAGE_NUMBER_DEFINED
typedef enum _PAGE_NUMBER
{
START_PAGE,
LANGUAGE_PAGE,
INTRO_PAGE,
WELCOME_PAGE,
LICENSE_PAGE,
INSTALL_INTRO_PAGE,
// SCSI_CONTROLLER_PAGE,
// OEM_DRIVER_PAGE,
REPAIR_INTRO_PAGE,
DEVICE_SETTINGS_PAGE,
COMPUTER_SETTINGS_PAGE,
@ -140,15 +140,12 @@ typedef enum _PAGE_NUMBER
BOOT_LOADER_HARDDISK_MBR_PAGE,
BOOT_LOADER_HARDDISK_VBR_PAGE,
REPAIR_INTRO_PAGE,
SUCCESS_PAGE,
QUIT_PAGE,
FLUSH_PAGE,
REBOOT_PAGE, /* virtual page */
RECOVERY_PAGE, /* virtual page */
REBOOT_PAGE, /* Virtual page */
RECOVERY_PAGE, /* Virtual page */
} PAGE_NUMBER, *PPAGE_NUMBER;
#endif
#define POPUP_WAIT_NONE 0
#define POPUP_WAIT_ANY_KEY 1