Pass calling window to context menu

This commit is contained in:
DarkPhoenix
2019-07-30 19:12:45 +03:00
parent 5a0ca503c1
commit cd20164d7a
49 changed files with 199 additions and 204 deletions

View File

@@ -10,7 +10,7 @@ class DroneAddStack(ContextMenuSingle):
def __init__(self):
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
def display(self, srcContext, mainItem):
def display(self, callingWindow, srcContext, mainItem):
if srcContext not in ('marketItemGroup', 'marketItemMisc'):
return False
@@ -32,11 +32,11 @@ class DroneAddStack(ContextMenuSingle):
self.amount = amount
return True
def getText(self, itmContext, mainItem):
def getText(self, callingWindow, itmContext, mainItem):
return 'Add {} to Drone Bay{}'.format(
itmContext, '' if self.amount == 1 else ' (x{})'.format(self.amount))
def activate(self, fullContext, mainItem, i):
def activate(self, callingWindow, fullContext, mainItem, i):
command = cmd.GuiAddLocalDroneCommand(
fitID=self.mainFrame.getActiveFit(),
itemID=int(mainItem.ID),