diff options
author | Eric Dong <eric.dong@intel.com> | 2015-05-06 09:29:39 +0000 |
---|---|---|
committer | ydong10 <ydong10@Edk2> | 2015-05-06 09:29:39 +0000 |
commit | 790447b2a515cdce5b13b8bf6e49785aaa58723b (patch) | |
tree | f1560570703be404c2698163ffffb7d6a12f9f62 /MdeModulePkg | |
parent | e2a5feb9d6c468c0ddb0caed2581d10585819db5 (diff) | |
download | edk2-790447b2a515cdce5b13b8bf6e49785aaa58723b.zip edk2-790447b2a515cdce5b13b8bf6e49785aaa58723b.tar.gz edk2-790447b2a515cdce5b13b8bf6e49785aaa58723b.tar.bz2 |
MdeModluePkg: Enable refresh opcode to refresh the entire form.
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@17334 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c | 20 | ||||
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 68 | ||||
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 1 |
3 files changed, 83 insertions, 6 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c index 0e9c823..a4a2478 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c @@ -2479,8 +2479,24 @@ ParseOpCodes ( // Refresh guid.
//
case EFI_IFR_REFRESH_ID_OP:
- ASSERT (ParentStatement != NULL);
- CopyMem (&ParentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
+ //
+ // Get ScopeOpcode from top of stack
+ //
+ PopScope (&ScopeOpCode);
+ PushScope (ScopeOpCode);
+
+ switch (ScopeOpCode) {
+ case EFI_IFR_FORM_OP:
+ case EFI_IFR_FORM_MAP_OP:
+ ASSERT (CurrentForm != NULL);
+ CopyMem (&CurrentForm->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
+ break;
+
+ default:
+ ASSERT (ParentStatement != NULL);
+ CopyMem (&ParentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
+ break;
+ }
break;
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index aa1fedc..c86fdf5 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);
@@ -225,6 +242,39 @@ CreateRefreshEvent ( }
/**
+ Create refresh hook event for statement which has refresh event or interval.
+
+ @param Statement The statement 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);
}
//
@@ -560,6 +610,16 @@ AddStatementToDisplayForm ( }
//
+ // 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.
//
if (gBrowserSettingScope == SystemLevel || FormEditable) {
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h index 9a300fa..0a935e8 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h @@ -406,6 +406,7 @@ typedef struct { BOOLEAN ModalForm; // Whether this is a modal form.
BOOLEAN Locked; // Whether this form is locked.
+ EFI_GUID RefreshGuid; // Form refresh event guid.
LIST_ENTRY FormViewListHead; // List of type FORMID_INFO is Browser View Form History List.
LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)
|