Added copy module by drag/drop module while holding Ctrl key. This has been planned since 2011 according to blame. =D
This commit is contained in:
@@ -352,7 +352,7 @@ class FittingView(d.Display):
|
||||
|
||||
cFit = service.Fit.getInstance()
|
||||
|
||||
if clone:
|
||||
if clone and mod2.isEmpty:
|
||||
cFit.cloneModule(self.mainFrame.getActiveFit(), mod1.position, mod2.position)
|
||||
else:
|
||||
cFit.swapModules(self.mainFrame.getActiveFit(), mod1.position, mod2.position)
|
||||
|
||||
@@ -395,8 +395,26 @@ class Fit(object):
|
||||
eos.db.commit()
|
||||
|
||||
def cloneModule(self, fitID, src, dst):
|
||||
#need implementation of module clone based on module positions (also make sure the dst is empty else do nothing)
|
||||
pass
|
||||
'''
|
||||
Clone a module from src to dst
|
||||
|
||||
This will overwrite dst! Checking for empty module must be
|
||||
done at a higher level
|
||||
'''
|
||||
fit = eos.db.getFit(fitID)
|
||||
# Gather modules
|
||||
srcMod = fit.modules[src]
|
||||
dstMod = fit.modules[dst]
|
||||
|
||||
new = copy.deepcopy(srcMod)
|
||||
|
||||
# remove empty mod
|
||||
fit.modules.remove(dstMod)
|
||||
|
||||
# insert copy
|
||||
fit.modules.insert(dst, new)
|
||||
|
||||
eos.db.commit()
|
||||
|
||||
def addDrone(self, fitID, itemID):
|
||||
if fitID == None:
|
||||
|
||||
Reference in New Issue
Block a user