Merge pull request #570 from agimofcarmen/CP-13030

CP-13030: Provide button on the Updates tab to restore dismissed upda…
This commit is contained in:
Mihaela Stoica 2015-07-23 13:54:37 +01:00
commit 84ed24cd0c
4 changed files with 74 additions and 1 deletions

View File

@ -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<string, string> 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);
}
}
}

View File

@ -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;
}
}

View File

@ -748,5 +748,11 @@ namespace XenAdmin.TabPages
Messages.XENCENTER)).ShowDialog(this);
}
}
private void toolStripButtonRestoreDismissed_Click(object sender, EventArgs e)
{
Updates.RestoreDismissedUpdates();
}
}
}

View File

@ -303,6 +303,30 @@
<data name="toolStripLabelFiltersOnOff.Text" xml:space="preserve">
<value>Filters are ON/OFF</value>
</data>
<data name="toolStripButtonRestoreDismissed.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
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==
</value>
</data>
<data name="toolStripButtonRestoreDismissed.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
<value>Magenta</value>
</data>
<data name="toolStripButtonRestoreDismissed.Size" type="System.Drawing.Size, System.Drawing">
<value>152, 23</value>
</data>
<data name="toolStripButtonRestoreDismissed.Text" xml:space="preserve">
<value>Restore &amp;Dismissed Updates</value>
</data>
<data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>1, 1</value>
</data>
@ -647,6 +671,12 @@
<data name="&gt;&gt;ColumnWebPage.Type" xml:space="preserve">
<value>System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripButtonRestoreDismissed.Name" xml:space="preserve">
<value>toolStripButtonRestoreDismissed</value>
</data>
<data name="&gt;&gt;toolStripButtonRestoreDismissed.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>ManageUpdatesPage</value>
</data>