mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-24 22:06:59 +01:00
CA-218719: Context menu: confusing "(empty)" pool item when there are no connected pools
This commit is contained in:
parent
081a6302d3
commit
ebd408a227
@ -114,17 +114,11 @@ namespace XenAdmin.Commands
|
||||
base.DropDownItems.Add(hostMenuItem);
|
||||
}
|
||||
|
||||
if (base.DropDownItems.Count <= 0)
|
||||
{
|
||||
ToolStripMenuItem hostMenuItem = new ToolStripMenuItem(Messages.HOST_MENU_EMPTY);
|
||||
hostMenuItem.Enabled = false;
|
||||
hostMenuItem.Font = Program.DefaultFont;
|
||||
base.DropDownItems.Add(hostMenuItem);
|
||||
}
|
||||
|
||||
if (Helpers.GetPool(connection) != null)
|
||||
{
|
||||
base.DropDownItems.Add(new ToolStripSeparator());
|
||||
if (base.DropDownItems.Count > 0)
|
||||
base.DropDownItems.Add(new ToolStripSeparator());
|
||||
|
||||
// Add a final option for connecting a new server and adding it to the pool in one action
|
||||
AddNewHostToPoolCommand cmd = new AddNewHostToPoolCommand(Command.MainWindowCommandInterface, Helpers.GetPool(connection));
|
||||
CommandToolStripMenuItem connectAndAddToPoolMenuItem = new CommandToolStripMenuItem(cmd);
|
||||
|
@ -84,15 +84,9 @@ namespace XenAdmin.Commands
|
||||
}
|
||||
}
|
||||
|
||||
if (base.DropDownItems.Count <= 0)
|
||||
{
|
||||
ToolStripMenuItem hostMenuItem = new ToolStripMenuItem(Messages.HOST_MENU_EMPTY);
|
||||
hostMenuItem.Font = Program.DefaultFont;
|
||||
hostMenuItem.Enabled = false;
|
||||
base.DropDownItems.Add(hostMenuItem);
|
||||
}
|
||||
if (base.DropDownItems.Count > 0)
|
||||
base.DropDownItems.Add(new ToolStripSeparator());
|
||||
|
||||
base.DropDownItems.Add(new ToolStripSeparator());
|
||||
base.DropDownItems.Add(new CommandToolStripMenuItem(new NewPoolCommand(Command.MainWindowCommandInterface, selection)));
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
@ -291,7 +291,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
@ -405,7 +405,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
@ -520,7 +520,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
@ -637,7 +637,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
@ -1364,7 +1364,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
@ -1476,7 +1476,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
@ -1590,7 +1590,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
@ -1732,7 +1732,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
@ -1860,7 +1860,7 @@ namespace XenAdminTests.TabsAndMenus
|
||||
ExpectedMenuItem[] poolToolStripMenuItem = new ExpectedMenuItem[]{
|
||||
new ExpectedTextMenuItem("&New Pool...", true, false ),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("(empty)", false), new ExpectedSeparator(), new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("&Add Server", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Add New Server...", true)} ),
|
||||
new ExpectedTextMenuItem("Re&move Server", false, false ),
|
||||
new ExpectedTextMenuItem("Reconnec&t As...", true, false ),
|
||||
new ExpectedTextMenuItem("Dis&connect", true, false ),
|
||||
|
@ -319,8 +319,6 @@ namespace XenAdminTests.TabsAndMenus
|
||||
new ExpectedTextMenuItem("&Add Server", true, false,
|
||||
new ExpectedMenuItem[]
|
||||
{
|
||||
new ExpectedTextMenuItem("(empty)", false),
|
||||
new ExpectedSeparator(),
|
||||
new ExpectedTextMenuItem("&Add New Server...", true)
|
||||
}),
|
||||
new ExpectedTextMenuItem("&Disconnect", true),
|
||||
|
Loading…
Reference in New Issue
Block a user