Merge pull request #130 from MihaelaStoica/CA-138822

CA-138822: Improvements to the Host/Pool Storage tab, following on from ...
This commit is contained in:
Gabor Apati-Nagy 2014-07-17 12:47:00 +01:00
commit 4e9327d1af
3 changed files with 28 additions and 0 deletions

View File

@ -30,6 +30,7 @@
*/
using System.Collections.Generic;
using System.Linq;
using XenAdmin.Actions;
using XenAdmin.Core;
using XenAPI;
@ -94,5 +95,20 @@ namespace XenAdmin.Commands
}
return base.GetCantExecuteReasonCore(item);
}
/// <summary>
/// Gets the tool tip text when the command is not able to run.
/// If multiple items and Trim is not supported on all, then return this reason.
/// Otherwise, the default behaviour: CantExectuteReason for single items, null for multiple.
/// </summary>
protected override string DisabledToolTipText
{
get
{
var selection = GetSelection();
var allUnsuported = selection.Count > 1 && selection.Select(item => item.XenObject as SR).All(sr => sr != null && !sr.SupportsTrim);
return allUnsuported ? Messages.TOOLTIP_SR_TRIM_UNSUPPORTED_MULTIPLE : base.DisabledToolTipText;
}
}
}
}

View File

@ -29956,6 +29956,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Reclaiming freed space not supported on these SRs.
/// </summary>
public static string TOOLTIP_SR_TRIM_UNSUPPORTED_MULTIPLE {
get {
return ResourceManager.GetString("TOOLTIP_SR_TRIM_UNSUPPORTED_MULTIPLE", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Views and Saved Searches.
/// </summary>

View File

@ -10376,6 +10376,9 @@ Do you want to connect to the pool master '{1}'?</value>
<data name="TOOLTIP_SR_TRIM_UNSUPPORTED" xml:space="preserve">
<value>Reclaiming freed space not supported on this SR</value>
</data>
<data name="TOOLTIP_SR_TRIM_UNSUPPORTED_MULTIPLE" xml:space="preserve">
<value>Reclaiming freed space not supported on these SRs</value>
</data>
<data name="TREESEARCHBOX_DROPDOWN_TOOLTIP" xml:space="preserve">
<value>Views and Saved Searches</value>
</data>