Add save settings method.
Call it before closing the app so we save the current open document settings.