Merge pull request #804 from robhoes/starton

CA-196231: Don't confuse start-on with migration
This commit is contained in:
Mihaela Stoica 2016-02-02 10:40:55 +00:00
commit f68c6a6cae

View File

@ -1,4 +1,4 @@
/* Copyright (c) Citrix Systems Inc.
/* Copyright (c) Citrix Systems Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@ -181,7 +181,7 @@ namespace XenAdmin.Commands
var firstItem = (VMOperationToolStripMenuSubItem)base.DropDownItems[0];
bool oldMigrateToHomeCmdCanRun = cmdHome.CanExecute();
if (affinityHost == null || !oldMigrateToHomeCmdCanRun && !cpmCmdHome.CanExecute())
if (affinityHost == null || _operation == vm_operations.start_on || !oldMigrateToHomeCmdCanRun && !cpmCmdHome.CanExecute())
firstItem.Command = cmdHome;
else
firstItem.Command = oldMigrateToHomeCmdCanRun ? cmdHome : cpmCmdHome;
@ -207,7 +207,7 @@ namespace XenAdmin.Commands
Program.Invoke(Program.MainWindow, delegate
{
bool oldMigrateCmdCanRun = cmd.CanExecute();
if (!oldMigrateCmdCanRun && !cpmCmd.CanExecute())
if (_operation == vm_operations.start_on || !oldMigrateCmdCanRun && !cpmCmd.CanExecute())
tempItem.Command = cmd;
else
tempItem.Command = oldMigrateCmdCanRun ? cmd : cpmCmd;