summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2017-01-12 13:49:40 +0300
committerHao Wu <hao.a.wu@intel.com>2017-01-19 05:14:36 +0300
commit9cf1aa29cf4036c21a69b6faeebd4d91dd50b12e (patch)
tree070ea355df531cdc421a65a9d4723753ace711b9 /MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
parentd9b64abbdf70e42f8e20bd372aaf9605cb20b725 (diff)
downloadedk2-9cf1aa29cf4036c21a69b6faeebd4d91dd50b12e.tar.xz
MdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore form
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>
Diffstat (limited to 'MdeModulePkg/Library/FileExplorerLib/FileExplorer.c')
-rw-r--r--MdeModulePkg/Library/FileExplorerLib/FileExplorer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
index 9cd366ddf4..315868a8ba 100644
--- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
+++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c
@@ -72,6 +72,7 @@ VOID *mLibStartOpCodeHandle = NULL;
VOID *mLibEndOpCodeHandle = NULL;
EFI_IFR_GUID_LABEL *mLibStartLabel = NULL;
EFI_IFR_GUID_LABEL *mLibEndLabel = NULL;
+UINT16 mQuestionIdUpdate;
/**
This function allows a caller to extract the current configuration for one
@@ -1183,6 +1184,8 @@ LibUpdateFileExplorePage (
LibRefreshUpdateData ();
MenuOption = gFileExplorerPrivate.FsOptionMenu;
+ mQuestionIdUpdate += QUESTION_ID_UPDATE_STEP;
+
for (Index = 0; Index < MenuOption->MenuNumber; Index++) {
NewMenuEntry = LibGetMenuEntry (MenuOption, Index);
NewFileContext = (FILE_CONTEXT *) NewMenuEntry->VariableContext;
@@ -1193,7 +1196,7 @@ LibUpdateFileExplorePage (
//
HiiCreateActionOpCode (
mLibStartOpCodeHandle,
- (UINT16) (FILE_OPTION_OFFSET + Index),
+ (UINT16) (FILE_OPTION_OFFSET + Index + mQuestionIdUpdate),
NewMenuEntry->DisplayStringToken,
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
@@ -1209,7 +1212,7 @@ LibUpdateFileExplorePage (
NewMenuEntry->DisplayStringToken,
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (FILE_OPTION_OFFSET + Index)
+ (UINT16) (FILE_OPTION_OFFSET + Index + mQuestionIdUpdate)
);
}
}
@@ -1244,7 +1247,7 @@ LibUpdateFileExplorer (
EFI_FILE_HANDLE FileHandle;
Status = EFI_SUCCESS;
- FileOptionMask = (UINT16) (FILE_OPTION_MASK & KeyValue);
+ FileOptionMask = (UINT16) (FILE_OPTION_MASK & KeyValue) - mQuestionIdUpdate;
NewMenuEntry = LibGetMenuEntry (gFileExplorerPrivate.FsOptionMenu, FileOptionMask);
NewFileContext = (FILE_CONTEXT *) NewMenuEntry->VariableContext;
@@ -1279,7 +1282,7 @@ LibGetDevicePath (
MENU_ENTRY *NewMenuEntry;
FILE_CONTEXT *NewFileContext;
- FileOptionMask = (UINT16) (FILE_OPTION_MASK & KeyValue);
+ FileOptionMask = (UINT16) (FILE_OPTION_MASK & KeyValue) - mQuestionIdUpdate;
NewMenuEntry = LibGetMenuEntry (gFileExplorerPrivate.FsOptionMenu, FileOptionMask);
@@ -1328,6 +1331,7 @@ ChooseFile (
return EFI_INVALID_PARAMETER;
}
+ mQuestionIdUpdate = 0;
FileName = NULL;
gFileExplorerPrivate.RetDevicePath = NULL;