Wigan Athletic have completed the permanent signing of striker Martyn Waghorn from Championship rivals Leicester City.