Revision: 17334
          http://sourceforge.net/p/edk2/code/17334
Author:   ydong10
Date:     2015-05-06 09:29:39 +0000 (Wed, 06 May 2015)
Log Message:
-----------
MdeModluePkg: Enable refresh opcode to refresh the entire form.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
    trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
    trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h

Modified: trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c        
2015-05-06 09:27:07 UTC (rev 17333)
+++ trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c        
2015-05-06 09:29:39 UTC (rev 17334)
@@ -2479,8 +2479,24 @@
     // 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;
 
     //

Modified: trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c    
2015-05-06 09:27:07 UTC (rev 17333)
+++ trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c    
2015-05-06 09:29:39 UTC (rev 17334)
@@ -178,7 +178,7 @@
 **/
 VOID
 EFIAPI
-RefreshEventNotify(
+RefreshEventNotifyForStatement(
   IN      EFI_EVENT Event,
   IN      VOID      *Context
   )
@@ -190,7 +190,24 @@
   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 @@
 
 **/
 VOID
-CreateRefreshEvent (
+CreateRefreshEventForStatement (
   IN     FORM_BROWSER_STATEMENT        *Statement
   )
 {
@@ -212,7 +229,7 @@
   Status = gBS->CreateEventEx (
                     EVT_NOTIFY_SIGNAL,
                     TPL_CALLBACK,
-                    RefreshEventNotify,
+                    RefreshEventNotifyForStatement,
                     Statement,
                     &Statement->RefreshGuid,
                     &RefreshEvent);
@@ -225,7 +242,40 @@
 }
 
 /**
+  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.
 
   @param DisplayStatement      Pointer to the display Statement data strucure.
@@ -308,7 +358,7 @@
   // Create the refresh event process function.
   //
   if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) {
-    CreateRefreshEvent (Statement);
+    CreateRefreshEventForStatement (Statement);
   }
 
   //
@@ -560,6 +610,16 @@
   }
 
   //
+  // 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) {

Modified: trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
===================================================================
--- trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h   2015-05-06 
09:27:07 UTC (rev 17333)
+++ trunk/edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h   2015-05-06 
09:29:39 UTC (rev 17334)
@@ -406,6 +406,7 @@
 
   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)


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to