diff options
author | Gao Qihang <gaoqihang@loongson.cn> | 2025-04-07 17:29:52 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-04-25 05:39:16 +0000 |
commit | 135e07c6e514a24a06e74db79a173c72c8d15019 (patch) | |
tree | abdd2fec15630dd1eb381649094253b497f7735f | |
parent | 864cc900ab047976becdc794174ec8c8096af8ad (diff) | |
download | edk2-135e07c6e514a24a06e74db79a173c72c8d15019.zip edk2-135e07c6e514a24a06e74db79a173c72c8d15019.tar.gz edk2-135e07c6e514a24a06e74db79a173c72c8d15019.tar.bz2 |
DeviceManagerUiLib:Update DeviceManager form data when the form opens.
Issue link:https://github.com/tianocore/edk2/issues/10925
If new HII resource is installed, show it in DeviceManager form. If HII
resource is uninstalled, remove it from DeviceManager form. So once we
enter DeviceManager form, form data should be refreshed to display
dynamically.
Cc: Li Chao <lichao@loongson.cn>
Cc: Qian Dongyan <qiandongyan@loongson.cn>
Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
-rw-r--r-- | MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c | 17 | ||||
-rw-r--r-- | MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerVfr.Vfr | 11 |
2 files changed, 22 insertions, 6 deletions
diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c index c8ca25e..3950bbb 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManager.c @@ -848,7 +848,17 @@ DeviceManagerCallback ( {
UINTN CurIndex;
- if (Action != EFI_BROWSER_ACTION_CHANGING) {
+ if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
+ //
+ // Means enter the device manager form.
+ // Update device manager page when form opens, because options may add or remove.
+ //
+ if (QuestionId == 0x1212) {
+ CreateDeviceManagerForm (DEVICE_MANAGER_FORM_ID);
+ }
+
+ return EFI_SUCCESS;
+ } else if (Action != EFI_BROWSER_ACTION_CHANGING) {
//
// Do nothing for other UEFI Action. Only do call back when data is changed.
//
@@ -926,11 +936,6 @@ DeviceManagerUiLibConstructor ( //
EfiBootManagerConnectAll ();
- //
- // Update boot manager page
- //
- CreateDeviceManagerForm (DEVICE_MANAGER_FORM_ID);
-
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerVfr.Vfr b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerVfr.Vfr index d81c580..911ea03 100644 --- a/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerVfr.Vfr +++ b/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerVfr.Vfr @@ -28,6 +28,17 @@ formset title = STRING_TOKEN(STR_EDKII_MENU_TITLE);
subtitle text = STRING_TOKEN(STR_DEVICES_LIST);
+ //
+ // Add this invisable text in order to indicate enter Device Manager form.
+ //
+ suppressif TRUE;
+ text
+ help = STRING_TOKEN(STR_EMPTY_STRING),
+ text = STRING_TOKEN(STR_EMPTY_STRING),
+ flags = INTERACTIVE,
+ key = 0x1212;
+ endif;
+
label LABEL_DEVICES_LIST;
label LABEL_END;
|