Fix saving file dialog view options
Currently, the view options are only saved when the user clicks OK or Cancel button. This MR makes the file dialog to write view options even if the user closes the window in any other way.
Currently, the view options are only saved when the user clicks OK or Cancel button. This MR makes the file dialog to write view options even if the user closes the window in any other way.
mentioned in commit e6d796d1