mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-25 14:27:26 +01:00
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:
commit
4e9327d1af
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
9
XenModel/Messages.Designer.cs
generated
9
XenModel/Messages.Designer.cs
generated
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user