CP-28284: Only show the error icon and text when all the workers have finished

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2018-06-11 15:59:27 +01:00 committed by Konstantina Chremmou
parent eca6081f48
commit 920da093e0

View File

@ -534,31 +534,28 @@ namespace XenAdmin.Wizards.PatchingWizard
{
if (!e.Cancelled)
{
if (!panel1.Visible)
var bgw = sender as UpdateProgressBackgroundWorker;
if (bgw != null && bgw.DoneActions.Any(a => a.Error != null))
{
var bgw = sender as UpdateProgressBackgroundWorker;
if (bgw != null && bgw.DoneActions.Any(a => a.Error != null))
_someWorkersFailed = true;
}
//if all finished
if (backgroundWorkers.All(w => !w.IsBusy))
{
panel1.Visible = true;
if (_someWorkersFailed)
{
labelError.Text = backgroundWorkers.Count > 1
? Messages.PATCHINGWIZARD_AUTOUPDATINGPAGE_ERROR_MANY
: Messages.PATCHINGWIZARD_AUTOUPDATINGPAGE_ERROR_ONE;
pictureBox1.Image = Images.StaticImages._000_error_h32bit_16;
panel1.Visible = true;
_someWorkersFailed = true;
}
}
//if all finished
if (backgroundWorkers.All(w => !w.IsBusy))
{
if (!panel1.Visible)
else
{
labelError.Text = backgroundWorkers.Count > 1
? Messages.PATCHINGWIZARD_AUTOUPDATINGPAGE_SUCCESS_MANY
: Messages.PATCHINGWIZARD_AUTOUPDATINGPAGE_SUCCESS_ONE;
pictureBox1.Image = Images.StaticImages._000_Tick_h32bit_16;
panel1.Visible = true;
progressBar.Value = 100;
}