From 182307963fdc11e327175cf1e7b3d8408fdaf744 Mon Sep 17 00:00:00 2001 From: Carmen Agimof Date: Thu, 23 Jul 2015 13:37:14 +0100 Subject: [PATCH] CP-13030: Provide button on the Updates tab to restore dismissed updates. --- XenAdmin/Core/Updates.cs | 26 ++++++++++++++++ .../TabPages/ManageUpdatesPage.Designer.cs | 13 +++++++- XenAdmin/TabPages/ManageUpdatesPage.cs | 6 ++++ XenAdmin/TabPages/ManageUpdatesPage.resx | 30 +++++++++++++++++++ 4 files changed, 74 insertions(+), 1 deletion(-) diff --git a/XenAdmin/Core/Updates.cs b/XenAdmin/Core/Updates.cs index 9c3abf2b4..d47dcf9dc 100644 --- a/XenAdmin/Core/Updates.cs +++ b/XenAdmin/Core/Updates.cs @@ -392,5 +392,31 @@ namespace XenAdmin.Core else if (!alert.CanIgnore) AddUpate(alert); } + + public static void RestoreDismissedUpdates() + { + foreach (IXenConnection _connection in ConnectionsManager.XenConnectionsCopy) + { + XenAPI.Pool pool = Helpers.GetPoolOfOne(_connection); + if (pool == null) + continue; + + Dictionary other_config = pool.other_config; + + if (other_config.ContainsKey(IgnorePatchAction.IgnorePatchKey)) + { + other_config.Remove(IgnorePatchAction.IgnorePatchKey); + } + if (other_config.ContainsKey(IgnoreServerAction.LAST_SEEN_SERVER_VERSION_KEY)) + { + other_config.Remove(IgnorePatchAction.IgnorePatchKey); + } + } + + Properties.Settings.Default.LatestXenCenterSeen = ""; + Settings.TrySaveSettings(); + + Updates.CheckForUpdates(true); + } } } diff --git a/XenAdmin/TabPages/ManageUpdatesPage.Designer.cs b/XenAdmin/TabPages/ManageUpdatesPage.Designer.cs index 6e1410d62..91d101a38 100644 --- a/XenAdmin/TabPages/ManageUpdatesPage.Designer.cs +++ b/XenAdmin/TabPages/ManageUpdatesPage.Designer.cs @@ -59,6 +59,7 @@ this.ColumnLocation = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnWebPage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.toolStripButtonRestoreDismissed = new System.Windows.Forms.ToolStripButton(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.informationLabelIcon)).BeginInit(); this.tableLayoutPanel2.SuspendLayout(); @@ -109,7 +110,8 @@ this.toolStripButtonRefresh, this.toolStripSeparator1, this.toolStripButtonExportAll, - this.toolStripLabelFiltersOnOff}); + this.toolStripLabelFiltersOnOff, + this.toolStripButtonRestoreDismissed}); this.toolStrip1.Name = "toolStrip1"; // // toolStripDropDownButtonServerFilter @@ -252,6 +254,14 @@ this.ColumnWebPage.Resizable = System.Windows.Forms.DataGridViewTriState.False; this.ColumnWebPage.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // + // toolStripButtonRestoreDismissed + // + this.toolStripButtonRestoreDismissed.AutoToolTip = false; + this.toolStripButtonRestoreDismissed.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + resources.ApplyResources(this.toolStripButtonRestoreDismissed, "toolStripButtonRestoreDismissed"); + this.toolStripButtonRestoreDismissed.Name = "toolStripButtonRestoreDismissed"; + this.toolStripButtonRestoreDismissed.Click += new System.EventHandler(this.toolStripButtonRestoreDismissed_Click); + // // ManageUpdatesPage // resources.ApplyResources(this, "$this"); @@ -300,5 +310,6 @@ private System.Windows.Forms.DataGridViewTextBoxColumn ColumnLocation; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnDate; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnWebPage; + private System.Windows.Forms.ToolStripButton toolStripButtonRestoreDismissed; } } \ No newline at end of file diff --git a/XenAdmin/TabPages/ManageUpdatesPage.cs b/XenAdmin/TabPages/ManageUpdatesPage.cs index 2fa5294c5..753f1e383 100644 --- a/XenAdmin/TabPages/ManageUpdatesPage.cs +++ b/XenAdmin/TabPages/ManageUpdatesPage.cs @@ -748,5 +748,11 @@ namespace XenAdmin.TabPages Messages.XENCENTER)).ShowDialog(this); } } + + private void toolStripButtonRestoreDismissed_Click(object sender, EventArgs e) + { + + Updates.RestoreDismissedUpdates(); + } } } diff --git a/XenAdmin/TabPages/ManageUpdatesPage.resx b/XenAdmin/TabPages/ManageUpdatesPage.resx index 2d780951b..6b20a1def 100644 --- a/XenAdmin/TabPages/ManageUpdatesPage.resx +++ b/XenAdmin/TabPages/ManageUpdatesPage.resx @@ -303,6 +303,30 @@ Filters are ON/OFF + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG + YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9 + 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw + bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc + VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9 + c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32 + Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo + mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+ + kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D + TgDQASA1MVpwzwAAAABJRU5ErkJggg== + + + + Magenta + + + 152, 23 + + + Restore &Dismissed Updates + 1, 1 @@ -647,6 +671,12 @@ System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + toolStripButtonRestoreDismissed + + + System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + ManageUpdatesPage