mirror of
https://github.com/reactos/reactos.git
synced 2025-02-28 11:25:13 +00:00
MUI extra modifs
This commit is contained in:
parent
17c4299ff8
commit
9e4ab20783
1 changed files with 70 additions and 8 deletions
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include "reactos.h"
|
||||
#include <winnls.h> // For GetUserDefaultLCID()
|
||||
|
||||
#define NTOS_MODE_USER
|
||||
#include <ndk/obfuncs.h>
|
||||
|
@ -2346,10 +2347,12 @@ RestartDlgProc(
|
|||
BOOL LoadSetupData(
|
||||
IN OUT PSETUPDATA pSetupData)
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
LANGID NewLanguageId = pSetupData->USetupData.LocaleID;
|
||||
|
||||
pSetupData->PartitionList = CreatePartitionList();
|
||||
if (!pSetupData->PartitionList)
|
||||
{
|
||||
DPRINT1("Could not enumerate available disks; failing installation\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pSetupData->NtOsInstallsList = CreateNTOSInstallationsList(pSetupData->PartitionList);
|
||||
if (!pSetupData->NtOsInstallsList)
|
||||
|
@ -2361,16 +2364,75 @@ BOOL LoadSetupData(
|
|||
pSetupData->DisplayList = CreateDisplayDriverList(pSetupData->USetupData.SetupInf);
|
||||
pSetupData->KeyboardList = CreateKeyboardDriverList(pSetupData->USetupData.SetupInf);
|
||||
|
||||
pSetupData->LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, &NewLanguageId);
|
||||
pSetupData->LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, pSetupData->DefaultLanguage);
|
||||
|
||||
/* If not unattended, overwrite language and locale with
|
||||
* the current ones of the running ReactOS instance */
|
||||
if (!IsUnattendedSetup)
|
||||
{
|
||||
LCID LocaleID = GetUserDefaultLCID();
|
||||
|
||||
StringCchPrintfW(pSetupData->DefaultLanguage,
|
||||
_countof(pSetupData->DefaultLanguage),
|
||||
L"%08lx", LocaleID);
|
||||
|
||||
StringCchPrintfW(pSetupData->USetupData.LocaleID,
|
||||
_countof(pSetupData->USetupData.LocaleID),
|
||||
L"%08lx", LocaleID);
|
||||
}
|
||||
|
||||
/* new part */
|
||||
pSetupData->USetupData.LocaleID = (LCID)NewLanguageId;
|
||||
pSetupData->SelectedLanguageId = pSetupData->DefaultLanguage;
|
||||
wcscpy(pSetupData->DefaultLanguage, pSetupData->USetupData.LocaleID); // FIXME: In principle, only when unattended.
|
||||
pSetupData->USetupData.LanguageId = (LANGID)(wcstol(pSetupData->SelectedLanguageId, NULL, 16) & 0xFFFF);
|
||||
|
||||
pSetupData->LayoutList = CreateKeyboardLayoutList(pSetupData->USetupData.SetupInf,
|
||||
LANGIDFROMLCID(pSetupData->USetupData.LocaleID),
|
||||
&pSetupData->USetupData.LayoutId);
|
||||
pSetupData->SelectedLanguageId,
|
||||
pSetupData->DefaultKBLayout);
|
||||
|
||||
return ret;
|
||||
/* If not unattended, overwrite keyboard layout with
|
||||
* the current one of the running ReactOS instance */
|
||||
if (!IsUnattendedSetup)
|
||||
{
|
||||
C_ASSERT(_countof(pSetupData->DefaultKBLayout) >= KL_NAMELENGTH);
|
||||
/* If the call fails, keep the default already stored in the buffer */
|
||||
GetKeyboardLayoutNameW(pSetupData->DefaultKBLayout);
|
||||
}
|
||||
|
||||
/* Change the default entries in the language and keyboard layout lists */
|
||||
{
|
||||
PGENERIC_LIST LanguageList = pSetupData->LanguageList;
|
||||
PGENERIC_LIST LayoutList = pSetupData->LayoutList;
|
||||
PGENERIC_LIST_ENTRY ListEntry;
|
||||
|
||||
/* Search for default language */
|
||||
for (ListEntry = GetFirstListEntry(LanguageList); ListEntry;
|
||||
ListEntry = GetNextListEntry(ListEntry))
|
||||
{
|
||||
PCWSTR LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
|
||||
if (!wcsicmp(pSetupData->DefaultLanguage, LocaleId))
|
||||
{
|
||||
DPRINT("found %S in LanguageList\n", LocaleId);
|
||||
SetCurrentListEntry(LanguageList, ListEntry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Search for default layout */
|
||||
for (ListEntry = GetFirstListEntry(LayoutList); ListEntry;
|
||||
ListEntry = GetNextListEntry(ListEntry))
|
||||
{
|
||||
PCWSTR pszLayoutId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
|
||||
if (!wcsicmp(pSetupData->DefaultKBLayout, pszLayoutId))
|
||||
{
|
||||
DPRINT("Found %S in LayoutList\n", pszLayoutId);
|
||||
SetCurrentListEntry(LayoutList, ListEntry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
Loading…
Reference in a new issue