From 866ef19966d6d24d8372766477db48456b2d2544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Sun, 15 Sep 2019 12:52:27 +0200 Subject: [PATCH] libroar/RoarCanvasCommands.py:update(): disable undo if on last undo item. --- libroar/RoarCanvasCommands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libroar/RoarCanvasCommands.py b/libroar/RoarCanvasCommands.py index 1932739..6eb577a 100644 --- a/libroar/RoarCanvasCommands.py +++ b/libroar/RoarCanvasCommands.py @@ -67,7 +67,8 @@ class RoarCanvasCommands(RoarCanvasCommandsFile, RoarCanvasCommandsEdit, RoarCan textItems.append("*") self.parentFrame.statusBar.SetStatusText(" | ".join(textItems)) if "undoLevel" in self.lastPanelState: - if self.lastPanelState["undoLevel"] >= 0: + if (self.lastPanelState["undoLevel"] >= 0) \ + and (self.lastPanelState["undoLevel"] < (len(self.parentCanvas.canvas.journal.patchesUndo) - 1)): self.parentFrame.menuItemsById[self.canvasUndo.attrDict["id"]].Enable(True) toolBar = self.parentFrame.toolBarItemsById[self.canvasUndo.attrDict["id"]].GetToolBar() toolBar.EnableTool(self.canvasUndo.attrDict["id"], True)