Dialog windows open conditionally

Isn't clear where to paste.