From 05cbae25ce6e546ec590f0f4576018512e8a2912 Mon Sep 17 00:00:00 2001 From: CitrixChris <86611314+CitrixChris@users.noreply.github.com> Date: Thu, 16 Dec 2021 10:34:00 +0000 Subject: [PATCH] CP-32667 Added download action to CHC (#2912) Added the interface option to download and install updates for client updates. Disabled by default until CP-31587 does the proper checks Signed-off-by: Christophe25 --- XenAdmin/Alerts/Types/ClientUpdateAlert.cs | 7 +++++++ XenAdmin/TabPages/ManageUpdatesPage.cs | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/XenAdmin/Alerts/Types/ClientUpdateAlert.cs b/XenAdmin/Alerts/Types/ClientUpdateAlert.cs index 65634ec44..6cb725b45 100644 --- a/XenAdmin/Alerts/Types/ClientUpdateAlert.cs +++ b/XenAdmin/Alerts/Types/ClientUpdateAlert.cs @@ -68,6 +68,13 @@ namespace XenAdmin.Alerts public override string HelpID => "XenCenterUpdateAlert"; + public bool Downloadable { + get { + // TODO: Implement proper check in CP-31587 + return false; + } + } + static int DISMISSED_XC_VERSIONS_LIMIT = 5; public override void Dismiss() diff --git a/XenAdmin/TabPages/ManageUpdatesPage.cs b/XenAdmin/TabPages/ManageUpdatesPage.cs index 3d12e7189..ca422abec 100644 --- a/XenAdmin/TabPages/ManageUpdatesPage.cs +++ b/XenAdmin/TabPages/ManageUpdatesPage.cs @@ -830,6 +830,14 @@ namespace XenAdmin.TabPages items.Add(fix); } + if (alert is ClientUpdateAlert) + { + var download = new ToolStripMenuItem(Messages.UPDATES_DOWNLOAD_AND_INSTALL); + download.Click += ToolStripMenuItemDownloadInstall_Click; + download.Enabled = (alert as ClientUpdateAlert).Downloadable; + items.Add(download); + } + if (items.Count > 0) items.Add(new ToolStripSeparator()); @@ -956,6 +964,11 @@ namespace XenAdmin.TabPages } } + private void ToolStripMenuItemDownloadInstall_Click(object sender, EventArgs e) + { + throw new NotImplementedException("To be implemented via CP-31587"); + } + private void ToolStripMenuItemDismiss_Click(object sender, EventArgs e) { if (dataGridViewUpdates.SelectedRows.Count != 1)