summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2013-09-25 12:40:31 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2013-09-25 12:40:31 +0000
commit798e4d22c4db5b710ca5fa98f5ee47aeeae7f9ac (patch)
tree8a139f844a881472811b0a773298f9e53c50bbd6 /MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
parentb1362258ef660d72471abf3dd6dab3835a01b0f7 (diff)
downloadedk2-798e4d22c4db5b710ca5fa98f5ee47aeeae7f9ac.tar.gz
edk2-798e4d22c4db5b710ca5fa98f5ee47aeeae7f9ac.tar.bz2
edk2-798e4d22c4db5b710ca5fa98f5ee47aeeae7f9ac.zip
Use RETRIEVE instead of CHANGING for refresh question.
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@14727 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 5318290144..8e6dff0dd4 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -160,7 +160,7 @@ UpdateStatement (
//
// Question value may be changed, need invoke its Callback()
//
- ProcessCallBackFunction (gCurrentSelection, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);
+ ProcessCallBackFunction (gCurrentSelection, gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, EFI_BROWSER_ACTION_RETRIEVE, FALSE);
if (mHiiPackageListUpdated) {
//
@@ -1364,7 +1364,7 @@ ProcessGotoOpCode (
//
// Check whether the device path string is a valid string.
//
- if (Statement->HiiValue.Value.ref.DevicePath != 0 && StringPtr != NULL) {
+ if (Statement->HiiValue.Value.ref.DevicePath != 0 && StringPtr != NULL && StringPtr[0] != L'\0') {
if (Selection->Form->ModalForm) {
return Status;
}
@@ -2038,6 +2038,8 @@ FindNextMenu (
about the Selection, form and formset to be displayed.
On output, Selection return the screen item that is selected
by user.
+ @param FormSet The formset this question belong to.
+ @param Form The form this question belong to.
@param Question The Question which need to call.
@param Action The action request.
@param SkipSaveOrDiscard Whether skip save or discard action.
@@ -2048,6 +2050,8 @@ FindNextMenu (
EFI_STATUS
ProcessCallBackFunction (
IN OUT UI_MENU_SELECTION *Selection,
+ IN FORM_BROWSER_FORMSET *FormSet,
+ IN FORM_BROWSER_FORM *Form,
IN FORM_BROWSER_STATEMENT *Question,
IN EFI_BROWSER_ACTION Action,
IN BOOLEAN SkipSaveOrDiscard
@@ -2067,7 +2071,7 @@ ProcessCallBackFunction (
EFI_IFR_TYPE_VALUE BackUpValue;
UINT8 *BackUpBuffer;
- ConfigAccess = Selection->FormSet->ConfigAccess;
+ ConfigAccess = FormSet->ConfigAccess;
SubmitFormIsRequired = FALSE;
SettingLevel = FormSetLevel;
DiscardFormIsRequired = FALSE;
@@ -2080,10 +2084,10 @@ ProcessCallBackFunction (
return EFI_SUCCESS;
}
- Link = GetFirstNode (&Selection->Form->StatementListHead);
- while (!IsNull (&Selection->Form->StatementListHead, Link)) {
+ Link = GetFirstNode (&Form->StatementListHead);
+ while (!IsNull (&Form->StatementListHead, Link)) {
Statement = FORM_BROWSER_STATEMENT_FROM_LINK (Link);
- Link = GetNextNode (&Selection->Form->StatementListHead, Link);
+ Link = GetNextNode (&Form->StatementListHead, Link);
//
// if Question != NULL, only process the question. Else, process all question in this form.
@@ -2100,7 +2104,7 @@ ProcessCallBackFunction (
// Check whether Statement is disabled.
//
if (Statement->Expression != NULL) {
- if (EvaluateExpressionList(Statement->Expression, TRUE, Selection->FormSet, Selection->Form) == ExpressDisable) {
+ if (EvaluateExpressionList(Statement->Expression, TRUE, FormSet, Form) == ExpressDisable) {
continue;
}
}
@@ -2188,7 +2192,7 @@ ProcessCallBackFunction (
// "retrieve" should update to the question's temp buffer.
//
if (Action == EFI_BROWSER_ACTION_CHANGING || Action == EFI_BROWSER_ACTION_RETRIEVE) {
- SetQuestionValue(Selection->FormSet, Selection->Form, Statement, GetSetValueWithEditBuffer);
+ SetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer);
}
} else {
//
@@ -2203,7 +2207,7 @@ ProcessCallBackFunction (
CopyMem (&HiiValue->Value, &BackUpValue, sizeof (EFI_IFR_TYPE_VALUE));
}
- SetQuestionValue(Selection->FormSet, Selection->Form, Statement, GetSetValueWithEditBuffer);
+ SetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer);
}
//
@@ -2212,7 +2216,7 @@ ProcessCallBackFunction (
//
if ((Action == EFI_BROWSER_ACTION_CHANGING && Status != EFI_UNSUPPORTED) ||
Action == EFI_BROWSER_ACTION_RETRIEVE) {
- GetQuestionValue(Selection->FormSet, Selection->Form, Statement, GetSetValueWithEditBuffer);
+ GetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer);
}
if (Status == EFI_UNSUPPORTED) {
@@ -2229,11 +2233,11 @@ ProcessCallBackFunction (
}
if (SubmitFormIsRequired && !SkipSaveOrDiscard) {
- SubmitForm (Selection->FormSet, Selection->Form, SettingLevel);
+ SubmitForm (FormSet, Form, SettingLevel);
}
if (DiscardFormIsRequired && !SkipSaveOrDiscard) {
- DiscardForm (Selection->FormSet, Selection->Form, SettingLevel);
+ DiscardForm (FormSet, Form, SettingLevel);
}
if (NeedExit) {
@@ -2335,6 +2339,11 @@ SetupBrowser (
return Status;
}
+ if ((Selection->Handle != mCurrentHiiHandle) ||
+ (!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid))) {
+ gFinishRetrieveCall = FALSE;
+ }
+
//
// Initialize current settings of Questions in this FormSet
//
@@ -2413,7 +2422,7 @@ SetupBrowser (
CopyGuid (&mCurrentFormSetGuid, &Selection->FormSetGuid);
mCurrentFormId = Selection->FormId;
- Status = ProcessCallBackFunction (Selection, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);
+ Status = ProcessCallBackFunction (Selection, gCurrentSelection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_OPEN, FALSE);
if (EFI_ERROR (Status)) {
goto Done;
}
@@ -2437,6 +2446,11 @@ SetupBrowser (
}
//
+ // Finish call RETRIEVE callback for this formset.
+ //
+ gFinishRetrieveCall = TRUE;
+
+ //
// IFR is updated during callback of read value, force to reparse the IFR binary
//
if (mHiiPackageListUpdated) {
@@ -2461,7 +2475,7 @@ SetupBrowser (
if ((ConfigAccess != NULL) &&
((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) &&
(Statement->Operand != EFI_IFR_PASSWORD_OP)) {
- Status = ProcessCallBackFunction(Selection, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);
+ Status = ProcessCallBackFunction(Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGING, FALSE);
if (Statement->Operand == EFI_IFR_REF_OP) {
//
// Process dynamic update ref opcode.
@@ -2483,7 +2497,7 @@ SetupBrowser (
}
if (!EFI_ERROR (Status) && Statement->Operand != EFI_IFR_REF_OP) {
- ProcessCallBackFunction(Selection, Statement, EFI_BROWSER_ACTION_CHANGED, FALSE);
+ ProcessCallBackFunction(Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGED, FALSE);
}
} else if (Statement->Operand != EFI_IFR_PASSWORD_OP) {
SetQuestionValue (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer);
@@ -2521,7 +2535,7 @@ SetupBrowser (
(!CompareGuid (&Selection->FormSetGuid, &mCurrentFormSetGuid)) ||
(Selection->FormId != mCurrentFormId))) {
- Status = ProcessCallBackFunction (Selection, NULL, EFI_BROWSER_ACTION_FORM_CLOSE, FALSE);
+ Status = ProcessCallBackFunction (Selection, Selection->FormSet, Selection->Form, NULL, EFI_BROWSER_ACTION_FORM_CLOSE, FALSE);
if (EFI_ERROR (Status)) {
goto Done;
}