diff options
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Ui.c | 129 |
1 files changed, 65 insertions, 64 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c index 1cd8a1a795..4609bab86c 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c @@ -1910,70 +1910,6 @@ UiDisplayMenu ( Temp = 0;
Row = OriginalRow;
- //
- // If Question has refresh guid, register the op-code.
- //
- if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) {
- if (gMenuEventGuidRefreshHead == NULL) {
- MenuUpdateEntry = AllocateZeroPool (sizeof (MENU_REFRESH_ENTRY));
- gMenuEventGuidRefreshHead = MenuUpdateEntry;
- } else {
- MenuUpdateEntry = gMenuEventGuidRefreshHead;
- while (MenuUpdateEntry->Next != NULL) {
- MenuUpdateEntry = MenuUpdateEntry->Next;
- }
- MenuUpdateEntry->Next = AllocateZeroPool (sizeof (MENU_REFRESH_ENTRY));
- MenuUpdateEntry = MenuUpdateEntry->Next;
- }
- ASSERT (MenuUpdateEntry != NULL);
- Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_NOTIFY, RefreshQuestionNotify, MenuUpdateEntry, &Statement->RefreshGuid, &MenuUpdateEntry->Event);
- ASSERT (!EFI_ERROR (Status));
- MenuUpdateEntry->MenuOption = MenuOption;
- MenuUpdateEntry->Selection = Selection;
- MenuUpdateEntry->CurrentColumn = MenuOption->OptCol;
- MenuUpdateEntry->CurrentRow = MenuOption->Row;
- if (MenuOption->GrayOut) {
- MenuUpdateEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND;
- } else {
- MenuUpdateEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;
- }
- }
-
- //
- // If Question request refresh, register the op-code
- //
- if (Statement->RefreshInterval != 0) {
- //
- // Menu will be refreshed at minimal interval of all Questions
- // which have refresh request
- //
- if (MinRefreshInterval == 0 || Statement->RefreshInterval < MinRefreshInterval) {
- MinRefreshInterval = Statement->RefreshInterval;
- }
-
- if (gMenuRefreshHead == NULL) {
- MenuRefreshEntry = AllocateZeroPool (sizeof (MENU_REFRESH_ENTRY));
- gMenuRefreshHead = MenuRefreshEntry;
- } else {
- MenuRefreshEntry = gMenuRefreshHead;
- while (MenuRefreshEntry->Next != NULL) {
- MenuRefreshEntry = MenuRefreshEntry->Next;
- }
- MenuRefreshEntry->Next = AllocateZeroPool (sizeof (MENU_REFRESH_ENTRY));
- MenuRefreshEntry = MenuRefreshEntry->Next;
- }
- ASSERT (MenuRefreshEntry != NULL);
- MenuRefreshEntry->MenuOption = MenuOption;
- MenuRefreshEntry->Selection = Selection;
- MenuRefreshEntry->CurrentColumn = MenuOption->OptCol;
- MenuRefreshEntry->CurrentRow = MenuOption->Row;
- if (MenuOption->GrayOut) {
- MenuRefreshEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND;
- } else {
- MenuRefreshEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;
- }
- }
-
Status = ProcessOptions (Selection, MenuOption, FALSE, &OptionString);
if (EFI_ERROR (Status)) {
//
@@ -2039,6 +1975,71 @@ UiDisplayMenu ( FreePool (OptionString);
}
+
+ //
+ // If Question has refresh guid, register the op-code.
+ //
+ if (!CompareGuid (&Statement->RefreshGuid, &gZeroGuid)) {
+ if (gMenuEventGuidRefreshHead == NULL) {
+ MenuUpdateEntry = AllocateZeroPool (sizeof (MENU_REFRESH_ENTRY));
+ gMenuEventGuidRefreshHead = MenuUpdateEntry;
+ } else {
+ MenuUpdateEntry = gMenuEventGuidRefreshHead;
+ while (MenuUpdateEntry->Next != NULL) {
+ MenuUpdateEntry = MenuUpdateEntry->Next;
+ }
+ MenuUpdateEntry->Next = AllocateZeroPool (sizeof (MENU_REFRESH_ENTRY));
+ MenuUpdateEntry = MenuUpdateEntry->Next;
+ }
+ ASSERT (MenuUpdateEntry != NULL);
+ Status = gBS->CreateEventEx (EVT_NOTIFY_SIGNAL, TPL_NOTIFY, RefreshQuestionNotify, MenuUpdateEntry, &Statement->RefreshGuid, &MenuUpdateEntry->Event);
+ ASSERT (!EFI_ERROR (Status));
+ MenuUpdateEntry->MenuOption = MenuOption;
+ MenuUpdateEntry->Selection = Selection;
+ MenuUpdateEntry->CurrentColumn = MenuOption->OptCol;
+ MenuUpdateEntry->CurrentRow = MenuOption->Row;
+ if (MenuOption->GrayOut) {
+ MenuUpdateEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND;
+ } else {
+ MenuUpdateEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;
+ }
+ }
+
+ //
+ // If Question request refresh, register the op-code
+ //
+ if (Statement->RefreshInterval != 0) {
+ //
+ // Menu will be refreshed at minimal interval of all Questions
+ // which have refresh request
+ //
+ if (MinRefreshInterval == 0 || Statement->RefreshInterval < MinRefreshInterval) {
+ MinRefreshInterval = Statement->RefreshInterval;
+ }
+
+ if (gMenuRefreshHead == NULL) {
+ MenuRefreshEntry = AllocateZeroPool (sizeof (MENU_REFRESH_ENTRY));
+ gMenuRefreshHead = MenuRefreshEntry;
+ } else {
+ MenuRefreshEntry = gMenuRefreshHead;
+ while (MenuRefreshEntry->Next != NULL) {
+ MenuRefreshEntry = MenuRefreshEntry->Next;
+ }
+ MenuRefreshEntry->Next = AllocateZeroPool (sizeof (MENU_REFRESH_ENTRY));
+ MenuRefreshEntry = MenuRefreshEntry->Next;
+ }
+ ASSERT (MenuRefreshEntry != NULL);
+ MenuRefreshEntry->MenuOption = MenuOption;
+ MenuRefreshEntry->Selection = Selection;
+ MenuRefreshEntry->CurrentColumn = MenuOption->OptCol;
+ MenuRefreshEntry->CurrentRow = MenuOption->Row;
+ if (MenuOption->GrayOut) {
+ MenuRefreshEntry->CurrentAttribute = FIELD_TEXT_GRAYED | FIELD_BACKGROUND;
+ } else {
+ MenuRefreshEntry->CurrentAttribute = PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;
+ }
+ }
+
//
// If this is a text op with secondary text information
//
|