]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UiApp: Retrieve the value of language menu
authorDandan Bi <dandan.bi@intel.com>
Wed, 15 Jun 2016 09:23:57 +0000 (17:23 +0800)
committerStar Zeng <star.zeng@intel.com>
Tue, 21 Jun 2016 04:34:46 +0000 (12:34 +0800)
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>
MdeModulePkg/Application/UiApp/FrontPageCustomizedUiSupport.c

index dc5d1c6c409bd5ce0905fe6c3f1fdb7f54389b09..da0cff7556c84f0e9e2a164637fb049f1229caa3 100644 (file)
@@ -56,6 +56,7 @@ CHAR8                        *gLanguageString;
 EFI_STRING_ID                *gLanguageToken;\r
 UI_HII_DRIVER_INSTANCE       *gHiiDriverList;\r
 extern EFI_HII_HANDLE        gStringPackHandle;\r
+UINT8                        gCurrentLanguageIndex;\r
 \r
 \r
 /**\r
@@ -130,6 +131,7 @@ LanguageChangeHandler (
     GetNextLanguage (&LangCode, Lang);\r
 \r
     if (Index == Value->u8) {\r
+      gCurrentLanguageIndex = Value->u8;\r
       break;\r
     }\r
 \r
@@ -190,6 +192,16 @@ UiSupportLibCallbackHandler (
     return FALSE;\r
   }\r
 \r
+  if (Action == EFI_BROWSER_ACTION_RETRIEVE) {\r
+    if (QuestionId == FRONT_PAGE_KEY_LANGUAGE) {\r
+      Value->u8 = gCurrentLanguageIndex;\r
+      *Status = EFI_SUCCESS;\r
+    } else {\r
+      *Status = EFI_UNSUPPORTED;\r
+    }\r
+    return TRUE;\r
+  }\r
+\r
   if (Action != EFI_BROWSER_ACTION_CHANGED) {\r
     //\r
     // Do nothing for other UEFI Action. Only do call back when data is changed.\r
@@ -347,6 +359,7 @@ UiCreateLanguageMenu (
         EFI_IFR_NUMERIC_SIZE_1,\r
         (UINT8) OptionCount\r
         );\r
+      gCurrentLanguageIndex = (UINT8) OptionCount;\r
     } else {\r
       HiiCreateOneOfOptionOpCode (\r
         OptionsOpCodeHandle,\r