From f120ffd496f0e62c3fb5722ea12f2b356237db3c Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Tue, 31 Dec 2013 15:47:52 +0000 Subject: [PATCH] CA-123572: Fixed regression: restored "New folder" item in the context menu of the Folders root node. Signed-off-by: Konstantina Chremmou --- XenAdmin/Commands/NewFolderCommand.cs | 4 +++- XenAdmin/Controls/MainWindowControls/NavigationView.cs | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/XenAdmin/Commands/NewFolderCommand.cs b/XenAdmin/Commands/NewFolderCommand.cs index 92ff35c59..c8937d504 100644 --- a/XenAdmin/Commands/NewFolderCommand.cs +++ b/XenAdmin/Commands/NewFolderCommand.cs @@ -144,7 +144,9 @@ namespace XenAdmin.Commands protected override bool CanExecuteCore(SelectedItemCollection selection) { - return selection.ContainsOneItemOfType() && ConnectionAvailable(); + return (selection.ContainsOneItemOfType() + || selection.ContainsOneItemOfType(t => t.Grouping is OrganizationViewFolders)) + && ConnectionAvailable(); } private bool ConnectionAvailable() diff --git a/XenAdmin/Controls/MainWindowControls/NavigationView.cs b/XenAdmin/Controls/MainWindowControls/NavigationView.cs index 1b2fdcf36..d602bd723 100644 --- a/XenAdmin/Controls/MainWindowControls/NavigationView.cs +++ b/XenAdmin/Controls/MainWindowControls/NavigationView.cs @@ -488,6 +488,14 @@ namespace XenAdmin.Controls.MainWindowControls TreeContextMenu.Items.Add(new CommandToolStripMenuItem(new ConnectAllHostsCommand(Program.MainWindow.CommandInterface), true)); TreeContextMenu.Items.Add(new CommandToolStripMenuItem(new DisconnectAllHostsCommand(Program.MainWindow.CommandInterface), true)); } + else + { + var groupingTag = e.Node.Tag as GroupingTag; + if (groupingTag != null && groupingTag.Grouping as OrganizationViewFolders != null) + TreeContextMenu.Items.Add(new CommandToolStripMenuItem( + new NewFolderCommand(Program.MainWindow.CommandInterface, new[] { new SelectedItem(groupingTag, e.Node) }), + true)); + } } else {