Files
pyfa/gui/builtinContextMenus/fitDiff.py
PhatPhuckDave a03c2e4091 Add a fit diff view
The point is to figure out what items are necessary to transform fit 1
into fit 2
2026-01-17 17:14:14 +01:00

49 lines
1.6 KiB
Python

# =============================================================================
# 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 <http://www.gnu.org/licenses/>.
# =============================================================================
# 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()