When browser was requested to go to another formset, it also needs to update the hiihandle in Selection structure. If not update this handle, later when call function GetIfrBinaryData to get binary ifr data will return failed.

Also add sample code to use it.

Signed-off-by: ydong10
Reviewed-by: lgao4


git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12607 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ydong10
2011-10-31 03:33:55 +00:00
parent 50bdaa0592
commit b2e444aaf7
6 changed files with 182 additions and 39 deletions

View File

@@ -1006,14 +1006,32 @@ FindNextMenu (
CHAR16 NoResponse;
EFI_INPUT_KEY Key;
EFI_STATUS Status;
BROWSER_SETTING_SCOPE Scope;
CurrentMenu = Selection->CurrentMenu;
if (CurrentMenu != NULL && CurrentMenu->Parent != NULL) {
//
// we have a parent, so go to the parent menu
//
if (CompareGuid (&CurrentMenu->FormSetGuid, &CurrentMenu->Parent->FormSetGuid)) {
//
// The parent menu and current menu are in the same formset
//
Selection->Action = UI_ACTION_REFRESH_FORM;
Scope = FormLevel;
} else {
Selection->Action = UI_ACTION_REFRESH_FORMSET;
CopyMem (&Selection->FormSetGuid, &CurrentMenu->Parent->FormSetGuid, sizeof (EFI_GUID));
Selection->Handle = CurrentMenu->Parent->HiiHandle;
Scope = FormSetLevel;
}
//
// Form Level Check whether the data is changed.
//
if (gBrowserSettingScope == FormLevel && Selection->Form->NvUpdateRequired) {
if ((gBrowserSettingScope == FormLevel && Selection->Form->NvUpdateRequired) ||
(gBrowserSettingScope == FormSetLevel && IsNvUpdateRequired(Selection->FormSet) && Scope == FormSetLevel)) {
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
YesResponse = gYesResponse[0];
@@ -1050,26 +1068,15 @@ FindNextMenu (
//
// If the user hits the YesResponse key
//
Status = SubmitForm (Selection->FormSet, Selection->Form, FormLevel);
Status = SubmitForm (Selection->FormSet, Selection->Form, Scope);
} else {
//
// If the user hits the NoResponse key
//
Status = DiscardForm (Selection->FormSet, Selection->Form, FormLevel);
Status = DiscardForm (Selection->FormSet, Selection->Form, Scope);
}
}
//
// we have a parent, so go to the parent menu
//
if (CompareGuid (&CurrentMenu->FormSetGuid, &CurrentMenu->Parent->FormSetGuid)) {
//
// The parent menu and current menu are in the same formset
//
Selection->Action = UI_ACTION_REFRESH_FORM;
} else {
Selection->Action = UI_ACTION_REFRESH_FORMSET;
}
Selection->Statement = NULL;
Selection->FormId = CurrentMenu->Parent->FormId;