Merge pull request #1904 from burnsypet/issue-1871

Logic to enable/disable redo/undo buttons
This commit is contained in:
Anton Vorobyov
2019-04-08 10:21:52 +03:00
committed by GitHub

View File

@@ -179,6 +179,15 @@ class MainMenuBar(wx.MenuBar):
self.Enable(wx.ID_COPY, enable)
self.Enable(self.exportSkillsNeededId, enable)
command = self.mainFrame.command
self.Enable(wx.ID_UNDO, False)
self.Enable(wx.ID_REDO, False)
if command.CanUndo():
self.Enable(wx.ID_UNDO, True)
if command.CanRedo():
self.Enable(wx.ID_REDO, True)
sChar = Character.getInstance()
charID = self.mainFrame.charSelection.getActiveCharacter()
char = sChar.getCharacter(charID)