当前位置: 首页>>代码示例>>Python>>正文


Python InternalCommandHistory.undoAll方法代码示例

本文整理汇总了Python中gui.fitCommands.helpers.InternalCommandHistory.undoAll方法的典型用法代码示例。如果您正苦于以下问题:Python InternalCommandHistory.undoAll方法的具体用法?Python InternalCommandHistory.undoAll怎么用?Python InternalCommandHistory.undoAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gui.fitCommands.helpers.InternalCommandHistory的用法示例。


在下文中一共展示了InternalCommandHistory.undoAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: GuiChangeLocalModuleChargesCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiChangeLocalModuleChargesCommand(wx.Command):

    def __init__(self, fitID, positions, chargeItemID):
        wx.Command.__init__(self, True, 'Change Local Module Charges')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.positions = positions
        self.chargeItemID = chargeItemID

    def Do(self):
        cmd = CalcChangeModuleChargesCommand(fitID=self.fitID, projected=False, chargeMap={p: self.chargeItemID for p in self.positions})
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:31,代码来源:

示例2: GuiRemoveCommandFitsCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiRemoveCommandFitsCommand(wx.Command):

    def __init__(self, fitID, commandFitIDs):
        wx.Command.__init__(self, True, 'Remove Command Fits')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.commandFitIDs = commandFitIDs

    def Do(self):
        results = []
        for commandFitID in self.commandFitIDs:
            cmd = CalcRemoveCommandFitCommand(fitID=self.fitID, commandFitID=commandFitID)
            results.append(self.internalHistory.submit(cmd))
        success = any(results)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:33,代码来源:

示例3: GuiToggleBoosterSideEffectStateCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiToggleBoosterSideEffectStateCommand(wx.Command):

    def __init__(self, fitID, position, effectID):
        wx.Command.__init__(self, True, 'Toggle Booster Side Effect State')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.position = position
        self.effectID = effectID

    def Do(self):
        cmd = CalcToggleBoosterSideEffectStateCommand(fitID=self.fitID, position=self.position, effectID=self.effectID)
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:31,代码来源:

示例4: GuiChangeLocalModuleSpoolCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiChangeLocalModuleSpoolCommand(wx.Command):

    def __init__(self, fitID, position, spoolType, spoolAmount):
        wx.Command.__init__(self, True, 'Change Local Module Spool')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.position = position
        self.spoolType = spoolType
        self.spoolAmount = spoolAmount

    def Do(self):
        cmd = CalcChangeModuleSpoolCommand(
            fitID=self.fitID,
            projected=False,
            position=self.position,
            spoolType=self.spoolType,
            spoolAmount=self.spoolAmount)
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:37,代码来源:

示例5: GuiChangeProjectedDroneAmountCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiChangeProjectedDroneAmountCommand(wx.Command):

    def __init__(self, fitID, itemID, amount):
        wx.Command.__init__(self, True, 'Change Projected Drone Amount')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.itemID = itemID
        self.amount = amount

    def Do(self):
        if self.amount > 0:
            cmd = CalcChangeProjectedDroneAmountCommand(fitID=self.fitID, itemID=self.itemID, amount=self.amount)
        else:
            cmd = CalcRemoveProjectedDroneCommand(fitID=self.fitID, itemID=self.itemID, amount=math.inf)
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:34,代码来源:

示例6: GuiAddProjectedFitCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiAddProjectedFitCommand(wx.Command):

    def __init__(self, fitID, projectedFitID, amount):
        wx.Command.__init__(self, True, 'Add Projected Fit')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.projectedFitID = projectedFitID
        self.amount = amount

    def Do(self):
        cmd = CalcAddProjectedFitCommand(fitID=self.fitID, projectedFitID=self.projectedFitID, amount=self.amount)
        success = self.internalHistory.submit(cmd)
        sFit = Fit.getInstance()
        eos.db.flush()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        sFit = Fit.getInstance()
        eos.db.flush()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:31,代码来源:

示例7: GuiToggleCommandFitStatesCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiToggleCommandFitStatesCommand(wx.Command):

    def __init__(self, fitID, mainCommandFitID, commandFitIDs):
        wx.Command.__init__(self, True, 'Toggle Command Fit States')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.mainCommandFitID = mainCommandFitID
        self.commandFitIDs = commandFitIDs

    def Do(self):
        cmd = CalcToggleCommandFitStatesCommand(
            fitID=self.fitID,
            mainCommandFitID=self.mainCommandFitID,
            commandFitIDs=self.commandFitIDs)
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:34,代码来源:

