From 8992e551412490765b0d827c4ec8e716277fa51d Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Mon, 14 May 2018 12:25:49 +0100 Subject: [PATCH] CA-286291: Add the additional menu items immediately after the first item, so we don't have to wait for the WLB recommendations to be retrieved. Signed-off-by: Konstantina Chremmou --- .../Commands/Controls/VMOperationToolStripMenuItem.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/XenAdmin/Commands/Controls/VMOperationToolStripMenuItem.cs b/XenAdmin/Commands/Controls/VMOperationToolStripMenuItem.cs index 06ce05c33..593c9f238 100644 --- a/XenAdmin/Commands/Controls/VMOperationToolStripMenuItem.cs +++ b/XenAdmin/Commands/Controls/VMOperationToolStripMenuItem.cs @@ -89,7 +89,8 @@ namespace XenAdmin.Commands } VisualMenuItemAlignData.ParentStrip = this; - IXenConnection connection = Command.GetSelection()[0].Connection; + var selection = Command.GetSelection(); + IXenConnection connection = selection[0].Connection; bool wlb = Helpers.WlbEnabled(connection); if (wlb) @@ -109,6 +110,9 @@ namespace XenAdmin.Commands item.Tag = host; base.DropDownItems.Add(item); } + + // Adds the migrate wizard button, do this before the enable checks on the other items + AddAdditionalMenuItems(selection); UpdateHostList(); } @@ -231,8 +235,6 @@ namespace XenAdmin.Commands { DropDownItems.Insert(hostMenuItems.IndexOf(menuItem) + 1, menuItem); } - - AddAdditionalMenuItems(selection); } private void EnableAppropriateHostsNoWlb() @@ -262,9 +264,6 @@ namespace XenAdmin.Commands if (Stopped) return; - // Adds the migrate wizard button, do this before the enable checks on the other items - AddAdditionalMenuItems(selection); - foreach (VMOperationToolStripMenuSubItem item in hostMenuItems) { var host = item.Tag as Host;