Print "stack" suffix on remove context menu text depending on passed source context rather than item context

This commit is contained in:
DarkPhoenix
2019-04-29 00:25:02 +03:00
parent cb7f0052c4
commit eb601e991a

View File

@@ -30,12 +30,13 @@ class RemoveItem(ContextMenuCombined):
if mainItem is None or getattr(mainItem, "isEmpty", False):
return False
self.srcContext = srcContext
return True
def getText(self, itmContext, mainItem, selection):
return 'Remove {}{}'.format(
itmContext if itmContext is not None else 'Item',
' Stack' if itmContext in ('Drone', 'Fit') else '')
' Stack' if self.srcContext in ('droneItem', 'projectedDrone', 'cargoItem', 'projectedFit') else '')
def activate(self, fullContext, mainItem, selection, i):
handlerMap = {