Make command-related commands and their invokations more reliable

This commit is contained in:
DarkPhoenix
2019-04-20 00:35:14 +03:00
parent fda83bcb49
commit 93cd3b97fa
5 changed files with 14 additions and 7 deletions

View File

@@ -99,14 +99,17 @@ class CommandView(d.Display):
fitID = self.mainFrame.getActiveFit()
row = self.GetFirstSelected()
if row != -1:
self.mainFrame.command.Submit(cmd.GuiRemoveCommandFitCommand(fitID, self.get(row).ID))
commandFit = self.get(row)
if commandFit is not None:
self.mainFrame.command.Submit(cmd.GuiRemoveCommandFitCommand(
fitID=fitID, commandFitID=commandFit.ID))
def handleDrag(self, type, fitID):
# Those are drags coming from pyfa sources, NOT builtin wx drags
if type == "fit":
activeFit = self.mainFrame.getActiveFit()
if activeFit:
self.mainFrame.command.Submit(cmd.GuiAddCommandFitCommand(activeFit, fitID))
self.mainFrame.command.Submit(cmd.GuiAddCommandFitCommand(fitID=activeFit, commandFitID=fitID))
def startDrag(self, event):
row = event.GetIndex()