summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-21 02:58:45 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-21 02:58:45 +0000
commit090f3fdbf96e4cba61de228b05cbeddeff387066 (patch)
treece040c8c03c8b125fec1a9e3c904ffedaa87433e /MdeModulePkg
parent8f766f6eec24056fff5588b422c773ecc631c482 (diff)
downloadedk2-platforms-090f3fdbf96e4cba61de228b05cbeddeff387066.tar.xz
Move the check refresh attribute logical out of the option string check logical.
Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11871 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Ui.c141
1 files changed, 64 insertions, 77 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
index de051709c0..1cd8a1a795 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
@@ -1910,6 +1910,70 @@ 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)) {
//
@@ -1938,83 +2002,6 @@ UiDisplayMenu (
OptionString[Count] = CHAR_NULL;
}
- //
- // 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));
- }
- 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));
- 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;
- }
- gMenuRefreshHead = MenuRefreshEntry;
- } else {
- //
- // Advance to the last entry
- //
- for (MenuRefreshEntry = gMenuRefreshHead;
- MenuRefreshEntry->Next != NULL;
- MenuRefreshEntry = MenuRefreshEntry->Next
- )
- ;
- MenuRefreshEntry->Next = AllocateZeroPool (sizeof (MENU_REFRESH_ENTRY));
- ASSERT (MenuRefreshEntry->Next != NULL);
- MenuRefreshEntry = MenuRefreshEntry->Next;
- 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;
- }
- }
- }
-
Width = (UINT16) gOptionBlockWidth;
OriginalRow = Row;