CA-339273: Mention source Host/Pool in VM cross-pool migration and copy actions

Also amended connected string resource and removed initial description.

Signed-off-by: Danilo Del Busso <Danilo.Del.Busso@citrix.com>
This commit is contained in:
Danilo Del Busso 2021-08-10 14:46:34 +01:00
parent 4f2a6f8995
commit 73f1f620da
3 changed files with 10 additions and 8 deletions

View File

@ -55,7 +55,6 @@ namespace XenAdmin.Actions.VMActions
: base(vm.Connection, GetTitle(vm, destinationHost, copy))
{
Session = vm.Connection.Session;
Description = Messages.ACTION_PREPARING;
VM = vm;
Host = destinationHost;
Pool = Helpers.GetPool(vm.Connection);
@ -80,13 +79,16 @@ namespace XenAdmin.Actions.VMActions
public static string GetTitle(VM vm, Host toHost, bool copy)
{
if (copy)
return string.Format(Messages.ACTION_VM_CROSS_POOL_COPY_TITLE, vm.Name(), toHost.Name());
return string.Format(Messages.ACTION_VM_CROSS_POOL_COPY_TITLE,
vm.NameWithLocation(),
Helpers.GetPool(vm.Connection)?.Name() ?? vm.Connection.Name,
toHost.NameWithLocation());
Host residentOn = vm.Connection.Resolve(vm.resident_on);
return residentOn == null
? string.Format(Messages.ACTION_VM_MIGRATING_NON_RESIDENT, vm.Name(), toHost.Name())
: string.Format(Messages.ACTION_VM_MIGRATING_RESIDENT, vm.Name(), Helpers.GetName(residentOn), toHost.Name());
? string.Format(Messages.ACTION_VM_MIGRATING_NON_RESIDENT, vm.NameWithLocation(), toHost.NameWithLocation())
: string.Format(Messages.ACTION_VM_MIGRATING_RESIDENT, vm.Name(), residentOn.NameWithLocation(), toHost.NameWithLocation());
}
protected override void Run()
@ -114,7 +116,7 @@ namespace XenAdmin.Actions.VMActions
Description = string.Format(copy
? Messages.ACTION_VM_CROSS_POOL_COPY_CANCELLED
: Messages.ACTION_VM_MIGRATE_CANCELLED,
VM.Name());
VM.NameWithLocation());
throw;
}
catch (Failure ex)

View File

@ -3067,7 +3067,7 @@ namespace XenAdmin {
}
/// <summary>
/// Looks up a localized string similar to Copying VM &apos;{0}&apos; to &apos;{1}&apos;.
/// Looks up a localized string similar to Copying VM &apos;{0}&apos; from &apos;{1}&apos; to &apos;{2}&apos;.
/// </summary>
public static string ACTION_VM_CROSS_POOL_COPY_TITLE {
get {

View File

@ -1141,7 +1141,7 @@
<value>Copying {0} canceled</value>
</data>
<data name="ACTION_VM_CROSS_POOL_COPY_TITLE" xml:space="preserve">
<value>Copying VM '{0}' to '{1}'</value>
<value>Copying VM '{0}' from '{1}' to '{2}'</value>
</data>
<data name="ACTION_VM_DELETE_SNAPSHOTS_TITLE" xml:space="preserve">
<value>Deleting snapshots</value>