From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 91A7881B5E for ; Tue, 17 Jan 2017 18:50:31 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 17 Jan 2017 18:50:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,247,1477983600"; d="scan'208";a="214605440" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 17 Jan 2017 18:50:31 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 17 Jan 2017 18:50:31 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 17 Jan 2017 18:50:30 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Wed, 18 Jan 2017 10:50:29 +0800 From: "Dong, Eric" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Yao, Jiewen" Thread-Topic: [patch 2/3] MdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore form Thread-Index: AQHSb72YwEOpU4EUm02DBDUCD2vdyaE9i8Fw Date: Wed, 18 Jan 2017 02:50:28 +0000 Message-ID: References: <1484546246-54936-1-git-send-email-dandan.bi@intel.com> <1484546246-54936-2-git-send-email-dandan.bi@intel.com> In-Reply-To: <1484546246-54936-2-git-send-email-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch 2/3] MdeModulePkg/FileExplorer: Update QuesrionId when Updating FileExplore form X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 02:50:31 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong -----Original Message----- From: Bi, Dandan=20 Sent: Monday, January 16, 2017 1:57 PM To: edk2-devel@lists.01.org Cc: Dong, Eric ; Gao, Liming ; Y= ao, Jiewen Subject: [patch 2/3] MdeModulePkg/FileExplorer: Update QuesrionId when Upda= ting FileExplore form https://bugzilla.tianocore.org/show_bug.cgi?id=3D342 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 ques= tion opcodes, the question id is same with previous one and this will cause= browser to show the highlight menu incorrectly. Cc: Eric Dong Cc: Liming Gao Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi --- MdeModulePkg/Library/FileExplorerLib/FileExplorer.c | 12 ++++++++---- Mde= ModulePkg/Library/FileExplorerLib/FileExplorer.h | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c b/MdeModul= ePkg/Library/FileExplorerLib/FileExplorer.c index 9cd366d..315868a 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.c @@ -70,10 +70,11 @@ HII_VENDOR_DEVICE_PATH FeHiiVendorDevicePath =3D { =20 VOID *mLibStartOpCodeHandle =3D NULL; VOID *mLibEndOpCodeHandle =3D NULL; EFI_IFR_GUID_LABEL *mLibStartLabel =3D NULL; EFI_IFR_GUID_LABEL *mLibEn= dLabel =3D NULL; +UINT16 mQuestionIdUpdate; =20 /** This function allows a caller to extract the current configuration for o= ne or more named elements from the target driver. =20 @@ -1181,21 +1182,23 @@ LibUpdateFileExplorePage ( NewFileContext =3D NULL; =20 LibRefreshUpdateData (); MenuOption =3D gFileExplorerPrivate.FsOptionMenu; =20 + mQuestionIdUpdate +=3D QUESTION_ID_UPDATE_STEP; + for (Index =3D 0; Index < MenuOption->MenuNumber; Index++) { NewMenuEntry =3D LibGetMenuEntry (MenuOption, Index); NewFileContext =3D (FILE_CONTEXT *) NewMenuEntry->VariableContext; =20 if (!NewFileContext->IsDir) { // // Create Text opcode for directory, also create Text opcode for fil= e in FileExplorerStateBootFromFile. // HiiCreateActionOpCode ( mLibStartOpCodeHandle, - (UINT16) (FILE_OPTION_OFFSET + Index), + (UINT16) (FILE_OPTION_OFFSET + Index + mQuestionIdUpdate), NewMenuEntry->DisplayStringToken, STRING_TOKEN (STR_NULL_STRING), EFI_IFR_FLAG_CALLBACK, 0 ); @@ -1207,11 +1210,11 @@ LibUpdateFileExplorePage ( mLibStartOpCodeHandle, FORM_FILE_EXPLORER_ID, NewMenuEntry->DisplayStringToken, STRING_TOKEN (STR_NULL_STRING), EFI_IFR_FLAG_CALLBACK, - (UINT16) (FILE_OPTION_OFFSET + Index) + (UINT16) (FILE_OPTION_OFFSET + Index + mQuestionIdUpdate) ); } } =20 HiiUpdateForm ( @@ -1242,11 +1245,11 @@ LibUpdateFileExplorer ( FILE_CONTEXT *NewFileContext; EFI_STATUS Status; EFI_FILE_HANDLE FileHandle; =20 Status =3D EFI_SUCCESS; - FileOptionMask =3D (UINT16) (FILE_OPTION_MASK & KeyValue); + FileOptionMask =3D (UINT16) (FILE_OPTION_MASK & KeyValue) -=20 + mQuestionIdUpdate; NewMenuEntry =3D LibGetMenuEntry (gFileExplorerPrivate.FsOptionMenu, F= ileOptionMask); NewFileContext =3D (FILE_CONTEXT *) NewMenuEntry->VariableContext; =20 if (NewFileContext->IsDir) { RemoveEntryList (&NewMenuEntry->Link); @@ -1277,11 +1280,11 @@ LibGetD= evicePath ( { UINT16 FileOptionMask; MENU_ENTRY *NewMenuEntry; FILE_CONTEXT *NewFileContext; =20 - FileOptionMask =3D (UINT16) (FILE_OPTION_MASK & KeyValue); + FileOptionMask =3D (UINT16) (FILE_OPTION_MASK & KeyValue) - mQuestion= IdUpdate; =20 NewMenuEntry =3D LibGetMenuEntry (gFileExplorerPrivate.FsOptionMenu, Fil= eOptionMask); =20 NewFileContext =3D (FILE_CONTEXT *) NewMenuEntry->VariableContext; =20 @@ -1326,10 +1329,11 @@ ChooseFile ( =20 if ((ChooseHandler =3D=3D NULL) && (File =3D=3D NULL)) { return EFI_INVALID_PARAMETER; } =20 + mQuestionIdUpdate =3D 0; FileName =3D NULL; =20 gFileExplorerPrivate.RetDevicePath =3D NULL; gFileExplorerPrivate.ChooseHandler =3D ChooseHandler; if (FileType !=3D NULL) { diff --git a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h b/MdeModul= ePkg/Library/FileExplorerLib/FileExplorer.h index 4b5f601..ea0ad3d 100644 --- a/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h +++ b/MdeModulePkg/Library/FileExplorerLib/FileExplorer.h @@ -111,11 +111,11 @@ extern UINT8 FileExplorerVfrBin[]; /// Define the maximum characters that will be accepted. /// #define MAX_CHAR 480 #define FILE_OPTION_OFFSET 0x8000 #define FILE_OPTION_MASK 0x7FFF - +#define QUESTION_ID_UPDATE_STEP 200 =20 /** This function processes the results of changes in configuration. When user select a interactive opcode, this callback will be triggered. Based on the Question(QuestionId) that triggers the callback, the corres= ponding -- 1.9.5.msysgit.1