Dialog windows open conditionally

Migrated this to a separate file.