# ============================================================================= # Copyright (C) 2025 # # This file is part of pyfa. # # pyfa is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # pyfa is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with pyfa. If not, see . # ============================================================================= # noinspection PyPackageRequirements import wx import gui.mainFrame from gui.contextMenu import ContextMenuSingle _t = wx.GetTranslation class FitDiff(ContextMenuSingle): def __init__(self): self.mainFrame = gui.mainFrame.MainFrame.getInstance() def display(self, callingWindow, srcContext, mainItem): # Only show for fittingShip context (right-click on ship) return srcContext == "fittingShip" def getText(self, callingWindow, itmContext, mainItem): return _t("Fit Diff...") def activate(self, callingWindow, fullContext, mainItem, i): fitID = self.mainFrame.getActiveFit() if fitID is not None: from gui.fitDiffFrame import FitDiffFrame FitDiffFrame(self.mainFrame, fitID) FitDiff.register()