def closeEvent(self, event):
        if not self.undoStack.isClean():
            if self.yesNoDialog("Current workflow is not saved.  Save it before quitting?"):
                if self.workingFilename:
                    self.save(self.workingFilename)
                else:
                    self.saveAs()
        self.saveSettings()
        QtGui.QMainWindow.closeEvent(self, event)


    ###########################################################################
    ## Internal functionality
    ###########################################################################
Save program settings and ask "are you sure" if there are unsaved changes.
dataset/ETHPy150Open andrew-gardner/dependsworkflow/depends/depends_main_window.py/MainWindow.closeEvent