CA-376330: If the boot mode radios are invisible do not check them or show the warning if they are disabled.

Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
Konstantina Chremmou 2023-04-06 00:31:21 +01:00
parent 601d615f52
commit efce18eff9

View File

@ -129,7 +129,7 @@ namespace XenAdmin.Wizards
return; return;
} }
imgUefi.Visible = labelUefi.Visible = true; imgUefi.Visible = labelUefi.Visible = radioButtonUEFIBoot.Visible;
labelUefi.Text = text; labelUefi.Text = text;
} }
@ -141,7 +141,7 @@ namespace XenAdmin.Wizards
return; return;
} }
imgSecureUefi.Visible = labelSecureUefi.Visible = true; imgSecureUefi.Visible = labelSecureUefi.Visible = radioButtonUEFISecureBoot.Visible;
labelSecureUefi.Text = text; labelSecureUefi.Text = text;
imgSecureUefi.Image = isInfo ? Images.StaticImages._000_Info3_h32bit_16 : Images.StaticImages._000_Alert2_h32bit_16; imgSecureUefi.Image = isInfo ? Images.StaticImages._000_Info3_h32bit_16 : Images.StaticImages._000_Alert2_h32bit_16;
} }
@ -183,9 +183,12 @@ namespace XenAdmin.Wizards
var secureBoot = _templateVM.GetSecureBootMode(); var secureBoot = _templateVM.GetSecureBootMode();
if (secureBoot == "true" || secureBoot == "auto" && _poolHasCertificates) if (secureBoot == "true" || secureBoot == "auto" && _poolHasCertificates)
radioButtonUEFISecureBoot.Checked = true; radioButtonUEFISecureBoot.Checked = radioButtonUEFISecureBoot.Visible;
else else
radioButtonUEFIBoot.Checked = true; radioButtonUEFIBoot.Checked = radioButtonUEFIBoot.Visible;
if (!radioButtonUEFISecureBoot.Checked && !radioButtonUEFIBoot.Checked && radioButtonBIOSBoot.Enabled)
radioButtonBIOSBoot.Checked = true;
if (radioButtonUEFISecureBoot.Enabled && radioButtonUEFISecureBoot.Checked && !_poolHasCertificates) if (radioButtonUEFISecureBoot.Enabled && radioButtonUEFISecureBoot.Checked && !_poolHasCertificates)
UpdateSecureUefiWarning(Messages.GUEFI_SECUREBOOT_MODE_MISSING_CERTIFICATES, false); UpdateSecureUefiWarning(Messages.GUEFI_SECUREBOOT_MODE_MISSING_CERTIFICATES, false);