Dialog windows open conditionally

Each dialog must have such a function.