Dialog windows open conditionally

So the `.exec` functions can stop handling dialogs.