Don't do anything if we dun have to, LETS BE LAZY!
This commit is contained in:
@@ -90,6 +90,9 @@ class Fit(object):
|
||||
|
||||
def removeModule(self, fitID, position):
|
||||
fit = eos.db.getFit(fitID)
|
||||
if fit.modules[position].isEmpty:
|
||||
return False
|
||||
|
||||
fit.modules.toDummy(position)
|
||||
eos.db.commit()
|
||||
fit.clear()
|
||||
|
||||
@@ -64,9 +64,10 @@ class FittingView(d.Display):
|
||||
row, _ = self.HitTest(event.Position)
|
||||
if row != -1:
|
||||
cFit = controller.Fit.getInstance()
|
||||
cFit.removeModule(self.activeFitID, self.mods[self.GetItemData(row)].position)
|
||||
trigger = cFit.removeModule(self.activeFitID, self.mods[self.GetItemData(row)].position)
|
||||
|
||||
wx.PostEvent(self.mainFrame, FitChanged(fitID=self.activeFitID))
|
||||
if trigger:
|
||||
wx.PostEvent(self.mainFrame, FitChanged(fitID=self.activeFitID))
|
||||
|
||||
def fitChanged(self, event):
|
||||
cFit = controller.Fit.getInstance()
|
||||
|
||||
Reference in New Issue
Block a user