summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-06-15 17:23:57 +0800
committerStar Zeng <star.zeng@intel.com>2016-06-21 12:34:46 +0800
commite42602528f1f054a7b71c8c5a3f818aa05561112 (patch)
tree7e15854190b41ecce2d3b4fd81cfe235f7dc3ce3 /MdeModulePkg/Application
parent7de6db5f558cfde0013a567dd9088cb2942d321f (diff)
downloadedk2-e42602528f1f054a7b71c8c5a3f818aa05561112.tar.gz
edk2-e42602528f1f054a7b71c8c5a3f818aa05561112.tar.bz2
edk2-e42602528f1f054a7b71c8c5a3f818aa05561112.zip
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>
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c13
1 files changed, 13 insertions, 0 deletions
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,