PR-1537: Added label on the alerts dialog to indicate whether filters are on/off. Removed icons from the toolstrip buttons to reduce clutter.

Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2013-07-03 11:10:21 +01:00
parent b2132132cd
commit 41ac4c6ea2
7 changed files with 83 additions and 16 deletions

View File

@ -86,12 +86,21 @@ namespace XenAdmin.Controls
return false;
}
public bool FilterIsOn
{
get { return !toolStripMenuItemShowAll.Checked; }
}
protected override void OnDropDownItemClicked(ToolStripItemClickedEventArgs e)
{
base.OnDropDownItemClicked(e);
var menuItem = (ToolStripMenuItem)e.ClickedItem;
//we do not allow unchecking by clicking an already checked item
if (menuItem.Checked)
return;
switch (DropDownItems.IndexOf(menuItem))
{

View File

@ -156,6 +156,11 @@ namespace XenAdmin.Controls
return false;
}
public bool FilterIsOn
{
get { return HostCheckStates.ContainsValue(false); }
}
private ToolStripMenuItem GeneratePoolFilterItem(Pool p)
{
@ -250,7 +255,7 @@ namespace XenAdmin.Controls
Program.Invoke(Parent, RefreshLists);
}
void XenConnections_CollectionChanged(object sender, CollectionChangeEventArgs e)
private void XenConnections_CollectionChanged(object sender, CollectionChangeEventArgs e)
{
if (e.Action == CollectionChangeAction.Add)
{

View File

@ -76,6 +76,7 @@ namespace XenAdmin.Dialogs
this.toolStripButtonFix = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonHelp = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonDismiss = new System.Windows.Forms.ToolStripButton();
this.toolStripLabelFiltersOnOff = new System.Windows.Forms.ToolStripLabel();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.GridViewAlerts)).BeginInit();
this.ContextMenuAlertGridView.SuspendLayout();
@ -265,7 +266,8 @@ namespace XenAdmin.Dialogs
this.toolStripButtonRefresh,
this.toolStripSeparator1,
this.toolStripButtonExportAll,
this.toolStripButtonDismissAll});
this.toolStripButtonDismissAll,
this.toolStripLabelFiltersOnOff});
this.toolStrip1.Name = "toolStrip1";
//
// toolStripDropDownButtonServerFilter
@ -292,7 +294,6 @@ namespace XenAdmin.Dialogs
this.informationalToolStripMenuItem,
this.unknownToolStripMenuItem});
resources.ApplyResources(this.toolStripDropDownSeveritiesFilter, "toolStripDropDownSeveritiesFilter");
this.toolStripDropDownSeveritiesFilter.Image = global::XenAdmin.Properties.Resources._000_FilterSeverity_h32bit_16;
this.toolStripDropDownSeveritiesFilter.Name = "toolStripDropDownSeveritiesFilter";
this.toolStripDropDownSeveritiesFilter.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.toolStripDropDownSeveritiesFilter_DropDownItemClicked);
//
@ -358,7 +359,6 @@ namespace XenAdmin.Dialogs
//
this.toolStripButtonRefresh.AutoToolTip = false;
resources.ApplyResources(this.toolStripButtonRefresh, "toolStripButtonRefresh");
this.toolStripButtonRefresh.Image = global::XenAdmin.Properties.Resources.Refresh16;
this.toolStripButtonRefresh.Name = "toolStripButtonRefresh";
this.toolStripButtonRefresh.Click += new System.EventHandler(this.toolStripButtonRefresh_Click);
//
@ -371,7 +371,6 @@ namespace XenAdmin.Dialogs
//
this.toolStripButtonExportAll.AutoToolTip = false;
resources.ApplyResources(this.toolStripButtonExportAll, "toolStripButtonExportAll");
this.toolStripButtonExportAll.Image = global::XenAdmin.Properties.Resources._000_ExportMessages_h32bit_16;
this.toolStripButtonExportAll.Name = "toolStripButtonExportAll";
this.toolStripButtonExportAll.Click += new System.EventHandler(this.toolStripButtonExportAll_Click);
//
@ -379,7 +378,6 @@ namespace XenAdmin.Dialogs
//
this.toolStripButtonDismissAll.AutoToolTip = false;
resources.ApplyResources(this.toolStripButtonDismissAll, "toolStripButtonDismissAll");
this.toolStripButtonDismissAll.Image = global::XenAdmin.Properties.Resources._000_DeleteAllMessages_h32bit_16;
this.toolStripButtonDismissAll.Name = "toolStripButtonDismissAll";
this.toolStripButtonDismissAll.Click += new System.EventHandler(this.DismissAllButton_Click);
//
@ -436,10 +434,15 @@ namespace XenAdmin.Dialogs
//
this.toolStripButtonDismiss.AutoToolTip = false;
resources.ApplyResources(this.toolStripButtonDismiss, "toolStripButtonDismiss");
this.toolStripButtonDismiss.Image = global::XenAdmin.Properties.Resources._000_DeleteMessage_h32bit_16;
this.toolStripButtonDismiss.Name = "toolStripButtonDismiss";
this.toolStripButtonDismiss.Click += new System.EventHandler(this.ButtonDismiss_Click);
//
// toolStripLabelFiltersOnOff
//
this.toolStripLabelFiltersOnOff.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
resources.ApplyResources(this.toolStripLabelFiltersOnOff, "toolStripLabelFiltersOnOff");
this.toolStripLabelFiltersOnOff.Name = "toolStripLabelFiltersOnOff";
//
// AlertSummaryDialog
//
this.AcceptButton = this.ButtonClose;
@ -513,5 +516,6 @@ namespace XenAdmin.Dialogs
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnAppliesTo;
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnDetails;
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnDate;
private System.Windows.Forms.ToolStripLabel toolStripLabelFiltersOnOff;
}
}

