CA-141101: XenCenter filters not changeable after dismiss all - FIXED

- In the Events view, offer a choice only to dismiss the visible ones instead of all
- Keep the filter buttons always enabled. This applies to all Notification views (Alerts, Updates & Events)
- Also refined the confirmation messages displayed when dismissing events

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
This commit is contained in:
Mihaela Stoica 2014-07-31 09:39:16 +01:00
parent 8212ad6e5a
commit 8faf672959
6 changed files with 67 additions and 54 deletions

View File

@ -154,8 +154,7 @@ namespace XenAdmin.Controls
});
}
if (DropDownItems.Count <= 0)
Enabled = false;
Enabled = DropDownItems.Count > 0;
}
finally
{

View File

@ -578,10 +578,7 @@ namespace XenAdmin.TabPages
private void UpdateActionEnablement()
{
toolStripDropDownSeveritiesFilter.Enabled =
toolStripDropDownButtonServerFilter.Enabled =
toolStripDropDownButtonDateFilter.Enabled =
toolStripButtonExportAll.Enabled = Alert.NonDismissingAlertCount > 0;
toolStripButtonExportAll.Enabled = Alert.NonDismissingAlertCount > 0;
tsmiDismissAll.Enabled = AllowedToDismiss(Alert.Alerts);
tsmiDismissAll.AutoToolTip = !tsmiDismissAll.Enabled;

View File

@ -133,15 +133,21 @@ namespace XenAdmin.TabPages
private void SetFilterLabel()
{
bool filterIsOn = toolStripDdbFilterDates.FilterIsOn
|| toolStripDdbFilterLocation.FilterIsOn
|| toolStripDdbFilterStatus.FilterIsOn;
toolStripLabelFiltersOnOff.Text = filterIsOn
toolStripLabelFiltersOnOff.Text = FilterIsOn
? Messages.FILTERS_ON
: Messages.FILTERS_OFF;
}
private bool FilterIsOn
{
get
{
return toolStripDdbFilterDates.FilterIsOn
|| toolStripDdbFilterLocation.FilterIsOn
|| toolStripDdbFilterStatus.FilterIsOn;
}
}
private void BuildRowList()
{
if (!Visible)
@ -172,6 +178,7 @@ namespace XenAdmin.TabPages
finally
{
dataGridView.ResumeLayout();
UpdateButtons();
}
}
@ -278,11 +285,7 @@ namespace XenAdmin.TabPages
private void UpdateButtons()
{
toolStripDdbFilterStatus.Enabled =
toolStripDdbFilterLocation.Enabled =
toolStripDdbFilterDates.Enabled = ConnectionsManager.History.Count > 0;
tsmiDismissAll.Enabled = dataGridView.Rows.Cast<DataGridViewActionRow>().Any(row => row.Action.IsCompleted);
tsmiDismissAll.Enabled = ConnectionsManager.History.Any(a => a.IsCompleted);
tsmiDismissSelected.Enabled = dataGridView.SelectedRows.Cast<DataGridViewActionRow>().Any(row => row.Action.IsCompleted);
toolStripSplitButtonDismiss.Enabled = tsmiDismissAll.Enabled || tsmiDismissSelected.Enabled;
@ -307,7 +310,7 @@ namespace XenAdmin.TabPages
if (ConnectionsManager.History.Count > 0 &&
(Program.RunInAutomatedTestMode ||
new ThreeButtonDialog(
new ThreeButtonDialog.Details(null, Messages.MESSAGEBOX_LOG_DELETE, Messages.MESSAGEBOX_LOG_DELETE_TITLE),
new ThreeButtonDialog.Details(null, Messages.MESSAGEBOX_LOG_DELETE),
ThreeButtonDialog.ButtonYes,
ThreeButtonDialog.ButtonNo).ShowDialog(this) == DialogResult.Yes))
{
@ -351,21 +354,49 @@ namespace XenAdmin.TabPages
private void tsmiDismissAll_Click(object sender, EventArgs e)
{
if (ConnectionsManager.History.Count > 0 &&
(Program.RunInAutomatedTestMode ||
new ThreeButtonDialog(
new ThreeButtonDialog.Details(null, Messages.MESSAGEBOX_LOGS_DELETE, Messages.MESSAGEBOX_LOGS_DELETE_TITLE),
ThreeButtonDialog.ButtonYes,
ThreeButtonDialog.ButtonNo).ShowDialog(this) == DialogResult.Yes))
if (ConnectionsManager.History.Count == 0)
return;
DialogResult result = DialogResult.Yes;
if (!Program.RunInAutomatedTestMode)
{
ConnectionsManager.History.RemoveAll(a => a.IsCompleted);
if (!FilterIsOn)
{
using (var dlog = new ThreeButtonDialog(
new ThreeButtonDialog.Details(null, Messages.MESSAGEBOX_LOGS_DELETE_NO_FILTER),
new ThreeButtonDialog.TBDButton(Messages.DISMISS_ALL_YES_CONFIRM_BUTTON, DialogResult.Yes),
ThreeButtonDialog.ButtonCancel))
{
result = dlog.ShowDialog(this);
}
}
else
{
using (var dlog = new ThreeButtonDialog(
new ThreeButtonDialog.Details(null, Messages.MESSAGEBOX_LOGS_DELETE),
new ThreeButtonDialog.TBDButton(Messages.DISMISS_ALL_CONFIRM_BUTTON, DialogResult.Yes),
new ThreeButtonDialog.TBDButton(Messages.DISMISS_FILTERED_CONFIRM_BUTTON, DialogResult.No, ThreeButtonDialog.ButtonType.NONE),
ThreeButtonDialog.ButtonCancel))
{
result = dlog.ShowDialog(this);
}
}
if (result == DialogResult.Cancel)
return;
}
var actions = result == DialogResult.No
? (from DataGridViewActionRow row in dataGridView.Rows where row.Action != null && row.Action.IsCompleted select row.Action)
: ConnectionsManager.History;
ConnectionsManager.History.RemoveAll(actions.Contains);
}
private void tsmiDismissSelected_Click(object sender, EventArgs e)
{
using (var dlog = new ThreeButtonDialog(
new ThreeButtonDialog.Details(null, Messages.MESSAGEBOX_LOGS_DELETE_SELECTED, Messages.MESSAGEBOX_LOGS_DELETE_TITLE),
new ThreeButtonDialog.Details(null, Messages.MESSAGEBOX_LOGS_DELETE_SELECTED),
ThreeButtonDialog.ButtonYes,
ThreeButtonDialog.ButtonNo))
{

View File

@ -272,9 +272,7 @@ namespace XenAdmin.TabPages
private void UpdateButtonEnablement()
{
toolStripDropDownButtonServerFilter.Enabled =
toolStripDropDownButtonDateFilter.Enabled =
toolStripButtonExportAll.Enabled = Updates.UpdateAlertsCount > 0;
toolStripButtonExportAll.Enabled = Updates.UpdateAlertsCount > 0;
}
private void ShowInformationHelper(string reason)

View File

@ -19831,7 +19831,7 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to Are you sure you want to delete this entry?.
/// Looks up a localized string similar to Are you sure you want to dismiss this event?.
/// </summary>
public static string MESSAGEBOX_LOG_DELETE {
get {
@ -19839,15 +19839,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Clear entry.
/// </summary>
public static string MESSAGEBOX_LOG_DELETE_TITLE {
get {
return ResourceManager.GetString("MESSAGEBOX_LOG_DELETE_TITLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Log file is missing..
/// </summary>
@ -19858,7 +19849,7 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to This will clear all non-active entries in the current view. Do you wish to continue?.
/// Looks up a localized string similar to You have applied filters to the list of events. Do you wish to dismiss all events or only the events you have chosen to view? In both cases only the non-active events will be removed..
/// </summary>
public static string MESSAGEBOX_LOGS_DELETE {
get {
@ -19867,20 +19858,20 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to Do you wish to delete the selected entries?.
/// Looks up a localized string similar to This operation will remove all non-active events. Do you wish to continue?.
/// </summary>
public static string MESSAGEBOX_LOGS_DELETE_SELECTED {
public static string MESSAGEBOX_LOGS_DELETE_NO_FILTER {
get {
return ResourceManager.GetString("MESSAGEBOX_LOGS_DELETE_SELECTED", resourceCulture);
return ResourceManager.GetString("MESSAGEBOX_LOGS_DELETE_NO_FILTER", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Clear entries.
/// Looks up a localized string similar to This operation will remove all selected non-active events. Do you wish to continue?.
/// </summary>
public static string MESSAGEBOX_LOGS_DELETE_TITLE {
public static string MESSAGEBOX_LOGS_DELETE_SELECTED {
get {
return ResourceManager.GetString("MESSAGEBOX_LOGS_DELETE_TITLE", resourceCulture);
return ResourceManager.GetString("MESSAGEBOX_LOGS_DELETE_SELECTED", resourceCulture);
}
}

View File

@ -6914,19 +6914,16 @@ This action is final and unrecoverable.</value>
<value>Log file is missing.</value>
</data>
<data name="MESSAGEBOX_LOGS_DELETE" xml:space="preserve">
<value>This will clear all non-active entries in the current view. Do you wish to continue?</value>
<value>You have applied filters to the list of events. Do you wish to dismiss all events or only the events you have chosen to view? In both cases only the non-active events will be removed.</value>
</data>
<data name="MESSAGEBOX_LOGS_DELETE_NO_FILTER" xml:space="preserve">
<value>This operation will remove all non-active events. Do you wish to continue?</value>
</data>
<data name="MESSAGEBOX_LOGS_DELETE_SELECTED" xml:space="preserve">
<value>Do you wish to delete the selected entries?</value>
</data>
<data name="MESSAGEBOX_LOGS_DELETE_TITLE" xml:space="preserve">
<value>Clear entries</value>
<value>This operation will remove all selected non-active events. Do you wish to continue?</value>
</data>
<data name="MESSAGEBOX_LOG_DELETE" xml:space="preserve">
<value>Are you sure you want to delete this entry?</value>
</data>
<data name="MESSAGEBOX_LOG_DELETE_TITLE" xml:space="preserve">
<value>Clear entry</value>
<value>Are you sure you want to dismiss this event?</value>
</data>
<data name="MESSAGEBOX_MOVING_VDI_TITLE" xml:space="preserve">
<value>Moving Virtual Disk</value>