mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-12-03 16:41:04 +01:00
CA-294091: Fix two Update wizards co-exist bug
Signed-off-by: Ji Jiang <ji.jiang@citrix.com>
This commit is contained in:
parent
61ee71dac1
commit
d0fc3be56e
@ -53,8 +53,8 @@ namespace XenAdmin
|
|||||||
void RequestRefreshTreeView();
|
void RequestRefreshTreeView();
|
||||||
void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard);
|
void ShowPerXenModelObjectWizard(IXenObject obj, Form wizard);
|
||||||
void ShowPerConnectionWizard(IXenConnection connection, Form wizard);
|
void ShowPerConnectionWizard(IXenConnection connection, Form wizard);
|
||||||
void ShowForm(Type type);
|
Form ShowForm(Type type);
|
||||||
void ShowForm(Type type, object[] args);
|
Form ShowForm(Type type, object[] args);
|
||||||
void CloseActiveWizards(IXenConnection connection);
|
void CloseActiveWizards(IXenConnection connection);
|
||||||
void CloseActiveWizards(IXenObject xenObject);
|
void CloseActiveWizards(IXenObject xenObject);
|
||||||
Collection<IXenConnection> GetXenConnectionsCopy();
|
Collection<IXenConnection> GetXenConnectionsCopy();
|
||||||
|
@ -2393,9 +2393,9 @@ namespace XenAdmin
|
|||||||
/// it is created first and then shown.
|
/// it is created first and then shown.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type">The type of the form to be shown.</param>
|
/// <param name="type">The type of the form to be shown.</param>
|
||||||
public void ShowForm(Type type)
|
public Form ShowForm(Type type)
|
||||||
{
|
{
|
||||||
ShowForm(type, null);
|
return ShowForm(type, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -2404,19 +2404,20 @@ namespace XenAdmin
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type">The type of the form to be shown.</param>
|
/// <param name="type">The type of the form to be shown.</param>
|
||||||
/// <param name="args">The arguments to pass to the form's consructor</param>
|
/// <param name="args">The arguments to pass to the form's consructor</param>
|
||||||
public void ShowForm(Type type, object[] args)
|
public Form ShowForm(Type type, object[] args)
|
||||||
{
|
{
|
||||||
foreach (Form form in Application.OpenForms)
|
foreach (Form form in Application.OpenForms)
|
||||||
{
|
{
|
||||||
if (form.GetType() == type)
|
if (form.GetType() == type)
|
||||||
{
|
{
|
||||||
HelpersGUI.BringFormToFront(form);
|
HelpersGUI.BringFormToFront(form);
|
||||||
return;
|
return form;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Form newForm = (Form)Activator.CreateInstance(type, args);
|
Form newForm = (Form)Activator.CreateInstance(type, args);
|
||||||
newForm.Show(this);
|
newForm.Show(this);
|
||||||
|
return newForm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Form Form
|
public Form Form
|
||||||
|
@ -1099,8 +1099,9 @@ namespace XenAdmin.TabPages
|
|||||||
if (string.IsNullOrEmpty(patchUri))
|
if (string.IsNullOrEmpty(patchUri))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var wizard = new PatchingWizard();
|
PatchingWizard wizard = (PatchingWizard)Program.MainWindow.ShowForm(typeof(PatchingWizard));
|
||||||
wizard.Show();
|
if (!wizard.IsFirstPage())
|
||||||
|
return;
|
||||||
wizard.NextStep();
|
wizard.NextStep();
|
||||||
wizard.AddAlert(patchAlert);
|
wizard.AddAlert(patchAlert);
|
||||||
wizard.NextStep();
|
wizard.NextStep();
|
||||||
@ -1531,16 +1532,9 @@ namespace XenAdmin.TabPages
|
|||||||
|
|
||||||
private void toolStripButtonUpdate_Click(object sender, EventArgs e)
|
private void toolStripButtonUpdate_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var wizard = new PatchingWizard();
|
PatchingWizard wizard = (PatchingWizard)Program.MainWindow.ShowForm(typeof(PatchingWizard));
|
||||||
wizard.Show();
|
if (wizard.IsFirstPage())
|
||||||
wizard.NextStep();
|
wizard.NextStep();
|
||||||
|
|
||||||
var hostlist = new List<Host>();
|
|
||||||
foreach (IXenConnection c in ConnectionsManager.XenConnectionsCopy)
|
|
||||||
hostlist.AddRange(c.Cache.Hosts);
|
|
||||||
|
|
||||||
if (hostlist.Count > 0)
|
|
||||||
wizard.SelectServers(hostlist);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -353,6 +353,11 @@ namespace XenAdmin.Wizards
|
|||||||
wizardProgress.PreviousStep();
|
wizardProgress.PreviousStep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsFirstPage()
|
||||||
|
{
|
||||||
|
return wizardProgress.IsFirstStep;
|
||||||
|
}
|
||||||
|
|
||||||
protected void RefreshProgress()
|
protected void RefreshProgress()
|
||||||
{
|
{
|
||||||
wizardProgress.Refresh();
|
wizardProgress.Refresh();
|
||||||
|
@ -75,14 +75,14 @@ namespace XenAdminTests
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowForm(Type type)
|
public Form ShowForm(Type type)
|
||||||
{
|
{
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowForm(Type type, object[] args)
|
public Form ShowForm(Type type, object[] args)
|
||||||
{
|
{
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseActiveWizards(IXenConnection connection)
|
public void CloseActiveWizards(IXenConnection connection)
|
||||||
|
Loading…
Reference in New Issue
Block a user