Author: hbelusca
Date: Thu Aug 31 18:49:39 2017
New Revision: 75723
URL:
http://svn.reactos.org/svn/reactos?rev=75723&view=rev
Log:
[USETUP]: Adjust some MUI & settings calls, following the commits r75719, r75720 and
r75721.
Modified:
branches/setup_improvements/base/setup/usetup/usetup.c
branches/setup_improvements/base/setup/usetup/usetup.h
Modified: branches/setup_improvements/base/setup/usetup/usetup.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/usetup.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/usetup.c [iso-8859-1] Thu Aug 31
18:49:39 2017
@@ -400,13 +400,13 @@
UpdateKBLayout(VOID)
{
PGENERIC_LIST_ENTRY ListEntry;
- LPCWSTR pszNewLayout;
-
- pszNewLayout = MUIDefaultKeyboardLayout();
+ PCWSTR pszNewLayout;
+
+ pszNewLayout = MUIDefaultKeyboardLayout(SelectedLanguageId);
if (LayoutList == NULL)
{
- LayoutList = CreateKeyboardLayoutList(SetupInf, DefaultKBLayout);
+ LayoutList = CreateKeyboardLayoutList(SetupInf, SelectedLanguageId,
DefaultKBLayout);
if (LayoutList == NULL)
{
/* FIXME: Handle error! */
@@ -463,9 +463,10 @@
}
}
+ SelectedLanguageId = DefaultLanguage;
+ USetupData.LanguageId = 0;
+
/* Load the font */
- USetupData.LanguageId = 0;
- SelectedLanguageId = DefaultLanguage;
SetConsoleCodePage();
UpdateKBLayout();
@@ -551,7 +552,7 @@
{
NewLanguageId =
(PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
- if (SelectedLanguageId != NewLanguageId)
+ if (wcscmp(SelectedLanguageId, NewLanguageId))
{
/* Clear the language page */
MUIClearPage(LANGUAGE_PAGE);
@@ -642,12 +643,15 @@
ComputerList = CreateComputerTypeList(SetupInf);
DisplayList = CreateDisplayDriverList(SetupInf);
KeyboardList = CreateKeyboardDriverList(SetupInf);
- LayoutList = CreateKeyboardLayoutList(SetupInf, DefaultKBLayout);
+
LanguageList = CreateLanguageList(SetupInf, DefaultLanguage);
/* new part */
+ SelectedLanguageId = DefaultLanguage;
wcscpy(SelectedLanguageId, USetupData.LocaleID);
USetupData.LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) &
0xFFFF);
+
+ LayoutList = CreateKeyboardLayoutList(SetupInf, SelectedLanguageId,
DefaultKBLayout);
/* first we hack LanguageList */
ListEntry = GetFirstListEntry(LanguageList);
@@ -1078,7 +1082,7 @@
/* Initialize the keyboard layout list */
if (LayoutList == NULL)
{
- LayoutList = CreateKeyboardLayoutList(SetupInf, DefaultKBLayout);
+ LayoutList = CreateKeyboardLayoutList(SetupInf, SelectedLanguageId,
DefaultKBLayout);
if (LayoutList == NULL)
{
/* FIXME: report error */
@@ -4032,14 +4036,14 @@
/* Add keyboard layouts */
CONSOLE_SetStatusText(MUIGetString(STRING_ADDKBLAYOUTS));
- if (!AddKeyboardLayouts())
+ if (!AddKeyboardLayouts(SelectedLanguageId))
{
MUIDisplayError(ERROR_ADDING_KBLAYOUTS, Ir, POPUP_WAIT_ENTER);
goto Cleanup;
}
/* Set GeoID */
- if (!SetGeoID(MUIGetGeoID()))
+ if (!SetGeoID(MUIGetGeoID(SelectedLanguageId)))
{
MUIDisplayError(ERROR_UPDATE_GEOID, Ir, POPUP_WAIT_ENTER);
goto Cleanup;
@@ -4049,7 +4053,7 @@
{
/* Update keyboard layout settings */
CONSOLE_SetStatusText(MUIGetString(STRING_KEYBOARDSETTINGSUPDATE));
- if (!ProcessKeyboardLayoutRegistry(LayoutList))
+ if (!ProcessKeyboardLayoutRegistry(LayoutList, SelectedLanguageId))
{
MUIDisplayError(ERROR_UPDATE_KBSETTINGS, Ir, POPUP_WAIT_ENTER);
goto Cleanup;
@@ -4058,7 +4062,7 @@
/* Add codepage information to registry */
CONSOLE_SetStatusText(MUIGetString(STRING_CODEPAGEINFOUPDATE));
- if (!AddCodePage())
+ if (!AddCodePage(SelectedLanguageId))
{
MUIDisplayError(ERROR_ADDING_CODEPAGE, Ir, POPUP_WAIT_ENTER);
goto Cleanup;
Modified: branches/setup_improvements/base/setup/usetup/usetup.h
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/u…
==============================================================================
--- branches/setup_improvements/base/setup/usetup/usetup.h [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/usetup/usetup.h [iso-8859-1] Thu Aug 31
18:49:39 2017
@@ -128,4 +128,10 @@
#define POPUP_WAIT_ANY_KEY 1
#define POPUP_WAIT_ENTER 2
+VOID
+PopupError(IN PCCH Text,
+ IN PCCH Status,
+ IN PINPUT_RECORD Ir,
+ IN ULONG WaitEvent);
+
#endif /* _USETUP_PCH_ */