Add support for ship browser lite to projected view
This commit is contained in:
@@ -59,7 +59,7 @@ from .gui.projectedFighter.abilityToggleState import GuiToggleProjectedFighterAb
|
||||
from .gui.projectedFighter.add import GuiAddProjectedFighterCommand
|
||||
from .gui.projectedFighter.changeAmount import GuiChangeProjectedFighterAmountCommand
|
||||
from .gui.projectedFighter.changeMetas import GuiChangeProjectedFighterMetasCommand
|
||||
from .gui.projectedFit.add import GuiAddProjectedFitCommand
|
||||
from .gui.projectedFit.add import GuiAddProjectedFitsCommand
|
||||
from .gui.projectedFit.changeAmount import GuiChangeProjectedFitAmountCommand
|
||||
from .gui.projectedModule.add import GuiAddProjectedModuleCommand
|
||||
from .gui.projectedModule.changeCharges import GuiChangeProjectedModuleChargesCommand
|
||||
|
||||
@@ -8,18 +8,23 @@ from gui.fitCommands.helpers import InternalCommandHistory
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
class GuiAddProjectedFitCommand(wx.Command):
|
||||
class GuiAddProjectedFitsCommand(wx.Command):
|
||||
|
||||
def __init__(self, fitID, projectedFitID, amount):
|
||||
wx.Command.__init__(self, True, 'Add Projected Fit')
|
||||
def __init__(self, fitID, projectedFitIDs, amount):
|
||||
wx.Command.__init__(self, True, 'Add Projected Fits')
|
||||
self.internalHistory = InternalCommandHistory()
|
||||
self.fitID = fitID
|
||||
self.projectedFitID = projectedFitID
|
||||
self.projectedFitIDs = projectedFitIDs
|
||||
self.amount = amount
|
||||
|
||||
def Do(self):
|
||||
cmd = CalcAddProjectedFitCommand(fitID=self.fitID, projectedFitID=self.projectedFitID, amount=self.amount)
|
||||
success = self.internalHistory.submit(cmd)
|
||||
commands = []
|
||||
for projectedFitID in self.projectedFitIDs:
|
||||
cmd = CalcAddProjectedFitCommand(fitID=self.fitID, projectedFitID=projectedFitID, amount=self.amount)
|
||||
commands.append(cmd)
|
||||
if not commands:
|
||||
return False
|
||||
success = self.internalHistory.submitBatch(*commands)
|
||||
sFit = Fit.getInstance()
|
||||
eos.db.flush()
|
||||
sFit.recalc(self.fitID)
|
||||
|
||||
Reference in New Issue
Block a user