From b0794ccaf9d63d24936b01cae52eaede749de34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Thu, 11 Jan 2018 01:12:55 +0100 Subject: [PATCH] MiRCARTCanvasInterface.py: prompt to save changes on exit given non-None canvasPathName. --- MiRCARTCanvasInterface.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MiRCARTCanvasInterface.py b/MiRCARTCanvasInterface.py index 1e29ff1..8818170 100644 --- a/MiRCARTCanvasInterface.py +++ b/MiRCARTCanvasInterface.py @@ -110,6 +110,14 @@ class MiRCARTCanvasInterface(): # }}} # {{{ canvasExit(self, event): XXX def canvasExit(self, event): + if self.canvasPathName != None: + saveChanges = self._dialogSaveChanges() + if saveChanges == wx.ID_CANCEL: + return + elif saveChanges == wx.ID_NO: + pass + elif saveChanges == wx.ID_YES: + self.canvasSave() self.parentFrame.Close(True) # }}} # {{{ canvasExportAsPng(self, event): XXX