]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Call EFI_BROWSER_ACTION_RETRIEVE for each form instead of only call once before enter...
authorEric Dong <eric.dong@intel.com>
Mon, 14 Apr 2014 10:03:00 +0000 (10:03 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 14 Apr 2014 10:03:00 +0000 (10:03 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming, Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15465 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
MdeModulePkg/Universal/SetupBrowserDxe/Setup.h

index 8f67f86446a3b3bdf7454bbaaa31e209feb6f7cf..8f2816502feb6c474d7bcb3a95f486ed5cc2bbcf 100644 (file)
@@ -25,6 +25,7 @@ UINT32             gBrowserStatus = BROWSER_SUCCESS;
 CHAR16             *gErrorInfo;\r
 UINT16             mCurFakeQestId;\r
 FORM_DISPLAY_ENGINE_FORM gDisplayFormData;\r
+BOOLEAN            mFinishRetrieveCall = FALSE;\r
 \r
 /**\r
   Evaluate all expressions in a Form.\r
@@ -2394,11 +2395,6 @@ SetupBrowser (
     return Status;\r
   }\r
 \r
-  if ((Selection->Handle != mCurrentHiiHandle) ||\r
-      (!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid))) {\r
-    gFinishRetrieveCall = FALSE;\r
-  }\r
-\r
   //\r
   // Initialize current settings of Questions in this FormSet\r
   //\r
@@ -2469,6 +2465,11 @@ SetupBrowser (
     if (((Selection->Handle != mCurrentHiiHandle) ||\r
         (!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||\r
         (Selection->FormId != mCurrentFormId))) {\r
+      //\r
+      // Update Retrieve flag.\r
+      //\r
+      mFinishRetrieveCall = FALSE;\r
+\r
       //\r
       // Keep current form information\r
       //\r
@@ -2477,7 +2478,7 @@ SetupBrowser (
       mCurrentFormId      = Selection->FormId;\r
 \r
       if (ConfigAccess != NULL) {\r
-        Status = ProcessCallBackFunction (Selection, gCurrentSelection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);\r
+        Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);\r
         if (EFI_ERROR (Status)) {\r
           goto Done;\r
         }\r
@@ -2501,18 +2502,27 @@ SetupBrowser (
       goto Done;\r
     }\r
 \r
-    //\r
-    // Finish call RETRIEVE callback for this formset.\r
-    //\r
-    gFinishRetrieveCall = TRUE;\r
+    if (!mFinishRetrieveCall) {\r
+      //\r
+      // Finish call RETRIEVE callback for this form.\r
+      //\r
+      mFinishRetrieveCall = TRUE;\r
 \r
-    //\r
-    // IFR is updated during callback of read value, force to reparse the IFR binary\r
-    //\r
-    if (mHiiPackageListUpdated) {\r
-      Selection->Action = UI_ACTION_REFRESH_FORMSET;\r
-      mHiiPackageListUpdated = FALSE;\r
-      break;\r
+      if (ConfigAccess != NULL) {\r
+        Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_RETRIEVE, FALSE);\r
+        if (EFI_ERROR (Status)) {\r
+          goto Done;\r
+        }\r
+\r
+        //\r
+        // IFR is updated during callback of open form, force to reparse the IFR binary\r
+        //\r
+        if (mHiiPackageListUpdated) {\r
+          Selection->Action = UI_ACTION_REFRESH_FORMSET;\r
+          mHiiPackageListUpdated = FALSE;\r
+          break;\r
+        }\r
+      }\r
     }\r
 \r
     //\r
index 1f8da4237e41155569e81f097813fdc6a134534d..26cbd234c677cf405293f8fdcef2487529fd6dc2 100644 (file)
@@ -48,7 +48,6 @@ LIST_ENTRY      gBrowserFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserFor
 LIST_ENTRY      gBrowserHotKeyList  = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList);\r
 LIST_ENTRY      gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList);\r
 \r
-BOOLEAN               gFinishRetrieveCall;\r
 BOOLEAN               gResetRequired;\r
 BOOLEAN               gExitRequired;\r
 BROWSER_SETTING_SCOPE gBrowserSettingScope = FormSetLevel;\r
@@ -258,11 +257,8 @@ LoadAllHiiFormset (
   EFI_GUID                ZeroGuid;\r
   EFI_STATUS              Status;\r
   FORM_BROWSER_FORMSET    *OldFormset;\r
-  BOOLEAN                 OldRetrieveValue;\r
 \r
   OldFormset = mSystemLevelFormSet;\r
-  OldRetrieveValue = gFinishRetrieveCall;\r
-  gFinishRetrieveCall = FALSE;\r
 \r
   //\r
   // Get all the Hii handles\r
@@ -311,7 +307,6 @@ LoadAllHiiFormset (
   //\r
   FreePool (HiiHandles);\r
 \r
-  gFinishRetrieveCall = OldRetrieveValue;\r
   mSystemLevelFormSet = OldFormset;\r
 }\r
 \r
@@ -370,7 +365,6 @@ SendForm (
   //\r
   SaveBrowserContext ();\r
 \r
-  gFinishRetrieveCall = FALSE;\r
   gResetRequired = FALSE;\r
   gExitRequired  = FALSE;\r
   Status         = EFI_SUCCESS;\r
@@ -3483,8 +3477,6 @@ LoadFormConfig (
   EFI_STATUS                  Status;\r
   LIST_ENTRY                  *Link;\r
   FORM_BROWSER_STATEMENT      *Question;\r
-  UINT8                       *BufferValue;\r
-  UINTN                       StorageWidth;\r
   \r
   Link = GetFirstNode (&Form->StatementListHead);\r
   while (!IsNull (&Form->StatementListHead, Link)) {\r
@@ -3506,38 +3498,6 @@ LoadFormConfig (
       HiiSetString (FormSet->HiiHandle, Question->HiiValue.Value.string, (CHAR16*)Question->BufferValue, NULL);\r
     }\r
 \r
-    //\r
-    // Call the Retrieve call back function for all questions.\r
-    //\r
-    if ((FormSet->ConfigAccess != NULL) && (Selection != NULL) &&\r
-        ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) &&\r
-        !gFinishRetrieveCall) {\r
-      //\r
-      // Check QuestionValue does exist.\r
-      //\r
-      StorageWidth = Question->StorageWidth;\r
-      if (Question->BufferValue != NULL) {\r
-        BufferValue  = Question->BufferValue;\r
-      } else {\r
-        BufferValue = (UINT8 *) &Question->HiiValue.Value;\r
-      }\r
-\r
-      //\r
-      // For efivarstore storage, initial question value first.\r
-      //\r
-      if ((Question->Storage != NULL) && (Question->Storage->Type == EFI_HII_VARSTORE_EFI_VARIABLE)) {\r
-        Status = gRT->GetVariable (\r
-                         Question->VariableName,\r
-                         &Question->Storage->Guid,\r
-                         NULL,\r
-                         &StorageWidth,\r
-                         BufferValue\r
-                         );\r
-      }\r
-\r
-      Status = ProcessCallBackFunction(Selection, FormSet, Form, Question, EFI_BROWSER_ACTION_RETRIEVE, TRUE);\r
-    }\r
-\r
     Link = GetNextNode (&Form->StatementListHead, Link);\r
   }\r
 \r
index b47c402c9ee102e76e0b32025c36865a5cdbae64..44094efb2961981e72ed4525ee30b98c4eb8c228 100644 (file)
@@ -546,7 +546,6 @@ extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;
 \r
 extern BOOLEAN               gResetRequired;\r
 extern BOOLEAN               gExitRequired;\r
-extern BOOLEAN               gFinishRetrieveCall;\r
 extern LIST_ENTRY            gBrowserFormSetList;\r
 extern LIST_ENTRY            gBrowserHotKeyList;\r
 extern BROWSER_SETTING_SCOPE gBrowserSettingScope;\r