summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2014-07-08 06:04:53 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2014-07-08 06:04:53 +0000
commit4d4deaaccb9b39106775d260ea0397c1991b0f04 (patch)
tree382a366de72509542fbdb705771e49f8a752b215 /MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
parenta6908c99aa48551616c25cf594862d3629ce91c0 (diff)
downloadedk2-platforms-4d4deaaccb9b39106775d260ea0397c1991b0f04.tar.xz
Refine the save action for the browser.
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@15639 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index f06b8a20d4..99a30bcfbf 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -905,8 +905,6 @@ ProcessAction (
IN UINT16 DefaultId
)
{
- EFI_STATUS Status;
-
//
// This is caused by use press ESC, and it should not combine with other action type.
//
@@ -928,10 +926,7 @@ ProcessAction (
}
if ((Action & BROWSER_ACTION_SUBMIT) == BROWSER_ACTION_SUBMIT) {
- Status = SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
- if (EFI_ERROR (Status)) {
- PopupErrorMessage(BROWSER_SUBMIT_FAIL, NULL, NULL);
- }
+ SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
}
if ((Action & BROWSER_ACTION_RESET) == BROWSER_ACTION_RESET) {
@@ -1186,7 +1181,8 @@ ProcessChangedData (
IN BROWSER_SETTING_SCOPE Scope
)
{
- BOOLEAN RetValue;
+ BOOLEAN RetValue;
+ EFI_STATUS Status;
RetValue = TRUE;
switch (mFormDisplay->ConfirmDataChange()) {
@@ -1195,7 +1191,10 @@ ProcessChangedData (
break;
case BROWSER_ACTION_SUBMIT:
- SubmitForm (Selection->FormSet, Selection->Form, Scope);
+ Status = SubmitForm (Selection->FormSet, Selection->Form, Scope);
+ if (EFI_ERROR (Status)) {
+ RetValue = FALSE;
+ }
break;
case BROWSER_ACTION_NONE:
@@ -1306,7 +1305,7 @@ ProcessGotoOpCode (
//
// Not found the EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL protocol.
//
- PopupErrorMessage(BROWSER_PROTOCOL_NOT_FOUND, NULL, NULL);
+ PopupErrorMessage(BROWSER_PROTOCOL_NOT_FOUND, NULL, NULL, NULL);
FreePool (StringPtr);
return Status;
}
@@ -1383,7 +1382,7 @@ ProcessGotoOpCode (
//
// Form is suppressed.
//
- PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL);
+ PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL, NULL);
return EFI_SUCCESS;
}
}
@@ -1630,6 +1629,12 @@ DisplayForm (
gCurrentSelection->FormId, gCurrentSelection->QuestionId);
ASSERT (CurrentMenu != NULL);
}
+
+ //
+ // Back up the form view history data for this form.
+ //
+ UiCopyMenuList(&gCurrentSelection->Form->FormViewListHead, &mPrivateData.FormBrowserEx2.FormViewHistoryHead);
+
gCurrentSelection->CurrentMenu = CurrentMenu;
//
@@ -1660,6 +1665,7 @@ DisplayForm (
// and an valid value has return.
// EFI_SUCCESS: Success shows form and get user input in UserInput paramenter.
//
+ ASSERT (gDisplayFormData.BrowserStatus == BROWSER_SUCCESS);
Status = mFormDisplay->FormDisplay (&gDisplayFormData, &UserInput);
if (EFI_ERROR (Status) && Status != EFI_NOT_FOUND) {
FreeDisplayFormData();
@@ -1849,7 +1855,7 @@ FindNextMenu (
//
if ((gBrowserSettingScope == FormLevel && IsNvUpdateRequiredForForm (Selection->Form)) ||
(gBrowserSettingScope == FormSetLevel && IsNvUpdateRequiredForFormSet(Selection->FormSet) && Scope == FormSetLevel)) {
- if (!ProcessChangedData(Selection, Scope)) {
+ if (!ProcessChangedData(Selection, gBrowserSettingScope)) {
return FALSE;
}
}
@@ -2309,7 +2315,7 @@ SetupBrowser (
//
// Form is suppressed.
//
- PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL);
+ PopupErrorMessage(BROWSER_FORM_SUPPRESS, NULL, NULL, NULL);
Status = EFI_NOT_FOUND;
goto Done;
}