Bypassing the save dialog box on exit from a ScriptedLoadableModule

I gave complete examples for both customizing the application close behavior (using event filter) and creating a custom save dialog (by adding a new file dialog class). For an optimal user experience probably you want to customize both.