Skip to content

Commit

Permalink
CP-40844 minor fixes/tidy up
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lancaster <[email protected]>
  • Loading branch information
CitrixChris committed Oct 5, 2023
1 parent beac450 commit 467c08b
Show file tree
Hide file tree
Showing 5 changed files with 499 additions and 908 deletions.
20 changes: 3 additions & 17 deletions XenAdmin/Alerts/Types/ClientUpdateAlert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ public static void DownloadSource(IWin32Window parent)
}

var clientVersion = Updates.ClientVersions.FirstOrDefault();
if (clientVersion == null) { return; }
if (clientVersion == null)
return;
var sourceUrl = clientVersion.SourceUrl;
var downloadSourceAction = new DownloadSourceAction(clientVersion.Name, clientVersion.Version, new Uri(sourceUrl), outputPathAndFileName);

Expand All @@ -177,22 +178,7 @@ public static void DownloadSource(IWin32Window parent)
}

if (!downloadSourceAction.Succeeded)
return;

bool currentTasks = false;
foreach (ActionBase a in ConnectionsManager.History)
{
if (a is MeddlingAction || a.IsCompleted)
continue;

currentTasks = true;
break;
}

if (currentTasks && new Dialogs.WarningDialogs.CloseXenCenterWarningDialog(true).ShowDialog(parent) != DialogResult.OK)
{
downloadSourceAction.ReleaseDownloadedContent();
}
return;
}
}
}
8 changes: 4 additions & 4 deletions XenAdmin/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2716,11 +2716,11 @@ private void SetClientUpdateAlert()
if (updateAlert != null)
{
relNotesToolStripMenuItem.Text = string.Format(Messages.MAINWINDOW_UPDATE_RELEASE, updateAlert.NewVersion.Version);
downloadLatestSourceToolStripMenuItem.Text = string.Format(Messages.DOWNLOAD_SOURCE, updateAlert.NewVersion.Version);
downloadSourceToolStripMenuItem.Text = string.Format(Messages.DOWNLOAD_SOURCE, updateAlert.NewVersion.Version);
}
var clientVersion = Updates.ClientVersions.FirstOrDefault();
downloadSourceToolStripMenuItem.Visible = clientVersion != null;
downloadSourceToolStripMenuItem.Text = clientVersion != null
var clientVersion = Updates.ClientVersions.FirstOrDefault();
downloadLatestSourceToolStripMenuItem.Visible = clientVersion != null;
downloadLatestSourceToolStripMenuItem.Text = clientVersion != null
? string.Format(Messages.DOWNLOAD_SOURCE, clientVersion.Version)
: string.Empty;
updateClientToolStripMenuItem.Visible = updateAlert != null;
Expand Down
Loading

0 comments on commit 467c08b

Please sign in to comment.