Dialog windows open conditionally

I don't think two spied methods in one function is a good justification for adding a global here and obscuring the fact that we're restoring our spies.