diff options
author | Eric Dong <eric.dong@intel.com> | 2013-09-16 09:50:32 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-09-16 09:50:32 +0000 |
commit | 184f3a02d60e994a1a78a7f16ea8cc0b9d0df3e9 (patch) | |
tree | 79e4caae5e67cdb820c70e2047532cb75919d3d5 /MdeModulePkg/Universal | |
parent | b7dbd9c27abd8691c321cd113178ab02dcb15c08 (diff) | |
download | edk2-platforms-184f3a02d60e994a1a78a7f16ea8cc0b9d0df3e9.tar.xz |
Export one interface to support 3rd party to change question attribute, such as hide/gray out.
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14678 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 55 | ||||
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 3 | ||||
-rw-r--r-- | MdeModulePkg/Universal/SetupBrowserDxe/Setup.h | 1 |
3 files changed, 58 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c index 4f8d4ee61b..5318290144 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c @@ -571,6 +571,47 @@ UpdateHotkeyList ( /**
+ Get the extra question attribute from override question list.
+
+ @param QuestionId The question id for this request question.
+
+ @retval The attribute for this question or NULL if not found this
+ question in the list.
+
+**/
+UINT32
+ProcessQuestionExtraAttr (
+ IN EFI_QUESTION_ID QuestionId
+ )
+{
+ LIST_ENTRY *Link;
+ QUESTION_ATTRIBUTE_OVERRIDE *QuestionDesc;
+
+ //
+ // Return HII_DISPLAY_NONE if input a invalid question id.
+ //
+ if (QuestionId == 0) {
+ return HII_DISPLAY_NONE;
+ }
+
+ Link = GetFirstNode (&mPrivateData.FormBrowserEx2.OverrideQestListHead);
+ while (!IsNull (&mPrivateData.FormBrowserEx2.OverrideQestListHead, Link)) {
+ QuestionDesc = FORM_QUESTION_ATTRIBUTE_OVERRIDE_FROM_LINK (Link);
+ Link = GetNextNode (&mPrivateData.FormBrowserEx2.OverrideQestListHead, Link);
+
+ if ((QuestionDesc->QuestionId == QuestionId) &&
+ (QuestionDesc->FormId == gCurrentSelection->FormId) &&
+ (QuestionDesc->HiiHandle == gCurrentSelection->Handle) &&
+ CompareGuid (&QuestionDesc->FormSetGuid, &gCurrentSelection->FormSetGuid)) {
+ return QuestionDesc->Attribute;
+ }
+ }
+
+ return HII_DISPLAY_NONE;
+}
+
+/**
+
Enum all statement in current form, find all the statement can be display and
add to the display form.
@@ -589,6 +630,7 @@ AddStatementToDisplayForm ( EFI_EVENT RefreshIntervalEvent;
FORM_BROWSER_REFRESH_EVENT_NODE *EventNode;
BOOLEAN FormEditable;
+ UINT32 ExtraAttribute;
HostDisplayStatement = NULL;
MinRefreshInterval = 0;
@@ -630,6 +672,14 @@ AddStatementToDisplayForm ( continue;
}
+ //
+ // Check the extra attribute.
+ //
+ ExtraAttribute = ProcessQuestionExtraAttr (Statement->QuestionId);
+ if ((ExtraAttribute & HII_DISPLAY_SUPPRESS) != 0) {
+ continue;
+ }
+
DisplayStatement = AllocateZeroPool (sizeof (FORM_DISPLAY_ENGINE_STATEMENT));
ASSERT (DisplayStatement != NULL);
@@ -639,6 +689,11 @@ AddStatementToDisplayForm ( InitializeDisplayStatement(DisplayStatement, Statement, HostDisplayStatement);
//
+ // Set the extra attribute.
+ //
+ DisplayStatement->Attribute |= ExtraAttribute;
+
+ //
// Save the Host statement info.
// Host statement may has nest statement follow it.
//
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 6dcb4aa77e..63f86809fa 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -766,7 +766,8 @@ InitializeSetup ( //
// Install FormBrowserEx2 protocol
//
- InitializeListHead (&mPrivateData.FormBrowserEx2.FormViewHistoryHead);
+ InitializeListHead (&mPrivateData.FormBrowserEx2.FormViewHistoryHead);
+ InitializeListHead (&mPrivateData.FormBrowserEx2.OverrideQestListHead);
mPrivateData.Handle = NULL;
Status = gBS->InstallProtocolInterface (
&mPrivateData.Handle,
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h index 99418543df..bd19ae6cb7 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h @@ -548,6 +548,7 @@ extern LIST_ENTRY gBrowserHotKeyList; extern BROWSER_SETTING_SCOPE gBrowserSettingScope;
extern EXIT_HANDLER ExitHandlerFunction;
extern EFI_HII_HANDLE mCurrentHiiHandle;
+extern SETUP_DRIVER_PRIVATE_DATA mPrivateData;
//
// Browser Global Strings
//
|