]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
Refine the save action for the browser.
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Presentation.c
index f06b8a20d4f1e1485f70a638e133bc49cbbefb2b..99a30bcfbfd2ee49692c4ef953dd790f018c3b8c 100644 (file)
@@ -905,8 +905,6 @@ ProcessAction (
   IN UINT16        DefaultId\r
   )\r
 {\r
-  EFI_STATUS    Status;\r
-\r
   //\r
   // This is caused by use press ESC, and it should not combine with other action type.\r
   //\r
@@ -928,10 +926,7 @@ ProcessAction (
   }\r
 \r
   if ((Action & BROWSER_ACTION_SUBMIT) == BROWSER_ACTION_SUBMIT) {\r
-    Status = SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);\r
-    if (EFI_ERROR (Status)) {\r
-      PopupErrorMessage(BROWSER_SUBMIT_FAIL, NULL, NULL);\r
-    }\r
+    SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);\r
   }\r
 \r
   if ((Action & BROWSER_ACTION_RESET) == BROWSER_ACTION_RESET) {\r
@@ -1186,7 +1181,8 @@ ProcessChangedData (
   IN     BROWSER_SETTING_SCOPE   Scope\r
   )\r
 {\r
-  BOOLEAN  RetValue;\r
+  BOOLEAN    RetValue;\r
+  EFI_STATUS Status;\r
 \r
   RetValue = TRUE;\r
   switch (mFormDisplay->ConfirmDataChange()) {\r
@@ -1195,7 +1191,10 @@ ProcessChangedData (
       break;\r
   \r
     case BROWSER_ACTION_SUBMIT:\r
-      SubmitForm (Selection->FormSet, Selection->Form, Scope);\r
+      Status = SubmitForm (Selection->FormSet, Selection->Form, Scope);\r
+      if (EFI_ERROR (Status)) {\r
+        RetValue = FALSE;\r
+      }\r
       break;\r
 \r
     case BROWSER_ACTION_NONE:\r
@@ -1306,7 +1305,7 @@ ProcessGotoOpCode (
       //\r
       // Not found the EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL protocol.\r
       //\r
-      PopupErrorMessage(BROWSER_PROTOCOL_NOT_FOUND, NULL, NULL);\r
+      PopupErrorMessage(BROWSER_PROTOCOL_NOT_FOUND, NULL, NULL, NULL);\r
       FreePool (StringPtr);\r
       return Status;\r
     }\r
@@ -1383,7 +1382,7 @@ ProcessGotoOpCode (
         //\r
         // Form is suppressed. \r
         //\r
-        PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL);\r
+        PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL, NULL);\r
         return EFI_SUCCESS;\r
       }\r
     }\r
@@ -1630,6 +1629,12 @@ DisplayForm (
                                  gCurrentSelection->FormId, gCurrentSelection->QuestionId);\r
     ASSERT (CurrentMenu != NULL);\r
   }\r
+\r
+  //\r
+  // Back up the form view history data for this form.\r
+  //\r
+  UiCopyMenuList(&gCurrentSelection->Form->FormViewListHead, &mPrivateData.FormBrowserEx2.FormViewHistoryHead);\r
+\r
   gCurrentSelection->CurrentMenu = CurrentMenu;\r
 \r
   //\r
@@ -1660,6 +1665,7 @@ DisplayForm (
   //                        and an valid value has return.\r
   // EFI_SUCCESS:           Success shows form and get user input in UserInput paramenter.\r
   //\r
+  ASSERT (gDisplayFormData.BrowserStatus == BROWSER_SUCCESS);\r
   Status = mFormDisplay->FormDisplay (&gDisplayFormData, &UserInput);\r
   if (EFI_ERROR (Status) && Status != EFI_NOT_FOUND) {\r
     FreeDisplayFormData();\r
@@ -1849,7 +1855,7 @@ FindNextMenu (
   //\r
   if ((gBrowserSettingScope == FormLevel && IsNvUpdateRequiredForForm (Selection->Form)) ||\r
       (gBrowserSettingScope == FormSetLevel && IsNvUpdateRequiredForFormSet(Selection->FormSet) && Scope == FormSetLevel)) {\r
-    if (!ProcessChangedData(Selection, Scope)) {\r
+    if (!ProcessChangedData(Selection, gBrowserSettingScope)) {\r
       return FALSE;\r
     }\r
   }\r
@@ -2309,7 +2315,7 @@ SetupBrowser (
         //\r
         // Form is suppressed. \r
         //\r
-        PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL);\r
+        PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL, NULL);\r
         Status = EFI_NOT_FOUND;\r
         goto Done;\r
       }\r