From 52a575cb479cfbf209dc74ce979efd49d62e3415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Fri, 13 Sep 2019 21:14:11 +0200 Subject: [PATCH] libroar/RoarCanvasCommandsFile.py:canvasSave{,As}(): don't reset dirty on canvasSaveAs(). --- libroar/RoarCanvasCommandsFile.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libroar/RoarCanvasCommandsFile.py b/libroar/RoarCanvasCommandsFile.py index 58e9891..00d367b 100644 --- a/libroar/RoarCanvasCommandsFile.py +++ b/libroar/RoarCanvasCommandsFile.py @@ -194,7 +194,7 @@ class RoarCanvasCommandsFile(): # }}} # {{{ canvasSave(self, event) @GuiCommandDecorator("Save", "&Save", ["", wx.ART_FILE_SAVE], [wx.ACCEL_CTRL, ord("S")], None) - def canvasSave(self, event): + def canvasSave(self, event, newDirty=False): if self.canvasPathName == None: if self.canvasSaveAs(event) == False: return False @@ -203,7 +203,8 @@ class RoarCanvasCommandsFile(): self.parentCanvas.SetCursor(wx.Cursor(wx.CURSOR_WAIT)) self.parentCanvas.canvas.exportStore.exportTextFile(self.parentCanvas.canvas.map, self.parentCanvas.canvas.size, outFile) self.parentCanvas.SetCursor(wx.Cursor(wx.NullCursor)) - self.parentCanvas.dirty = False + if self.parentCanvas.dirty != newDirty: + self.parentCanvas.dirty = newDirty self.update(dirty=self.parentCanvas.dirty) return True except IOError as error: @@ -217,7 +218,7 @@ class RoarCanvasCommandsFile(): return False else: self.canvasPathName = dialog.GetPath() - return self.canvasSave(event) + return self.canvasSave(event, newDirty=True) # }}} #