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:
Dandan Bi 2016-06-15 17:23:57 +08:00 committed by Star Zeng
parent 7de6db5f55
commit e42602528f
1 changed files with 13 additions and 0 deletions

View File

@ -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,