Added support to choose the output file type using the save dialog