mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-21 07:49:32 +01:00
CA-368812: Prevent host reset when moving between wizard pages using SelectMultipleVMDestinationPage
Multiple changes: 1. Remove `SetDefaultTarget(ChosenItem);` from `PageLeaveCore`. This was clearing the value every time the page was left. 2. Add event `m_dataGridView_CellValueChanged`. Inside the event, we keep track of which target host/pool was selected 3. Add a check that resets the value set in `m_dataGridView_CellValueChanged` in case the chosen pool is changed. Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
parent
69c007eabb
commit
a69843352f
@ -103,6 +103,7 @@
|
|||||||
this.m_dataGridView.Name = "m_dataGridView";
|
this.m_dataGridView.Name = "m_dataGridView";
|
||||||
this.m_dataGridView.RowHeadersVisible = false;
|
this.m_dataGridView.RowHeadersVisible = false;
|
||||||
this.m_dataGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.m_dataGridView_CellClick);
|
this.m_dataGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.m_dataGridView_CellClick);
|
||||||
|
this.m_dataGridView.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.m_dataGridView_CellValueChanged);
|
||||||
this.m_dataGridView.CurrentCellDirtyStateChanged += new System.EventHandler(this.m_dataGridView_CurrentCellDirtyStateChanged);
|
this.m_dataGridView.CurrentCellDirtyStateChanged += new System.EventHandler(this.m_dataGridView_CurrentCellDirtyStateChanged);
|
||||||
//
|
//
|
||||||
// m_colVmName
|
// m_colVmName
|
||||||
|
@ -205,7 +205,6 @@ namespace XenAdmin.Wizards.GenericPages
|
|||||||
}
|
}
|
||||||
|
|
||||||
UnregisterHandlers();
|
UnregisterHandlers();
|
||||||
SetDefaultTarget(ChosenItem);
|
|
||||||
ClearComboBox();
|
ClearComboBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -612,6 +611,12 @@ namespace XenAdmin.Wizards.GenericPages
|
|||||||
if (updatingHomeServerList)
|
if (updatingHomeServerList)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// when selecting a new destination pool, reset the target host selection
|
||||||
|
if (ChosenItem != null && !ChosenItem.Equals(m_comboBoxConnection.SelectedItem))
|
||||||
|
{
|
||||||
|
SetDefaultTarget(null);
|
||||||
|
}
|
||||||
|
|
||||||
//If the item is delay loading and them item is disabled, null the selection made
|
//If the item is delay loading and them item is disabled, null the selection made
|
||||||
//and clear the table containing server data
|
//and clear the table containing server data
|
||||||
IEnableableXenObjectComboBoxItem item = m_comboBoxConnection.SelectedItem as IEnableableXenObjectComboBoxItem;
|
IEnableableXenObjectComboBoxItem item = m_comboBoxConnection.SelectedItem as IEnableableXenObjectComboBoxItem;
|
||||||
@ -675,6 +680,20 @@ namespace XenAdmin.Wizards.GenericPages
|
|||||||
SetButtonNextEnabled(true);
|
SetButtonNextEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void m_dataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.RowIndex < 0 || e.ColumnIndex < 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var cell = m_dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex];
|
||||||
|
if (cell.Value is IEnableableXenObjectComboBoxItem value)
|
||||||
|
{
|
||||||
|
SetDefaultTarget(value.Item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void UnregisterHandlers()
|
private void UnregisterHandlers()
|
||||||
|
@ -151,7 +151,7 @@
|
|||||||
<value>m_labelIntro</value>
|
<value>m_labelIntro</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>m_labelIntro.Type" xml:space="preserve">
|
<data name=">>m_labelIntro.Type" xml:space="preserve">
|
||||||
<value>XenAdmin.Controls.Common.AutoHeightLabel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>XenAdmin.Controls.Common.AutoHeightLabel, [XenCenter_No_Space]Main, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>m_labelIntro.Parent" xml:space="preserve">
|
<data name=">>m_labelIntro.Parent" xml:space="preserve">
|
||||||
<value>tableLayoutPanel1</value>
|
<value>tableLayoutPanel1</value>
|
||||||
@ -205,7 +205,7 @@
|
|||||||
<value>m_comboBoxConnection</value>
|
<value>m_comboBoxConnection</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>m_comboBoxConnection.Type" xml:space="preserve">
|
<data name=">>m_comboBoxConnection.Type" xml:space="preserve">
|
||||||
<value>XenAdmin.Controls.EnableableComboBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>XenAdmin.Controls.EnableableComboBox, [XenCenter_No_Space]Main, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>m_comboBoxConnection.Parent" xml:space="preserve">
|
<data name=">>m_comboBoxConnection.Parent" xml:space="preserve">
|
||||||
<value>tableLayoutPanel1</value>
|
<value>tableLayoutPanel1</value>
|
||||||
@ -427,12 +427,12 @@
|
|||||||
<value>m_colTarget</value>
|
<value>m_colTarget</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>m_colTarget.Type" xml:space="preserve">
|
<data name=">>m_colTarget.Type" xml:space="preserve">
|
||||||
<value>XenAdmin.Controls.EnableableComboBoxColumn, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>XenAdmin.Controls.EnableableComboBoxColumn, [XenCenter_No_Space]Main, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>$this.Name" xml:space="preserve">
|
<data name=">>$this.Name" xml:space="preserve">
|
||||||
<value>SelectMultipleVMDestinationPage</value>
|
<value>SelectMultipleVMDestinationPage</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>$this.Type" xml:space="preserve">
|
<data name=">>$this.Type" xml:space="preserve">
|
||||||
<value>XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>XenAdmin.Controls.XenTabPage, [XenCenter_No_Space]Main, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
Loading…
Reference in New Issue
Block a user