Make command-related commands and their invokations more reliable
This commit is contained in:
@@ -30,7 +30,9 @@ class CalcAddCommandCommand(wx.Command):
|
||||
if commandFit in fit.commandFits:
|
||||
pyfalog.debug('Command fit had been applied already')
|
||||
return False
|
||||
|
||||
if commandFit.ID in fit.commandFitDict:
|
||||
pyfalog.debug('Commanding fit is in command dict already')
|
||||
return False
|
||||
fit.commandFitDict[commandFit.ID] = commandFit
|
||||
# This bit is required, see issue #83
|
||||
eos.db.saveddata_session.flush()
|
||||
|
||||
@@ -30,8 +30,10 @@ class CalcRemoveCommandCommand(wx.Command):
|
||||
if commandInfo is None:
|
||||
pyfalog.warning('Fit command info is not available')
|
||||
return False
|
||||
|
||||
self.savedState = commandInfo.active
|
||||
if commandFit.ID not in fit.commandFitDict:
|
||||
pyfalog.warning('Unable to find commanding fit in command dict')
|
||||
return False
|
||||
del fit.commandFitDict[commandFit.ID]
|
||||
eos.db.commit()
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user