CP-18417: Simplifying the automatic enabled/disabled logic.

Automatic is disabled if any pool forbids auto restart (per Neptune), and reboot is required. It's also disabled if the update type isn't one of the three in the switch statement. If it's enabled it is checked by default.
This commit is contained in:
Callum McIntyre 2016-08-26 14:45:24 +01:00
parent 8639660562
commit a548c21120

View File

@ -86,31 +86,29 @@ namespace XenAdmin.Wizards.PatchingWizard
var automaticDisabled = anyPoolForbidsAutoRestart && patchRequiresReboot;
if (automaticDisabled)
{
AutomaticRadioButton.Checked = false;
AutomaticRadioButton.Enabled = false;
}
switch (SelectedUpdateType)
{
case UpdateType.NewRetail:
case UpdateType.Existing:
textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeRetailPatch(SelectedServers, Patch);
if (!automaticDisabled)
{
AutomaticRadioButton.Enabled = true;
AutomaticRadioButton.Checked = true;
}
break;
case UpdateType.NewSuppPack:
textBoxLog.Text = PatchingWizardModeGuidanceBuilder.ModeSuppPack(SelectedServers);
if (!automaticDisabled)
{
AutomaticRadioButton.Enabled = true;
AutomaticRadioButton.Checked = true;
}
break;
default:
automaticDisabled = true;
break;
}
if (automaticDisabled)
{
AutomaticRadioButton.Checked = false;
AutomaticRadioButton.Enabled = false;
}
else
{
AutomaticRadioButton.Enabled = true;
AutomaticRadioButton.Checked = true;
}
if (SelectedUpdateType == UpdateType.NewSuppPack || SelectedServers.Exists(server => !Helpers.ClearwaterOrGreater(server)))