View File

@ -52,8 +52,6 @@ namespace XenAdmin.Dialogs
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private DateFilterDialog dateFilterDialog = new DateFilterDialog();
private static readonly int ALERT_CAP = 1000;
public AlertSummaryDialog()
@ -75,6 +73,16 @@ namespace XenAdmin.Dialogs
{
Rebuild();
}
private void SetFilterLabel()
{
bool filterIsOn = toolStripDropDownButtonDateFilter.FilterIsOn
|| toolStripDropDownButtonServerFilter.FilterIsOn;
toolStripLabelFiltersOnOff.Text = filterIsOn
? Messages.FILTERS_ON
: Messages.FILTERS_OFF;
}
#region AlertListCode
@ -116,6 +124,8 @@ namespace XenAdmin.Dialogs
// 4) Take the top n as set by the filters
// 5) Add them to the control using the optimized AddRange()
Program.Invoke(this, SetFilterLabel);
List<Alert> alerts = Alert.NonDismissingAlerts;
alerts.RemoveAll(filterAlert);

View File

@ -424,7 +424,7 @@
<value>Magenta</value>
</data>
<data name="toolStripDropDownButtonServerFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>102, 25</value>
<value>86, 25</value>
</data>
<data name="toolStripDropDownButtonServerFilter.Text" xml:space="preserve">
<value>Filter &amp;Servers</value>
@ -484,7 +484,7 @@
<value>Magenta</value>
</data>
<data name="toolStripDropDownSeveritiesFilter.Size" type="System.Drawing.Size, System.Drawing">
<value>114, 25</value>
<value>98, 25</value>
</data>
<data name="toolStripDropDownSeveritiesFilter.Text" xml:space="preserve">
<value>Filter Se&amp;verities</value>
@ -499,7 +499,7 @@
<value>Magenta</value>
</data>
<data name="toolStripButtonRefresh.Size" type="System.Drawing.Size, System.Drawing">
<value>66, 25</value>
<value>50, 25</value>
</data>
<data name="toolStripButtonRefresh.Text" xml:space="preserve">
<value>&amp;Refresh</value>
@ -514,7 +514,7 @@
<value>Magenta</value>
</data>
<data name="toolStripButtonExportAll.Size" type="System.Drawing.Size, System.Drawing">
<value>77, 25</value>
<value>61, 25</value>
</data>
<data name="toolStripButtonExportAll.Text" xml:space="preserve">
<value>&amp;Export All</value>
@ -526,11 +526,20 @@
<value>Magenta</value>
</data>
<data name="toolStripButtonDismissAll.Size" type="System.Drawing.Size, System.Drawing">
<value>84, 25</value>
<value>68, 25</value>
</data>
<data name="toolStripButtonDismissAll.Text" xml:space="preserve">
<value>Dismiss &amp;All</value>
</data>
<data name="toolStripLabelFiltersOnOff.Font" type="System.Drawing.Font, System.Drawing">
<value>Segoe UI, 9pt</value>
</data>
<data name="toolStripLabelFiltersOnOff.Size" type="System.Drawing.Size, System.Drawing">
<value>104, 25</value>
</data>
<data name="toolStripLabelFiltersOnOff.Text" xml:space="preserve">
<value>Filters are ON/OFF</value>
</data>
<data name="toolStrip1.Location" type="System.Drawing.Point, System.Drawing">
<value>1, 1</value>
</data>
@ -655,7 +664,7 @@
<value>Magenta</value>
</data>
<data name="toolStripButtonDismiss.Size" type="System.Drawing.Size, System.Drawing">
<value>67, 25</value>
<value>51, 25</value>
</data>
<data name="toolStripButtonDismiss.Text" xml:space="preserve">
<value>&amp;Dismiss</value>
@ -796,7 +805,7 @@
<value>toolStripDropDownButtonServerFilter</value>
</data>
<data name="&gt;&gt;toolStripDropDownButtonServerFilter.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripDropDownButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>XenAdmin.Controls.FilterLocationToolStripDropDownButton, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;toolStripDropDownButtonDateFilter.Name" xml:space="preserve">
<value>toolStripDropDownButtonDateFilter</value>
@ -900,6 +909,12 @@
<data name="&gt;&gt;toolStripButtonDismiss.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toolStripLabelFiltersOnOff.Name" xml:space="preserve">
<value>toolStripLabelFiltersOnOff</value>
</data>
<data name="&gt;&gt;toolStripLabelFiltersOnOff.Type" xml:space="preserve">
<value>System.Windows.Forms.ToolStripLabel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>AlertSummaryDialog</value>
</data>

View File

@ -12975,6 +12975,24 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Filters are OFF.
/// </summary>
public static string FILTERS_OFF {
get {
return ResourceManager.GetString("FILTERS_OFF", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Filters are ON.
/// </summary>
public static string FILTERS_ON {
get {
return ResourceManager.GetString("FILTERS_ON", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &amp;Finish.
/// </summary>

View File

@ -4562,6 +4562,12 @@ Would you like to eject these ISOs before continuing?</value>
<data name="FILE_X_EXISTS_OVERWRITE" xml:space="preserve">
<value>File {0} already exists. Overwrite?</value>
</data>
<data name="FILTERS_OFF" xml:space="preserve">
<value>Filters are OFF</value>
</data>
<data name="FILTERS_ON" xml:space="preserve">
<value>Filters are ON</value>
</data>
<data name="FINISH" xml:space="preserve">
<value>&amp;Finish</value>
</data>