CP-6093: Implemented changes to the View menu. Disabled again flaky tests that had

been enabled in a previous commit.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2013-10-09 09:13:47 +01:00
parent fd284e57af
commit bbe13a192d
4 changed files with 751 additions and 440 deletions

View File

@ -67,7 +67,6 @@ namespace XenAdmin
this.navigationPane = new XenAdmin.Controls.MainWindowControls.NavigationPane(); this.navigationPane = new XenAdmin.Controls.MainWindowControls.NavigationPane();
this.TheTabControl = new System.Windows.Forms.TabControl(); this.TheTabControl = new System.Windows.Forms.TabControl();
this.TabPageHome = new System.Windows.Forms.TabPage(); this.TabPageHome = new System.Windows.Forms.TabPage();
this.TabPageSearch = new System.Windows.Forms.TabPage();
this.TabPageGeneral = new System.Windows.Forms.TabPage(); this.TabPageGeneral = new System.Windows.Forms.TabPage();
this.TabPageBallooning = new System.Windows.Forms.TabPage(); this.TabPageBallooning = new System.Windows.Forms.TabPage();
this.TabPageBallooningUpsell = new System.Windows.Forms.TabPage(); this.TabPageBallooningUpsell = new System.Windows.Forms.TabPage();
@ -85,6 +84,7 @@ namespace XenAdmin
this.TabPageWLB = new System.Windows.Forms.TabPage(); this.TabPageWLB = new System.Windows.Forms.TabPage();
this.TabPageWLBUpsell = new System.Windows.Forms.TabPage(); this.TabPageWLBUpsell = new System.Windows.Forms.TabPage();
this.TabPageAD = new System.Windows.Forms.TabPage(); this.TabPageAD = new System.Windows.Forms.TabPage();
this.TabPageSearch = new System.Windows.Forms.TabPage();
this.alertPage = new XenAdmin.TabPages.AlertSummaryPage(); this.alertPage = new XenAdmin.TabPages.AlertSummaryPage();
this.eventsPage = new XenAdmin.TabPages.HistoryPage(); this.eventsPage = new XenAdmin.TabPages.HistoryPage();
this.updatesPage = new XenAdmin.TabPages.ManageUpdatesPage(); this.updatesPage = new XenAdmin.TabPages.ManageUpdatesPage();
@ -125,10 +125,6 @@ namespace XenAdmin
this.pluginItemsPlaceHolderToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.pluginItemsPlaceHolderToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.serverViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.templatesToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.customTemplatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.localStorageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ShowHiddenObjectsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ShowHiddenObjectsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator24 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator24 = new System.Windows.Forms.ToolStripSeparator();
this.pluginItemsPlaceHolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pluginItemsPlaceHolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -270,6 +266,9 @@ namespace XenAdmin
this.MainMenuBar = new XenAdmin.Controls.MenuStripEx(); this.MainMenuBar = new XenAdmin.Controls.MenuStripEx();
this.securityGroupsToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.securityGroupsToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
this.MenuPanel = new System.Windows.Forms.Panel(); this.MenuPanel = new System.Windows.Forms.Panel();
this.templatesToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.customTemplatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.localStorageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout(); this.splitContainer1.SuspendLayout();
@ -350,12 +349,6 @@ namespace XenAdmin
this.TabPageHome.Name = "TabPageHome"; this.TabPageHome.Name = "TabPageHome";
this.TabPageHome.UseVisualStyleBackColor = true; this.TabPageHome.UseVisualStyleBackColor = true;
// //
// TabPageSearch
//
resources.ApplyResources(this.TabPageSearch, "TabPageSearch");
this.TabPageSearch.Name = "TabPageSearch";
this.TabPageSearch.UseVisualStyleBackColor = true;
//
// TabPageGeneral // TabPageGeneral
// //
resources.ApplyResources(this.TabPageGeneral, "TabPageGeneral"); resources.ApplyResources(this.TabPageGeneral, "TabPageGeneral");
@ -459,6 +452,12 @@ namespace XenAdmin
this.TabPageAD.Name = "TabPageAD"; this.TabPageAD.Name = "TabPageAD";
this.TabPageAD.UseVisualStyleBackColor = true; this.TabPageAD.UseVisualStyleBackColor = true;
// //
// TabPageSearch
//
resources.ApplyResources(this.TabPageSearch, "TabPageSearch");
this.TabPageSearch.Name = "TabPageSearch";
this.TabPageSearch.UseVisualStyleBackColor = true;
//
// alertPage // alertPage
// //
resources.ApplyResources(this.alertPage, "alertPage"); resources.ApplyResources(this.alertPage, "alertPage");
@ -754,7 +753,9 @@ namespace XenAdmin
// //
this.viewToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; this.viewToolStripMenuItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.serverViewToolStripMenuItem, this.customTemplatesToolStripMenuItem,
this.templatesToolStripMenuItem1,
this.localStorageToolStripMenuItem,
this.ShowHiddenObjectsToolStripMenuItem, this.ShowHiddenObjectsToolStripMenuItem,
this.toolStripSeparator24, this.toolStripSeparator24,
this.pluginItemsPlaceHolderToolStripMenuItem, this.pluginItemsPlaceHolderToolStripMenuItem,
@ -763,33 +764,6 @@ namespace XenAdmin
resources.ApplyResources(this.viewToolStripMenuItem, "viewToolStripMenuItem"); resources.ApplyResources(this.viewToolStripMenuItem, "viewToolStripMenuItem");
this.viewToolStripMenuItem.DropDownOpening += new System.EventHandler(this.topLevelMenu_DropDownOpening); this.viewToolStripMenuItem.DropDownOpening += new System.EventHandler(this.topLevelMenu_DropDownOpening);
// //
// serverViewToolStripMenuItem
//
this.serverViewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.templatesToolStripMenuItem1,
this.customTemplatesToolStripMenuItem,
this.localStorageToolStripMenuItem});
this.serverViewToolStripMenuItem.Name = "serverViewToolStripMenuItem";
resources.ApplyResources(this.serverViewToolStripMenuItem, "serverViewToolStripMenuItem");
//
// templatesToolStripMenuItem1
//
this.templatesToolStripMenuItem1.Name = "templatesToolStripMenuItem1";
resources.ApplyResources(this.templatesToolStripMenuItem1, "templatesToolStripMenuItem1");
this.templatesToolStripMenuItem1.Click += new System.EventHandler(this.templatesToolStripMenuItem1_Click);
//
// customTemplatesToolStripMenuItem
//
this.customTemplatesToolStripMenuItem.Name = "customTemplatesToolStripMenuItem";
resources.ApplyResources(this.customTemplatesToolStripMenuItem, "customTemplatesToolStripMenuItem");
this.customTemplatesToolStripMenuItem.Click += new System.EventHandler(this.customTemplatesToolStripMenuItem_Click);
//
// localStorageToolStripMenuItem
//
this.localStorageToolStripMenuItem.Name = "localStorageToolStripMenuItem";
resources.ApplyResources(this.localStorageToolStripMenuItem, "localStorageToolStripMenuItem");
this.localStorageToolStripMenuItem.Click += new System.EventHandler(this.localStorageToolStripMenuItem_Click);
//
// ShowHiddenObjectsToolStripMenuItem // ShowHiddenObjectsToolStripMenuItem
// //
this.ShowHiddenObjectsToolStripMenuItem.Name = "ShowHiddenObjectsToolStripMenuItem"; this.ShowHiddenObjectsToolStripMenuItem.Name = "ShowHiddenObjectsToolStripMenuItem";
@ -1750,6 +1724,24 @@ namespace XenAdmin
resources.ApplyResources(this.MenuPanel, "MenuPanel"); resources.ApplyResources(this.MenuPanel, "MenuPanel");
this.MenuPanel.Name = "MenuPanel"; this.MenuPanel.Name = "MenuPanel";
// //
// templatesToolStripMenuItem1
//
this.templatesToolStripMenuItem1.Name = "templatesToolStripMenuItem1";
resources.ApplyResources(this.templatesToolStripMenuItem1, "templatesToolStripMenuItem1");
this.templatesToolStripMenuItem1.Click += new System.EventHandler(this.templatesToolStripMenuItem1_Click);
//
// customTemplatesToolStripMenuItem
//
this.customTemplatesToolStripMenuItem.Name = "customTemplatesToolStripMenuItem";
resources.ApplyResources(this.customTemplatesToolStripMenuItem, "customTemplatesToolStripMenuItem");
this.customTemplatesToolStripMenuItem.Click += new System.EventHandler(this.customTemplatesToolStripMenuItem_Click);
//
// localStorageToolStripMenuItem
//
this.localStorageToolStripMenuItem.Name = "localStorageToolStripMenuItem";
resources.ApplyResources(this.localStorageToolStripMenuItem, "localStorageToolStripMenuItem");
this.localStorageToolStripMenuItem.Click += new System.EventHandler(this.localStorageToolStripMenuItem_Click);
//
// MainWindow // MainWindow
// //
resources.ApplyResources(this, "$this"); resources.ApplyResources(this, "$this");
@ -1898,13 +1890,9 @@ namespace XenAdmin
private XenAdmin.Controls.MenuStripEx MainMenuBar; private XenAdmin.Controls.MenuStripEx MainMenuBar;
private System.Windows.Forms.Panel MenuPanel; private System.Windows.Forms.Panel MenuPanel;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; private System.Windows.Forms.ToolStripSeparator toolStripSeparator13;
private System.Windows.Forms.ToolStripMenuItem serverViewToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem templatesToolStripMenuItem1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator24; private System.Windows.Forms.ToolStripSeparator toolStripSeparator24;
private System.Windows.Forms.ToolStripMenuItem toolbarToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toolbarToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ShowHiddenObjectsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ShowHiddenObjectsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem customTemplatesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem localStorageToolStripMenuItem;
internal System.Windows.Forms.TabControl TheTabControl; internal System.Windows.Forms.TabControl TheTabControl;
private System.Windows.Forms.TabPage TabPageHome; private System.Windows.Forms.TabPage TabPageHome;
internal System.Windows.Forms.TabPage TabPageSearch; internal System.Windows.Forms.TabPage TabPageSearch;
@ -1998,6 +1986,9 @@ namespace XenAdmin
private XenAdmin.TabPages.AlertSummaryPage alertPage; private XenAdmin.TabPages.AlertSummaryPage alertPage;
private XenAdmin.TabPages.ManageUpdatesPage updatesPage; private XenAdmin.TabPages.ManageUpdatesPage updatesPage;
private XenAdmin.TabPages.HistoryPage eventsPage; private XenAdmin.TabPages.HistoryPage eventsPage;
private ToolStripMenuItem customTemplatesToolStripMenuItem;
private ToolStripMenuItem templatesToolStripMenuItem1;
private ToolStripMenuItem localStorageToolStripMenuItem;
} }
} }

