mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
Merge pull request #478 from MihaelaStoica/CP-12282
CP-12282: Semantics of Move / Migrate / Copy for suspended VMs
This commit is contained in:
commit
0809dd2f56
@ -60,7 +60,7 @@ namespace XenAdmin.Commands
|
||||
else
|
||||
{
|
||||
MainWindowCommandInterface.ShowPerConnectionWizard(con,
|
||||
new CrossPoolMigrateWizard(con, selection, preSelectedHost, WizardMode.Move));
|
||||
new CrossPoolMigrateWizard(con, selection, preSelectedHost, GetWizardMode(selection)));
|
||||
}
|
||||
|
||||
}
|
||||
@ -77,5 +77,13 @@ namespace XenAdmin.Commands
|
||||
|
||||
return CrossPoolMigrateCommand.CanExecute(vm, preSelectedHost);
|
||||
}
|
||||
|
||||
public static WizardMode GetWizardMode(SelectedItemCollection selection)
|
||||
{
|
||||
return selection != null && selection.Count > 0 && selection[0].XenObject is VM
|
||||
&& (selection[0].XenObject as VM).power_state == vm_power_state.Suspended
|
||||
? WizardMode.Migrate
|
||||
: WizardMode.Move;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using XenAdmin.Wizards.CrossPoolMigrateWizard;
|
||||
using XenAPI;
|
||||
using XenAdmin.Dialogs;
|
||||
using System.Collections.ObjectModel;
|
||||
@ -41,7 +42,7 @@ using XenAdmin.Dialogs.VMDialogs;
|
||||
namespace XenAdmin.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Launches the Copy-VM dialog for the selected VM.
|
||||
/// Launches the Move-VM dialog for the selected VM.
|
||||
/// </summary>
|
||||
internal class MoveVMCommand : Command
|
||||
{
|
||||
@ -87,7 +88,9 @@ namespace XenAdmin.Commands
|
||||
{
|
||||
get
|
||||
{
|
||||
return Messages.MAINWINDOW_MOVEVM;
|
||||
return CrossPoolMoveVMCommand.GetWizardMode(GetSelection()) == WizardMode.Migrate
|
||||
? Messages.MAINWINDOW_MIGRATEVM
|
||||
: Messages.MAINWINDOW_MOVEVM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
9
XenModel/Messages.Designer.cs
generated
9
XenModel/Messages.Designer.cs
generated
@ -19889,6 +19889,15 @@ namespace XenAdmin {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to &Migrate VM....
|
||||
/// </summary>
|
||||
public static string MAINWINDOW_MIGRATEVM {
|
||||
get {
|
||||
return ResourceManager.GetString("MAINWINDOW_MIGRATEVM", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to &Move VM....
|
||||
/// </summary>
|
||||
|
@ -6915,6 +6915,9 @@ This will permanently delete and reinitialize all local storage on the servers.
|
||||
<data name="MAINWINDOW_LOG_REMOVECONNECTION" xml:space="preserve">
|
||||
<value>Removed connection to {0}</value>
|
||||
</data>
|
||||
<data name="MAINWINDOW_MIGRATEVM" xml:space="preserve">
|
||||
<value>&Migrate VM...</value>
|
||||
</data>
|
||||
<data name="MAINWINDOW_MIGRATE_TO_SERVER" xml:space="preserve">
|
||||
<value>M&igrate to Server</value>
|
||||
</data>
|
||||
|
Loading…
Reference in New Issue
Block a user