]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore form
authorDandan Bi <dandan.bi@intel.com>
Thu, 12 Jan 2017 10:49:40 +0000 (18:49 +0800)
committerHao Wu <hao.a.wu@intel.com>
Thu, 19 Jan 2017 02:14:36 +0000 (10:14 +0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=342

When user select and enter a directory, File Explorer will update the
form based on the new folders and files in the directory. But when
creating question opcodes, the question id is same with previous one
and this will cause browser to show the highlight menu incorrectly.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
MdeModulePkg/Library/FileExplorerLib/FileExplorer.h

index 9cd366ddf4f859c3c5c7d3928ab2ba97c7c6dc0a..315868a8bacdae1de5d0d04013649cbb7e461cbf 100644 (file)
@@ -72,6 +72,7 @@ VOID                *mLibStartOpCodeHandle = NULL;
 VOID                *mLibEndOpCodeHandle = NULL;\r
 EFI_IFR_GUID_LABEL  *mLibStartLabel = NULL;\r
 EFI_IFR_GUID_LABEL  *mLibEndLabel = NULL;\r
+UINT16              mQuestionIdUpdate;\r
 \r
 /**\r
   This function allows a caller to extract the current configuration for one\r
@@ -1183,6 +1184,8 @@ LibUpdateFileExplorePage (
   LibRefreshUpdateData ();\r
   MenuOption = gFileExplorerPrivate.FsOptionMenu;\r
 \r
+  mQuestionIdUpdate += QUESTION_ID_UPDATE_STEP;\r
+\r
   for (Index = 0; Index < MenuOption->MenuNumber; Index++) {\r
     NewMenuEntry    = LibGetMenuEntry (MenuOption, Index);\r
     NewFileContext  = (FILE_CONTEXT *) NewMenuEntry->VariableContext;\r
@@ -1193,7 +1196,7 @@ LibUpdateFileExplorePage (
       //\r
       HiiCreateActionOpCode (\r
         mLibStartOpCodeHandle,\r
-        (UINT16) (FILE_OPTION_OFFSET + Index),\r
+        (UINT16) (FILE_OPTION_OFFSET + Index + mQuestionIdUpdate),\r
         NewMenuEntry->DisplayStringToken,\r
         STRING_TOKEN (STR_NULL_STRING),\r
         EFI_IFR_FLAG_CALLBACK,\r
@@ -1209,7 +1212,7 @@ LibUpdateFileExplorePage (
         NewMenuEntry->DisplayStringToken,\r
         STRING_TOKEN (STR_NULL_STRING),\r
         EFI_IFR_FLAG_CALLBACK,\r
-        (UINT16) (FILE_OPTION_OFFSET + Index)\r
+        (UINT16) (FILE_OPTION_OFFSET + Index + mQuestionIdUpdate)\r
         );\r
     }\r
   }\r
@@ -1244,7 +1247,7 @@ LibUpdateFileExplorer (
   EFI_FILE_HANDLE FileHandle;\r
 \r
   Status = EFI_SUCCESS;\r
-  FileOptionMask = (UINT16) (FILE_OPTION_MASK & KeyValue);\r
+  FileOptionMask = (UINT16) (FILE_OPTION_MASK & KeyValue) - mQuestionIdUpdate;\r
   NewMenuEntry   = LibGetMenuEntry (gFileExplorerPrivate.FsOptionMenu, FileOptionMask);\r
   NewFileContext = (FILE_CONTEXT *) NewMenuEntry->VariableContext;\r
 \r
@@ -1279,7 +1282,7 @@ LibGetDevicePath (
   MENU_ENTRY      *NewMenuEntry;\r
   FILE_CONTEXT    *NewFileContext;\r
 \r
-  FileOptionMask    = (UINT16) (FILE_OPTION_MASK & KeyValue);\r
+  FileOptionMask    = (UINT16) (FILE_OPTION_MASK & KeyValue) - mQuestionIdUpdate;\r
 \r
   NewMenuEntry = LibGetMenuEntry (gFileExplorerPrivate.FsOptionMenu, FileOptionMask);\r
 \r
@@ -1328,6 +1331,7 @@ ChooseFile (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  mQuestionIdUpdate = 0;\r
   FileName = NULL;\r
 \r
   gFileExplorerPrivate.RetDevicePath = NULL;\r
index 4b5f601b911de1573398e89bc2db397d5917cc87..ea0ad3d8e2871384c32da55d1653619e8508e3f4 100644 (file)
@@ -113,7 +113,7 @@ extern UINT8    FileExplorerVfrBin[];
 #define MAX_CHAR                480\r
 #define FILE_OPTION_OFFSET      0x8000\r
 #define FILE_OPTION_MASK        0x7FFF\r
-\r
+#define QUESTION_ID_UPDATE_STEP 200\r
 \r
 /**\r
   This function processes the results of changes in configuration.\r