counting number of open viewers.  If we cancel the file dialog and there
are no open viewers, we exit.