From 035e6cea41634dee803f9c1202f773bed0843b25 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Wed, 26 Feb 2014 00:32:07 -0500 Subject: [PATCH] Fixes incorrect setting of `draggedFitID` when selecting booster from menu --- gui/gangView.py | 4 ++-- gui/shipBrowser.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gui/gangView.py b/gui/gangView.py index 84aadcc55..589e25924 100644 --- a/gui/gangView.py +++ b/gui/gangView.py @@ -352,7 +352,7 @@ class GangView ( ScrolledPanel ): choice.SetSelection(1) def handleDrag(self, type, fitID): - ''' Handle dragging of fit to fleet interface. This is also fired when right-clicking fit if there's an active one ''' + ''' Handle dragging of fit to fleet interface ''' #Those are drags coming from pyfa sources, NOT builtin wx drags self.draggedFitID = None if type == "fit": @@ -368,7 +368,6 @@ class GangView ( ScrolledPanel ): def OnPopupItemSelected(self, event): ''' Fired when booster popup item is selected ''' - # Get menu selection ID via self.options menuItem = self.FitDNDPopupMenu.FindItemById(event.GetId()) type = self.options.index(menuItem.GetText()) @@ -387,6 +386,7 @@ class GangView ( ScrolledPanel ): # set type via choice box used chFit = event.GetEventObject() fitID = chFit.GetClientData(chFit.GetSelection()) + type = -1 for id in self.fleet: if chFit == self.fleet[id]['chFit']: type = id diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index 4de320b29..453607a69 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -1367,7 +1367,6 @@ class FitItem(SFItem.SFBrowserItem): self.fitMenu.AppendSeparator() boosterMenu = self.mainFrame.additionsPane.gangPage.FitDNDPopupMenu self.fitMenu.AppendMenu(wx.ID_ANY, 'Set Booster', boosterMenu) - self.mainFrame.additionsPane.gangPage.draggedFitID = self.fitID self.boosterBmp = bitmapLoader.getBitmap("fleet_fc_small", "icons") self.copyBmp = bitmapLoader.getBitmap("fit_add_small", "icons") @@ -1460,6 +1459,8 @@ class FitItem(SFItem.SFBrowserItem): ''' Handles context menu for fit. Dragging is handled by MouseLeftUp() ''' pos = wx.GetMousePosition() pos = self.ScreenToClient(pos) + # Even though we may not select a booster, automatically set this so that the fleet pane knows which fit we're applying + self.mainFrame.additionsPane.gangPage.draggedFitID = self.fitID self.PopupMenu(self.fitMenu, pos) event.Skip()