Rework projected removal command to be able to handle multi-selection

This commit is contained in:
DarkPhoenix
2019-04-27 23:27:16 +03:00
parent e865c9a399
commit e39f9ffecf
17 changed files with 180 additions and 229 deletions

View File

@@ -1,29 +0,0 @@
import wx
import gui.mainFrame
from gui import globalEvents as GE
from gui.fitCommands.calc.module.projectedRemove import CalcRemoveProjectedModuleCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiRemoveProjectedModuleCommand(wx.Command):
def __init__(self, fitID, position):
wx.Command.__init__(self, True, 'Remove Projected Module')
self.internalHistory = InternalCommandHistory()
self.fitID = fitID
self.position = position
def Do(self):
cmd = CalcRemoveProjectedModuleCommand(fitID=self.fitID, position=self.position)
success = self.internalHistory.submit(cmd)
Fit.getInstance().recalc(self.fitID)
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success
def Undo(self):
success = self.internalHistory.undoAll()
Fit.getInstance().recalc(self.fitID)
wx.PostEvent(gui.mainFrame.MainFrame.getInstance(), GE.FitChanged(fitID=self.fitID))
return success