mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/UiApp: Retrieve the value of language menu
In current UI code, we use oneof opcode without storage for language menu. If we change the language form A->B, then go to another form and then go back to the front page, the language menu always shows A. Now we fix this issue by retrieving the value of oneof opcode(language menu) when display it. Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
7de6db5f55
commit
e42602528f
|
@ -56,6 +56,7 @@ CHAR8 *gLanguageString;
|
|||
EFI_STRING_ID *gLanguageToken;
|
||||
UI_HII_DRIVER_INSTANCE *gHiiDriverList;
|
||||
extern EFI_HII_HANDLE gStringPackHandle;
|
||||
UINT8 gCurrentLanguageIndex;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -130,6 +131,7 @@ LanguageChangeHandler (
|
|||
GetNextLanguage (&LangCode, Lang);
|
||||
|
||||
if (Index == Value->u8) {
|
||||
gCurrentLanguageIndex = Value->u8;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -190,6 +192,16 @@ UiSupportLibCallbackHandler (
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (Action == EFI_BROWSER_ACTION_RETRIEVE) {
|
||||
if (QuestionId == FRONT_PAGE_KEY_LANGUAGE) {
|
||||
Value->u8 = gCurrentLanguageIndex;
|
||||
*Status = EFI_SUCCESS;
|
||||
} else {
|
||||
*Status = EFI_UNSUPPORTED;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (Action != EFI_BROWSER_ACTION_CHANGED) {
|
||||
//
|
||||
// Do nothing for other UEFI Action. Only do call back when data is changed.
|
||||
|
@ -347,6 +359,7 @@ UiCreateLanguageMenu (
|
|||
EFI_IFR_NUMERIC_SIZE_1,
|
||||
(UINT8) OptionCount
|
||||
);
|
||||
gCurrentLanguageIndex = (UINT8) OptionCount;
|
||||
} else {
|
||||
HiiCreateOneOfOptionOpCode (
|
||||
OptionsOpCodeHandle,
|
||||
|
|
Loading…
Reference in New Issue