From e42602528f1f054a7b71c8c5a3f818aa05561112 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Wed, 15 Jun 2016 17:23:57 +0800 Subject: 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 Cc: Eric Dong Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Eric Dong Reviewed-by: Liming Gao --- .../Application/UiApp/FrontPageCustomizedUiSupport.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c index dc5d1c6c40..da0cff7556 100644 --- a/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c +++ b/MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c @@ -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, -- cgit v1.2.3