Merged in the bug fixes from EDK I.
authorqwang12 <qwang12@de2fecce-e211-0410-80a6-f3fac2684e05>
Tue, 2 Sep 2008 01:23:52 +0000 (01:23 +0000)
committerqwang12 <qwang12@de2fecce-e211-0410-80a6-f3fac2684e05>
Tue, 2 Sep 2008 01:23:52 +0000 (01:23 +0000)
*** Press F9 in Uefi64 FrontPage shouldnot enter sub-menu
** [FT] Some UI error on multiple platforms on framework_20080811
** [FT] UI test of How tall are you(Hex) on framework_20080811

To improve backward compatibility, add gEfiPrint2ProtocolGuid and rename gEfiPrintProtocolGuid to the previous GUID value used in EDK I. gEfiPrint2ProtocolGuid is a enhanced version of gEfiPrintProtocolGuid.

git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@5768 de2fecce-e211-0410-80a6-f3fac2684e05

edk2/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
edk2/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
edk2/MdeModulePkg/Universal/SetupBrowserDxe/ProcessOptions.c
edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
edk2/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
edk2/MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
edk2/MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserStr.uni
edk2/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c

index e4be921..1f40058 100644 (file)
@@ -687,7 +687,10 @@ IsExpressionOpCode (
 {
   if (((Operand >= EFI_IFR_EQ_ID_VAL_OP) && (Operand <= EFI_IFR_NOT_OP)) ||
       ((Operand >= EFI_IFR_MATCH_OP) && (Operand <= EFI_IFR_SPAN_OP)) ||
-      (Operand == EFI_IFR_CATENATE_OP)
+      (Operand == EFI_IFR_CATENATE_OP) ||
+      (Operand == EFI_IFR_TO_LOWER_OP) ||
+      (Operand == EFI_IFR_TO_UPPER_OP) ||
+      (Operand == EFI_IFR_VERSION_OP)
      ) {
     return TRUE;
   } else {
index a35ca35..404bb31 100644 (file)
@@ -597,6 +597,7 @@ InitializeBrowserStrings (
   gPlusString           = GetToken (STRING_TOKEN (PLUS_STRING), gHiiHandle);\r
   gMinusString          = GetToken (STRING_TOKEN (MINUS_STRING), gHiiHandle);\r
   gAdjustNumber         = GetToken (STRING_TOKEN (ADJUST_NUMBER), gHiiHandle);\r
+  gSaveChanges          = GetToken (STRING_TOKEN (SAVE_CHANGES), gHiiHandle);\r
   return ;\r
 }\r
 \r
@@ -637,6 +638,7 @@ FreeBrowserStrings (
   SafeFreePool (gPlusString);\r
   SafeFreePool (gMinusString);\r
   SafeFreePool (gAdjustNumber);\r
+  SafeFreePool (gSaveChanges);\r
   return ;\r
 }\r
 \r
@@ -857,6 +859,9 @@ SetupBrowser (
   EFI_HII_VALUE                   *HiiValue;\r
   FORM_BROWSER_STATEMENT          *Statement;\r
   EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess;\r
+  EFI_INPUT_KEY                   Key;\r
+  CHAR16                          YesResponse;\r
+  CHAR16                          NoResponse;\r
 \r
   gMenuRefreshHead = NULL;\r
   gResetRequired = FALSE;\r
@@ -990,6 +995,32 @@ SetupBrowser (
         // Force to reparse IFR binary of target Formset\r
         //\r
         Selection->Action = UI_ACTION_REFRESH_FORMSET;\r
+\r
+        //\r
+        // Uncommitted data will be lost after IFR binary re-pasing, so confirm on whether to save\r
+        //\r
+        if (gNvUpdateRequired) {\r
+          Status      = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);\r
+\r
+          YesResponse = gYesResponse[0];\r
+          NoResponse  = gNoResponse[0];\r
+\r
+          do {\r
+            CreateDialog (3, TRUE, 0, NULL, &Key, gEmptyString, gSaveChanges, gEmptyString);\r
+          } while\r
+          (\r
+            (Key.ScanCode != SCAN_ESC) &&\r
+            ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (NoResponse | UPPER_LOWER_CASE_OFFSET)) &&\r
+            ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (YesResponse | UPPER_LOWER_CASE_OFFSET))\r
+          );\r
+\r
+          if ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) == (YesResponse | UPPER_LOWER_CASE_OFFSET)) {\r
+            //\r
+            // If the user hits the YesResponse key\r
+            //\r
+            SubmitForm (Selection->FormSet, Selection->Form);\r
+          }\r
+        }\r
       }\r
     }\r
   } while (Selection->Action == UI_ACTION_REFRESH_FORM);\r
index 3e2cd18..9329159 100644 (file)
@@ -328,6 +328,7 @@ ProcessOptions (
     //
     // Initialize Option value array
     //
+
     if (Question->BufferValue[0] == 0) {
       GetQuestionDefault (Selection->FormSet, Selection->Form, Question, 0);
     }
index fd5aee4..f728d53 100644 (file)
@@ -24,7 +24,12 @@ SETUP_DRIVER_PRIVATE_DATA  mPrivateData = {
     BrowserCallback\r
   },\r
   {\r
-    UnicodeVSPrint\r
+    UnicodeVSPrint,\r
+    UnicodeVSPrintAsciiFormat,\r
+    UnicodeValueToString,                         \r
+    AsciiVSPrint,          \r
+    AsciiVSPrintUnicodeFormat,\r
+    AsciiValueToString\r
   }\r
 };\r
 \r
