]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
Update DEBUG log information to specify SMM driver to be loaded in SmmCore
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Ui.c
index 3310bb284e62263c751fd91811832261649a4111..736d9e822a1b42019102aa58d8a47d73fb5e9592 100644 (file)
@@ -341,7 +341,6 @@ RefreshForm (
   UI_MENU_SELECTION               *Selection;\r
   FORM_BROWSER_STATEMENT          *Question;\r
   EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess;\r
-  EFI_HII_VALUE                   *HiiValue;\r
   EFI_BROWSER_ACTION_REQUEST      ActionRequest;\r
 \r
   if (gMenuRefreshHead != NULL) {\r
@@ -384,31 +383,14 @@ RefreshForm (
       ConfigAccess = Selection->FormSet->ConfigAccess;\r
       if (((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) && (ConfigAccess != NULL)) {\r
         ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;\r
-\r
-        HiiValue = &Question->HiiValue;\r
-        if (HiiValue->Type == EFI_IFR_TYPE_STRING) {\r
-          //\r
-          // Create String in HII database for Configuration Driver to retrieve\r
-          //\r
-          HiiValue->Value.string = NewString ((CHAR16 *) Question->BufferValue, Selection->FormSet->HiiHandle);\r
-        }\r
-\r
         Status = ConfigAccess->Callback (\r
                                  ConfigAccess,\r
                                  EFI_BROWSER_ACTION_CHANGING,\r
                                  Question->QuestionId,\r
-                                 HiiValue->Type,\r
-                                 &HiiValue->Value,\r
+                                 Question->HiiValue.Type,\r
+                                 &Question->HiiValue.Value,\r
                                  &ActionRequest\r
                                  );\r
-\r
-        if (HiiValue->Type == EFI_IFR_TYPE_STRING) {\r
-          //\r
-          // Clean the String in HII Database\r
-          //\r
-          DeleteString (HiiValue->Value.string, Selection->FormSet->HiiHandle);\r
-        }\r
-\r
         if (!EFI_ERROR (Status)) {\r
           switch (ActionRequest) {\r
           case EFI_BROWSER_ACTION_REQUEST_RESET:\r
@@ -1134,7 +1116,7 @@ GetWidth (
     Width -= SUBTITLE_INDENT;\r
   }\r
 \r
-  return Width;\r
+  return (UINT16) (Width - LEFT_SKIPPED_COLUMNS);\r
 }\r
 \r
 /**\r
@@ -1704,7 +1686,7 @@ UiDisplayMenu (
     Row     = LocalScreen.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT + SCROLL_ARROW_HEIGHT;\r
   }\r
 \r
-  Col = LocalScreen.LeftColumn;\r
+  Col = LocalScreen.LeftColumn + LEFT_SKIPPED_COLUMNS;\r
   BottomRow = LocalScreen.BottomRow - STATUS_BAR_HEIGHT - FOOTER_HEIGHT - SCROLL_ARROW_HEIGHT - 1;\r
 \r
   Selection->TopRow = TopRow;\r
@@ -1811,6 +1793,18 @@ UiDisplayMenu (
           Width       = GetWidth (Statement, MenuOption->Handle);\r
           OriginalRow = Row;\r
 \r
+          if (Statement->Operand == EFI_IFR_REF_OP && ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP)) {\r
+            //\r
+            // Print Arrow for Goto button.\r
+            //\r
+            PrintAt (\r
+              MenuOption->Col - LEFT_SKIPPED_COLUMNS,\r
+              Row,\r
+              L"%c",\r
+              GEOMETRICSHAPE_RIGHT_TRIANGLE\r
+              );\r
+          }\r
+\r
           for (Index = 0; GetLineByWidth (MenuOption->Description, Width, &Index, &OutputString) != 0x0000;) {\r
             if ((Temp == 0) && (Row <= BottomRow)) {\r
               PrintStringAt (MenuOption->Col, Row, OutputString);\r
@@ -1833,7 +1827,6 @@ UiDisplayMenu (
           Temp  = 0;\r
           Row   = OriginalRow;\r
 \r
-          gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);\r
           Status = ProcessOptions (Selection, MenuOption, FALSE, &OptionString);\r
           if (EFI_ERROR (Status)) {\r
             //\r
@@ -1981,6 +1974,7 @@ UiDisplayMenu (
             Row = OriginalRow;\r
             FreePool (StringPtr);\r
           }\r
+          gST->ConOut->SetAttribute (gST->ConOut, FIELD_TEXT | FIELD_BACKGROUND);\r
 \r
           //\r
           // Need to handle the bottom of the display\r
@@ -2400,6 +2394,8 @@ UiDisplayMenu (
             //\r
             Repaint = TRUE;\r
             NewLine = TRUE;\r
+          } else {\r
+            Selection->Action = UI_ACTION_REFRESH_FORM;\r
           }\r
           if (OptionString != NULL) {\r
             FreePool (OptionString);\r
@@ -2501,10 +2497,7 @@ UiDisplayMenu (
 \r
       ASSERT(MenuOption != NULL);\r
       Statement = MenuOption->ThisTag;\r
-      if ((Statement->Operand == EFI_IFR_TEXT_OP) ||\r
-          (Statement->Operand == EFI_IFR_DATE_OP) ||\r
-          (Statement->Operand == EFI_IFR_TIME_OP) ||\r
-          (Statement->Operand == EFI_IFR_NUMERIC_OP && Statement->Step != 0)) {\r
+      if (Statement->Operand == EFI_IFR_TEXT_OP) {\r
         break;\r
       }\r
 \r
@@ -2813,6 +2806,7 @@ UiDisplayMenu (
           NewPos = NewPos->BackLink;\r
         }\r
 \r
+        Difference = MoveToNextStatement (TRUE, &NewPos);\r
         PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos);\r
         DistanceValue = PreviousMenuOption->Skip;\r
 \r
@@ -2823,32 +2817,8 @@ UiDisplayMenu (
         // checking can be done.\r
         //\r
         DistanceValue += AdjustDateAndTimePosition (TRUE, &NewPos);\r
-\r
-        //\r
-        // Check the previous menu entry to see if it was a zero-length advance.  If it was,\r
-        // don't worry about a redraw.\r
-        //\r
-        ASSERT(MenuOption != NULL);\r
-        if ((INTN) MenuOption->Row - (INTN) DistanceValue < (INTN) TopRow) {\r
-          Repaint     = TRUE;\r
-          TopOfScreen = NewPos;\r
-        }\r
-\r
-        Difference = MoveToNextStatement (TRUE, &NewPos);\r
-        PreviousMenuOption = MENU_OPTION_FROM_LINK (NewPos);\r
-        DistanceValue += PreviousMenuOption->Skip;\r
-\r
-        if ((INTN) MenuOption->Row - (INTN) DistanceValue  < (INTN) TopRow) {\r
-          if (Difference > 0) {\r
-            //\r
-            // Previous focus MenuOption is above the TopOfScreen, so we need to scroll\r
-            //\r
-            TopOfScreen = NewPos;\r
-            Repaint     = TRUE;\r
-            SkipValue = 0;\r
-            OldSkipValue = 0;\r
-          }\r
-        }\r
+        \r
+        ASSERT (MenuOption != NULL);\r
         if (Difference < 0) {\r
           //\r
           // We want to goto previous MenuOption, but finally we go down.\r
@@ -2859,6 +2829,14 @@ UiDisplayMenu (
             TopOfScreen = gMenuOption.ForwardLink;\r
             Repaint     = TRUE;\r
           }\r
+        } else if ((INTN) MenuOption->Row - (INTN) DistanceValue - Difference < (INTN) TopRow) {\r
+          //\r
+          // Previous focus MenuOption is above the TopOfScreen, so we need to scroll\r
+          //\r
+          TopOfScreen = NewPos;\r
+          Repaint     = TRUE;\r
+          SkipValue = 0;\r
+          OldSkipValue = 0;\r
         }\r
 \r
         //\r
@@ -3002,14 +2980,15 @@ UiDisplayMenu (
         MenuOption      = MENU_OPTION_FROM_LINK (NewPos);\r
         NewLine         = TRUE;\r
         NewPos          = NewPos->ForwardLink;\r
-        NextMenuOption  = MENU_OPTION_FROM_LINK (NewPos);\r
 \r
-        DistanceValue  += NextMenuOption->Skip;\r
         DistanceValue  += MoveToNextStatement (FALSE, &NewPos);\r
+        NextMenuOption  = MENU_OPTION_FROM_LINK (NewPos);\r
+\r
         //\r
         // An option might be multi-line, so we need to reflect that data in the overall skip value\r
         //\r
         UpdateOptionSkipLines (Selection, NextMenuOption, &OptionString, (UINTN) SkipValue);\r
+        DistanceValue  += NextMenuOption->Skip;\r
 \r
         Temp = MenuOption->Row + MenuOption->Skip + DistanceValue - 1;\r
         if ((MenuOption->Row + MenuOption->Skip == BottomRow + 1) &&\r
@@ -3051,26 +3030,13 @@ UiDisplayMenu (
                 //\r
                 // If we have a remainder, skip that many more op-codes until we drain the remainder\r
                 //\r
-                for (;\r
-                     Difference >= (INTN) SavedMenuOption->Skip;\r
-                     Difference = Difference - (INTN) SavedMenuOption->Skip\r
-                    ) {\r
+                while (Difference >= (INTN) SavedMenuOption->Skip) {\r
                   //\r
                   // Since the Difference is greater than or equal to this op-code's skip value, skip it\r
                   //\r
+                  Difference      = Difference - (INTN) SavedMenuOption->Skip;\r
                   TopOfScreen     = TopOfScreen->ForwardLink;\r
                   SavedMenuOption = MENU_OPTION_FROM_LINK (TopOfScreen);\r
-                  if (Difference < (INTN) SavedMenuOption->Skip) {\r
-                    Difference = SavedMenuOption->Skip - Difference - 1;\r
-                    break;\r
-                  } else {\r
-                    if (Difference == (INTN) SavedMenuOption->Skip) {\r
-                      TopOfScreen     = TopOfScreen->ForwardLink;\r
-                      SavedMenuOption = MENU_OPTION_FROM_LINK (TopOfScreen);\r
-                      Difference      = SavedMenuOption->Skip - Difference;\r
-                      break;\r
-                    }\r
-                  }\r
                 }\r
                 //\r
                 // Since we will act on this op-code in the next routine, and increment the\r
@@ -3103,6 +3069,8 @@ UiDisplayMenu (
               } else {\r
                 SkipValue++;\r
               }\r
+            } else if (SavedMenuOption->Skip == 1) {\r
+              SkipValue   = 0;\r
             } else {\r
               SkipValue   = 0;\r
               TopOfScreen = TopOfScreen->ForwardLink;\r