CP-6093: Filter by Location ToolStripDropDownButton: only add ShowAll item if there

are actually items to show. Button enablement on Events page.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2013-11-25 08:42:17 +00:00
parent 5d04edae99
commit 58d0599bdc
2 changed files with 16 additions and 10 deletions

View File

@ -139,17 +139,22 @@ namespace XenAdmin.Controls
DropDownItems.Add(GeneratePoolFilterItem(p));
}
toolStripMenuItemAll = new ToolStripMenuItem
{
Text = Messages.FILTER_SHOW_ALL,
Enabled = FilterIsOn
};
if (DropDownItems.Count > 0)
{
toolStripMenuItemAll = new ToolStripMenuItem
{
Text = Messages.FILTER_SHOW_ALL,
Enabled = FilterIsOn
};
DropDownItems.AddRange(new ToolStripItem[]
{
new ToolStripSeparator(),
toolStripMenuItemAll
});
DropDownItems.AddRange(new ToolStripItem[]
{
new ToolStripSeparator(),
toolStripMenuItemAll
});
}
Enabled = DropDownItems.Count > 0;
}
finally
{

View File

@ -61,6 +61,7 @@ namespace XenAdmin.TabPages
toolStripTop.Renderer = new CustomToolStripRenderer();
toolStripSplitButtonDismiss.DefaultItem = tsmiDismissAll;
toolStripSplitButtonDismiss.Text = tsmiDismissAll.Text;
UpdateButtons();
ConnectionsManager.History.CollectionChanged += History_CollectionChanged;
ActionBase.NewAction += Action_NewAction;
}