@@ -39,7 +44,6 @@ UINTN                 gFunctionKeySetting;
 BOOLEAN               gResetRequired;\r
 BOOLEAN               gNvUpdateRequired;\r
 EFI_HII_HANDLE        gHiiHandle;\r
-BOOLEAN               gFirstIn;\r
 UINT16                gDirection;\r
 EFI_SCREEN_DESCRIPTOR gScreenDimensions;\r
 BOOLEAN               gUpArrow;\r
@@ -76,6 +80,7 @@ CHAR16            *gMiniString;
 CHAR16            *gPlusString;\r
 CHAR16            *gMinusString;\r
 CHAR16            *gAdjustNumber;\r
+CHAR16            *gSaveChanges;\r
 \r
 CHAR16            gPromptBlockWidth;\r
 CHAR16            gOptionBlockWidth;\r
@@ -274,11 +279,8 @@ SendForm (
   //\r
   // Ensure we are in Text mode\r
   //\r
-  if (gFirstIn) {\r
-    gFirstIn = FALSE;\r
-    gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));\r
-    DisableQuietBoot ();\r
-  }\r
+  gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));\r
+  DisableQuietBoot ();\r
 \r
   for (Index = 0; Index < HandleCount; Index++) {\r
     Selection = AllocateZeroPool (sizeof (UI_MENU_SELECTION));\r
@@ -576,7 +578,6 @@ InitializeSetup (
   //\r
   // Initialize Driver private data\r
   //\r
-  gFirstIn = TRUE;\r
   BannerData = AllocateZeroPool (sizeof (BANNER_DATA));\r
   ASSERT (BannerData != NULL);\r
 \r
@@ -595,6 +596,19 @@ InitializeSetup (
   //\r
   // Install Print protocol\r
   //\r
+  Status = gBS->InstallProtocolInterface (\r
+                  &mPrivateData.Handle,\r
+                  &gEfiPrint2ProtocolGuid,\r
+                  EFI_NATIVE_INTERFACE,\r
+                  &mPrivateData.Print\r
+                  );\r
+\r
+  //\r
+  // Install Ecp Print protocol, which is defined in\r
+  // Edk\Foundation\Protocol\Print\Print.h with protocol\r
+  // GUID of { 0xdf2d868e, 0x32fc, 0x4cf0, {0x8e, 0x6b, 0xff, 0xd9, 0x5d, 0x13, 0x43, 0xd0 }}\r
+  // This is support previous module that written to consume this protocol.\r
+  // \r
   Status = gBS->InstallProtocolInterface (\r
                   &mPrivateData.Handle,\r
                   &gEfiPrintProtocolGuid,\r
index 60cd50f..e41f953 100644 (file)
@@ -20,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Uefi.h>\r
 \r
 #include <Protocol/Print.h>\r
+#include <Protocol/Print2.h>\r
 #include <Protocol/SimpleTextOut.h>\r
 #include <Protocol/SimpleTextIn.h>\r
 #include <Protocol/FormBrowser2.h>\r
@@ -172,7 +173,7 @@ typedef struct {
   // Produced protocol\r
   //\r
   EFI_FORM_BROWSER2_PROTOCOL         FormBrowser2;\r
-  EFI_PRINT_PROTOCOL                 Print;\r
+  EFI_PRINT2_PROTOCOL                Print;\r
 \r
 } SETUP_DRIVER_PRIVATE_DATA;\r
 \r
@@ -454,7 +455,6 @@ extern UINTN                 gFunctionKeySetting;
 extern BOOLEAN               gResetRequired;\r
 extern BOOLEAN               gNvUpdateRequired;\r
 extern EFI_HII_HANDLE        gHiiHandle;\r
-extern BOOLEAN               gFirstIn;\r
 extern UINT16                gDirection;\r
 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;\r
 extern BOOLEAN               gUpArrow;\r
@@ -491,6 +491,7 @@ extern CHAR16            *gMiniString;
 extern CHAR16            *gPlusString;\r
 extern CHAR16            *gMinusString;\r
 extern CHAR16            *gAdjustNumber;\r
+extern CHAR16            *gSaveChanges;\r
 \r
 extern CHAR16            gPromptBlockWidth;\r
 extern CHAR16            gOptionBlockWidth;\r
index 7848144..190b80c 100644 (file)
@@ -69,6 +69,7 @@
 \r
 [Protocols]\r
   gEfiPrintProtocolGuid                         # PROTOCOL ALWAYS_PRODUCED\r
+  gEfiPrint2ProtocolGuid\r
   gEfiHiiConfigAccessProtocolGuid\r
   gEfiHiiStringProtocolGuid\r
   gEfiFormBrowser2ProtocolGuid\r
index 5b5e282..adb33c5 100644 (file)
Binary files a/edk2/MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserStr.uni and b/edk2/MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserStr.uni differ
index cd933e9..068a3e7 100644 (file)
@@ -2828,6 +2828,7 @@ UiDisplayMenu (
 \r
       if (!EFI_ERROR (Status)) {\r
         Selection->Action = UI_ACTION_REFRESH_FORM;\r
+        Selection->Statement = NULL;\r
 \r
         //\r
         // Show NV update flag on status bar\r