Rename set mode command
This commit is contained in:
@@ -10,7 +10,7 @@ from service.market import Market
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
class FitSetModeCommand(wx.Command):
|
||||
class FitChangeModeCommand(wx.Command):
|
||||
|
||||
def __init__(self, fitID, itemID):
|
||||
wx.Command.__init__(self, True, 'Set Mode')
|
||||
@@ -19,7 +19,7 @@ class FitSetModeCommand(wx.Command):
|
||||
self.savedItemID = None
|
||||
|
||||
def Do(self):
|
||||
pyfalog.debug('Doing setting mode {} for fit {}'.format(self.itemID, self.fitID))
|
||||
pyfalog.debug('Doing changing mode to {} for fit {}'.format(self.itemID, self.fitID))
|
||||
fit = Fit.getInstance().getFit(self.fitID)
|
||||
self.savedItemID = fit.modeID
|
||||
item = Market.getInstance().getItem(self.itemID)
|
||||
@@ -29,5 +29,6 @@ class FitSetModeCommand(wx.Command):
|
||||
return True
|
||||
|
||||
def Undo(self):
|
||||
cmd = FitSetModeCommand(self.fitID, self.savedItemID)
|
||||
pyfalog.debug('Undoing changing mode to {} for fit {}'.format(self.itemID, self.fitID))
|
||||
cmd = FitChangeModeCommand(self.fitID, self.savedItemID)
|
||||
return cmd.Do()
|
||||
@@ -30,8 +30,8 @@ class FitSwapModuleCommand(wx.Command):
|
||||
fit = Fit.getInstance().getFit(fitID)
|
||||
srcMod = fit.modules[src]
|
||||
dstMod = fit.modules[dst]
|
||||
fit.modules.remove(srcMod)
|
||||
fit.modules.insert(dst, srcMod)
|
||||
fit.modules.remove(dstMod)
|
||||
fit.modules.insert(src, dstMod)
|
||||
fit.modules.free(src)
|
||||
fit.modules.free(dst)
|
||||
fit.modules.replace(dst, srcMod)
|
||||
fit.modules.replace(src, dstMod)
|
||||
eos.db.commit()
|
||||
|
||||
@@ -3,7 +3,7 @@ from service.fit import Fit
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import globalEvents as GE
|
||||
from .calc.fitSetMode import FitSetModeCommand
|
||||
from .calc.fitChangeMode import FitChangeModeCommand
|
||||
|
||||
|
||||
class GuiSetModeCommand(wx.Command):
|
||||
@@ -16,7 +16,7 @@ class GuiSetModeCommand(wx.Command):
|
||||
self.itemID = itemID
|
||||
|
||||
def Do(self):
|
||||
if self.internal_history.Submit(FitSetModeCommand(self.fitID, self.itemID)):
|
||||
if self.internal_history.Submit(FitChangeModeCommand(self.fitID, self.itemID)):
|
||||
self.sFit.recalc(self.fitID)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.fitID))
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user