]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Disable change value for grayout or readonly menu.
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 5 Dec 2011 12:45:45 +0000 (12:45 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 5 Dec 2011 12:45:45 +0000 (12:45 +0000)
Signed-off-by: ydong10
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12817 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/SetupBrowserDxe/Ui.c

index ebe8fae2cc4391812cc948a29cb2f25f1719dd20..ca2ec3b169f7ff97db9e6c9f31218bc9da49a27f 100644 (file)
@@ -2876,6 +2876,11 @@ UiDisplayMenu (
 \r
       switch (Key.UnicodeChar) {\r
       case CHAR_CARRIAGE_RETURN:\r
 \r
       switch (Key.UnicodeChar) {\r
       case CHAR_CARRIAGE_RETURN:\r
+        if(MenuOption->GrayOut || MenuOption->ReadOnly) {\r
+          ControlFlag = CfReadKey;\r
+          break;\r
+        }\r
+\r
         ScreenOperation = UiSelect;\r
         gDirection      = 0;\r
         break;\r
         ScreenOperation = UiSelect;\r
         gDirection      = 0;\r
         break;\r
@@ -2890,7 +2895,7 @@ UiDisplayMenu (
         // If the screen has no menu items, and the user didn't select UiReset\r
         // ignore the selection and go back to reading keys.\r
         //\r
         // If the screen has no menu items, and the user didn't select UiReset\r
         // ignore the selection and go back to reading keys.\r
         //\r
-        if(IsListEmpty (&gMenuOption)) {\r
+        if(IsListEmpty (&gMenuOption) || MenuOption->GrayOut || MenuOption->ReadOnly) {\r
           ControlFlag = CfReadKey;\r
           break;\r
         }\r
           ControlFlag = CfReadKey;\r
           break;\r
         }\r
@@ -2943,7 +2948,7 @@ UiDisplayMenu (
           }\r
           \r
           ASSERT(MenuOption != NULL);\r
           }\r
           \r
           ASSERT(MenuOption != NULL);\r
-          if (MenuOption->ThisTag->Operand == EFI_IFR_CHECKBOX_OP && !MenuOption->GrayOut) {\r
+          if (MenuOption->ThisTag->Operand == EFI_IFR_CHECKBOX_OP && !MenuOption->GrayOut && !MenuOption->ReadOnly) {\r
             ScreenOperation = UiSelect;\r
           }\r
         }\r
             ScreenOperation = UiSelect;\r
           }\r
         }\r