Convert template manager dialog to .ui + adapt code.

Change-Id: I854abb47c2d22206ed5581373b3e841f221672e3