示例8: GuiRemoveBoostersCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiRemoveBoostersCommand(wx.Command):

    def __init__(self, fitID, positions):
        wx.Command.__init__(self, True, 'Remove Boosters')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.positions = positions

    def Do(self):
        results = []
        for position in sorted(self.positions, reverse=True):
            cmd = CalcRemoveBoosterCommand(fitID=self.fitID, position=position)
            results.append(self.internalHistory.submit(cmd))
        success = any(results)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:33,代码来源:

示例9: GuiAddImplantSetCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiAddImplantSetCommand(wx.Command):

    def __init__(self, fitID, itemIDs):
        wx.Command.__init__(self, True, 'Add Implant Set')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.itemIDs = itemIDs

    def Do(self):
        results = []
        for itemID in self.itemIDs:
            cmd = CalcAddImplantCommand(fitID=self.fitID, implantInfo=ImplantInfo(itemID=itemID))
            results.append(self.internalHistory.submit(cmd))
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        # Some might fail, as we already might have these implants
        return any(results)

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:33,代码来源:

示例10: GuiChangeLocalFighterAmountCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiChangeLocalFighterAmountCommand(wx.Command):

    def __init__(self, fitID, position, amount):
        wx.Command.__init__(self, True, 'Change Local Fighter Amount')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.position = position
        self.amount = amount

    def Do(self):
        if self.amount > 0:
            cmd = CalcChangeFighterAmountCommand(fitID=self.fitID, projected=False, position=self.position, amount=self.amount)
        else:
            cmd = CalcRemoveLocalFighterCommand(fitID=self.fitID, position=self.position)
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:34,代码来源:

示例11: GuiChangeBoosterMetaCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiChangeBoosterMetaCommand(wx.Command):

    def __init__(self, fitID, position, newItemID):
        wx.Command.__init__(self, True, 'Change Booster Meta')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.position = position
        self.newItemID = newItemID

    def Do(self):
        sFit = Fit.getInstance()
        fit = sFit.getFit(self.fitID)
        booster = fit.boosters[self.position]
        if booster.itemID == self.newItemID:
            return False
        info = BoosterInfo.fromBooster(booster)
        info.itemID = self.newItemID
        cmd = CalcAddBoosterCommand(fitID=self.fitID, boosterInfo=info)
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:37,代码来源:

示例12: GuiChangeShipModeCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiChangeShipModeCommand(wx.Command):

    def __init__(self, fitID, itemID):
        wx.Command.__init__(self, True, 'Change Ship Mode')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.itemID = itemID

    def Do(self):
        cmd = CalcChangeShipModeCommand(fitID=self.fitID, itemID=self.itemID)
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:30,代码来源:

示例13: GuiRemoveCargosCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiRemoveCargosCommand(wx.Command):

    def __init__(self, fitID, itemIDs):
        wx.Command.__init__(self, True, 'Remove Cargos')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.itemIDs = itemIDs

    def Do(self):
        results = []
        for itemID in self.itemIDs:
            cmd = CalcRemoveCargoCommand(
                fitID=self.fitID,
                cargoInfo=CargoInfo(itemID=itemID, amount=math.inf))
            results.append(self.internalHistory.submit(cmd))
        success = any(results)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:27,代码来源:

示例14: GuiChangeLocalModuleMutationCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiChangeLocalModuleMutationCommand(wx.Command):

    def __init__(self, fitID, position, mutation, oldMutation=None):
        wx.Command.__init__(self, True, 'Change Local Module Mutation')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.position = position
        self.mutation = mutation
        self.oldMutation = oldMutation

    def Do(self):
        cmd = CalcChangeLocalModuleMutationCommand(
            fitID=self.fitID,
            position=self.position,
            mutation=self.mutation,
            oldMutation=self.oldMutation)
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:36,代码来源:

示例15: GuiAddProjectedDroneCommand

# 需要导入模块: from gui.fitCommands.helpers import InternalCommandHistory [as 别名]
# 或者: from gui.fitCommands.helpers.InternalCommandHistory import undoAll [as 别名]
class GuiAddProjectedDroneCommand(wx.Command):

    def __init__(self, fitID, itemID):
        wx.Command.__init__(self, True, 'Add Projected Drone')
        self.internalHistory = InternalCommandHistory()
        self.fitID = fitID
        self.itemID = itemID

    def Do(self):
        cmd = CalcAddProjectedDroneCommand(fitID=self.fitID, droneInfo=DroneInfo(itemID=self.itemID, amount=1, amountActive=1))
        success = self.internalHistory.submit(cmd)
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success

    def Undo(self):
        success = self.internalHistory.undoAll()
        eos.db.flush()
        sFit = Fit.getInstance()
        sFit.recalc(self.fitID)
        sFit.fill(self.fitID)
        eos.db.commit()
        wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
        return success
开发者ID:,项目名称:,代码行数:30,代码来源:


注:本文中的gui.fitCommands.helpers.InternalCommandHistory.undoAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。