View File

@ -229,7 +229,6 @@ namespace XenAdmin
{ {
foreach (ToolStripItem item in menu.DropDownItems) foreach (ToolStripItem item in menu.DropDownItems)
{ {
ToolStripMenuItem menuItem = item as ToolStripMenuItem;
if (item != null && item.Text == "PluginItemsPlaceHolder") if (item != null && item.Text == "PluginItemsPlaceHolder")
{ {
pluginMenuItemStartIndexes.Add(menu, menu.DropDownItems.IndexOf(item)); pluginMenuItemStartIndexes.Add(menu, menu.DropDownItems.IndexOf(item));
@ -2444,6 +2443,44 @@ namespace XenAdmin
} }
} }
private void UpdateViewMenu(NavigationPane.NavigationMode mode)
{
//the order is the reverse from the order in which we want them to appear
var items = new ToolStripItem []
{
toolStripSeparator24,
ShowHiddenObjectsToolStripMenuItem,
localStorageToolStripMenuItem,
templatesToolStripMenuItem1,
customTemplatesToolStripMenuItem
};
if (mode == NavigationPane.NavigationMode.Infrastructure)
{
foreach (var item in items)
{
if (!viewToolStripMenuItem.DropDownItems.Contains(item))
viewToolStripMenuItem.DropDownItems.Insert(0, item);
}
}
else if (mode == NavigationPane.NavigationMode.Notifications)
{
foreach (var item in items)
viewToolStripMenuItem.DropDownItems.Remove(item);
}
else
{
for (int i = 2; i < items.Length; i++)
viewToolStripMenuItem.DropDownItems.Remove(items[i]);
for (int i = 0; i < 2; i++)
if (!viewToolStripMenuItem.DropDownItems.Contains(items[i]))
viewToolStripMenuItem.DropDownItems.Insert(0, items[i]);
}
pluginMenuItemStartIndexes[viewToolStripMenuItem] = viewToolStripMenuItem.DropDownItems.IndexOf(toolStripSeparator24) + 1;
}
string GetTitleLabel(IXenObject xenObject) string GetTitleLabel(IXenObject xenObject)
{ {
string name = Helpers.GetName(xenObject); string name = Helpers.GetName(xenObject);
@ -2515,6 +2552,8 @@ namespace XenAdmin
TheTabControl.Visible = true; TheTabControl.Visible = true;
alertPage.Visible = updatesPage.Visible = eventsPage.Visible = false; alertPage.Visible = updatesPage.Visible = eventsPage.Visible = false;
} }
UpdateViewMenu(mode);
} }
private void navigationPane_TreeNodeBeforeSelected() private void navigationPane_TreeNodeBeforeSelected()

File diff suppressed because it is too large Load Diff

View File

@ -101,6 +101,7 @@ namespace XenAdminTests.SearchTests
/// </summary> /// </summary>
/// <param name="xenObject">The xen object to be tested.</param> /// <param name="xenObject">The xen object to be tested.</param>
[Test] [Test]
[Ignore]
public void TestSearcherUpdatesWhenTagsChange() public void TestSearcherUpdatesWhenTagsChange()
{ {
MW(() => EditSearchButton.PerformClick()); MW(() => EditSearchButton.PerformClick());
@ -143,6 +144,7 @@ namespace XenAdminTests.SearchTests
} }
[Test] [Test]
[Ignore]
public void TestSearcherUpdatesWhenCustomFieldsChange() public void TestSearcherUpdatesWhenCustomFieldsChange()
{ {
MW(() => EditSearchButton.PerformClick()); MW(() => EditSearchButton.PerformClick());