Created undo/redo command for module remove, along with reapplying some module-specific attributes (state, charge). Fixed a bug when trying to add a module that doesn't fit
This commit is contained in:
@@ -401,18 +401,10 @@ class FittingView(d.Display):
|
||||
|
||||
def removeModule(self, modules):
|
||||
"""Removes a list of modules from the fit"""
|
||||
sFit = Fit.getInstance()
|
||||
|
||||
if not isinstance(modules, list):
|
||||
modules = [modules]
|
||||
|
||||
positions = [mod.modPosition for mod in modules]
|
||||
result = sFit.removeModule(self.activeFitID, positions)
|
||||
|
||||
if result is not None:
|
||||
self.slotsChanged()
|
||||
ids = {mod.item.ID for mod in modules}
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.activeFitID, action="moddel", typeID=ids))
|
||||
self.mainFrame.command.Submit(cmd.FitModuleRemoveCommand(self.activeFitID, modules))
|
||||
|
||||
def addModule(self, x, y, srcIdx):
|
||||
"""Add a module from the market browser"""
|
||||
|
||||
Reference in New Issue
Block a user