set up project dialog earlier
refactor dialog showing/hiding code