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
This commit is contained in:
Eric Dong
2014-07-08 06:04:53 +00:00
committed by ydong10
parent a6908c99aa
commit 4d4deaaccb
9 changed files with 983 additions and 262 deletions

View File

@@ -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;
}