X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FSetupBrowserDxe%2FPresentation.c;h=b8c5a3919ef1629a11d8127a3143fd1850efba5c;hb=e6557276f0cf3c114dc881be2478cf724b171e39;hp=aa1fedc7b48a18602d7f0914c396b938ccb8eeff;hpb=40ad4b1a6bd2d17b6bd3f0a14f65392a7b7249a1;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index aa1fedc7b4..b8c5a3919e 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -178,7 +178,7 @@ UpdateStatement ( **/ VOID EFIAPI -RefreshEventNotify( +RefreshEventNotifyForStatement( IN EFI_EVENT Event, IN VOID *Context ) @@ -190,6 +190,23 @@ RefreshEventNotify( gBS->SignalEvent (mValueChangedEvent); } +/** + Refresh the questions within this form. + + @param Event The event which has this function related. + @param Context The input context info related to this event or the status code return to the caller. +**/ +VOID +EFIAPI +RefreshEventNotifyForForm( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + gCurrentSelection->Action = UI_ACTION_REFRESH_FORMSET; + + gBS->SignalEvent (mValueChangedEvent); +} /** Create refresh hook event for statement which has refresh event or interval. @@ -198,7 +215,7 @@ RefreshEventNotify( **/ VOID -CreateRefreshEvent ( +CreateRefreshEventForStatement ( IN FORM_BROWSER_STATEMENT *Statement ) { @@ -212,7 +229,7 @@ CreateRefreshEvent ( Status = gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, - RefreshEventNotify, + RefreshEventNotifyForStatement, Statement, &Statement->RefreshGuid, &RefreshEvent); @@ -224,6 +241,39 @@ CreateRefreshEvent ( InsertTailList(&mRefreshEventList, &EventNode->Link); } +/** + Create refresh hook event for form which has refresh event or interval. + + @param Form The form need to check. + +**/ +VOID +CreateRefreshEventForForm ( + IN FORM_BROWSER_FORM *Form + ) +{ + EFI_STATUS Status; + EFI_EVENT RefreshEvent; + FORM_BROWSER_REFRESH_EVENT_NODE *EventNode; + + // + // If question has refresh guid, create the notify function. + // + Status = gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + RefreshEventNotifyForForm, + Form, + &Form->RefreshGuid, + &RefreshEvent); + ASSERT_EFI_ERROR (Status); + + EventNode = AllocateZeroPool (sizeof (FORM_BROWSER_REFRESH_EVENT_NODE)); + ASSERT (EventNode != NULL); + EventNode->RefreshEvent = RefreshEvent; + InsertTailList(&mRefreshEventList, &EventNode->Link); +} + /** Initialize the Display statement structure data. @@ -308,7 +358,7 @@ InitializeDisplayStatement ( // Create the refresh event process function. // if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) { - CreateRefreshEvent (Statement); + CreateRefreshEventForStatement (Statement); } // @@ -559,6 +609,16 @@ AddStatementToDisplayForm ( InsertTailList(&mRefreshEventList, &EventNode->Link); } + // + // Create the refresh event process function for Form. + // + if (!CompareGuid (&gCurrentSelection->Form->RefreshGuid, &gZeroGuid)) { + CreateRefreshEventForForm (gCurrentSelection->Form); + if (gDisplayFormData.FormRefreshEvent == NULL) { + gDisplayFormData.FormRefreshEvent = mValueChangedEvent; + } + } + // // Update hotkey list field. // @@ -2006,6 +2066,11 @@ ProcessCallBackFunction ( // Status = ValueChangedValidation (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement); if (!EFI_ERROR (Status)) { + // + //check whether the question value changed compared with edit buffer before updating edit buffer + // if changed, set the ValueChanged flag to TRUE,in order to trig the CHANGED callback function + // + IsQuestionValueChanged(gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer); // // According the spec, return value from call back of "changing" and // "retrieve" should update to the question's temp buffer. @@ -2043,6 +2108,11 @@ ProcessCallBackFunction ( // InternalStatus = ValueChangedValidation (gCurrentSelection->FormSet, gCurrentSelection->Form, Statement); if (!EFI_ERROR (InternalStatus)) { + // + //check whether the question value changed compared with edit buffer before updating edit buffer + // if changed, set the ValueChanged flag to TRUE,in order to trig the CHANGED callback function + // + IsQuestionValueChanged(gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithEditBuffer); SetQuestionValue(FormSet, Form, Statement, GetSetValueWithEditBuffer); } } @@ -2377,10 +2447,6 @@ SetupBrowser ( } } - // - // Verify whether question value has checked, update the ValueChanged flag in Question. - // - IsQuestionValueChanged(gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithBuffer); if (!EFI_ERROR (Status) && (Statement->Operand != EFI_IFR_REF_OP) && @@ -2389,6 +2455,11 @@ SetupBrowser ( // Only question value has been changed, browser will trig CHANGED callback. // ProcessCallBackFunction(Selection, Selection->FormSet, Selection->Form, Statement, EFI_BROWSER_ACTION_CHANGED, FALSE); + // + //check whether the question value changed compared with buffer value + //if doesn't change ,set the ValueChanged flag to FALSE ,in order not to display the "configuration changed "information on the screen + // + IsQuestionValueChanged(gCurrentSelection->FormSet, gCurrentSelection->Form, Statement, GetSetValueWithBuffer); } } else { //