Skip to content

Commit

Permalink
Allow pasting non-mutated modules via ctrl-v
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkFenX committed Feb 3, 2020
1 parent fc9337d commit f22a4f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions gui/mainFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,12 @@ def importFromClipboard(self, event):
activeFit = self.getActiveFit()
try:
importType, importData = Port().importFitFromBuffer(clipboard, activeFit)
if importType == "MutatedItem":
# we've imported an Abyssal module, need to fire off the command to add it to the fit
self.command.Submit(cmd.GuiImportLocalMutatedModuleCommand(activeFit, *importData[0]))
if importType == "FittingItem":
baseItem, mutaplasmidItem, mutations = importData[0]
if mutaplasmidItem:
self.command.Submit(cmd.GuiImportLocalMutatedModuleCommand(activeFit, baseItem, mutaplasmidItem, mutations))
else:
self.command.Submit(cmd.GuiAddLocalModuleCommand(activeFit, baseItem.ID))
return
if importType == "AdditionsDrones":
if self.command.Submit(cmd.GuiImportLocalDronesCommand(activeFit, [(i.ID, a) for i, a in importData[0]])):
Expand Down
4 changes: 2 additions & 2 deletions service/port/port.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ def importAuto(cls, string, path=None, activeFit=None, iportuser=None):
except:
pass
else:
if baseItem is not None and mutaplasmidItem is not None:
return "MutatedItem", False, ((baseItem, mutaplasmidItem, mutations),)
if baseItem is not None:
return "FittingItem", False, ((baseItem, mutaplasmidItem, mutations),)
# Try to import into one of additions panels
isDrone, droneData = isValidDroneImport(string)
if isDrone:
Expand Down

0 comments on commit f22a4f1

Please sign in to comment.