Merge branch 'i18n' into singularity
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
# =============================================================================
|
||||
|
||||
import config
|
||||
import wx
|
||||
_t = wx.GetTranslation
|
||||
|
||||
try:
|
||||
versionString = "{0}".format(config.getVersion())
|
||||
@@ -26,10 +28,10 @@ except NameError:
|
||||
versionString = "0.0"
|
||||
|
||||
licenses = (
|
||||
"pyfa is released under GNU GPLv3 - see included LICENSE file",
|
||||
"All EVE-Online related materials are property of CCP hf.",
|
||||
"Silk Icons Set by famfamfam.com - Creative Commons Attribution 2.5 License",
|
||||
"Fat Cow Icons by fatcow.com - Creative Commons Attribution 3.0 License"
|
||||
_t("pyfa is released under GNU GPLv3 - see included LICENSE file"),
|
||||
_t("All EVE-Online related materials are property of CCP hf."),
|
||||
_t("Silk Icons Set by famfamfam.com - Creative Commons Attribution 2.5 License"),
|
||||
_t("Fat Cow Icons by fatcow.com - Creative Commons Attribution 3.0 License")
|
||||
)
|
||||
developers = (
|
||||
"blitzmann \tSable Blitzmann (maintainer)",
|
||||
@@ -44,7 +46,7 @@ credits = (
|
||||
"Corollax (Aamrr) \tVarious EOS / pyfa improvements",
|
||||
"Dreae (Dreae)\tPyCrest")
|
||||
description = (
|
||||
"Pyfa (the Python Fitting Assistant) is an open-source standalone application able to "
|
||||
_t("Pyfa (the Python Fitting Assistant) is an open-source standalone application able to "
|
||||
"create and simulate fittings for EVE-Online SciFi MMORPG with a very high degree of "
|
||||
"accuracy. Pyfa can run on all platforms where Python and wxWidgets are supported."
|
||||
"accuracy. Pyfa can run on all platforms where Python and wxWidgets are supported.")
|
||||
)
|
||||
|
||||
@@ -33,6 +33,7 @@ from gui.builtinAdditionPanes.projectedView import ProjectedView
|
||||
from gui.chrome_tabs import ChromeNotebook
|
||||
from gui.toggle_panel import TogglePanel
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
class AdditionsPane(TogglePanel):
|
||||
|
||||
@@ -41,7 +42,7 @@ class AdditionsPane(TogglePanel):
|
||||
TogglePanel.__init__(self, parent, force_layout=1)
|
||||
self.mainFrame = mainFrame
|
||||
|
||||
self.SetLabel("Additions")
|
||||
self.SetLabel(_t("Additions"))
|
||||
pane = self.GetContentPanel()
|
||||
|
||||
baseSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
@@ -62,28 +63,28 @@ class AdditionsPane(TogglePanel):
|
||||
notesImg = BitmapLoader.getImage("skill_small", "gui")
|
||||
|
||||
self.drone = DroneView(self.notebook)
|
||||
self.notebook.AddPage(self.drone, "Drones", image=droneImg, closeable=False)
|
||||
self.notebook.AddPage(self.drone, _t("Drones"), image=droneImg, closeable=False)
|
||||
|
||||
self.fighter = FighterView(self.notebook)
|
||||
self.notebook.AddPage(self.fighter, "Fighters", image=fighterImg, closeable=False)
|
||||
self.notebook.AddPage(self.fighter, _t("Fighters"), image=fighterImg, closeable=False)
|
||||
|
||||
self.cargo = CargoView(self.notebook)
|
||||
self.notebook.AddPage(self.cargo, "Cargo", image=cargoImg, closeable=False)
|
||||
self.notebook.AddPage(self.cargo, _t("Cargo"), image=cargoImg, closeable=False)
|
||||
|
||||
self.implant = ImplantView(self.notebook)
|
||||
self.notebook.AddPage(self.implant, "Implants", image=implantImg, closeable=False)
|
||||
self.notebook.AddPage(self.implant, _t("Implants"), image=implantImg, closeable=False)
|
||||
|
||||
self.booster = BoosterView(self.notebook)
|
||||
self.notebook.AddPage(self.booster, "Boosters", image=boosterImg, closeable=False)
|
||||
self.notebook.AddPage(self.booster, _t("Boosters"), image=boosterImg, closeable=False)
|
||||
|
||||
self.projectedPage = ProjectedView(self.notebook)
|
||||
self.notebook.AddPage(self.projectedPage, "Projected", image=projectedImg, closeable=False)
|
||||
self.notebook.AddPage(self.projectedPage, _t("Projected"), image=projectedImg, closeable=False)
|
||||
|
||||
self.gangPage = CommandView(self.notebook)
|
||||
self.notebook.AddPage(self.gangPage, "Command", image=gangImg, closeable=False)
|
||||
self.notebook.AddPage(self.gangPage, _t("Command"), image=gangImg, closeable=False)
|
||||
|
||||
self.notes = NotesView(self.notebook)
|
||||
self.notebook.AddPage(self.notes, "Notes", image=notesImg, closeable=False)
|
||||
self.notebook.AddPage(self.notes, _t("Notes"), image=notesImg, closeable=False)
|
||||
|
||||
self.mainFrame.Bind(GE.FIT_CHANGED, self.OnFitChanged)
|
||||
self.mainFrame.Bind(GE.FIT_NOTES_CHANGED, self.OnNotesChanged)
|
||||
|
||||
77
gui/app.py
Normal file
77
gui/app.py
Normal file
@@ -0,0 +1,77 @@
|
||||
import wx
|
||||
import config
|
||||
import os
|
||||
import sys
|
||||
from logbook import Logger
|
||||
pyfalog = Logger(__name__)
|
||||
from service.settings import LocaleSettings
|
||||
|
||||
|
||||
class PyfaApp(wx.App):
|
||||
def OnInit(self):
|
||||
"""
|
||||
Do application initialization work, e.g. define application globals.
|
||||
"""
|
||||
|
||||
# Name for my application.
|
||||
self.appName = "pyfa"
|
||||
|
||||
#------------
|
||||
|
||||
# # Simplified init method.
|
||||
# self.DoConfig()
|
||||
# self.Init() # InspectionMixin
|
||||
# # work around for Python stealing "_".
|
||||
# sys.displayhook = _displayHook
|
||||
#
|
||||
# #------------
|
||||
|
||||
|
||||
# Return locale folder.
|
||||
localeDir = os.path.join(config.pyfaPath, "locale")
|
||||
|
||||
# Set language stuff and update to last used language.
|
||||
self.locale = None
|
||||
wx.Locale.AddCatalogLookupPathPrefix(localeDir)
|
||||
# Set language stuff and update to last used language.
|
||||
self.UpdateLanguage(config.language)
|
||||
|
||||
return True
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
def UpdateLanguage(self, lang=None):
|
||||
"""
|
||||
Update the language to the requested one.
|
||||
|
||||
Make *sure* any existing locale is deleted before the new
|
||||
one is created. The old C++ object needs to be deleted
|
||||
before the new one is created, and if we just assign a new
|
||||
instance to the old Python variable, the old C++ locale will
|
||||
not be destroyed soon enough, likely causing a crash.
|
||||
|
||||
:param string `lang`: one of the supported language codes.
|
||||
"""
|
||||
|
||||
# Language domain.
|
||||
langDomain = config.CATALOG
|
||||
|
||||
# If an unsupported language is requested default to English.
|
||||
|
||||
if self.locale:
|
||||
assert sys.getrefcount(self.locale) <= 2
|
||||
del self.locale
|
||||
|
||||
# Create a locale object for this language.
|
||||
langInfo = wx.Locale.FindLanguageInfo(lang)
|
||||
if langInfo is not None:
|
||||
pyfalog.debug("Setting language to: " + lang)
|
||||
self.locale = wx.Locale(langInfo.Language)
|
||||
if self.locale.IsOk():
|
||||
success = self.locale.AddCatalog(langDomain)
|
||||
if not success:
|
||||
print("Langauage catalog not successfully loaded")
|
||||
|
||||
else:
|
||||
pyfalog.debug("Cannot find langauge: " + lang)
|
||||
self.locale = wx.Locale(wx.Locale.FindLanguageInfo(LocaleSettings.defaults['locale']).Language)
|
||||
@@ -29,7 +29,7 @@ from gui.contextMenu import ContextMenu
|
||||
from gui.utils.staticHelpers import DragDropHelper
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
class BoosterViewDrop(wx.DropTarget):
|
||||
def __init__(self, dropFn, *args, **kwargs):
|
||||
@@ -212,7 +212,7 @@ class BoosterView(d.Display):
|
||||
else:
|
||||
if booster in self.original:
|
||||
mainBooster = booster
|
||||
itemContext = None if mainBooster is None else "Booster"
|
||||
itemContext = None if mainBooster is None else _t("Booster")
|
||||
menu = ContextMenu.getMenu(self, mainBooster, selection, ("boosterItem", itemContext), ("boosterItemMisc", itemContext))
|
||||
if menu:
|
||||
self.PopupMenu(menu)
|
||||
|
||||
@@ -227,7 +227,7 @@ class CargoView(d.Display):
|
||||
else:
|
||||
if cargo in self.original:
|
||||
mainCargo = cargo
|
||||
itemContext = None if mainCargo is None else Market.getInstance().getCategoryByItem(mainCargo.item).name
|
||||
itemContext = None if mainCargo is None else Market.getInstance().getCategoryByItem(mainCargo.item).displayName
|
||||
menu = ContextMenu.getMenu(self, mainCargo, selection, ("cargoItem", itemContext), ("cargoItemMisc", itemContext))
|
||||
if menu:
|
||||
self.PopupMenu(menu)
|
||||
|
||||
@@ -30,6 +30,7 @@ from gui.contextMenu import ContextMenu
|
||||
from gui.utils.staticHelpers import DragDropHelper
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
class DummyItem:
|
||||
|
||||
@@ -159,7 +160,7 @@ class CommandView(d.Display):
|
||||
self.fits.sort(key=self.fitSort)
|
||||
stuff.extend(self.fits)
|
||||
if not stuff:
|
||||
stuff = [DummyEntry("Drag a fit to this area")]
|
||||
stuff = [DummyEntry(_t("Drag a fit to this area"))]
|
||||
self.update(stuff)
|
||||
|
||||
def click(self, event):
|
||||
@@ -197,7 +198,7 @@ class CommandView(d.Display):
|
||||
pass
|
||||
contexts = []
|
||||
if mainCommandFit is not None:
|
||||
contexts.append(('commandFit', 'Command Fit'))
|
||||
contexts.append(('commandFit', _t('Command Fit')))
|
||||
contexts.append(('commandView',))
|
||||
menu = ContextMenu.getMenu(self, mainCommandFit, selection, *contexts)
|
||||
if menu:
|
||||
|
||||
@@ -195,7 +195,7 @@ class DroneView(Display):
|
||||
def droneKey(drone):
|
||||
sMkt = Market.getInstance()
|
||||
|
||||
groupName = sMkt.getMarketGroupByItem(drone.item).name
|
||||
groupName = sMkt.getMarketGroupByItem(drone.item).marketGroupName
|
||||
|
||||
return (DRONE_ORDER.index(groupName), drone.item.name)
|
||||
|
||||
@@ -324,7 +324,7 @@ class DroneView(Display):
|
||||
if drone in self.original:
|
||||
mainDrone = drone
|
||||
selection = self.getSelectedDrones()
|
||||
itemContext = None if mainDrone is None else Market.getInstance().getCategoryByItem(mainDrone.item).name
|
||||
itemContext = None if mainDrone is None else Market.getInstance().getCategoryByItem(mainDrone.item).displayName
|
||||
menu = ContextMenu.getMenu(self, mainDrone, selection, ("droneItem", itemContext), ("droneItemMisc", itemContext))
|
||||
if menu:
|
||||
self.PopupMenu(menu)
|
||||
|
||||
@@ -35,6 +35,7 @@ from service.market import Market
|
||||
|
||||
|
||||
FIGHTER_ORDER = ('Light Fighter', 'Heavy Fighter', 'Support Fighter')
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class FighterViewDrop(wx.DropTarget):
|
||||
@@ -58,7 +59,7 @@ class FighterView(wx.Panel):
|
||||
def __init__(self, parent):
|
||||
wx.Panel.__init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, style=wx.TAB_TRAVERSAL)
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.labels = ["Light", "Heavy", "Support"]
|
||||
self.labels = [("Light", _t("Light")), ("Heavy", _t("Heavy")), ("Support", _t("Support"))]
|
||||
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
@@ -68,18 +69,18 @@ class FighterView(wx.Panel):
|
||||
textSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
textSizer.AddStretchSpacer()
|
||||
|
||||
for x in self.labels:
|
||||
lbl = wx.StaticText(self, wx.ID_ANY, x.capitalize())
|
||||
for attr, label in self.labels:
|
||||
lbl = wx.StaticText(self, wx.ID_ANY, label)
|
||||
textSizer.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5)
|
||||
|
||||
lbl = wx.StaticText(self, wx.ID_ANY, "0")
|
||||
setattr(self, "label%sUsed" % (x.capitalize()), lbl)
|
||||
setattr(self, "label%sUsed" % attr, lbl)
|
||||
textSizer.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5)
|
||||
|
||||
textSizer.Add(wx.StaticText(self, wx.ID_ANY, "/"), 0, wx.ALIGN_CENTER)
|
||||
|
||||
lbl = wx.StaticText(self, wx.ID_ANY, "0")
|
||||
setattr(self, "label%sTotal" % (x.capitalize()), lbl)
|
||||
setattr(self, "label%sTotal" % attr, lbl)
|
||||
textSizer.Add(lbl, 0, wx.ALIGN_CENTER)
|
||||
textSizer.AddStretchSpacer()
|
||||
|
||||
@@ -100,7 +101,7 @@ class FighterView(wx.Panel):
|
||||
fit = sFit.getFit(activeFitID)
|
||||
|
||||
if fit:
|
||||
for x in self.labels:
|
||||
for x, _ in self.labels:
|
||||
if fit.isStructure:
|
||||
slot = getattr(FittingSlot, "FS_{}".format(x.upper()))
|
||||
else:
|
||||
@@ -382,7 +383,7 @@ class FighterDisplay(d.Display):
|
||||
else:
|
||||
if fighter in self.original:
|
||||
mainFighter = fighter
|
||||
itemContext = None if mainFighter is None else Market.getInstance().getCategoryByItem(mainFighter.item).name
|
||||
itemContext = None if mainFighter is None else Market.getInstance().getCategoryByItem(mainFighter.item).displayName
|
||||
menu = ContextMenu.getMenu(self, mainFighter, selection, ("fighterItem", itemContext), ("fighterItemMisc", itemContext))
|
||||
if menu:
|
||||
self.PopupMenu(menu)
|
||||
|
||||
@@ -32,6 +32,8 @@ from gui.utils.staticHelpers import DragDropHelper
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ImplantViewDrop(wx.DropTarget):
|
||||
def __init__(self, dropFn, *args, **kwargs):
|
||||
@@ -62,8 +64,8 @@ class ImplantView(wx.Panel):
|
||||
|
||||
radioSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
radioSizer.AddStretchSpacer()
|
||||
self.rbFit = wx.RadioButton(self, id=wx.ID_ANY, label="Use Fit-specific Implants", style=wx.RB_GROUP)
|
||||
self.rbChar = wx.RadioButton(self, id=wx.ID_ANY, label="Use Character Implants")
|
||||
self.rbFit = wx.RadioButton(self, id=wx.ID_ANY, label=_t("Use Fit-specific Implants"), style=wx.RB_GROUP)
|
||||
self.rbChar = wx.RadioButton(self, id=wx.ID_ANY, label=_t("Use Character Implants"))
|
||||
radioSizer.Add(self.rbFit, 0, wx.ALL, 5)
|
||||
radioSizer.Add(self.rbChar, 0, wx.ALL, 5)
|
||||
radioSizer.AddStretchSpacer()
|
||||
@@ -298,7 +300,7 @@ class ImplantDisplay(d.Display):
|
||||
fit = Fit.getInstance().getFit(fitID)
|
||||
sourceContext1 = "implantItem" if fit.implantSource == ImplantLocation.FIT else "implantItemChar"
|
||||
sourceContext2 = "implantItemMisc" if fit.implantSource == ImplantLocation.FIT else "implantItemMiscChar"
|
||||
itemContext = None if mainImplant is None else Market.getInstance().getCategoryByItem(mainImplant.item).name
|
||||
itemContext = None if mainImplant is None else Market.getInstance().getCategoryByItem(mainImplant.item).displayName
|
||||
menu = ContextMenu.getMenu(self, mainImplant, selection,
|
||||
(sourceContext1, itemContext),
|
||||
(sourceContext2, itemContext)
|
||||
|
||||
@@ -41,7 +41,7 @@ from service.market import Market
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
class DummyItem:
|
||||
def __init__(self, txt):
|
||||
@@ -221,7 +221,7 @@ class ProjectedView(d.Display):
|
||||
stuff.extend(self.drones)
|
||||
stuff.extend(self.fighters)
|
||||
if not stuff:
|
||||
stuff = [DummyEntry('Drag an item or fit, or use right-click menu for wormhole effects')]
|
||||
stuff = [DummyEntry(_t('Drag an item or fit, or use right-click menu for wormhole effects'))]
|
||||
self.update(stuff)
|
||||
|
||||
def get(self, row):
|
||||
@@ -301,27 +301,27 @@ class ProjectedView(d.Display):
|
||||
|
||||
if isinstance(mainItem, EosModule):
|
||||
modSrcContext = 'projectedModule'
|
||||
modItemContext = 'Projected Item'
|
||||
modItemContext = _t('Projected Item')
|
||||
modFullContext = (modSrcContext, modItemContext)
|
||||
contexts.append(modFullContext)
|
||||
if mainItem.charge is not None:
|
||||
chargeSrcContext = 'projectedCharge'
|
||||
chargeItemContext = sMkt.getCategoryByItem(mainItem.charge).name
|
||||
chargeItemContext = sMkt.getCategoryByItem(mainItem.charge).displayName
|
||||
chargeFullContext = (chargeSrcContext, chargeItemContext)
|
||||
contexts.append(chargeFullContext)
|
||||
elif isinstance(mainItem, EosDrone):
|
||||
srcContext = 'projectedDrone'
|
||||
itemContext = 'Projected Item'
|
||||
itemContext = _t('Projected Item')
|
||||
droneFullContext = (srcContext, itemContext)
|
||||
contexts.append(droneFullContext)
|
||||
elif isinstance(mainItem, EosFighter):
|
||||
srcContext = 'projectedFighter'
|
||||
itemContext = 'Projected Item'
|
||||
itemContext = _t('Projected Item')
|
||||
fighterFullContext = (srcContext, itemContext)
|
||||
contexts.append(fighterFullContext)
|
||||
else:
|
||||
fitSrcContext = 'projectedFit'
|
||||
fitItemContext = 'Projected Item'
|
||||
fitItemContext = _t('Projected Item')
|
||||
fitFullContext = (fitSrcContext, fitItemContext)
|
||||
contexts.append(fitFullContext)
|
||||
contexts.append(('projected',))
|
||||
|
||||
@@ -1,44 +1,46 @@
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from gui.utils.clipboard import toClipboard
|
||||
from service.fit import Fit
|
||||
from service.port.eft import exportDrones, exportFighters, exportCargo, exportImplants, exportBoosters
|
||||
from service.port.eft import exportBoosters, exportCargo, exportDrones, exportFighters, exportImplants
|
||||
|
||||
|
||||
viewSpecMap = {
|
||||
'droneItemMisc': ('Drones', lambda cw: cw.drones, exportDrones),
|
||||
'fighterItemMisc': ('Fighters', lambda cw: cw.fighters, exportFighters),
|
||||
'cargoItemMisc': ('Cargo Items', lambda cw: cw.cargo, exportCargo),
|
||||
'implantItemMisc': ('Implants', lambda cw: cw.implants, exportImplants),
|
||||
'implantItemMiscChar': ('Implants', lambda cw: cw.implants, exportImplants),
|
||||
'boosterItemMisc': ('Boosters', lambda cw: cw.boosters, exportBoosters)}
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AdditionsExportAll(ContextMenuUnconditional):
|
||||
|
||||
visibilitySetting = 'additionsCopyPaste'
|
||||
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.viewSpecMap = {
|
||||
'droneItemMisc': (_t('Drones'), lambda cw: cw.drones, exportDrones),
|
||||
'fighterItemMisc': (_t('Fighters'), lambda cw: cw.fighters, exportFighters),
|
||||
'cargoItemMisc': (_t('Cargo Items'), lambda cw: cw.cargo, exportCargo),
|
||||
'implantItemMisc': (_t('Implants'), lambda cw: cw.implants, exportImplants),
|
||||
'implantItemMiscChar': (_t('Implants'), lambda cw: cw.implants, exportImplants),
|
||||
'boosterItemMisc': (_t('Boosters'), lambda cw: cw.boosters, exportBoosters)
|
||||
}
|
||||
|
||||
def display(self, callingWindow, srcContext):
|
||||
if srcContext not in viewSpecMap:
|
||||
if srcContext not in self.viewSpecMap:
|
||||
return False
|
||||
fit = Fit.getInstance().getFit(self.mainFrame.getActiveFit())
|
||||
if fit is None:
|
||||
return False
|
||||
if not viewSpecMap[srcContext][1](callingWindow):
|
||||
if not self.viewSpecMap[srcContext][1](callingWindow):
|
||||
return False
|
||||
|
||||
self.srcContext = srcContext
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Copy All {}'.format(viewSpecMap[self.srcContext][0])
|
||||
return _t('Copy All {}').format(self.viewSpecMap[self.srcContext][0])
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
items = viewSpecMap[self.srcContext][1](callingWindow)
|
||||
export = viewSpecMap[self.srcContext][2](items)
|
||||
items = self.viewSpecMap[self.srcContext][1](callingWindow)
|
||||
export = self.viewSpecMap[self.srcContext][2](items)
|
||||
if export:
|
||||
toClipboard(export)
|
||||
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSelection
|
||||
from gui.utils.clipboard import toClipboard
|
||||
from service.fit import Fit
|
||||
from service.port.eft import exportDrones, exportFighters, exportCargo, exportImplants, exportBoosters
|
||||
from service.port.eft import exportBoosters, exportCargo, exportDrones, exportFighters, exportImplants
|
||||
|
||||
|
||||
viewSpecMap = {
|
||||
'droneItemMisc': ('Drones', exportDrones),
|
||||
'fighterItemMisc': ('Fighters', exportFighters),
|
||||
'cargoItemMisc': ('Cargo Items', exportCargo),
|
||||
'implantItemMisc': ('Implants', exportImplants),
|
||||
'implantItemMiscChar': ('Implants', exportImplants),
|
||||
'boosterItemMisc': ('Boosters', exportBoosters)}
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AdditionsExportAll(ContextMenuSelection):
|
||||
|
||||
visibilitySetting = 'additionsCopyPaste'
|
||||
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.viewSpecMap = {
|
||||
'droneItemMisc': (_t('Drones'), exportDrones),
|
||||
'fighterItemMisc': (_t('Fighters'), exportFighters),
|
||||
'cargoItemMisc': (_t('Cargo Items'), exportCargo),
|
||||
'implantItemMisc': (_t('Implants'), exportImplants),
|
||||
'implantItemMiscChar': (_t('Implants'), exportImplants),
|
||||
'boosterItemMisc': (_t('Boosters'), exportBoosters)
|
||||
}
|
||||
|
||||
def display(self, callingWindow, srcContext, selection):
|
||||
if srcContext not in viewSpecMap:
|
||||
if srcContext not in self.viewSpecMap:
|
||||
return False
|
||||
if not selection:
|
||||
return False
|
||||
@@ -34,10 +36,10 @@ class AdditionsExportAll(ContextMenuSelection):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, selection):
|
||||
return 'Copy Selected {}'.format(viewSpecMap[self.srcContext][0])
|
||||
return _t('Copy Selected {}').format(self.viewSpecMap[self.srcContext][0])
|
||||
|
||||
def activate(self, callingWindow, fullContext, selection, i):
|
||||
export = viewSpecMap[self.srcContext][1](selection)
|
||||
export = self.viewSpecMap[self.srcContext][1](selection)
|
||||
if export:
|
||||
toClipboard(export)
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import fitCommands as cmd
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
@@ -5,25 +7,25 @@ from gui.utils.clipboard import fromClipboard
|
||||
from service.fit import Fit
|
||||
from service.port.eft import parseAdditions
|
||||
|
||||
|
||||
viewSpecMap = {
|
||||
'droneItemMisc': ('Drones', lambda i: i.isDrone, cmd.GuiImportLocalDronesCommand),
|
||||
'fighterItemMisc': ('Fighters', lambda i: i.isFighter, cmd.GuiImportLocalFightersCommand),
|
||||
'cargoItemMisc': ('Cargo Items', lambda i: not i.isAbyssal, cmd.GuiImportCargosCommand),
|
||||
'implantItemMisc': ('Implants', lambda i: i.isImplant, cmd.GuiImportImplantsCommand),
|
||||
'implantItemMiscChar': ('Implants', lambda i: i.isImplant, cmd.GuiImportImplantsCommand),
|
||||
'boosterItemMisc': ('Boosters', lambda i: i.isBooster, cmd.GuiImportBoostersCommand)}
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AdditionsImport(ContextMenuUnconditional):
|
||||
|
||||
visibilitySetting = 'additionsCopyPaste'
|
||||
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.viewSpecMap = {
|
||||
'droneItemMisc': (_t('Drones'), lambda i: i.isDrone, cmd.GuiImportLocalDronesCommand),
|
||||
'fighterItemMisc': (_t('Fighters'), lambda i: i.isFighter, cmd.GuiImportLocalFightersCommand),
|
||||
'cargoItemMisc': (_t('Cargo Items'), lambda i: not i.isAbyssal, cmd.GuiImportCargosCommand),
|
||||
'implantItemMisc': (_t('Implants'), lambda i: i.isImplant, cmd.GuiImportImplantsCommand),
|
||||
'implantItemMiscChar': (_t('Implants'), lambda i: i.isImplant, cmd.GuiImportImplantsCommand),
|
||||
'boosterItemMisc': (_t('Boosters'), lambda i: i.isBooster, cmd.GuiImportBoostersCommand)
|
||||
}
|
||||
|
||||
def display(self, callingWindow, srcContext):
|
||||
if srcContext not in viewSpecMap:
|
||||
if srcContext not in self.viewSpecMap:
|
||||
return False
|
||||
fit = Fit.getInstance().getFit(self.mainFrame.getActiveFit())
|
||||
if fit is None:
|
||||
@@ -35,16 +37,16 @@ class AdditionsImport(ContextMenuUnconditional):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Paste {}'.format(viewSpecMap[self.srcContext][0])
|
||||
return _t('Paste {}').format(self.viewSpecMap[self.srcContext][0])
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
text = fromClipboard()
|
||||
items = parseAdditions(text)
|
||||
filterFunc = viewSpecMap[self.srcContext][1]
|
||||
filterFunc = self.viewSpecMap[self.srcContext][1]
|
||||
items = [(i.ID, a) for i, a in items if filterFunc(i)]
|
||||
if not items:
|
||||
return
|
||||
command = viewSpecMap[self.srcContext][2]
|
||||
command = self.viewSpecMap[self.srcContext][2]
|
||||
self.mainFrame.command.Submit(command(self.mainFrame.getActiveFit(), items))
|
||||
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AmmoToDmgPattern(ContextMenuSingle):
|
||||
|
||||
visibilitySetting = 'ammoPattern'
|
||||
|
||||
def __init__(self):
|
||||
@@ -28,7 +29,7 @@ class AmmoToDmgPattern(ContextMenuSingle):
|
||||
return False
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Set {} as Damage Pattern".format(itmContext if itmContext is not None else "Item")
|
||||
return _t("Set {} as Damage Pattern").format(itmContext if itmContext is not None else _t("Item"))
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -6,6 +7,8 @@ from gui import fitCommands as cmd
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class BoosterSideEffects(ContextMenuSingle):
|
||||
|
||||
@@ -28,7 +31,7 @@ class BoosterSideEffects(ContextMenuSingle):
|
||||
return False
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Side Effects"
|
||||
return _t("Side Effects")
|
||||
|
||||
def addEffect(self, menu, ability):
|
||||
label = ability.name
|
||||
@@ -67,7 +70,7 @@ class BoosterSideEffects(ContextMenuSingle):
|
||||
if booster in fit.boosters:
|
||||
index = fit.boosters.index(booster)
|
||||
self.mainFrame.command.Submit(cmd.GuiToggleBoosterSideEffectStateCommand(
|
||||
fitID=fitID, position=index, effectID=effect.effectID))
|
||||
fitID=fitID, position=index, effectID=effect.effectID))
|
||||
|
||||
|
||||
BoosterSideEffects.register()
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AddToCargo(ContextMenuSingle):
|
||||
|
||||
@@ -26,7 +30,7 @@ class AddToCargo(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Add {} to Cargo".format(itmContext)
|
||||
return _t("Add {} to Cargo").format(itmContext)
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AddToCargoAmmo(ContextMenuSingle):
|
||||
|
||||
@@ -21,7 +25,7 @@ class AddToCargoAmmo(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Add {0} to Cargo (x1000)".format(itmContext)
|
||||
return _t("Add {0} to Cargo (x1000)").format(itmContext)
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
|
||||
@@ -7,9 +7,10 @@ from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AddCommandFit(ContextMenuUnconditional):
|
||||
|
||||
# Get list of items that define a command fit
|
||||
sMkt = Market.getInstance()
|
||||
grp = sMkt.getGroup(1770) # Command burst group
|
||||
@@ -47,7 +48,7 @@ class AddCommandFit(ContextMenuUnconditional):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return "Command Fits"
|
||||
return _t("Command Fits")
|
||||
|
||||
def addFit(self, menu, fit, includeShip=False):
|
||||
label = fit.name if not includeShip else "({}) {}".format(fit.ship.item.name, fit.name)
|
||||
|
||||
@@ -11,6 +11,8 @@ from gui.utils.sorter import smartSort
|
||||
from service.damagePattern import DamagePattern as DmgPatternSvc
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ChangeDamagePattern(ContextMenuUnconditional):
|
||||
|
||||
@@ -35,16 +37,18 @@ class ChangeDamagePattern(ContextMenuUnconditional):
|
||||
# Order here is important: patterns with duplicate names from the latter will overwrite
|
||||
# patterns from the former
|
||||
self.patterns = sorted(
|
||||
chain(builtinPatterns, userPatterns),
|
||||
key=lambda p: p.fullName not in ["Uniform", "Selected Ammo"])
|
||||
chain(builtinPatterns, userPatterns),
|
||||
key=lambda p: p.fullName not in ["Uniform", "Selected Ammo"])
|
||||
|
||||
self.patternEventMap = {}
|
||||
self.items = (OrderedDict(), OrderedDict())
|
||||
for pattern in self.patterns:
|
||||
container = self.items
|
||||
for categoryName in pattern.hierarchy:
|
||||
categoryName = _t(categoryName) if pattern.builtin else categoryName
|
||||
container = container[1].setdefault(categoryName, (OrderedDict(), OrderedDict()))
|
||||
container[0][pattern.shortName] = pattern
|
||||
shortName = _t(pattern.shortName) if pattern.builtin else pattern.shortName
|
||||
container[0][shortName] = pattern
|
||||
|
||||
return list(self.items[0].keys()) + list(self.items[1].keys())
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from gui.fitCommands.helpers import droneStackLimit
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class DroneAddStack(ContextMenuSingle):
|
||||
|
||||
@@ -33,14 +37,14 @@ class DroneAddStack(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return 'Add {} to Drone Bay{}'.format(
|
||||
itmContext, '' if self.amount == 1 else ' (x{})'.format(self.amount))
|
||||
return _t('Add {} to Drone Bay{}').format(
|
||||
itmContext, '' if self.amount == 1 else ' (x{})'.format(self.amount))
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
command = cmd.GuiAddLocalDroneCommand(
|
||||
fitID=self.mainFrame.getActiveFit(),
|
||||
itemID=int(mainItem.ID),
|
||||
amount=self.amount)
|
||||
fitID=self.mainFrame.getActiveFit(),
|
||||
itemID=int(mainItem.ID),
|
||||
amount=self.amount)
|
||||
if self.mainFrame.command.Submit(command):
|
||||
self.mainFrame.additionsPane.select('Drones', focus=False)
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class DroneSplitStack(ContextMenuSingle):
|
||||
|
||||
@@ -24,7 +26,7 @@ class DroneSplitStack(ContextMenuSingle):
|
||||
return mainItem.amount > 1
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Split {} Stack".format(itmContext)
|
||||
return _t("Split {} Stack").format(itmContext)
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
with DroneStackSplit(self.mainFrame, mainItem.amount) as dlg:
|
||||
@@ -41,7 +43,7 @@ class DroneSplitStack(ContextMenuSingle):
|
||||
if mainItem in fit.drones:
|
||||
position = fit.drones.index(mainItem)
|
||||
self.mainFrame.command.Submit(cmd.GuiSplitLocalDroneStackCommand(
|
||||
fitID=fitID, position=position, amount=int(cleanInput)))
|
||||
fitID=fitID, position=position, amount=int(cleanInput)))
|
||||
|
||||
|
||||
DroneSplitStack.register()
|
||||
|
||||
@@ -10,6 +10,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.market import Market
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class Group:
|
||||
|
||||
@@ -32,9 +34,7 @@ class Entry:
|
||||
self.shortName = shortName
|
||||
|
||||
|
||||
|
||||
class AddEnvironmentEffect(ContextMenuUnconditional):
|
||||
|
||||
# CCP doesn't currently provide a mapping between the general Environment, and the specific environment effect
|
||||
# (which can be random when going into Abyssal space). This is how we currently define it:
|
||||
# environment type: specific type name prefix
|
||||
@@ -53,7 +53,7 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
|
||||
return srcContext == "projected"
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return "Add Environmental Effect"
|
||||
return _t("Add Environmental Effect")
|
||||
|
||||
def _addGroup(self, parentMenu, name):
|
||||
id = ContextMenuUnconditional.nextID()
|
||||
@@ -102,16 +102,30 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
|
||||
|
||||
def getData(self):
|
||||
data = Group()
|
||||
data.groups['Metaliminal Storm'] = self.getEffectBeacons(
|
||||
'Electrical', 'Exotic', 'Gamma', 'Plasma',
|
||||
extra_garbage=('Metaliminal', 'Storm', 'Matter', 'Ray', 'Firestorm'))
|
||||
data.groups['Wormhole'] = self.getEffectBeacons(
|
||||
'Black Hole', 'Cataclysmic Variable', 'Magnetar',
|
||||
'Pulsar', 'Red Giant', 'Wolf Rayet')
|
||||
data.groups['Abyssal Weather'] = self.getAbyssalWeather()
|
||||
data.groups['Sansha Incursion'] = self.getEffectBeacons('Sansha Incursion')
|
||||
data.groups['Triglavian Invasion'] = self.getEffectBeacons('Triglavian Invasion')
|
||||
data.groups['Triglavian Invasion'].groups['Destructible Beacons'] = self.getDestructibleBeacons()
|
||||
data.groups[_t('Metaliminal Storm')] = self.getEffectBeacons(
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Electrical'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Exotic'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Gamma'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Plasma'),
|
||||
extra_garbage=(
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Metaliminal'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Storm'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Matter'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Ray'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Firestorm')))
|
||||
data.groups[_t('Wormhole')] = self.getEffectBeacons(
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Black Hole'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Cataclysmic Variable'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Magnetar'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Pulsar'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Red Giant'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Wolf Rayet'))
|
||||
data.groups[_t('Abyssal Weather')] = self.getAbyssalWeather()
|
||||
data.groups[_t('Sansha Incursion')] = self.getEffectBeacons(
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Sansha Incursion'))
|
||||
data.groups[_t('Triglavian Invasion')] = self.getEffectBeacons(
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Triglavian Invasion'))
|
||||
data.groups[_t('Triglavian Invasion')].groups[_t('Destructible Beacons')] = self.getDestructibleBeacons()
|
||||
return data
|
||||
|
||||
def getEffectBeacons(self, *groups, extra_garbage=()):
|
||||
@@ -125,7 +139,9 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
|
||||
data = Group()
|
||||
|
||||
# Stuff we don't want to see in names
|
||||
garbages = ["System Effects", "Effects"]
|
||||
garbages = [
|
||||
_t('ContextMenu|ProjectedEffectManipulation|System Effects'),
|
||||
_t('ContextMenu|ProjectedEffectManipulation|Effects')]
|
||||
garbages.extend(extra_garbage)
|
||||
|
||||
# Get group with all the system-wide beacons
|
||||
@@ -169,8 +185,8 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
|
||||
|
||||
environments = {x.ID: x for x in sMkt.getGroup("Abyssal Environment").items}
|
||||
items = chain(
|
||||
sMkt.getGroup("MassiveEnvironments").items,
|
||||
sMkt.getGroup("Non-Interactable Object").items)
|
||||
sMkt.getGroup("MassiveEnvironments").items,
|
||||
sMkt.getGroup("Non-Interactable Object").items)
|
||||
for beacon in items:
|
||||
if not beacon.isType('projected'):
|
||||
continue
|
||||
@@ -186,21 +202,24 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
|
||||
# Localized abyssal hazards
|
||||
items = sMkt.getGroup("Abyssal Hazards").items
|
||||
if items:
|
||||
subdata = data.groups.setdefault('Localized', Group())
|
||||
subdata = data.groups.setdefault(_t('Localized'), Group())
|
||||
for beacon in sMkt.getGroup("Abyssal Hazards").items:
|
||||
if not beacon.isType('projected'):
|
||||
continue
|
||||
# Localized effects, currently, have a name like "(size) (type) Cloud"
|
||||
# Until this inevitably changes, do a simple split
|
||||
name_parts = beacon.name.split(" ")
|
||||
groups = (_t('Bioluminescence'), _t('Caustic'), _t('Filament'))
|
||||
for group in groups:
|
||||
if re.search(group, beacon.name):
|
||||
key = group
|
||||
break
|
||||
else:
|
||||
continue
|
||||
|
||||
key = name_parts[1].strip()
|
||||
subsubdata = subdata.groups.setdefault(key, Group())
|
||||
subsubdata.items.append(Entry(beacon.ID, beacon.name, beacon.name))
|
||||
subdata.sort()
|
||||
|
||||
# PVP weather
|
||||
data.items.append(Entry(49766, 'PvP Weather', 'PvP Weather'))
|
||||
data.items.append(Entry(49766, _t('PvP Weather'), _t('PvP Weather')))
|
||||
|
||||
return data
|
||||
|
||||
@@ -214,4 +233,5 @@ class AddEnvironmentEffect(ContextMenuUnconditional):
|
||||
data.sort()
|
||||
return data
|
||||
|
||||
|
||||
AddEnvironmentEffect.register()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.globalEvents as GE
|
||||
@@ -6,6 +7,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class FactorReload(ContextMenuUnconditional):
|
||||
|
||||
@@ -20,7 +23,7 @@ class FactorReload(ContextMenuUnconditional):
|
||||
return self.mainFrame.getActiveFit() is not None
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return "Factor in Reload Time"
|
||||
return _t("Factor in Reload Time")
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
fitIDs = Fit.getInstance().toggleFactorReload()
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
from gui import fitCommands as cmd
|
||||
from gui.fitCommands.helpers import getSimilarFighters
|
||||
from gui.contextMenu import ContextMenuCombined
|
||||
from gui.fitCommands.helpers import getSimilarFighters
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class FighterAbilities(ContextMenuCombined):
|
||||
|
||||
@@ -27,7 +30,7 @@ class FighterAbilities(ContextMenuCombined):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem, selection):
|
||||
return "Abilities"
|
||||
return _t("Abilities")
|
||||
|
||||
def addAbility(self, menu, ability):
|
||||
label = ability.name
|
||||
@@ -78,10 +81,10 @@ class FighterAbilities(ContextMenuCombined):
|
||||
if fighter in container:
|
||||
positions.append(container.index(fighter))
|
||||
self.mainFrame.command.Submit(command(
|
||||
fitID=fitID,
|
||||
mainPosition=mainPosition,
|
||||
positions=positions,
|
||||
effectID=ability.effectID))
|
||||
fitID=fitID,
|
||||
mainPosition=mainPosition,
|
||||
positions=positions,
|
||||
effectID=ability.effectID))
|
||||
|
||||
|
||||
FighterAbilities.register()
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AddBrowsedFits(ContextMenuUnconditional):
|
||||
|
||||
@@ -16,7 +19,7 @@ class AddBrowsedFits(ContextMenuUnconditional):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Add Fit...'
|
||||
return _t('Add Fit...')
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
from gui.fitBrowserLite import FitBrowserLiteDialog
|
||||
@@ -24,7 +27,8 @@ class AddBrowsedFits(ContextMenuUnconditional):
|
||||
'projected': 'Add Projected Fits',
|
||||
'commandView': 'Add Command Fits',
|
||||
'graphFitList': 'Add Fits to Graph',
|
||||
'graphTgtList': 'Add Targets to Graph'}
|
||||
'graphTgtList': 'Add Targets to Graph'
|
||||
}
|
||||
excludedFitIDs = callingWindow.getExistingFitIDs()
|
||||
with FitBrowserLiteDialog(self.mainFrame, title=titles[fullContext[0]], excludedFitIDs=excludedFitIDs) as dlg:
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -6,6 +7,8 @@ from gui.builtinViews.emptyView import BlankPage
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AddCurrentlyOpenFit(ContextMenuUnconditional):
|
||||
|
||||
@@ -23,7 +26,7 @@ class AddCurrentlyOpenFit(ContextMenuUnconditional):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Add Currently Open Fit'
|
||||
return _t('Add Currently Open Fit')
|
||||
|
||||
def getSubMenu(self, callingWindow, context, rootMenu, i, pitem):
|
||||
self.fitLookup = {}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -6,6 +7,8 @@ from graphs.wrapper import BaseWrapper
|
||||
from gui.builtinShipBrowser.events import FitSelected
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class OpenFitInNewTab(ContextMenuSingle):
|
||||
|
||||
@@ -31,7 +34,7 @@ class OpenFitInNewTab(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Open Fit in New Tab"
|
||||
return _t("Open Fit in New Tab")
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
if isinstance(mainItem, BaseWrapper):
|
||||
|
||||
@@ -8,18 +8,18 @@ from eos.const import FitSystemSecurity
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
optionMap = OrderedDict((
|
||||
('High Security', FitSystemSecurity.HISEC),
|
||||
('Low Security', FitSystemSecurity.LOWSEC),
|
||||
('Null Security', FitSystemSecurity.NULLSEC),
|
||||
('W-Space', FitSystemSecurity.WSPACE)))
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class FitSystemSecurityMenu(ContextMenuUnconditional):
|
||||
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.optionMap = OrderedDict((
|
||||
(_t('High Security'), FitSystemSecurity.HISEC),
|
||||
(_t('Low Security'), FitSystemSecurity.LOWSEC),
|
||||
(_t('Null Security'), FitSystemSecurity.NULLSEC),
|
||||
(_t('W-Space'), FitSystemSecurity.WSPACE)))
|
||||
|
||||
def display(self, callingWindow, srcContext):
|
||||
if srcContext != "fittingShip":
|
||||
@@ -34,7 +34,7 @@ class FitSystemSecurityMenu(ContextMenuUnconditional):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return "Citadel System Security"
|
||||
return _t("Citadel System Security")
|
||||
|
||||
def addOption(self, menu, optionLabel):
|
||||
id = ContextMenuUnconditional.nextID()
|
||||
@@ -49,7 +49,7 @@ class FitSystemSecurityMenu(ContextMenuUnconditional):
|
||||
msw = True if "wxMSW" in wx.PlatformInfo else False
|
||||
self.optionIds = {}
|
||||
sub = wx.Menu()
|
||||
for optionLabel, optionValue in optionMap.items():
|
||||
for optionLabel, optionValue in self.optionMap.items():
|
||||
menuItem = self.addOption(rootMenu if msw else sub, optionLabel)
|
||||
sub.Append(menuItem)
|
||||
menuItem.Check(fit.getSystemSecurity() == optionValue)
|
||||
@@ -58,10 +58,10 @@ class FitSystemSecurityMenu(ContextMenuUnconditional):
|
||||
|
||||
def handleMode(self, event):
|
||||
optionLabel = self.optionIds[event.Id]
|
||||
optionValue = optionMap[optionLabel]
|
||||
optionValue = self.optionMap[optionLabel]
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeFitSystemSecurityCommand(
|
||||
fitID=self.mainFrame.getActiveFit(),
|
||||
secStatus=optionValue))
|
||||
fitID=self.mainFrame.getActiveFit(),
|
||||
secStatus=optionValue))
|
||||
|
||||
|
||||
FitSystemSecurityMenu.register()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.globalEvents as GE
|
||||
@@ -6,6 +7,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.settings import GraphSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class GraphDmgApplyProjectedMenu(ContextMenuUnconditional):
|
||||
|
||||
@@ -17,7 +20,7 @@ class GraphDmgApplyProjectedMenu(ContextMenuUnconditional):
|
||||
return srcContext == 'dmgStatsGraph'
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Apply Projected Items'
|
||||
return _t('Apply Projected Items')
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
self.settings.set('applyProjected', not self.settings.get('applyProjected'))
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from collections import OrderedDict
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
import gui.globalEvents as GE
|
||||
@@ -9,6 +8,10 @@ from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.const import GraphDpsDroneMode
|
||||
from service.settings import GraphSettings
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class GraphDmgDroneModeMenu(ContextMenuUnconditional):
|
||||
|
||||
@@ -20,7 +23,7 @@ class GraphDmgDroneModeMenu(ContextMenuUnconditional):
|
||||
return srcContext == 'dmgStatsGraph'
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Drone Mode'
|
||||
return _t('Drone Mode')
|
||||
|
||||
def handleModeSwitch(self, event):
|
||||
option = self.idOptionMap[event.Id]
|
||||
@@ -37,9 +40,9 @@ class GraphDmgDroneModeMenu(ContextMenuUnconditional):
|
||||
bindmenu = m
|
||||
self.idOptionMap = {}
|
||||
optionMap = OrderedDict([
|
||||
(GraphDpsDroneMode.auto, 'Auto'),
|
||||
(GraphDpsDroneMode.followTarget, 'Stick to Target'),
|
||||
(GraphDpsDroneMode.followAttacker, 'Stick to Attacker')])
|
||||
(GraphDpsDroneMode.auto, _t('Auto')),
|
||||
(GraphDpsDroneMode.followTarget, _t('Stick to Target')),
|
||||
(GraphDpsDroneMode.followAttacker, _t('Stick to Attacker'))])
|
||||
for option, label in optionMap.items():
|
||||
menuId = ContextMenuUnconditional.nextID()
|
||||
item = wx.MenuItem(m, menuId, label, kind=wx.ITEM_CHECK)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.globalEvents as GE
|
||||
@@ -6,6 +7,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.settings import GraphSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class GraphDmgIgnoreResistsMenu(ContextMenuUnconditional):
|
||||
|
||||
@@ -17,7 +20,7 @@ class GraphDmgIgnoreResistsMenu(ContextMenuUnconditional):
|
||||
return srcContext == 'dmgStatsGraph'
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Ignore Target Resists'
|
||||
return _t('Ignore Target Resists')
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
self.settings.set('ignoreResists', not self.settings.get('ignoreResists'))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.globalEvents as GE
|
||||
@@ -6,6 +7,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.settings import GraphSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class GraphIgnoreDcrMenu(ContextMenuUnconditional):
|
||||
|
||||
@@ -17,7 +20,7 @@ class GraphIgnoreDcrMenu(ContextMenuUnconditional):
|
||||
return srcContext in ('dmgStatsGraph', 'remoteRepsGraph', 'ewarStatsGraph')
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Ignore Drone Control Range'
|
||||
return _t('Ignore Drone Control Range')
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
self.settings.set('ignoreDCR', not self.settings.get('ignoreDCR'))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -7,6 +8,8 @@ from gui.contextMenu import ContextMenuSingle
|
||||
from service.ammo import Ammo
|
||||
from service.market import Market
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class GraphFitAmmoPicker(ContextMenuSingle):
|
||||
|
||||
@@ -23,7 +26,7 @@ class GraphFitAmmoPicker(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return 'Plot with Different Ammo...'
|
||||
return _t('Plot with Different Ammo...')
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
AmmoPickerFrame.openOne(callingWindow, mainItem.item, forceReopen=True)
|
||||
@@ -73,7 +76,6 @@ class AmmoPickerFrame(AuxiliaryDialog):
|
||||
|
||||
|
||||
class AmmoPickerContents(wx.ScrolledCanvas):
|
||||
|
||||
indent = 15
|
||||
|
||||
def __init__(self, parent, fit):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.globalEvents as GE
|
||||
@@ -6,6 +7,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.settings import GraphSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class GraphIgnoreLockRangeMenu(ContextMenuUnconditional):
|
||||
|
||||
@@ -17,7 +20,7 @@ class GraphIgnoreLockRangeMenu(ContextMenuUnconditional):
|
||||
return srcContext in ('dmgStatsGraph', 'remoteRepsGraph', 'ewarStatsGraph')
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Ignore Lock Range'
|
||||
return _t('Ignore Lock Range')
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
self.settings.set('ignoreLockRange', not self.settings.get('ignoreLockRange'))
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.market import Market
|
||||
from service.implantSet import ImplantSets as UserImplantSets
|
||||
from service.precalcImplantSet import PrecalcedImplantSets
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ImplantSetApply(ContextMenuUnconditional):
|
||||
|
||||
@@ -20,7 +22,7 @@ class ImplantSetApply(ContextMenuUnconditional):
|
||||
return srcContext in ("implantItemMisc", "implantEditor")
|
||||
|
||||
def getText(self, callingWindow, context):
|
||||
return "Apply Implant Set"
|
||||
return _t("Apply Implant Set")
|
||||
|
||||
def _addSeparator(self, m, text):
|
||||
id_ = ContextMenuUnconditional.nextID()
|
||||
|
||||
@@ -4,6 +4,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ImplantSetSave(ContextMenuUnconditional):
|
||||
|
||||
@@ -22,7 +24,7 @@ class ImplantSetSave(ContextMenuUnconditional):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, context):
|
||||
return 'Save as New Implant Set'
|
||||
return _t('Save as New Implant Set')
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
with NameDialog(self.mainFrame, '') as dlg:
|
||||
@@ -40,13 +42,13 @@ ImplantSetSave.register()
|
||||
class NameDialog(wx.Dialog):
|
||||
|
||||
def __init__(self, parent, value):
|
||||
super().__init__(parent, title='New Implant Set', style=wx.DEFAULT_DIALOG_STYLE)
|
||||
super().__init__(parent, title=_t('New Implant Set'), style=wx.DEFAULT_DIALOG_STYLE)
|
||||
self.SetMinSize((346, 156))
|
||||
|
||||
bSizer1 = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
bSizer2 = wx.BoxSizer(wx.VERTICAL)
|
||||
text = wx.StaticText(self, wx.ID_ANY, 'Enter a name for your new Implant Set:')
|
||||
text = wx.StaticText(self, wx.ID_ANY, _t('Enter a name for your new Implant Set:'))
|
||||
bSizer2.Add(text, 0)
|
||||
|
||||
bSizer1.Add(bSizer2, 0, wx.ALL, 10)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import re
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
@@ -12,6 +11,10 @@ from eos.saveddata.fit import Fit as es_Fit
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.fit import Fit
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ChangeItemAmount(ContextMenuSingle):
|
||||
|
||||
@@ -28,7 +31,7 @@ class ChangeItemAmount(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Change {0} Quantity".format(itmContext)
|
||||
return _t("Change {0} Quantity").format(itmContext)
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -54,30 +57,30 @@ class ChangeItemAmount(ContextMenuSingle):
|
||||
|
||||
if isinstance(mainItem, es_Cargo):
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeCargoAmountCommand(
|
||||
fitID=fitID, itemID=mainItem.itemID, amount=cleanInput))
|
||||
fitID=fitID, itemID=mainItem.itemID, amount=cleanInput))
|
||||
elif isinstance(mainItem, Drone):
|
||||
if srcContext == "projectedDrone":
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeProjectedDroneAmountCommand(
|
||||
fitID=fitID, itemID=mainItem.itemID, amount=cleanInput))
|
||||
fitID=fitID, itemID=mainItem.itemID, amount=cleanInput))
|
||||
else:
|
||||
if mainItem in fit.drones:
|
||||
position = fit.drones.index(mainItem)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeLocalDroneAmountCommand(
|
||||
fitID=fitID, position=position, amount=cleanInput))
|
||||
fitID=fitID, position=position, amount=cleanInput))
|
||||
elif isinstance(mainItem, es_Fit):
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeProjectedFitAmountCommand(
|
||||
fitID=fitID, projectedFitID=mainItem.ID, amount=cleanInput))
|
||||
fitID=fitID, projectedFitID=mainItem.ID, amount=cleanInput))
|
||||
elif isinstance(mainItem, es_Fighter):
|
||||
if srcContext == "projectedFighter":
|
||||
if mainItem in fit.projectedFighters:
|
||||
position = fit.projectedFighters.index(mainItem)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeProjectedFighterAmountCommand(
|
||||
fitID=fitID, position=position, amount=cleanInput))
|
||||
fitID=fitID, position=position, amount=cleanInput))
|
||||
else:
|
||||
if mainItem in fit.fighters:
|
||||
position = fit.fighters.index(mainItem)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeLocalFighterAmountCommand(
|
||||
fitID=fitID, position=position, amount=cleanInput))
|
||||
fitID=fitID, position=position, amount=cleanInput))
|
||||
|
||||
|
||||
ChangeItemAmount.register()
|
||||
@@ -86,13 +89,13 @@ ChangeItemAmount.register()
|
||||
class AmountChanger(wx.Dialog):
|
||||
|
||||
def __init__(self, parent, value, limits=None):
|
||||
super().__init__(parent, title="Change Amount", style=wx.DEFAULT_DIALOG_STYLE)
|
||||
super().__init__(parent, title=_t("Change Amount"), style=wx.DEFAULT_DIALOG_STYLE)
|
||||
self.SetMinSize((346, 156))
|
||||
|
||||
bSizer1 = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
bSizer2 = wx.BoxSizer(wx.VERTICAL)
|
||||
text = wx.StaticText(self, wx.ID_ANY, "New Amount:" if limits is None else "New Amount ({}-{})".format(*limits))
|
||||
text = wx.StaticText(self, wx.ID_ANY, _t("New Amount:") if limits is None else _t("New Amount ({}-{})").format(*limits))
|
||||
bSizer2.Add(text, 0)
|
||||
|
||||
bSizer1.Add(bSizer2, 0, wx.ALL, 10)
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class FillWithItem(ContextMenuSingle):
|
||||
|
||||
visibilitySetting = 'moduleFill'
|
||||
|
||||
def __init__(self):
|
||||
@@ -26,12 +29,12 @@ class FillWithItem(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Fill With Module"
|
||||
return _t("Fill With Module")
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
self.mainFrame.command.Submit(cmd.GuiFillWithNewLocalModulesCommand(
|
||||
fitID=self.mainFrame.getActiveFit(),
|
||||
itemID=int(mainItem.ID)))
|
||||
fitID=self.mainFrame.getActiveFit(),
|
||||
itemID=int(mainItem.ID)))
|
||||
|
||||
|
||||
FillWithItem.register()
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.market import Market
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class JumpToMarketItem(ContextMenuSingle):
|
||||
def __init__(self):
|
||||
@@ -37,7 +41,7 @@ class JumpToMarketItem(ContextMenuSingle):
|
||||
return doit
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "{0} Market Group".format(itmContext if itmContext is not None else "Item")
|
||||
return _t("{0} Market Group").format(itmContext if itmContext is not None else _t("Item"))
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
srcContext = fullContext[0]
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ProjectItem(ContextMenuSingle):
|
||||
|
||||
visibilitySetting = 'project'
|
||||
|
||||
def __init__(self):
|
||||
@@ -28,7 +31,7 @@ class ProjectItem(ContextMenuSingle):
|
||||
return mainItem.isType("projected")
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Project {0} onto Fit".format(itmContext)
|
||||
return _t("Project {0} onto Fit").format(itmContext)
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import re
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
@@ -12,6 +11,10 @@ from gui.contextMenu import ContextMenuCombined
|
||||
from gui.fitCommands.helpers import getSimilarFighters, getSimilarModPositions
|
||||
from service.fit import Fit
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ChangeItemProjectionRange(ContextMenuCombined):
|
||||
|
||||
@@ -28,7 +31,7 @@ class ChangeItemProjectionRange(ContextMenuCombined):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem, selection):
|
||||
return 'Change {} Range'.format(itmContext)
|
||||
return _t('Change {} Range').format(itmContext)
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, selection, i):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -63,7 +66,7 @@ class ChangeItemProjectionRange(ContextMenuCombined):
|
||||
fit = Fit.getInstance().getFit(fitID)
|
||||
items = getSimilarFighters(fit.projectedFighters, mainItem)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeProjectedItemsProjectionRangeCommand(
|
||||
fitID=fitID, items=items, projectionRange=newRange))
|
||||
fitID=fitID, items=items, projectionRange=newRange))
|
||||
|
||||
|
||||
ChangeItemProjectionRange.register()
|
||||
|
||||
@@ -12,6 +12,8 @@ from gui.contextMenu import ContextMenuCombined
|
||||
from gui.fitCommands.helpers import getSimilarFighters, getSimilarModPositions
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class RemoveItem(ContextMenuCombined):
|
||||
|
||||
@@ -20,13 +22,13 @@ class RemoveItem(ContextMenuCombined):
|
||||
|
||||
def display(self, callingWindow, srcContext, mainItem, selection):
|
||||
if srcContext not in (
|
||||
"fittingModule", "droneItem",
|
||||
"implantItem", "boosterItem",
|
||||
"projectedModule", "cargoItem",
|
||||
"projectedFit", "projectedDrone",
|
||||
"fighterItem", "projectedFighter",
|
||||
"commandFit", "graphFitList",
|
||||
"graphTgtList"
|
||||
"fittingModule", "droneItem",
|
||||
"implantItem", "boosterItem",
|
||||
"projectedModule", "cargoItem",
|
||||
"projectedFit", "projectedDrone",
|
||||
"fighterItem", "projectedFighter",
|
||||
"commandFit", "graphFitList",
|
||||
"graphTgtList"
|
||||
):
|
||||
return False
|
||||
|
||||
@@ -37,9 +39,9 @@ class RemoveItem(ContextMenuCombined):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem, selection):
|
||||
return 'Remove {}{}'.format(
|
||||
itmContext if itmContext is not None else 'Item',
|
||||
' Stack' if self.srcContext in ('droneItem', 'projectedDrone', 'cargoItem', 'projectedFit') else '')
|
||||
return _t('Remove {item}{stack}').format(
|
||||
item=itmContext if itmContext is not None else _t('Item'),
|
||||
stack=_t(' Stack') if self.srcContext in ('droneItem', 'projectedDrone', 'cargoItem', 'projectedFit') else '')
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, selection, i):
|
||||
handlerMap = {
|
||||
@@ -55,7 +57,8 @@ class RemoveItem(ContextMenuCombined):
|
||||
'projectedFighter': self.__handleProjectedItem,
|
||||
'commandFit': self.__handleCommandFit,
|
||||
'graphFitList': self.__handleGraphItem,
|
||||
'graphTgtList': self.__handleGraphItem}
|
||||
'graphTgtList': self.__handleGraphItem
|
||||
}
|
||||
srcContext = fullContext[0]
|
||||
handler = handlerMap.get(srcContext)
|
||||
if handler is None:
|
||||
@@ -73,7 +76,7 @@ class RemoveItem(ContextMenuCombined):
|
||||
if mod in fit.modules:
|
||||
positions.append(fit.modules.index(mod))
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveLocalModuleCommand(
|
||||
fitID=fitID, positions=positions))
|
||||
fitID=fitID, positions=positions))
|
||||
|
||||
def __handleDrone(self, callingWindow, mainItem, selection):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -83,7 +86,7 @@ class RemoveItem(ContextMenuCombined):
|
||||
if drone in fit.drones:
|
||||
positions.append(fit.drones.index(drone))
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveLocalDronesCommand(
|
||||
fitID=fitID, positions=positions, amount=math.inf))
|
||||
fitID=fitID, positions=positions, amount=math.inf))
|
||||
|
||||
def __handleFighter(self, callingWindow, mainItem, selection):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -97,7 +100,7 @@ class RemoveItem(ContextMenuCombined):
|
||||
if fighter in fit.fighters:
|
||||
positions.append(fit.fighters.index(fighter))
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveLocalFightersCommand(
|
||||
fitID=fitID, positions=positions))
|
||||
fitID=fitID, positions=positions))
|
||||
|
||||
def __handleImplant(self, callingWindow, mainItem, selection):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -107,7 +110,7 @@ class RemoveItem(ContextMenuCombined):
|
||||
if implant in fit.implants:
|
||||
positions.append(fit.implants.index(implant))
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveImplantsCommand(
|
||||
fitID=fitID, positions=positions))
|
||||
fitID=fitID, positions=positions))
|
||||
|
||||
def __handleBooster(self, callingWindow, mainItem, selection):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -117,19 +120,19 @@ class RemoveItem(ContextMenuCombined):
|
||||
if booster in fit.boosters:
|
||||
positions.append(fit.boosters.index(booster))
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveBoostersCommand(
|
||||
fitID=fitID, positions=positions))
|
||||
fitID=fitID, positions=positions))
|
||||
|
||||
def __handleCargo(self, callingWindow, mainItem, selection):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
itemIDs = [c.itemID for c in selection]
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveCargosCommand(
|
||||
fitID=fitID, itemIDs=itemIDs))
|
||||
fitID=fitID, itemIDs=itemIDs))
|
||||
|
||||
def __handleProjectedItem(self, callingWindow, mainItem, selection):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
if isinstance(mainItem, EosFit):
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
|
||||
fitID=fitID, items=selection, amount=math.inf))
|
||||
fitID=fitID, items=selection, amount=math.inf))
|
||||
elif isinstance(mainItem, EosModule):
|
||||
if wx.GetMouseState().GetModifiers() in (wx.MOD_ALT, wx.MOD_CONTROL):
|
||||
fit = Fit.getInstance().getFit(fitID)
|
||||
@@ -138,10 +141,10 @@ class RemoveItem(ContextMenuCombined):
|
||||
else:
|
||||
items = selection
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
|
||||
fitID=fitID, items=items, amount=math.inf))
|
||||
fitID=fitID, items=items, amount=math.inf))
|
||||
elif isinstance(mainItem, EosDrone):
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
|
||||
fitID=fitID, items=selection, amount=math.inf))
|
||||
fitID=fitID, items=selection, amount=math.inf))
|
||||
elif isinstance(mainItem, EosFighter):
|
||||
if wx.GetMouseState().GetModifiers() in (wx.MOD_ALT, wx.MOD_CONTROL):
|
||||
fit = Fit.getInstance().getFit(fitID)
|
||||
@@ -149,16 +152,16 @@ class RemoveItem(ContextMenuCombined):
|
||||
else:
|
||||
items = selection
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
|
||||
fitID=fitID, items=items, amount=math.inf))
|
||||
fitID=fitID, items=items, amount=math.inf))
|
||||
else:
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveProjectedItemsCommand(
|
||||
fitID=fitID, items=selection, amount=math.inf))
|
||||
fitID=fitID, items=selection, amount=math.inf))
|
||||
|
||||
def __handleCommandFit(self, callingWindow, mainItem, selection):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
commandFitIDs = [cf.ID for cf in selection]
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveCommandFitsCommand(
|
||||
fitID=fitID, commandFitIDs=commandFitIDs))
|
||||
fitID=fitID, commandFitIDs=commandFitIDs))
|
||||
|
||||
def __handleGraphItem(self, callingWindow, mainItem, selection):
|
||||
callingWindow.removeWrappers(selection)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -6,6 +7,8 @@ from gui.contextMenu import ContextMenuSingle
|
||||
from gui.itemStats import ItemStatsFrame
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ItemStats(ContextMenuSingle):
|
||||
def __init__(self):
|
||||
@@ -13,16 +16,16 @@ class ItemStats(ContextMenuSingle):
|
||||
|
||||
def display(self, callingWindow, srcContext, mainItem):
|
||||
if srcContext not in (
|
||||
"marketItemGroup", "marketItemMisc",
|
||||
"fittingModule", "fittingCharge",
|
||||
"fittingShip", "baseShip",
|
||||
"cargoItem", "droneItem",
|
||||
"implantItem", "boosterItem",
|
||||
"skillItem", "projectedModule",
|
||||
"projectedDrone", "projectedCharge",
|
||||
"itemStats", "fighterItem",
|
||||
"implantItemChar", "projectedFighter",
|
||||
"fittingMode"
|
||||
"marketItemGroup", "marketItemMisc",
|
||||
"fittingModule", "fittingCharge",
|
||||
"fittingShip", "baseShip",
|
||||
"cargoItem", "droneItem",
|
||||
"implantItem", "boosterItem",
|
||||
"skillItem", "projectedModule",
|
||||
"projectedDrone", "projectedCharge",
|
||||
"itemStats", "fighterItem",
|
||||
"implantItemChar", "projectedFighter",
|
||||
"fittingMode"
|
||||
):
|
||||
return False
|
||||
|
||||
@@ -32,7 +35,7 @@ class ItemStats(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "{} Stats".format(itmContext if itmContext is not None else "Item")
|
||||
return _t("{} Stats").format(itmContext if itmContext is not None else _t("Item"))
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
srcContext = fullContext[0]
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuCombined
|
||||
from gui.fitCommands.helpers import getSimilarModPositions, getSimilarFighters
|
||||
from gui.fitCommands.helpers import getSimilarFighters, getSimilarModPositions
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ChangeItemToVariation(ContextMenuCombined):
|
||||
|
||||
visibilitySetting = 'metaSwap'
|
||||
|
||||
def __init__(self):
|
||||
@@ -18,15 +20,15 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
|
||||
def display(self, callingWindow, srcContext, mainItem, selection):
|
||||
if self.mainFrame.getActiveFit() is None or srcContext not in (
|
||||
'fittingModule',
|
||||
'droneItem',
|
||||
'fighterItem',
|
||||
'boosterItem',
|
||||
'implantItem',
|
||||
'cargoItem',
|
||||
'projectedModule',
|
||||
'projectedDrone',
|
||||
'projectedFighter'
|
||||
'fittingModule',
|
||||
'droneItem',
|
||||
'fighterItem',
|
||||
'boosterItem',
|
||||
'implantItem',
|
||||
'cargoItem',
|
||||
'projectedModule',
|
||||
'projectedDrone',
|
||||
'projectedFighter'
|
||||
):
|
||||
return False
|
||||
|
||||
@@ -44,7 +46,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem, selection):
|
||||
return 'Variations'
|
||||
return _t('Variations')
|
||||
|
||||
def getSubMenu(self, callingWindow, context, mainItem, selection, rootMenu, i, pitem):
|
||||
self.moduleLookup = {}
|
||||
@@ -60,7 +62,8 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
# We want deadspace before officer mods
|
||||
5: 6, 6: 5,
|
||||
# For structures we want t1-t2-faction
|
||||
54: 52, 52: 54}
|
||||
54: 52, 52: 54
|
||||
}
|
||||
metaGroup = sMkt.getMetaGroupByItem(x)
|
||||
return remap.get(metaGroup.ID, metaGroup.ID) if metaGroup is not None else 0
|
||||
|
||||
@@ -86,8 +89,8 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
|
||||
# Do not show abyssal items
|
||||
items = list(
|
||||
i for i in self.mainVariations
|
||||
if sMkt.getMetaGroupByItem(i) is None or sMkt.getMetaGroupByItem(i).ID != 15)
|
||||
i for i in self.mainVariations
|
||||
if sMkt.getMetaGroupByItem(i) is None or sMkt.getMetaGroupByItem(i).ID != 15)
|
||||
# Sort items by metalevel, and group within that metalevel
|
||||
# Sort all items by name first
|
||||
items.sort(key=lambda x: x.name)
|
||||
@@ -143,7 +146,8 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
'boosterItem': self.__handleBooster,
|
||||
'projectedModule': self.__handleProjectedModule,
|
||||
'projectedDrone': self.__handleProjectedDrone,
|
||||
'projectedFighter': self.__handleProjectedFighter}
|
||||
'projectedFighter': self.__handleProjectedFighter
|
||||
}
|
||||
handler = handlerMap.get(context)
|
||||
if handler is None:
|
||||
return
|
||||
@@ -169,7 +173,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
if modVariations == self.mainVariations:
|
||||
positions.append(fit.modules.index(mod))
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeLocalModuleMetasCommand(
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
|
||||
def __handleDrone(self, varItem):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -186,7 +190,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
if droneVariations == self.mainVariations:
|
||||
positions.append(fit.drones.index(drone))
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeLocalDroneMetasCommand(
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
|
||||
def __handleFighter(self, varItem):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -207,7 +211,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
if fighterVariations == self.mainVariations:
|
||||
positions.append(fit.fighters.index(fighter))
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeLocalFighterMetasCommand(
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
|
||||
def __handleCargo(self, varItem):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -221,7 +225,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
if cargoVariations == self.mainVariations:
|
||||
itemIDs.append(cargo.itemID)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeCargoMetasCommand(
|
||||
fitID=fitID, itemIDs=itemIDs, newItemID=varItem.ID))
|
||||
fitID=fitID, itemIDs=itemIDs, newItemID=varItem.ID))
|
||||
|
||||
def __handleImplant(self, varItem):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -230,7 +234,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
if implant in fit.implants:
|
||||
position = fit.implants.index(implant)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeImplantMetaCommand(
|
||||
fitID=fitID, position=position, newItemID=varItem.ID))
|
||||
fitID=fitID, position=position, newItemID=varItem.ID))
|
||||
|
||||
def __handleBooster(self, varItem):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -239,7 +243,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
if booster in fit.boosters:
|
||||
position = fit.boosters.index(booster)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeBoosterMetaCommand(
|
||||
fitID=fitID, position=position, newItemID=varItem.ID))
|
||||
fitID=fitID, position=position, newItemID=varItem.ID))
|
||||
|
||||
def __handleProjectedModule(self, varItem):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -259,7 +263,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
if modVariations == self.mainVariations:
|
||||
positions.append(fit.projectedModules.index(mod))
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeProjectedModuleMetasCommand(
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
|
||||
def __handleProjectedDrone(self, varItem):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -276,7 +280,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
if droneVariations == self.mainVariations:
|
||||
itemIDs.append(drone.itemID)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeProjectedDroneMetasCommand(
|
||||
fitID=fitID, itemIDs=itemIDs, newItemID=varItem.ID))
|
||||
fitID=fitID, itemIDs=itemIDs, newItemID=varItem.ID))
|
||||
|
||||
def __handleProjectedFighter(self, varItem):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -297,7 +301,7 @@ class ChangeItemToVariation(ContextMenuCombined):
|
||||
if fighterVariations == self.mainVariations:
|
||||
positions.append(fit.projectedFighters.index(fighter))
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeProjectedFighterMetasCommand(
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
fitID=fitID, positions=positions, newItemID=varItem.ID))
|
||||
|
||||
|
||||
ChangeItemToVariation.register()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
@@ -9,6 +10,8 @@ from gui.fitCommands.helpers import getSimilarModPositions
|
||||
from service.ammo import Ammo
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ChangeModuleAmmo(ContextMenuCombined):
|
||||
|
||||
@@ -16,6 +19,14 @@ class ChangeModuleAmmo(ContextMenuCombined):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
# Format: {type ID: set(loadable, charges)}
|
||||
self.loadableChargesCache = {}
|
||||
# Translations for the missile categories, as the text here is auto-generated via damage attributes
|
||||
self.ddMissileChargeCatTrans = {
|
||||
'em': _t('EM'),
|
||||
'thermal': _t('Thermal'),
|
||||
'explosive': _t('Explosive'),
|
||||
'kinetic': _t('Kinetic'),
|
||||
'mixed': _t('Mixed')
|
||||
}
|
||||
|
||||
def display(self, callingWindow, srcContext, mainItem, selection):
|
||||
if srcContext not in ('fittingModule', 'projectedModule'):
|
||||
@@ -34,7 +45,7 @@ class ChangeModuleAmmo(ContextMenuCombined):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem, selection):
|
||||
return 'Charge'
|
||||
return _t('Charge')
|
||||
|
||||
def _getAmmo(self, mod):
|
||||
if mod.itemID is None:
|
||||
@@ -45,7 +56,7 @@ class ChangeModuleAmmo(ContextMenuCombined):
|
||||
|
||||
def _addCharge(self, menu, charge):
|
||||
id_ = ContextMenuCombined.nextID()
|
||||
name = charge.name if charge is not None else 'Empty'
|
||||
name = charge.name if charge is not None else _t('Empty')
|
||||
self.chargeEventMap[id_] = charge
|
||||
item = wx.MenuItem(menu, id_, name)
|
||||
menu.Bind(wx.EVT_MENU, self.handleAmmoSwitch, item)
|
||||
@@ -68,7 +79,7 @@ class ChangeModuleAmmo(ContextMenuCombined):
|
||||
self.chargeEventMap = {}
|
||||
modType, chargeDict = Ammo.getInstance().getModuleStructuredAmmo(self.module, ammo=self.mainCharges)
|
||||
if modType == 'ddTurret':
|
||||
self._addSeparator(menu, 'Long Range')
|
||||
self._addSeparator(menu, _t('Long Range'))
|
||||
menuItems = []
|
||||
for charges in chargeDict.values():
|
||||
if len(charges) == 1:
|
||||
@@ -80,25 +91,28 @@ class ChangeModuleAmmo(ContextMenuCombined):
|
||||
subMenu = wx.Menu()
|
||||
subMenu.Bind(wx.EVT_MENU, self.handleAmmoSwitch)
|
||||
menuItem.SetSubMenu(subMenu)
|
||||
self._addSeparator(subMenu, 'Less Damage')
|
||||
self._addSeparator(subMenu, _t('Less Damage'))
|
||||
for charge in charges:
|
||||
subMenu.Append(self._addCharge(rootMenu if msw else subMenu, charge))
|
||||
self._addSeparator(subMenu, 'More Damage')
|
||||
self._addSeparator(subMenu, _t('More Damage'))
|
||||
for menuItem in menuItems:
|
||||
menu.Append(menuItem)
|
||||
self._addSeparator(menu, 'Short Range')
|
||||
self._addSeparator(menu, _t('Short Range'))
|
||||
elif modType == 'ddMissile':
|
||||
menuItems = []
|
||||
for chargeCatName, charges in chargeDict.items():
|
||||
menuItem = wx.MenuItem(menu, wx.ID_ANY, chargeCatName.capitalize())
|
||||
menuItem = wx.MenuItem(menu, wx.ID_ANY, self.ddMissileChargeCatTrans.get(chargeCatName, chargeCatName))
|
||||
bitmap = BitmapLoader.getBitmap("%s_small" % chargeCatName, "gui")
|
||||
if bitmap is not None:
|
||||
menuItem.SetBitmap(bitmap)
|
||||
menuItems.append(menuItem)
|
||||
subMenu = wx.Menu()
|
||||
subMenu.Bind(wx.EVT_MENU, self.handleAmmoSwitch)
|
||||
menuItem.SetSubMenu(subMenu)
|
||||
self._addSeparator(subMenu, 'Less Damage')
|
||||
self._addSeparator(subMenu, _t('Less Damage'))
|
||||
for charge in charges:
|
||||
subMenu.Append(self._addCharge(rootMenu if msw else subMenu, charge))
|
||||
self._addSeparator(subMenu, 'More Damage')
|
||||
self._addSeparator(subMenu, _t('More Damage'))
|
||||
for menuItem in menuItems:
|
||||
menu.Append(menuItem)
|
||||
elif modType == 'general':
|
||||
@@ -129,9 +143,9 @@ class ChangeModuleAmmo(ContextMenuCombined):
|
||||
return
|
||||
positions = getSimilarModPositions(modContainer, self.module)
|
||||
self.mainFrame.command.Submit(command(
|
||||
fitID=fitID,
|
||||
positions=positions,
|
||||
chargeItemID=charge.ID if charge is not None else None))
|
||||
fitID=fitID,
|
||||
positions=positions,
|
||||
chargeItemID=charge.ID if charge is not None else None))
|
||||
else:
|
||||
if self.srcContext == 'fittingModule':
|
||||
command = cmd.GuiChangeLocalModuleChargesCommand
|
||||
@@ -148,9 +162,9 @@ class ChangeModuleAmmo(ContextMenuCombined):
|
||||
if modCharges.issubset(self.mainCharges):
|
||||
positions.append(position)
|
||||
self.mainFrame.command.Submit(command(
|
||||
fitID=fitID,
|
||||
positions=positions,
|
||||
chargeItemID=charge.ID if charge is not None else None))
|
||||
fitID=fitID,
|
||||
positions=positions,
|
||||
chargeItemID=charge.ID if charge is not None else None))
|
||||
|
||||
|
||||
ChangeModuleAmmo.register()
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class FillWithModule(ContextMenuSingle):
|
||||
|
||||
visibilitySetting = 'moduleFill'
|
||||
|
||||
def __init__(self):
|
||||
@@ -18,7 +21,7 @@ class FillWithModule(ContextMenuSingle):
|
||||
return srcContext == "fittingModule"
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Fill With {0}".format(itmContext if itmContext is not None else "Module")
|
||||
return _t("Fill With {0}").format(itmContext if itmContext is not None else _t("Module"))
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
|
||||
@@ -30,7 +33,7 @@ class FillWithModule(ContextMenuSingle):
|
||||
if mainItem in fit.modules:
|
||||
position = fit.modules.index(mainItem)
|
||||
self.mainFrame.command.Submit(cmd.GuiFillWithClonedLocalModulesCommand(
|
||||
fitID=fitID, position=position))
|
||||
fitID=fitID, position=position))
|
||||
|
||||
|
||||
FillWithModule.register()
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from gui.utils.clipboard import toClipboard
|
||||
from service.port.muta import renderMutant
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ExportMutatedModule(ContextMenuSingle):
|
||||
|
||||
@@ -21,7 +25,7 @@ class ExportMutatedModule(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return 'Copy Module to Clipboard'
|
||||
return _t('Copy Module to Clipboard')
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
export = renderMutant(mainItem, prefix=' ')
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -6,6 +7,8 @@ from gui.contextMenu import ContextMenuSingle
|
||||
from gui.fitCommands import GuiConvertMutatedLocalModuleCommand, GuiRevertMutatedLocalModuleCommand
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ChangeModuleMutation(ContextMenuSingle):
|
||||
|
||||
@@ -27,7 +30,7 @@ class ChangeModuleMutation(ContextMenuSingle):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Apply Mutaplasmid" if not mainItem.isMutated else "Revert to {}".format(mainItem.baseItem.name)
|
||||
return _t("Apply Mutaplasmid") if not mainItem.isMutated else _t("Revert to {}").format(mainItem.baseItem.name)
|
||||
|
||||
def getSubMenu(self, callingWindow, context, mainItem, rootMenu, i, pitem):
|
||||
if mainItem.isMutated:
|
||||
@@ -56,7 +59,7 @@ class ChangeModuleMutation(ContextMenuSingle):
|
||||
if mod in fit.modules:
|
||||
position = fit.modules.index(mod)
|
||||
self.mainFrame.command.Submit(GuiConvertMutatedLocalModuleCommand(
|
||||
fitID=fitID, position=position, mutaplasmid=mutaplasmid))
|
||||
fitID=fitID, position=position, mutaplasmid=mutaplasmid))
|
||||
|
||||
def activate(self, callingWindow, fullContext, mainItem, i):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -64,7 +67,7 @@ class ChangeModuleMutation(ContextMenuSingle):
|
||||
if mainItem in fit.modules:
|
||||
position = fit.modules.index(mainItem)
|
||||
self.mainFrame.command.Submit(GuiRevertMutatedLocalModuleCommand(
|
||||
fitID=fitID, position=position))
|
||||
fitID=fitID, position=position))
|
||||
|
||||
def getBitmap(self, callingWindow, context, mainItem):
|
||||
return None
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
import math
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
import eos.config
|
||||
import gui.fitCommands as cmd
|
||||
import gui.mainFrame
|
||||
from eos.utils.spoolSupport import SpoolType, SpoolOptions
|
||||
from eos.utils.spoolSupport import SpoolOptions, SpoolType
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from service.fit import Fit
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ChangeModuleSpool(ContextMenuSingle):
|
||||
|
||||
visibilitySetting = 'spoolup'
|
||||
|
||||
def __init__(self):
|
||||
@@ -32,7 +34,7 @@ class ChangeModuleSpool(ContextMenuSingle):
|
||||
return self.mod.item.group.name in ("Precursor Weapon", "Mutadaptive Remote Armor Repairer")
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Spoolup Cycles"
|
||||
return _t("Spoolup Cycles")
|
||||
|
||||
def getSubMenu(self, callingWindow, context, mainItem, rootMenu, i, pitem):
|
||||
m = wx.Menu()
|
||||
@@ -78,7 +80,7 @@ class ChangeModuleSpool(ContextMenuSingle):
|
||||
|
||||
# Show default only for current value and when not overriden
|
||||
if not isNotDefault and cycle == cycleDefault:
|
||||
text = "{} (default)".format(cycle)
|
||||
text = _t("{} (default)").format(cycle)
|
||||
# Always show current selection and stuff which we decided to show via the cycles function
|
||||
elif cycle == cycleCurrent or cycle in cyclesToShow:
|
||||
text = "{}".format(cycle)
|
||||
@@ -93,7 +95,7 @@ class ChangeModuleSpool(ContextMenuSingle):
|
||||
self.cycleMap[menuId] = cycle
|
||||
|
||||
self.resetId = ContextMenuSingle.nextID()
|
||||
item = wx.MenuItem(m, self.resetId, "Reset")
|
||||
item = wx.MenuItem(m, self.resetId, _t("Reset"))
|
||||
bindmenu.Bind(wx.EVT_MENU, self.handleSpoolChange, item)
|
||||
m.Append(item)
|
||||
|
||||
@@ -114,12 +116,12 @@ class ChangeModuleSpool(ContextMenuSingle):
|
||||
if self.mod in fit.modules:
|
||||
position = fit.modules.index(self.mod)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeLocalModuleSpoolCommand(
|
||||
fitID=fitID, position=position, spoolType=spoolType, spoolAmount=spoolAmount))
|
||||
fitID=fitID, position=position, spoolType=spoolType, spoolAmount=spoolAmount))
|
||||
elif self.context == 'projectedModule':
|
||||
if self.mod in fit.projectedModules:
|
||||
position = fit.projectedModules.index(self.mod)
|
||||
self.mainFrame.command.Submit(cmd.GuiChangeProjectedModuleSpoolCommand(
|
||||
fitID=fitID, position=position, spoolType=spoolType, spoolAmount=spoolAmount))
|
||||
fitID=fitID, position=position, spoolType=spoolType, spoolAmount=spoolAmount))
|
||||
|
||||
|
||||
ChangeModuleSpool.register()
|
||||
|
||||
@@ -7,6 +7,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.settings import MarketPriceSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
|
||||
|
||||
@@ -14,11 +16,6 @@ class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.settings = MarketPriceSettings.getInstance()
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def label(self):
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def optionName(self):
|
||||
@@ -27,9 +24,6 @@ class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
|
||||
def display(self, callingWindow, srcContext):
|
||||
return srcContext in ("priceViewFull", "priceViewMinimal")
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return self.label
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
self.settings.set(self.optionName, not self.settings.get(self.optionName))
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -40,22 +34,25 @@ class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
|
||||
|
||||
|
||||
class DronesPrice(ItemGroupPrice):
|
||||
|
||||
label = 'Drones'
|
||||
optionName = 'drones'
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return _t('Drones')
|
||||
|
||||
|
||||
class CargoPrice(ItemGroupPrice):
|
||||
|
||||
label = 'Cargo'
|
||||
optionName = 'cargo'
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return _t('Cargo')
|
||||
|
||||
|
||||
class ImplantBoosterPrice(ItemGroupPrice):
|
||||
|
||||
label = 'Implants && Boosters'
|
||||
optionName = 'character'
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return _t('Implants && Boosters')
|
||||
|
||||
|
||||
DronesPrice.register()
|
||||
CargoPrice.register()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from collections import OrderedDict
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -10,6 +9,9 @@ from gui.contextMenu import ContextMenuCombined
|
||||
from service.const import TargetResistMode
|
||||
from service.settings import GraphSettings
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
optionMap = OrderedDict((
|
||||
('Auto', TargetResistMode.auto),
|
||||
@@ -36,7 +38,7 @@ class TargetWrapperResists(ContextMenuCombined):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem, selection):
|
||||
return 'Resist Mode'
|
||||
return _t('Resist Mode')
|
||||
|
||||
def addOption(self, menu, optionLabel):
|
||||
id = ContextMenuCombined.nextID()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -6,6 +7,8 @@ from gui.builtinShipBrowser.events import Stage3Selected
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class JumpToShip(ContextMenuUnconditional):
|
||||
|
||||
@@ -29,7 +32,7 @@ class JumpToShip(ContextMenuUnconditional):
|
||||
return False
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return "Open in Fitting Browser"
|
||||
return _t("Open in Fitting Browser")
|
||||
|
||||
def activate(self, callingWindow, fullContext, i):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
@@ -6,11 +7,18 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenuUnconditional
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ChangeShipTacticalMode(ContextMenuUnconditional):
|
||||
|
||||
def __init__(self):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.modeMap = {
|
||||
'Defense': _t('Defense'),
|
||||
'Propulsion': _t('Propulsion'),
|
||||
'Sharpshooter': _t('Sharpshooter')
|
||||
}
|
||||
|
||||
def display(self, callingWindow, srcContext):
|
||||
if self.mainFrame.getActiveFit() is None or srcContext != "fittingShip":
|
||||
@@ -26,10 +34,12 @@ class ChangeShipTacticalMode(ContextMenuUnconditional):
|
||||
return srcContext == "fittingShip" and self.modes is not None
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return "Tactical Mode"
|
||||
return _t("Tactical Mode")
|
||||
|
||||
def addMode(self, menu, mode):
|
||||
label = mode.item.name.rsplit()[-2]
|
||||
key = mode.item.typeName.rsplit()[-2]
|
||||
label = self.modeMap[key]
|
||||
|
||||
id = ContextMenuUnconditional.nextID()
|
||||
self.modeIds[id] = mode
|
||||
menuItem = wx.MenuItem(menu, id, label, kind=wx.ITEM_RADIO)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
import wx
|
||||
|
||||
import gui.globalEvents as GE
|
||||
@@ -9,9 +10,10 @@ from gui.contextMenu import ContextMenuSingle
|
||||
from service.character import Character
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ChangeAffectingSkills(ContextMenuSingle):
|
||||
|
||||
visibilitySetting = 'changeAffectingSkills'
|
||||
|
||||
def __init__(self):
|
||||
@@ -19,9 +21,9 @@ class ChangeAffectingSkills(ContextMenuSingle):
|
||||
|
||||
def display(self, callingWindow, srcContext, mainItem):
|
||||
if srcContext not in (
|
||||
"fittingModule", "fittingCharge",
|
||||
"fittingShip", "droneItem",
|
||||
"fighterItem"
|
||||
"fittingModule", "fittingCharge",
|
||||
"fittingShip", "droneItem",
|
||||
"fighterItem"
|
||||
):
|
||||
return False
|
||||
|
||||
@@ -68,13 +70,13 @@ class ChangeAffectingSkills(ContextMenuSingle):
|
||||
return len(self.skills) > 0
|
||||
|
||||
def getText(self, callingWindow, itmContext, mainItem):
|
||||
return "Change %s Skills" % itmContext
|
||||
return _t("Change %s Skills") % itmContext
|
||||
|
||||
def addSkill(self, rootMenu, skill, i):
|
||||
if i < 0:
|
||||
label = "Not Learned"
|
||||
label = _t("Not Learned")
|
||||
else:
|
||||
label = "Level %s" % i
|
||||
label = _t("Level %s") % i
|
||||
|
||||
id = ContextMenuSingle.nextID()
|
||||
self.skillIds[id] = (skill, i)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from collections import OrderedDict
|
||||
from itertools import chain
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
@@ -10,6 +9,10 @@ from gui.contextMenu import ContextMenuUnconditional
|
||||
from gui.utils.sorter import smartSort
|
||||
from service.targetProfile import TargetProfile as svc_TargetProfile
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class TargetProfileAdder(ContextMenuUnconditional):
|
||||
|
||||
@@ -23,7 +26,7 @@ class TargetProfileAdder(ContextMenuUnconditional):
|
||||
return True
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
return 'Add Target Profile'
|
||||
return _t('Add Target Profile')
|
||||
|
||||
def handleProfileAdd(self, event):
|
||||
profile = self.eventProfileMap.get(event.Id, False)
|
||||
@@ -56,8 +59,10 @@ class TargetProfileAdder(ContextMenuUnconditional):
|
||||
for profile in profiles:
|
||||
container = items
|
||||
for categoryName in profile.hierarchy:
|
||||
categoryName = _t(categoryName) if profile.builtin else categoryName
|
||||
container = container[1].setdefault(categoryName, (OrderedDict(), OrderedDict()))
|
||||
container[0][profile.shortName] = profile
|
||||
shortName = _t(profile.shortName) if profile.builtin else profile.shortName
|
||||
container[0][shortName] = profile
|
||||
|
||||
# Category as menu item - expands further
|
||||
msw = "wxMSW" in wx.PlatformInfo
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import wx
|
||||
|
||||
import gui.mainFrame
|
||||
from graphs.wrapper import TargetWrapper
|
||||
from gui.contextMenu import ContextMenuSingle
|
||||
from gui.targetProfileEditor import TargetProfileEditor
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class TargetProfileEditorMenu(ContextMenuSingle):
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from collections import OrderedDict
|
||||
from itertools import chain
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
import gui.globalEvents as GE
|
||||
@@ -11,6 +10,10 @@ from gui.utils.sorter import smartSort
|
||||
from service.fit import Fit
|
||||
from service.targetProfile import TargetProfile as svc_TargetProfile
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class TargetProfileSwitcher(ContextMenuUnconditional):
|
||||
|
||||
@@ -27,7 +30,7 @@ class TargetProfileSwitcher(ContextMenuUnconditional):
|
||||
|
||||
def getText(self, callingWindow, itmContext):
|
||||
# We take into consideration just target resists, so call menu item accordingly
|
||||
return 'Target Resists'
|
||||
return _t('Target Resists')
|
||||
|
||||
def handleResistSwitch(self, event):
|
||||
profile = self.profileEventMap.get(event.Id, False)
|
||||
@@ -68,8 +71,10 @@ class TargetProfileSwitcher(ContextMenuUnconditional):
|
||||
for profile in profiles:
|
||||
container = items
|
||||
for categoryName in profile.hierarchy:
|
||||
categoryName = _t(categoryName) if profile.builtin else categoryName
|
||||
container = container[1].setdefault(categoryName, (OrderedDict(), OrderedDict()))
|
||||
container[0][profile.shortName] = profile
|
||||
shortName = _t(profile.shortName) if profile.builtin else profile.shortName
|
||||
container[0][shortName] = profile
|
||||
|
||||
# Category as menu item - expands further
|
||||
msw = "wxMSW" in wx.PlatformInfo
|
||||
@@ -77,7 +82,7 @@ class TargetProfileSwitcher(ContextMenuUnconditional):
|
||||
def makeMenu(container, parentMenu, first=False):
|
||||
menu = wx.Menu()
|
||||
if first:
|
||||
mitem, checked = self._addProfile(rootMenu if msw else parentMenu, None, 'No Profile')
|
||||
mitem, checked = self._addProfile(rootMenu if msw else parentMenu, None, _t('No Profile'))
|
||||
menu.Append(mitem)
|
||||
mitem.Check(checked)
|
||||
if len(container[0]) > 0 or len(container[1]) > 0:
|
||||
|
||||
@@ -17,6 +17,8 @@ import gui.mainFrame
|
||||
from gui.contextMenu import ContextMenu
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
def formatOperator(operator, stackingGroup, preResAmount, postResAmount):
|
||||
opMap = {
|
||||
@@ -24,7 +26,8 @@ def formatOperator(operator, stackingGroup, preResAmount, postResAmount):
|
||||
Operator.PREINCREASE: '+',
|
||||
Operator.MULTIPLY: '*',
|
||||
Operator.POSTINCREASE: '+',
|
||||
Operator.FORCE: '\u2263'}
|
||||
Operator.FORCE: '\u2263'
|
||||
}
|
||||
prefix = ''
|
||||
if stackingGroup is not None:
|
||||
prefix += 's'
|
||||
@@ -61,17 +64,17 @@ class ItemAffectedBy(wx.Panel):
|
||||
mainSizer.Add(self.m_staticline, 0, wx.EXPAND)
|
||||
bSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.toggleExpandBtn = wx.ToggleButton(self, wx.ID_ANY, "Expand All", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.toggleExpandBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Expand All"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.toggleExpandBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
self.toggleNameBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle Names", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.toggleNameBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Toggle Names"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.toggleNameBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle View", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Toggle View"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
if stuff is not None:
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Refresh", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, _t("Refresh"), wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
|
||||
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshTree)
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ from enum import IntEnum
|
||||
from gui.builtinItemStatsViews.attributeGrouping import *
|
||||
from service.const import GuiAttrGroup
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class AttributeView(IntEnum):
|
||||
NORMAL = 1
|
||||
@@ -25,7 +27,8 @@ class ItemParams(wx.Panel):
|
||||
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.paramList = wx.lib.agw.hypertreelist.HyperTreeList(self, wx.ID_ANY, agwStyle=wx.TR_HIDE_ROOT | wx.TR_NO_LINES | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_HAS_BUTTONS)
|
||||
self.paramList = wx.lib.agw.hypertreelist.HyperTreeList(self, wx.ID_ANY,
|
||||
agwStyle=wx.TR_HIDE_ROOT | wx.TR_NO_LINES | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_HAS_BUTTONS)
|
||||
self.paramList.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW))
|
||||
|
||||
mainSizer.Add(self.paramList, 1, wx.ALL | wx.EXPAND, 0)
|
||||
@@ -38,25 +41,25 @@ class ItemParams(wx.Panel):
|
||||
self.attrValues = {}
|
||||
self._fetchValues()
|
||||
|
||||
self.paramList.AddColumn("Attribute")
|
||||
self.paramList.AddColumn("Current Value")
|
||||
self.paramList.AddColumn(_t("Attribute"))
|
||||
self.paramList.AddColumn(_t("Current Value"))
|
||||
if self.stuff is not None:
|
||||
self.paramList.AddColumn("Base Value")
|
||||
self.paramList.AddColumn(_t("Base Value"))
|
||||
|
||||
self.m_staticline = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline, 0, wx.EXPAND)
|
||||
bSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, "View Raw Data", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, _t("View Raw Data"), wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
self.exportStatsBtn = wx.ToggleButton(self, wx.ID_ANY, "Export Item Stats", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.exportStatsBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Export Item Stats"), wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
bSizer.Add(self.exportStatsBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
if stuff is not None:
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Refresh", wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, _t("Refresh"), wx.DefaultPosition, wx.DefaultSize, wx.BU_EXACTFIT)
|
||||
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshValues)
|
||||
|
||||
@@ -111,8 +114,8 @@ class ItemParams(wx.Panel):
|
||||
exportFileName = self.item.name + " (" + str(self.item.ID) + ").csv"
|
||||
|
||||
with wx.FileDialog(
|
||||
self, "Save CSV file", "", exportFileName,
|
||||
"CSV files (*.csv)|*.csv", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT
|
||||
self, _t("Save CSV file"), "", exportFileName,
|
||||
_t("CSV files") + " (*.csv)|*.csv", wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT
|
||||
) as dlg:
|
||||
|
||||
if dlg.ShowModal() == wx.ID_CANCEL:
|
||||
@@ -213,7 +216,7 @@ class ItemParams(wx.Panel):
|
||||
misc_parent = root
|
||||
|
||||
# We must first deet4ermine if it's categorey already has defined groupings set for it. Otherwise, we default to just using the fitting group
|
||||
order = CategoryGroups.get(self.item.category.categoryName, [GuiAttrGroup.FITTING, GuiAttrGroup.SHIP_GROUP])
|
||||
order = CategoryGroups.get(self.item.category.name, [GuiAttrGroup.FITTING, GuiAttrGroup.SHIP_GROUP])
|
||||
# start building out the tree
|
||||
for data in [AttrGroupDict[o] for o in order]:
|
||||
heading = data.get("label")
|
||||
@@ -266,7 +269,7 @@ class ItemParams(wx.Panel):
|
||||
for i in range(self.paramList.GetMainWindow().GetColumnCount()):
|
||||
self.paramList.SetColumnWidth(i, wx.LIST_AUTOSIZE)
|
||||
|
||||
def GetData(self, attr, displayOveride = None):
|
||||
def GetData(self, attr, displayOveride=None):
|
||||
info = self.attrInfo.get(attr)
|
||||
att = self.attrValues[attr]
|
||||
|
||||
@@ -285,7 +288,8 @@ class ItemParams(wx.Panel):
|
||||
val = getattr(att, "value", None)
|
||||
value = val if val is not None else att
|
||||
|
||||
if self.toggleView == AttributeView.NORMAL and ((attr not in GroupedAttributes and not (value or valueDefault)) or info is None or not info.published or attr in RequiredSkillAttrs):
|
||||
if self.toggleView == AttributeView.NORMAL and (
|
||||
(attr not in GroupedAttributes and not (value or valueDefault)) or info is None or not info.published or attr in RequiredSkillAttrs):
|
||||
return None
|
||||
|
||||
if info and info.displayName and self.toggleView == AttributeView.NORMAL:
|
||||
|
||||
@@ -7,6 +7,8 @@ from service.market import Market
|
||||
from service.attribute import Attribute
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
def defaultSort(item):
|
||||
return (item.metaLevel or 0, item.name)
|
||||
@@ -70,11 +72,11 @@ class ItemCompare(wx.Panel):
|
||||
self.totalAttrsLabel = wx.StaticText(self, wx.ID_ANY, " ", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
bSizer.Add(self.totalAttrsLabel, 0, wx.ALIGN_CENTER_VERTICAL | wx.RIGHT)
|
||||
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, "Toggle view mode", wx.DefaultPosition,
|
||||
self.toggleViewBtn = wx.ToggleButton(self, wx.ID_ANY, _t("Toggle view mode"), wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
bSizer.Add(self.toggleViewBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Refresh", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, _t("Refresh"), wx.DefaultPosition, wx.DefaultSize,
|
||||
wx.BU_EXACTFIT)
|
||||
bSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL)
|
||||
self.refreshBtn.Bind(wx.EVT_BUTTON, self.RefreshValues)
|
||||
@@ -142,7 +144,7 @@ class ItemCompare(wx.Panel):
|
||||
|
||||
self.items = sorted(self.items, key=func, reverse=self.sortReverse)
|
||||
|
||||
self.paramList.InsertColumn(0, "Item")
|
||||
self.paramList.InsertColumn(0, _t("Item"))
|
||||
self.paramList.SetColumnWidth(0, 200)
|
||||
|
||||
for i, attr in enumerate(self.attrs.keys()):
|
||||
@@ -150,7 +152,7 @@ class ItemCompare(wx.Panel):
|
||||
self.paramList.InsertColumn(i + 1, name)
|
||||
self.paramList.SetColumnWidth(i + 1, 120)
|
||||
|
||||
self.paramList.InsertColumn(len(self.attrs) + 1, "Price")
|
||||
self.paramList.InsertColumn(len(self.attrs) + 1, _t("Price"))
|
||||
self.paramList.SetColumnWidth(len(self.attrs) + 1, 60)
|
||||
|
||||
for item in self.items:
|
||||
@@ -189,16 +191,16 @@ class ItemCompare(wx.Panel):
|
||||
return "%s (%d)" % (attribute.name.capitalize(), value)
|
||||
|
||||
trans = {
|
||||
"Inverse Absolute Percent" : (lambda: (1 - value) * 100, unitName),
|
||||
"Inverse Absolute Percent": (lambda: (1 - value) * 100, unitName),
|
||||
"Inversed Modifier Percent": (lambda: (1 - value) * 100, unitName),
|
||||
"Modifier Percent" : (lambda: ("%+.2f" if ((value - 1) * 100) % 1 else "%+d") % ((value - 1) * 100), unitName),
|
||||
"Volume" : (lambda: value, "m\u00B3"),
|
||||
"Sizeclass" : (lambda: value, ""),
|
||||
"Absolute Percent" : (lambda: (value * 100), unitName),
|
||||
"Milliseconds" : (lambda: value / 1000.0, unitName),
|
||||
"typeID" : (itemIDCallback, ""),
|
||||
"groupID" : (groupIDCallback, ""),
|
||||
"attributeID" : (attributeIDCallback, "")
|
||||
"Modifier Percent": (lambda: ("%+.2f" if ((value - 1) * 100) % 1 else "%+d") % ((value - 1) * 100), unitName),
|
||||
"Volume": (lambda: value, "m\u00B3"),
|
||||
"Sizeclass": (lambda: value, ""),
|
||||
"Absolute Percent": (lambda: (value * 100), unitName),
|
||||
"Milliseconds": (lambda: value / 1000.0, unitName),
|
||||
"typeID": (itemIDCallback, ""),
|
||||
"groupID": (groupIDCallback, ""),
|
||||
"attributeID": (attributeIDCallback, "")
|
||||
}
|
||||
|
||||
override = trans.get(unitDisplayName)
|
||||
|
||||
@@ -3,6 +3,8 @@ import wx
|
||||
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ItemDependents(wx.Panel):
|
||||
def __init__(self, parent, stuff, item):
|
||||
@@ -41,7 +43,7 @@ class ItemDependents(wx.Panel):
|
||||
items = levelToItems[x]
|
||||
items.sort(key=lambda x: x.name)
|
||||
|
||||
child = self.reqTree.AppendItem(parent, "Level {}".format(self.romanNb[int(x)]), sbIconId)
|
||||
child = self.reqTree.AppendItem(parent, _t("Level {}").format(self.romanNb[int(x)]), sbIconId)
|
||||
for item in items:
|
||||
|
||||
if item.iconID:
|
||||
|
||||
@@ -4,6 +4,8 @@ import wx
|
||||
import wx.html
|
||||
import re
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ItemDescription(wx.Panel):
|
||||
def __init__(self, parent, stuff, item):
|
||||
@@ -24,9 +26,9 @@ class ItemDescription(wx.Panel):
|
||||
# Strip URLs
|
||||
desc = re.sub("<( *)a(.*?)>(?P<inside>.*?)<( *)/( *)a( *)>", "\g<inside>", desc)
|
||||
desc = "<body style='background-color: {}; color: {}'>{}</body>".format(
|
||||
bgcolor.GetAsString(wx.C2S_CSS_SYNTAX),
|
||||
fgcolor.GetAsString(wx.C2S_CSS_SYNTAX),
|
||||
desc
|
||||
bgcolor.GetAsString(wx.C2S_CSS_SYNTAX),
|
||||
fgcolor.GetAsString(wx.C2S_CSS_SYNTAX),
|
||||
desc
|
||||
)
|
||||
|
||||
self.description.SetPage(desc)
|
||||
@@ -38,7 +40,7 @@ class ItemDescription(wx.Panel):
|
||||
self.description.Bind(wx.EVT_KEY_UP, self.onKeyUp)
|
||||
|
||||
self.popupMenu = wx.Menu()
|
||||
copyItem = wx.MenuItem(self.popupMenu, 1, 'Copy')
|
||||
copyItem = wx.MenuItem(self.popupMenu, 1, _t('Copy'))
|
||||
self.popupMenu.Append(copyItem)
|
||||
self.popupMenu.Bind(wx.EVT_MENU, self.menuClickHandler, copyItem)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import wx
|
||||
|
||||
from .helpers import AutoListCtrl
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
class ItemEffects(wx.Panel):
|
||||
def __init__(self, parent, stuff, item):
|
||||
@@ -26,12 +27,12 @@ class ItemEffects(wx.Panel):
|
||||
|
||||
def PopulateList(self):
|
||||
|
||||
self.effectList.InsertColumn(0, "Name")
|
||||
self.effectList.InsertColumn(1, "Active")
|
||||
self.effectList.InsertColumn(2, "Type")
|
||||
self.effectList.InsertColumn(0, _t("Name"))
|
||||
self.effectList.InsertColumn(1, _t("Active"))
|
||||
self.effectList.InsertColumn(2, _t("Type"))
|
||||
if config.debug:
|
||||
self.effectList.InsertColumn(3, "Run Time")
|
||||
self.effectList.InsertColumn(4, "ID")
|
||||
self.effectList.InsertColumn(3, _t("Run Time"))
|
||||
self.effectList.InsertColumn(4, _t("ID"))
|
||||
|
||||
# self.effectList.SetColumnWidth(0,385)
|
||||
|
||||
@@ -52,9 +53,9 @@ class ItemEffects(wx.Panel):
|
||||
|
||||
if effects[name].isImplemented:
|
||||
if effects[name].activeByDefault:
|
||||
activeByDefault = "Yes"
|
||||
activeByDefault = _t("Yes")
|
||||
else:
|
||||
activeByDefault = "No"
|
||||
activeByDefault = _t("No")
|
||||
else:
|
||||
activeByDefault = ""
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ from .itemAttributes import ItemParams
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
class ItemMutatorPanel(wx.Panel):
|
||||
|
||||
@@ -48,13 +48,13 @@ class ItemMutatorPanel(wx.Panel):
|
||||
|
||||
mainSizer.Add(wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0, wx.EXPAND, 0)
|
||||
footerSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, "Reset defaults", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.refreshBtn = wx.Button(self, wx.ID_ANY, _t("Reset defaults"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
footerSizer.Add(self.refreshBtn, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
|
||||
self.refreshBtn.Bind(wx.EVT_BUTTON, self.mutaList.resetMutatedValues)
|
||||
self.randomBtn = wx.Button(self, wx.ID_ANY, "Random stats", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.randomBtn = wx.Button(self, wx.ID_ANY, _t("Random stats"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
footerSizer.Add(self.randomBtn, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
|
||||
self.randomBtn.Bind(wx.EVT_BUTTON, self.mutaList.randomMutatedValues)
|
||||
self.revertBtn = wx.Button(self, wx.ID_ANY, "Revert changes", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.revertBtn = wx.Button(self, wx.ID_ANY, _t("Revert changes"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
footerSizer.Add(self.revertBtn, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5)
|
||||
self.revertBtn.Bind(wx.EVT_BUTTON, self.mutaList.revertChanges)
|
||||
mainSizer.Add(footerSizer, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import wx
|
||||
|
||||
from .helpers import AutoListCtrl
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
class ItemProperties(wx.Panel):
|
||||
def __init__(self, parent, stuff, item, context=None):
|
||||
@@ -53,8 +53,8 @@ class ItemProperties(wx.Panel):
|
||||
return
|
||||
|
||||
def PopulateList(self):
|
||||
self.paramList.InsertColumn(0, "Attribute")
|
||||
self.paramList.InsertColumn(1, "Current Value")
|
||||
self.paramList.InsertColumn(0, _t("Attribute"))
|
||||
self.paramList.InsertColumn(1, _t("Current Value"))
|
||||
self.paramList.SetColumnWidth(0, 110)
|
||||
self.paramList.SetColumnWidth(1, 1500)
|
||||
self.paramList.setResizeColumn(0)
|
||||
@@ -95,5 +95,5 @@ class ItemProperties(wx.Panel):
|
||||
|
||||
self.paramList.SortItems(lambda id1, id2: (idNameMap[id1] > idNameMap[id2]) - (idNameMap[id1] < idNameMap[id2]))
|
||||
self.paramList.RefreshRows()
|
||||
self.totalAttrsLabel.SetLabel("%d attributes. " % idCount)
|
||||
self.totalAttrsLabel.SetLabel(_t("%d attribute.", "%d attributes.", idCount) % idCount)
|
||||
self.Layout()
|
||||
|
||||
@@ -3,6 +3,8 @@ import wx
|
||||
# noinspection PyPackageRequirements
|
||||
import wx.html
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ItemTraits(wx.Panel):
|
||||
def __init__(self, parent, stuff, item):
|
||||
@@ -11,7 +13,7 @@ class ItemTraits(wx.Panel):
|
||||
self.SetSizer(mainSizer)
|
||||
|
||||
self.traits = wx.html.HtmlWindow(self)
|
||||
self.traits.SetPage(item.traits.traitText)
|
||||
self.traits.SetPage(item.traits.display)
|
||||
|
||||
self.traits.Bind(wx.EVT_CONTEXT_MENU, self.onPopupMenu)
|
||||
self.traits.Bind(wx.EVT_KEY_UP, self.onKeyUp)
|
||||
@@ -20,7 +22,7 @@ class ItemTraits(wx.Panel):
|
||||
self.Layout()
|
||||
|
||||
self.popupMenu = wx.Menu()
|
||||
copyItem = wx.MenuItem(self.popupMenu, 1, 'Copy')
|
||||
copyItem = wx.MenuItem(self.popupMenu, 1, _t('Copy'))
|
||||
self.popupMenu.Append(copyItem)
|
||||
self.popupMenu.Bind(wx.EVT_MENU, self.menuClickHandler, copyItem)
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ class ItemView(Display):
|
||||
item = self.active[clickedPos]
|
||||
sMkt = self.sMkt
|
||||
sourceContext = "marketItemMisc" if self.marketBrowser.mode in ("search", "recent") else "marketItemGroup"
|
||||
itemContext = sMkt.getCategoryByItem(item).name
|
||||
itemContext = sMkt.getCategoryByItem(item).displayName
|
||||
|
||||
menu = ContextMenu.getMenu(self, item, (item,), (sourceContext, itemContext))
|
||||
self.PopupMenu(menu)
|
||||
|
||||
@@ -6,6 +6,7 @@ from gui.builtinMarketBrowser.events import RECENTLY_USED_MODULES
|
||||
from logbook import Logger
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class MarketTree(wx.TreeCtrl):
|
||||
@@ -33,7 +34,7 @@ class MarketTree(wx.TreeCtrl):
|
||||
|
||||
# Add recently used modules node
|
||||
rumIconId = self.addImage("market_small", "gui")
|
||||
self.AppendItem(self.root, "Recently Used Items", rumIconId, data=RECENTLY_USED_MODULES)
|
||||
self.AppendItem(self.root, _t("Recently Used Items"), rumIconId, data=RECENTLY_USED_MODULES)
|
||||
|
||||
# Bind our lookup method to when the tree gets expanded
|
||||
self.Bind(wx.EVT_TREE_ITEM_EXPANDING, self.expandLookup)
|
||||
|
||||
@@ -5,11 +5,13 @@ from gui.bitmap_loader import BitmapLoader
|
||||
import gui.mainFrame
|
||||
from service.settings import ContextMenuSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFContextMenuPref(PreferenceView):
|
||||
title = "Context Menus"
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.title = _t("Context Menus")
|
||||
self.settings = ContextMenuSettings.getInstance()
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
@@ -22,11 +24,11 @@ class PFContextMenuPref(PreferenceView):
|
||||
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText(
|
||||
panel, wx.ID_ANY,
|
||||
'Disabling context menus can improve responsiveness.\n'
|
||||
'You can hold {} key + right-click to show all menu items regardless of these settings.'.format(
|
||||
'Command' if 'wxMac' in wx.PlatformInfo else 'Control'),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
panel, wx.ID_ANY,
|
||||
_t('Disabling context menus can improve responsiveness.\n'
|
||||
'You can hold {} key + right-click to show all menu items regardless of these settings.').format(
|
||||
'Command' if 'wxMac' in wx.PlatformInfo else 'Control'),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 5)
|
||||
|
||||
@@ -36,17 +38,17 @@ class PFContextMenuPref(PreferenceView):
|
||||
|
||||
rbSizerRow1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbBox1 = wx.RadioBox(panel, -1, "Set as Damage Pattern", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox1 = wx.RadioBox(panel, -1, _t("Set as Damage Pattern"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox1.SetSelection(self.settings.get('ammoPattern'))
|
||||
rbSizerRow1.Add(self.rbBox1, 1, wx.ALL, 5)
|
||||
self.rbBox1.Bind(wx.EVT_RADIOBOX, self.OnSetting1Change)
|
||||
|
||||
self.rbBox2 = wx.RadioBox(panel, -1, "Change Skills", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox2 = wx.RadioBox(panel, -1, _t("Change Skills"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox2.SetSelection(self.settings.get('changeAffectingSkills'))
|
||||
rbSizerRow1.Add(self.rbBox2, 1, wx.ALL, 5)
|
||||
self.rbBox2.Bind(wx.EVT_RADIOBOX, self.OnSetting2Change)
|
||||
|
||||
self.rbBox3 = wx.RadioBox(panel, -1, "Variations", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox3 = wx.RadioBox(panel, -1, _t("Variations"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox3.SetSelection(self.settings.get('metaSwap'))
|
||||
rbSizerRow1.Add(self.rbBox3, 1, wx.ALL, 5)
|
||||
self.rbBox3.Bind(wx.EVT_RADIOBOX, self.OnSetting3Change)
|
||||
@@ -56,12 +58,12 @@ class PFContextMenuPref(PreferenceView):
|
||||
# Row 2
|
||||
rbSizerRow2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbBox4 = wx.RadioBox(panel, -1, "Project onto Fit", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox4 = wx.RadioBox(panel, -1, _t("Project onto Fit"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox4.SetSelection(self.settings.get('project'))
|
||||
rbSizerRow2.Add(self.rbBox4, 1, wx.ALL, 5)
|
||||
self.rbBox4.Bind(wx.EVT_RADIOBOX, self.OnSetting4Change)
|
||||
|
||||
self.rbBox5 = wx.RadioBox(panel, -1, "Fill with module", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox5 = wx.RadioBox(panel, -1, _t("Fill with module"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox5.SetSelection(self.settings.get('moduleFill'))
|
||||
rbSizerRow2.Add(self.rbBox5, 1, wx.ALL, 5)
|
||||
self.rbBox5.Bind(wx.EVT_RADIOBOX, self.OnSetting5Change)
|
||||
@@ -71,12 +73,13 @@ class PFContextMenuPref(PreferenceView):
|
||||
# Row 3
|
||||
rbSizerRow3 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbBox6 = wx.RadioBox(panel, -1, "Spoolup", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox6 = wx.RadioBox(panel, -1, _t("Spoolup"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox6.SetSelection(self.settings.get('spoolup'))
|
||||
rbSizerRow3.Add(self.rbBox6, 1, wx.ALL, 5)
|
||||
self.rbBox6.Bind(wx.EVT_RADIOBOX, self.OnSetting6Change)
|
||||
|
||||
self.rbBox7 = wx.RadioBox(panel, -1, "Additions Panel Copy/Paste", wx.DefaultPosition, wx.DefaultSize, ['Disabled', 'Enabled'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbBox7 = wx.RadioBox(panel, -1, _t("Additions Panel Copy/Paste"), wx.DefaultPosition, wx.DefaultSize, [_t('Disabled'), _t('Enabled')], 1,
|
||||
wx.RA_SPECIFY_COLS)
|
||||
self.rbBox7.SetSelection(self.settings.get('additionsCopyPaste'))
|
||||
rbSizerRow3.Add(self.rbBox7, 1, wx.ALL, 5)
|
||||
self.rbBox7.Bind(wx.EVT_RADIOBOX, self.OnSetting7Change)
|
||||
|
||||
@@ -6,11 +6,13 @@ from gui.bitmap_loader import BitmapLoader
|
||||
from gui.preferenceView import PreferenceView
|
||||
from gui.utils import helpers_wxPython as wxHelpers
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFGeneralPref(PreferenceView):
|
||||
title = "Database"
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.title = _t("Database")
|
||||
self.dirtySettings = False
|
||||
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
@@ -20,7 +22,7 @@ class PFGeneralPref(PreferenceView):
|
||||
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, "(Cannot be changed while pyfa is running. Set via command line switches.)",
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, _t("(Cannot be changed while pyfa is running. Set via command line switches.)"),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
|
||||
@@ -29,11 +31,11 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
# Save in Root
|
||||
self.cbsaveInRoot = wx.CheckBox(panel, wx.ID_ANY, "Using Executable Path for Saved Fit Database and Settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbsaveInRoot = wx.CheckBox(panel, wx.ID_ANY, _t("Using Executable Path for Saved Fit Database and Settings"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbsaveInRoot, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
# Database path
|
||||
self.stSetUserPath = wx.StaticText(panel, wx.ID_ANY, "pyfa User Path:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetUserPath = wx.StaticText(panel, wx.ID_ANY, _t("pyfa User Path:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetUserPath.Wrap(-1)
|
||||
mainSizer.Add(self.stSetUserPath, 0, wx.ALL, 5)
|
||||
self.inputUserPath = wx.TextCtrl(panel, wx.ID_ANY, config.savePath, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
@@ -42,7 +44,7 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.inputUserPath, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
# Save DB
|
||||
self.stFitDB = wx.StaticText(panel, wx.ID_ANY, "Fitting Database:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stFitDB = wx.StaticText(panel, wx.ID_ANY, _t("Fitting Database:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stFitDB.Wrap(-1)
|
||||
mainSizer.Add(self.stFitDB, 0, wx.ALL, 5)
|
||||
|
||||
@@ -52,7 +54,7 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.inputFitDB, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
# Game Data DB
|
||||
self.stGameDB = wx.StaticText(panel, wx.ID_ANY, "Game Database:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stGameDB = wx.StaticText(panel, wx.ID_ANY, _t("Game Database:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stGameDB.Wrap(-1)
|
||||
mainSizer.Add(self.stGameDB, 0, wx.ALL, 5)
|
||||
|
||||
@@ -74,37 +76,36 @@ class PFGeneralPref(PreferenceView):
|
||||
btnSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
btnSizer.AddStretchSpacer()
|
||||
|
||||
self.btnDeleteDamagePatterns = wx.Button(panel, wx.ID_ANY, "Delete All Damage Pattern Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnDeleteDamagePatterns = wx.Button(panel, wx.ID_ANY, _t("Delete All Damage Pattern Profiles"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
btnSizer.Add(self.btnDeleteDamagePatterns, 0, wx.ALL, 5)
|
||||
self.btnDeleteDamagePatterns.Bind(wx.EVT_BUTTON, self.DeleteDamagePatterns)
|
||||
|
||||
self.btnDeleteTargetProfiles = wx.Button(panel, wx.ID_ANY, "Delete All Target Profiles", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnDeleteTargetProfiles = wx.Button(panel, wx.ID_ANY, _t("Delete All Target Profiles"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
btnSizer.Add(self.btnDeleteTargetProfiles, 0, wx.ALL, 5)
|
||||
self.btnDeleteTargetProfiles.Bind(wx.EVT_BUTTON, self.DeleteTargetProfiles)
|
||||
|
||||
self.btnPrices = wx.Button(panel, wx.ID_ANY, "Delete All Prices", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnPrices = wx.Button(panel, wx.ID_ANY, _t("Delete All Prices"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
btnSizer.Add(self.btnPrices, 0, wx.ALL, 5)
|
||||
self.btnPrices.Bind(wx.EVT_BUTTON, self.DeletePrices)
|
||||
|
||||
mainSizer.Add(btnSizer, 0, wx.EXPAND, 5)
|
||||
|
||||
|
||||
panel.SetSizer(mainSizer)
|
||||
panel.Layout()
|
||||
|
||||
def DeleteDamagePatterns(self, event):
|
||||
question = "This is a destructive action that will delete all damage pattern profiles.\nAre you sure you want to do this?"
|
||||
if wxHelpers.YesNoDialog(question, "Confirm"):
|
||||
question = _t("This is a destructive action that will delete all damage pattern profiles.\nAre you sure you want to do this?")
|
||||
if wxHelpers.YesNoDialog(question, _t("Confirm")):
|
||||
clearDamagePatterns()
|
||||
|
||||
def DeleteTargetProfiles(self, event):
|
||||
question = "This is a destructive action that will delete all target profiles.\nAre you sure you want to do this?"
|
||||
if wxHelpers.YesNoDialog(question, "Confirm"):
|
||||
question = _t("This is a destructive action that will delete all target profiles.\nAre you sure you want to do this?")
|
||||
if wxHelpers.YesNoDialog(question, _t("Confirm")):
|
||||
clearTargetProfiles()
|
||||
|
||||
def DeletePrices(self, event):
|
||||
question = "This is a destructive action that will delete all cached prices out of the database.\nAre you sure you want to do this?"
|
||||
if wxHelpers.YesNoDialog(question, "Confirm"):
|
||||
question = _t("This is a destructive action that will delete all cached prices out of the database.\nAre you sure you want to do this?")
|
||||
if wxHelpers.YesNoDialog(question, _t("Confirm")):
|
||||
clearPrices()
|
||||
|
||||
def onCBsaveInRoot(self, event):
|
||||
|
||||
@@ -12,10 +12,10 @@ from wx.lib.intctrl import IntCtrl
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFFittingEnginePref(PreferenceView):
|
||||
title = "Fitting Engine"
|
||||
|
||||
def __init__(self):
|
||||
self.dirtySettings = False
|
||||
|
||||
@@ -24,6 +24,7 @@ class PFFittingEnginePref(PreferenceView):
|
||||
|
||||
# noinspection PyAttributeOutsideInit
|
||||
def populatePanel(self, panel):
|
||||
self.title = _t("Fitting Engine")
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
@@ -40,41 +41,40 @@ class PFFittingEnginePref(PreferenceView):
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
self.cbGlobalForceReload = wx.CheckBox(panel, wx.ID_ANY, "Factor in reload time when calculating capacitor usage, damage, and tank.",
|
||||
self.cbGlobalForceReload = wx.CheckBox(panel, wx.ID_ANY, _t("Factor in reload time when calculating capacitor usage, damage, and tank."),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
|
||||
mainSizer.Add(self.cbGlobalForceReload, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbStrictSkillLevels = wx.CheckBox(panel, wx.ID_ANY,
|
||||
"Enforce strict skill level requirements",
|
||||
_t("Enforce strict skill level requirements"),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbStrictSkillLevels.SetCursor(helpCursor)
|
||||
self.cbStrictSkillLevels.SetToolTip(wx.ToolTip(
|
||||
'When enabled, skills will check their dependencies\' requirements when their levels change and reset ' +
|
||||
'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy ' +
|
||||
'Drone Operation skill, as that requires Drones V'))
|
||||
_t('When enabled, skills will check their dependencies\' requirements when their levels change and reset '
|
||||
'skills that no longer meet the requirement.\neg: Setting Drones from level V to IV will reset the Heavy '
|
||||
'Drone Operation skill, as that requires Drones V')))
|
||||
|
||||
mainSizer.Add(self.cbStrictSkillLevels, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbUniversalAdaptiveArmorHardener = wx.CheckBox(panel, wx.ID_ANY,
|
||||
"When damage profile is Uniform, set Reactive Armor " +
|
||||
"Hardener to match (old behavior).",
|
||||
_t("When damage profile is Uniform, set Reactive Armor "
|
||||
"Hardener to match (old behavior)."),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbUniversalAdaptiveArmorHardener, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
|
||||
spoolup_sizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.spool_up_label = wx.StaticText(panel, wx.ID_ANY, "Global Default Spoolup Percentage:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.spool_up_label = wx.StaticText(panel, wx.ID_ANY, _t("Global Default Spoolup Percentage:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.spool_up_label.Wrap(-1)
|
||||
self.spool_up_label.SetCursor(helpCursor)
|
||||
self.spool_up_label.SetToolTip(
|
||||
wx.ToolTip('The amount of spoolup to use by default on module which support it. Can be changed on a per-module basis'))
|
||||
wx.ToolTip(_t('The amount of spoolup to use by default on module which support it. Can be changed on a per-module basis')))
|
||||
|
||||
spoolup_sizer.Add(self.spool_up_label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.spoolup_value = IntCtrl(panel, min=0, max=100, limited=True)
|
||||
spoolup_sizer.Add(self.spoolup_value , 0, wx.ALL, 5)
|
||||
spoolup_sizer.Add(self.spoolup_value, 0, wx.ALL, 5)
|
||||
|
||||
mainSizer.Add(spoolup_sizer, 0, wx.ALL | wx.EXPAND, 0)
|
||||
|
||||
|
||||
@@ -6,15 +6,14 @@ from gui.bitmap_loader import BitmapLoader
|
||||
from gui.preferenceView import PreferenceView
|
||||
from service.settings import EsiSettings
|
||||
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFEsiPref(PreferenceView):
|
||||
title = "EVE SSO"
|
||||
|
||||
def populatePanel(self, panel):
|
||||
|
||||
self.title = _t("EVE SSO")
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.settings = EsiSettings.getInstance()
|
||||
self.dirtySettings = False
|
||||
@@ -30,25 +29,25 @@ class PFEsiPref(PreferenceView):
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
self.stInfo = wx.StaticText(panel, wx.ID_ANY,
|
||||
"Please see the pyfa wiki on GitHub for information regarding these options.",
|
||||
_t("Please see the pyfa wiki on GitHub for information regarding these options."),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stInfo.Wrap(dlgWidth - 50)
|
||||
mainSizer.Add(self.stInfo, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
rbSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
self.rbMode = wx.RadioBox(panel, -1, "Login Authentication Method", wx.DefaultPosition, wx.DefaultSize,
|
||||
['Local Server', 'Manual'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbMode.SetItemToolTip(0, "This options starts a local webserver that the web application will call back to"
|
||||
" with information about the character login.")
|
||||
self.rbMode.SetItemToolTip(1, "This option prompts users to copy and paste information from the web application "
|
||||
"to allow for character login. Use this if having issues with the local server.")
|
||||
self.rbMode = wx.RadioBox(panel, -1, _t("Login Authentication Method"), wx.DefaultPosition, wx.DefaultSize,
|
||||
[_t('Local Server'), _t('Manual')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbMode.SetItemToolTip(0, _t("This options starts a local webserver that the web application will call back to"
|
||||
" with information about the character login."))
|
||||
self.rbMode.SetItemToolTip(1, _t("This option prompts users to copy and paste information from the web application "
|
||||
"to allow for character login. Use this if having issues with the local server."))
|
||||
|
||||
self.rbSsoMode = wx.RadioBox(panel, -1, "SSO Mode", wx.DefaultPosition, wx.DefaultSize,
|
||||
['pyfa.io', 'Custom application'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbSsoMode.SetItemToolTip(0, "This options routes SSO Logins through pyfa.io, allowing you to easily login "
|
||||
"without any configuration. When in doubt, use this option.")
|
||||
self.rbSsoMode.SetItemToolTip(1, "This option goes through EVE SSO directly, but requires more configuration. Use "
|
||||
"this is pyfa.io is blocked for some reason, or if you do not wish to route data throguh pyfa.io.")
|
||||
self.rbSsoMode = wx.RadioBox(panel, -1, _t("SSO Mode"), wx.DefaultPosition, wx.DefaultSize,
|
||||
[_t('pyfa.io'), _t('Custom application')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbSsoMode.SetItemToolTip(0, _t("This options routes SSO Logins through pyfa.io, allowing you to easily login "
|
||||
"without any configuration. When in doubt, use this option."))
|
||||
self.rbSsoMode.SetItemToolTip(1, _t("This option goes through EVE SSO directly, but requires more configuration. Use "
|
||||
"this if pyfa.io is blocked for some reason, or if you do not wish to route data throguh pyfa.io."))
|
||||
|
||||
self.rbMode.SetSelection(self.settings.get('loginMode'))
|
||||
self.rbSsoMode.SetSelection(self.settings.get('ssoMode'))
|
||||
@@ -61,7 +60,7 @@ class PFEsiPref(PreferenceView):
|
||||
|
||||
mainSizer.Add(rbSizer, 1, wx.ALL | wx.EXPAND, 0)
|
||||
|
||||
detailsTitle = wx.StaticText(panel, wx.ID_ANY, "Custom Application", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
detailsTitle = wx.StaticText(panel, wx.ID_ANY, _t("Custom Application"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
detailsTitle.Wrap(-1)
|
||||
detailsTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
|
||||
@@ -74,7 +73,7 @@ class PFEsiPref(PreferenceView):
|
||||
fgAddrSizer.SetFlexibleDirection(wx.BOTH)
|
||||
fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
|
||||
|
||||
self.stSetID = wx.StaticText(panel, wx.ID_ANY, "Client ID:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetID = wx.StaticText(panel, wx.ID_ANY, _t("Client ID:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetID.Wrap(-1)
|
||||
fgAddrSizer.Add(self.stSetID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
@@ -83,7 +82,7 @@ class PFEsiPref(PreferenceView):
|
||||
|
||||
fgAddrSizer.Add(self.inputClientID, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, "Client Secret:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetSecret = wx.StaticText(panel, wx.ID_ANY, _t("Client Secret:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSetSecret.Wrap(-1)
|
||||
|
||||
fgAddrSizer.Add(self.stSetSecret, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
@@ -6,19 +6,23 @@ import gui.mainFrame
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
from gui.preferenceView import PreferenceView
|
||||
from service.fit import Fit
|
||||
from service.settings import SettingsProvider
|
||||
from service.settings import SettingsProvider, LocaleSettings
|
||||
import eos.config
|
||||
import wx.lib.agw.hyperlink as hl
|
||||
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFGeneralPref(PreferenceView):
|
||||
|
||||
title = "General"
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.title = _t("General")
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.dirtySettings = False
|
||||
self.openFitsSettings = SettingsProvider.getInstance().getSettings("pyfaPrevOpenFits",
|
||||
{"enabled": False, "pyfaOpenFits": []})
|
||||
|
||||
self.localeSettings = LocaleSettings.getInstance()
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
@@ -31,65 +35,116 @@ class PFGeneralPref(PreferenceView):
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, "Use global character", wx.DefaultPosition, wx.DefaultSize,
|
||||
self.cbGlobalChar = wx.CheckBox(panel, wx.ID_ANY, _t("Use global character"), wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
mainSizer.Add(self.cbGlobalChar, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbDefaultCharImplants = wx.CheckBox(panel, wx.ID_ANY, "Use character implants by default for new fits",
|
||||
self.cbDefaultCharImplants = wx.CheckBox(panel, wx.ID_ANY, _t("Use character implants by default for new fits"),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbDefaultCharImplants, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, "Use global damage pattern", wx.DefaultPosition,
|
||||
self.cbGlobalDmgPattern = wx.CheckBox(panel, wx.ID_ANY, _t("Use global damage pattern"), wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbGlobalDmgPattern, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, "Compact skills needed tooltip", wx.DefaultPosition,
|
||||
self.cbCompactSkills = wx.CheckBox(panel, wx.ID_ANY, _t("Compact skills needed tooltip"), wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbCompactSkills, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, "Color fitting view by slot", wx.DefaultPosition,
|
||||
self.cbFitColorSlots = wx.CheckBox(panel, wx.ID_ANY, _t("Color fitting view by slot"), wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbFitColorSlots, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, "Reopen previous fits on startup", wx.DefaultPosition,
|
||||
self.cbReopenFits = wx.CheckBox(panel, wx.ID_ANY, _t("Reopen previous fits on startup"), wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbReopenFits, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, "Separate Racks", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbRackSlots = wx.CheckBox(panel, wx.ID_ANY, _t("Separate Racks"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbRackSlots, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
labelSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, "Show Rack Labels", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbRackLabels = wx.CheckBox(panel, wx.ID_ANY, _t("Show Rack Labels"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
labelSizer.Add(self.cbRackLabels, 0, wx.ALL | wx.EXPAND, 5)
|
||||
mainSizer.Add(labelSizer, 0, wx.LEFT | wx.EXPAND, 30)
|
||||
|
||||
self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show fitting tab tooltips", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbShowTooltip = wx.CheckBox(panel, wx.ID_ANY, _t("Show fitting tab tooltips"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbShowTooltip, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, "Animate gauges", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbGaugeAnimation = wx.CheckBox(panel, wx.ID_ANY, _t("Animate gauges"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbGaugeAnimation, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, "Open fittings in a new page by default",
|
||||
self.cbOpenFitInNew = wx.CheckBox(panel, wx.ID_ANY, _t("Open fittings in a new page by default"),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbOpenFitInNew, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, "Show ship browser tooltip",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbShowShipBrowserTooltip = wx.CheckBox(panel, wx.ID_ANY, _t("Show ship browser tooltip"),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbShowShipBrowserTooltip, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
|
||||
self.cbReloadAll = wx.CheckBox(panel, wx.ID_ANY, "Change charge in all modules of the same type",
|
||||
self.cbReloadAll = wx.CheckBox(panel, wx.ID_ANY, _t("Change charge in all modules of the same type"),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
if "wxGTK" not in wx.PlatformInfo:
|
||||
self.cbReloadAll.SetCursor(helpCursor)
|
||||
self.cbReloadAll.SetToolTip(wx.ToolTip(
|
||||
'When disabled, reloads charges just in selected modules. Action can be reversed by holding Ctrl or Alt key while changing charge.'))
|
||||
_t('When disabled, reloads charges just in selected modules. Action can be reversed by holding Ctrl or Alt key while changing charge.')))
|
||||
mainSizer.Add(self.cbReloadAll, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.rbAddLabels = wx.RadioBox(panel, -1, "Extra info in Additions panel tab names", wx.DefaultPosition, wx.DefaultSize, ["None", "Quantity of active items", "Quantity of all items"], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbAddLabels = wx.RadioBox(panel, -1, _t("Extra info in Additions panel tab names"), wx.DefaultPosition, wx.DefaultSize,
|
||||
[_t("None"), _t("Quantity of active items"), _t("Quantity of all items")], 1, wx.RA_SPECIFY_COLS)
|
||||
mainSizer.Add(self.rbAddLabels, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.BOTTOM, 10)
|
||||
self.rbAddLabels.Bind(wx.EVT_RADIOBOX, self.OnAddLabelsChange)
|
||||
|
||||
langBox = wx.StaticBoxSizer(wx.VERTICAL, panel, _t("Language (requires restart)"))
|
||||
mainSizer.Add(langBox, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.BOTTOM, 10)
|
||||
|
||||
langSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.stLangLabel = wx.StaticText(panel, wx.ID_ANY, _t("pyfa:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stLangLabel.Wrap(-1)
|
||||
langSizer.Add(self.stLangLabel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.langChoices = sorted([langInfo for lang, langInfo in LocaleSettings.supported_langauges().items()], key=lambda x: x.Description)
|
||||
|
||||
def langDisplay(langInfo):
|
||||
progress = self.localeSettings.get_progress(langInfo.CanonicalName)
|
||||
progress_display = (" ({}%)".format(progress['translated_progress']) if progress is not None else "")
|
||||
return langInfo.Description + progress_display
|
||||
|
||||
self.chLang = wx.Choice(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, [langDisplay(x) for x in self.langChoices], 0)
|
||||
self.chLang.Bind(wx.EVT_CHOICE, self.onLangSelection)
|
||||
|
||||
selectedIndex = self.langChoices.index(next((x for x in self.langChoices if x.CanonicalName == self.localeSettings.get('locale')), None))
|
||||
self.chLang.SetSelection(selectedIndex)
|
||||
|
||||
langSizer.Add(self.chLang, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
langBox.Add(langSizer)
|
||||
langBox.Add(hl.HyperLinkCtrl(panel, -1,
|
||||
_t("Interested in helping with translations?"),
|
||||
URL="https://github.com/pyfa-org/Pyfa/blob/master/locale/README.md"
|
||||
), 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 15)
|
||||
eosLangSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.stEosLangLabel = wx.StaticText(panel, wx.ID_ANY, _t("EVE Data:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stEosLangLabel.Wrap(-1)
|
||||
eosLangSizer.Add(self.stEosLangLabel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.eosLangChoices = [(LocaleSettings.defaults['eos_locale'], LocaleSettings.defaults['eos_locale'])] + \
|
||||
sorted([(wx.Locale.FindLanguageInfo(x).Description, x) for x in eos.config.translation_mapping.keys()], key=lambda x: x[0])
|
||||
|
||||
self.chEosLang = wx.Choice(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, [x[0] for x in self.eosLangChoices], 0)
|
||||
self.chEosLang.Bind(wx.EVT_CHOICE, self.onEosLangSelection)
|
||||
|
||||
selectedIndex = self.eosLangChoices.index(
|
||||
next((x for x in self.eosLangChoices if x[1] == self.localeSettings.get('eos_locale')), None))
|
||||
self.chEosLang.SetSelection(selectedIndex)
|
||||
|
||||
eosLangSizer.Add(self.chEosLang, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
langBox.Add(eosLangSizer)
|
||||
langBox.Add(wx.StaticText(panel, wx.ID_ANY,
|
||||
_t("Auto will use the same language pyfa uses if available, otherwise English"),
|
||||
wx.DefaultPosition,
|
||||
wx.DefaultSize, 0), 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 15)
|
||||
self.sFit = Fit.getInstance()
|
||||
|
||||
self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"])
|
||||
@@ -126,6 +181,16 @@ class PFGeneralPref(PreferenceView):
|
||||
panel.SetSizer(mainSizer)
|
||||
panel.Layout()
|
||||
|
||||
def onLangSelection(self, event):
|
||||
selection = self.chLang.GetSelection()
|
||||
locale = self.langChoices[selection]
|
||||
self.localeSettings.set('locale', locale.CanonicalName)
|
||||
|
||||
def onEosLangSelection(self, event):
|
||||
selection = self.chEosLang.GetSelection()
|
||||
locale = self.eosLangChoices[selection]
|
||||
self.localeSettings.set('eos_locale', locale[1])
|
||||
|
||||
def onCBGlobalColorBySlot(self, event):
|
||||
# todo: maybe create a SettingChanged event that we can fire, and have other things hook into, instead of having the preference panel itself handle the
|
||||
# updating of things related to settings.
|
||||
|
||||
@@ -10,16 +10,18 @@ import gui.mainFrame
|
||||
from service.settings import HTMLExportSettings
|
||||
import wx.lib.agw.hyperlink
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFHTMLExportPref(PreferenceView):
|
||||
title = "HTML Export"
|
||||
desc = ("HTML Export (File > Export HTML) allows you to export your entire fitting "
|
||||
"database into an HTML file at the specified location. This file can be "
|
||||
"used to easily open your fits in a web-based fitting program")
|
||||
desc4 = ("Export Fittings in a minimal HTML Version, just containing the fittings links "
|
||||
"without any visual styling")
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.title = _t("HTML Export")
|
||||
self.desc = _t("HTML Export (File > Export HTML) allows you to export your entire fitting "
|
||||
"database into an HTML file at the specified location. This file can be "
|
||||
"used to easily open your fits in a web-based fitting program")
|
||||
self.desc4 = _t("Export Fittings in a minimal HTML Version, just containing the fittings links "
|
||||
"without any visual styling")
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.HTMLExportSettings = HTMLExportSettings.getInstance()
|
||||
self.dirtySettings = False
|
||||
@@ -39,16 +41,16 @@ class PFHTMLExportPref(PreferenceView):
|
||||
mainSizer.Add(self.stDesc, 0, wx.ALL, 5)
|
||||
|
||||
self.PathLinkCtrl = wx.lib.agw.hyperlink.HyperLinkCtrl(panel, wx.ID_ANY, self.HTMLExportSettings.getPath(),
|
||||
wx.DefaultPosition, wx.DefaultSize,
|
||||
URL='file:///{}'.format(self.HTMLExportSettings.getPath()),)
|
||||
wx.DefaultPosition, wx.DefaultSize,
|
||||
URL='file:///{}'.format(self.HTMLExportSettings.getPath()), )
|
||||
mainSizer.Add(self.PathLinkCtrl, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.fileSelectDialog = wx.FileDialog(None, "Save Fitting As...",
|
||||
wildcard="EVE IGB HTML fitting file (*.html)|*.html", style=wx.FD_SAVE)
|
||||
self.fileSelectDialog = wx.FileDialog(None, _t("Save Fitting As..."),
|
||||
wildcard=_t("EVE IGB HTML fitting file") + " (*.html)|*.html", style=wx.FD_SAVE)
|
||||
self.fileSelectDialog.SetPath(self.HTMLExportSettings.getPath())
|
||||
self.fileSelectDialog.SetFilename(os.path.basename(self.HTMLExportSettings.getPath()))
|
||||
|
||||
self.fileSelectButton = wx.Button(panel, -1, "Set export destination", pos=(0, 0))
|
||||
self.fileSelectButton = wx.Button(panel, -1, _t("Set export destination"), pos=(0, 0))
|
||||
self.fileSelectButton.Bind(wx.EVT_BUTTON, self.selectHTMLExportFilePath)
|
||||
mainSizer.Add(self.fileSelectButton, 0, wx.ALL, 5)
|
||||
|
||||
@@ -56,7 +58,7 @@ class PFHTMLExportPref(PreferenceView):
|
||||
self.stDesc4.Wrap(dlgWidth - 50)
|
||||
mainSizer.Add(self.stDesc4, 0, wx.ALL, 5)
|
||||
|
||||
self.exportMinimal = wx.CheckBox(panel, wx.ID_ANY, "Enable minimal format", wx.DefaultPosition,
|
||||
self.exportMinimal = wx.CheckBox(panel, wx.ID_ANY, _t("Enable minimal format"), wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
self.exportMinimal.SetValue(self.HTMLExportSettings.getMinimalEnabled())
|
||||
self.exportMinimal.Bind(wx.EVT_CHECKBOX, self.OnMinimalEnabledChange)
|
||||
|
||||
@@ -6,6 +6,7 @@ import config
|
||||
from logbook import Logger
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
def OnDumpLogs(event):
|
||||
@@ -13,9 +14,9 @@ def OnDumpLogs(event):
|
||||
|
||||
|
||||
class PFGeneralPref(PreferenceView):
|
||||
title = "Logging"
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.title = _t("Logging")
|
||||
self.dirtySettings = False
|
||||
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
@@ -25,7 +26,7 @@ class PFGeneralPref(PreferenceView):
|
||||
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, "(Cannot be changed while pyfa is running. Set via command line switches.)",
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY, _t("(Cannot be changed while pyfa is running. Set via command line switches.)"),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
|
||||
@@ -34,7 +35,7 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
# Database path
|
||||
self.stLogPath = wx.StaticText(panel, wx.ID_ANY, "Log file location:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stLogPath = wx.StaticText(panel, wx.ID_ANY, _t("Log file location:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stLogPath.Wrap(-1)
|
||||
mainSizer.Add(self.stLogPath, 0, wx.ALL, 5)
|
||||
self.inputLogPath = wx.TextCtrl(panel, wx.ID_ANY, config.logPath, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
@@ -43,8 +44,8 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.inputLogPath, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
import requests
|
||||
self.certPath = wx.StaticText(panel, wx.ID_ANY, "Cert Path:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.certPath .Wrap(-1)
|
||||
self.certPath = wx.StaticText(panel, wx.ID_ANY, _t("Cert Path:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.certPath.Wrap(-1)
|
||||
mainSizer.Add(self.certPath, 0, wx.ALL, 5)
|
||||
self.certPathCtrl = wx.TextCtrl(panel, wx.ID_ANY, requests.certs.where(), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.certPathCtrl.SetEditable(False)
|
||||
@@ -52,13 +53,13 @@ class PFGeneralPref(PreferenceView):
|
||||
mainSizer.Add(self.certPathCtrl, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
# Debug Logging
|
||||
self.cbdebugLogging = wx.CheckBox(panel, wx.ID_ANY, "Debug Logging Enabled", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbdebugLogging = wx.CheckBox(panel, wx.ID_ANY, _t("Debug Logging Enabled"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbdebugLogging, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.stDumpLogs = wx.StaticText(panel, wx.ID_ANY, "Pressing this button will cause all logs in memory to write to the log file:",
|
||||
self.stDumpLogs = wx.StaticText(panel, wx.ID_ANY, _t("Pressing this button will cause all logs in memory to write to the log file:"),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.stDumpLogs, 0, wx.ALL, 5)
|
||||
self.btnDumpLogs = wx.Button(panel, wx.ID_ANY, "Dump All Logs", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnDumpLogs = wx.Button(panel, wx.ID_ANY, _t("Dump All Logs"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnDumpLogs.Bind(wx.EVT_BUTTON, OnDumpLogs)
|
||||
mainSizer.Add(self.btnDumpLogs, 0, wx.ALIGN_LEFT, 5)
|
||||
|
||||
|
||||
@@ -11,21 +11,23 @@ from service.settings import MarketPriceSettings
|
||||
from service.fit import Fit
|
||||
from service.price import Price
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFMarketPref(PreferenceView):
|
||||
title = "Market & Prices"
|
||||
|
||||
def __init__(self):
|
||||
self.priceSettings = MarketPriceSettings.getInstance()
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.title = _t("Market & Prices")
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.sFit = Fit.getInstance()
|
||||
|
||||
helpCursor = wx.Cursor(wx.CURSOR_QUESTION_ARROW)
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.stTitle = wx.StaticText(panel, wx.ID_ANY, "Market && Prices", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTitle = wx.StaticText(panel, wx.ID_ANY, _t("Market && Prices"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stTitle.Wrap(-1)
|
||||
self.stTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
|
||||
@@ -34,11 +36,12 @@ class PFMarketPref(PreferenceView):
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
delayTimer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
self.stMarketDelay = wx.StaticText(panel, wx.ID_ANY, "Market Search Delay (ms):", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stMarketDelay = wx.StaticText(panel, wx.ID_ANY, _t("Market Search Delay (ms):"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stMarketDelay.Wrap(-1)
|
||||
if "wxGTK" not in wx.PlatformInfo:
|
||||
self.stMarketDelay.SetCursor(helpCursor)
|
||||
self.stMarketDelay.SetToolTip(wx.ToolTip('The delay between a keystroke and the market search. Can help reduce lag when typing fast in the market search box.'))
|
||||
self.stMarketDelay.SetToolTip(wx.ToolTip(
|
||||
_t('The delay between a keystroke and the market search. Can help reduce lag when typing fast in the market search box.')))
|
||||
delayTimer.Add(self.stMarketDelay, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
self.intDelay = IntCtrl(panel, max=1000, limited=True)
|
||||
delayTimer.Add(self.intDelay, 0, wx.ALL, 5)
|
||||
@@ -46,20 +49,20 @@ class PFMarketPref(PreferenceView):
|
||||
self.intDelay.SetValue(self.sFit.serviceFittingOptions["marketSearchDelay"])
|
||||
self.intDelay.Bind(wx.lib.intctrl.EVT_INT, self.onMarketDelayChange)
|
||||
|
||||
self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY, "Show market shortcuts", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbMarketShortcuts = wx.CheckBox(panel, wx.ID_ANY, _t("Show market shortcuts"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbMarketShortcuts, 0, wx.EXPAND | wx.TOP | wx.RIGHT, 10)
|
||||
self.cbMarketShortcuts.SetValue(self.sFit.serviceFittingOptions["showMarketShortcuts"] or False)
|
||||
self.cbMarketShortcuts.Bind(wx.EVT_CHECKBOX, self.onCBShowShortcuts)
|
||||
|
||||
priceSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY, "Default Market Prices:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stDefaultSystem = wx.StaticText(panel, wx.ID_ANY, _t("Default Market Prices:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stDefaultSystem.Wrap(-1)
|
||||
priceSizer.Add(self.stDefaultSystem, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
if "wxGTK" not in wx.PlatformInfo:
|
||||
self.stDefaultSystem.SetCursor(helpCursor)
|
||||
self.stDefaultSystem.SetToolTip(wx.ToolTip(
|
||||
'The source you choose will be tried first, but subsequent sources will be used if the preferred source fails. '
|
||||
'The system you choose will also be tried first, and if no data is available, global price will be used.'))
|
||||
_t('The source you choose will be tried first, but subsequent sources will be used if the preferred source fails. '
|
||||
'The system you choose will also be tried first, and if no data is available, global price will be used.')))
|
||||
self.chPriceSource = wx.Choice(panel, choices=sorted(Price.sources.keys()))
|
||||
self.chPriceSystem = wx.Choice(panel, choices=list(Price.systemsList.keys()))
|
||||
priceSizer.Add(self.chPriceSource, 1, wx.ALL | wx.EXPAND, 5)
|
||||
@@ -70,37 +73,45 @@ class PFMarketPref(PreferenceView):
|
||||
self.chPriceSystem.SetStringSelection(self.sFit.serviceFittingOptions["priceSystem"])
|
||||
self.chPriceSystem.Bind(wx.EVT_CHOICE, self.onPriceSelection)
|
||||
|
||||
self.tbTotalPriceBox = wx.StaticBoxSizer(wx.VERTICAL, panel, "Total Price Includes")
|
||||
self.tbTotalPriceDrones = wx.CheckBox(panel, -1, "Drones", wx.DefaultPosition, wx.DefaultSize, 1)
|
||||
self.tbTotalPriceBox = wx.StaticBoxSizer(wx.VERTICAL, panel, _t("Total Price Includes"))
|
||||
self.tbTotalPriceDrones = wx.CheckBox(panel, -1, _t("Drones"), wx.DefaultPosition, wx.DefaultSize, 1)
|
||||
self.tbTotalPriceDrones.SetValue(self.priceSettings.get("drones"))
|
||||
self.tbTotalPriceDrones.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceDroneChange)
|
||||
self.tbTotalPriceBox.Add(self.tbTotalPriceDrones, 0, wx.LEFT | wx.RIGHT | wx.TOP, 5)
|
||||
self.tbTotalPriceCargo = wx.CheckBox(panel, -1, "Cargo", wx.DefaultPosition, wx.DefaultSize, 1)
|
||||
self.tbTotalPriceCargo = wx.CheckBox(panel, -1, _t("Cargo"), wx.DefaultPosition, wx.DefaultSize, 1)
|
||||
self.tbTotalPriceCargo.SetValue(self.priceSettings.get("cargo"))
|
||||
self.tbTotalPriceCargo.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceCargoChange)
|
||||
self.tbTotalPriceBox.Add(self.tbTotalPriceCargo, 0, wx.LEFT | wx.RIGHT, 5)
|
||||
self.tbTotalPriceCharacter = wx.CheckBox(panel, -1, "Implants && Boosters", wx.DefaultPosition, wx.DefaultSize, 1)
|
||||
self.tbTotalPriceCharacter = wx.CheckBox(panel, -1, _t("Implants && Boosters"), wx.DefaultPosition, wx.DefaultSize, 1)
|
||||
self.tbTotalPriceCharacter.SetValue(self.priceSettings.get("character"))
|
||||
self.tbTotalPriceCharacter.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceCharacterChange)
|
||||
self.tbTotalPriceBox.Add(self.tbTotalPriceCharacter, 0, wx.LEFT | wx.RIGHT | wx.BOTTOM, 5)
|
||||
mainSizer.Add(self.tbTotalPriceBox, 0, wx.EXPAND | wx.TOP | wx.RIGHT, 10)
|
||||
|
||||
self.rbMarketSearch = wx.RadioBox(panel, -1, "Market Search && Recent Items", wx.DefaultPosition, wx.DefaultSize, ["No changes to meta buttons", "Enable all meta buttons for a duration of search / recents", "Enable all meta buttons"], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbMarketSearch = wx.RadioBox(panel, -1, _t("Market Search && Recent Items"), wx.DefaultPosition, wx.DefaultSize,
|
||||
[_t("No changes to meta buttons"), _t("Enable all meta buttons for a duration of search / recents"),
|
||||
_t("Enable all meta buttons")], 1,
|
||||
wx.RA_SPECIFY_COLS)
|
||||
self.rbMarketSearch.SetSelection(self.priceSettings.get('marketMGSearchMode'))
|
||||
mainSizer.Add(self.rbMarketSearch, 0, wx.RIGHT | wx.TOP | wx.EXPAND, 10)
|
||||
self.rbMarketSearch.Bind(wx.EVT_RADIOBOX, self.OnMarketSearchChange)
|
||||
|
||||
self.rbMarketEmpty = wx.RadioBox(panel, -1, "Market Group Selection", wx.DefaultPosition, wx.DefaultSize, ["No changes to meta buttons", "Enable all meta buttons"], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbMarketEmpty = wx.RadioBox(panel, -1, _t("Market Group Selection"), wx.DefaultPosition, wx.DefaultSize,
|
||||
[_t("No changes to meta buttons"), _t("Enable all meta buttons")], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbMarketEmpty.SetSelection(self.priceSettings.get('marketMGMarketSelectMode'))
|
||||
mainSizer.Add(self.rbMarketEmpty, 0, wx.EXPAND | wx.TOP | wx.RIGHT, 10)
|
||||
self.rbMarketEmpty.Bind(wx.EVT_RADIOBOX, self.OnMarketGroupSelectionChange)
|
||||
|
||||
self.rbMarketEmpty = wx.RadioBox(panel, -1, "Empty Market View", wx.DefaultPosition, wx.DefaultSize, ["No changes to meta buttons", "Enable leftmost available meta button", "Enable all available meta buttons"], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbMarketEmpty = wx.RadioBox(panel, -1, _t("Empty Market View"), wx.DefaultPosition, wx.DefaultSize,
|
||||
[_t("No changes to meta buttons"), _t("Enable leftmost available meta button"), _t("Enable all available meta buttons")], 1,
|
||||
wx.RA_SPECIFY_COLS)
|
||||
self.rbMarketEmpty.SetSelection(self.priceSettings.get('marketMGEmptyMode'))
|
||||
mainSizer.Add(self.rbMarketEmpty, 0, wx.EXPAND | wx.TOP | wx.RIGHT, 10)
|
||||
self.rbMarketEmpty.Bind(wx.EVT_RADIOBOX, self.OnMarketEmptyChange)
|
||||
|
||||
self.rbMarketJump = wx.RadioBox(panel, -1, "Item Market Group Jump", wx.DefaultPosition, wx.DefaultSize, ["No changes to meta buttons", "Enable item's meta button", "Enable item's meta button, disable others", "Enable all meta buttons"], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbMarketJump = wx.RadioBox(panel, -1, _t("Item Market Group Jump"), wx.DefaultPosition, wx.DefaultSize,
|
||||
[_t("No changes to meta buttons"), _t("Enable item's meta button"), _t("Enable item's meta button, disable others"),
|
||||
_t("Enable all meta buttons")], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbMarketJump.SetSelection(self.priceSettings.get('marketMGJumpMode'))
|
||||
mainSizer.Add(self.rbMarketJump, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.BOTTOM, 10)
|
||||
self.rbMarketJump.Bind(wx.EVT_RADIOBOX, self.OnMarketJumpChange)
|
||||
|
||||
@@ -8,12 +8,13 @@ import gui.mainFrame
|
||||
from service.settings import NetworkSettings
|
||||
from service.network import Network
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFNetworkPref(PreferenceView):
|
||||
title = "Network"
|
||||
|
||||
def populatePanel(self, panel):
|
||||
|
||||
self.title = _t("Network")
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.settings = NetworkSettings.getInstance()
|
||||
self.network = Network.getInstance()
|
||||
@@ -29,23 +30,23 @@ class PFNetworkPref(PreferenceView):
|
||||
self.m_staticline1 = wx.StaticLine(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
mainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)
|
||||
|
||||
self.cbEnableNetwork = wx.CheckBox(panel, wx.ID_ANY, "Enable Network", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbEnableNetwork = wx.CheckBox(panel, wx.ID_ANY, _t("Enable Network"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
mainSizer.Add(self.cbEnableNetwork, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
subSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
self.cbEve = wx.CheckBox(panel, wx.ID_ANY, "EVE Servers (API && CREST import)", wx.DefaultPosition,
|
||||
self.cbEve = wx.CheckBox(panel, wx.ID_ANY, _t("EVE Servers (API && CREST import)"), wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
subSizer.Add(self.cbEve, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbPricing = wx.CheckBox(panel, wx.ID_ANY, "Pricing updates", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbPricing = wx.CheckBox(panel, wx.ID_ANY, _t("Pricing updates"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
subSizer.Add(self.cbPricing, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.cbPyfaUpdate = wx.CheckBox(panel, wx.ID_ANY, "Pyfa Update checks", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.cbPyfaUpdate = wx.CheckBox(panel, wx.ID_ANY, _t("Pyfa Update checks"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
subSizer.Add(self.cbPyfaUpdate, 0, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
mainSizer.Add(subSizer, 0, wx.LEFT | wx.EXPAND, 30)
|
||||
|
||||
proxyTitle = wx.StaticText(panel, wx.ID_ANY, "Proxy settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
proxyTitle = wx.StaticText(panel, wx.ID_ANY, _t("Proxy settings"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
proxyTitle.Wrap(-1)
|
||||
proxyTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
|
||||
@@ -79,11 +80,11 @@ class PFNetworkPref(PreferenceView):
|
||||
|
||||
ptypeSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.stPType = wx.StaticText(panel, wx.ID_ANY, "Mode:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPType = wx.StaticText(panel, wx.ID_ANY, _t("Mode:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPType.Wrap(-1)
|
||||
ptypeSizer.Add(self.stPType, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
self.chProxyTypeChoices = ["No proxy", "Auto-detected proxy settings", "Manual proxy settings"]
|
||||
self.chProxyTypeChoices = [_t("No proxy"), _t("Auto-detected proxy settings"), _t("Manual proxy settings")]
|
||||
self.chProxyType = wx.Choice(panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.chProxyTypeChoices, 0)
|
||||
|
||||
self.chProxyType.SetSelection(self.nMode)
|
||||
@@ -97,7 +98,7 @@ class PFNetworkPref(PreferenceView):
|
||||
fgAddrSizer.SetFlexibleDirection(wx.BOTH)
|
||||
fgAddrSizer.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
|
||||
|
||||
self.stPSetAddr = wx.StaticText(panel, wx.ID_ANY, "Addr:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetAddr = wx.StaticText(panel, wx.ID_ANY, _t("Addr:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetAddr.Wrap(-1)
|
||||
fgAddrSizer.Add(self.stPSetAddr, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
|
||||
@@ -105,7 +106,7 @@ class PFNetworkPref(PreferenceView):
|
||||
|
||||
fgAddrSizer.Add(self.editProxySettingsAddr, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5)
|
||||
|
||||
self.stPSetPort = wx.StaticText(panel, wx.ID_ANY, "Port:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetPort = wx.StaticText(panel, wx.ID_ANY, _t("Port:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetPort.Wrap(-1)
|
||||
|
||||
fgAddrSizer.Add(self.stPSetPort, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
@@ -117,14 +118,14 @@ class PFNetworkPref(PreferenceView):
|
||||
mainSizer.Add(fgAddrSizer, 0, wx.EXPAND, 5)
|
||||
|
||||
# proxy auth information: login and pass
|
||||
self.stPSetLogin = wx.StaticText(panel, wx.ID_ANY, "Username:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetLogin = wx.StaticText(panel, wx.ID_ANY, _t("Username:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetLogin.Wrap(-1)
|
||||
self.editProxySettingsLogin = wx.TextCtrl(panel, wx.ID_ANY, self.nAuth[0], wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
self.stPSetPassword = wx.StaticText(panel, wx.ID_ANY, "Password:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
0)
|
||||
self.stPSetPassword = wx.StaticText(panel, wx.ID_ANY, _t("Password:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stPSetPassword.Wrap(-1)
|
||||
self.editProxySettingsPassword = wx.TextCtrl(panel, wx.ID_ANY, self.nAuth[1], wx.DefaultPosition,
|
||||
wx.DefaultSize, wx.TE_PASSWORD)
|
||||
wx.DefaultSize, wx.TE_PASSWORD)
|
||||
pAuthSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
pAuthSizer.Add(self.stPSetLogin, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
pAuthSizer.Add(self.editProxySettingsLogin, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
@@ -132,15 +133,15 @@ class PFNetworkPref(PreferenceView):
|
||||
pAuthSizer.Add(self.editProxySettingsPassword, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
|
||||
mainSizer.Add(pAuthSizer, 0, wx.EXPAND, 5)
|
||||
|
||||
self.stPSAutoDetected = wx.StaticText(panel, wx.ID_ANY, "Auto-detected: ", wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
self.stPSAutoDetected = wx.StaticText(panel, wx.ID_ANY, _t("Auto-detected: "), wx.DefaultPosition, wx.DefaultSize,
|
||||
0)
|
||||
self.stPSAutoDetected.Wrap(-1)
|
||||
mainSizer.Add(self.stPSAutoDetected, 0, wx.ALL, 5)
|
||||
|
||||
btnSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
btnSizer.AddStretchSpacer()
|
||||
|
||||
self.btnApply = wx.Button(panel, wx.ID_ANY, "Apply Proxy Settings", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.btnApply = wx.Button(panel, wx.ID_ANY, _t("Apply Proxy Settings"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
|
||||
btnSizer.Add(self.btnApply, 0, wx.ALL, 5)
|
||||
|
||||
@@ -154,7 +155,7 @@ class PFNetworkPref(PreferenceView):
|
||||
else:
|
||||
txt = "None"
|
||||
|
||||
self.stPSAutoDetected.SetLabel("Auto-detected: " + txt)
|
||||
self.stPSAutoDetected.SetLabel(_t("Auto-detected: ") + txt)
|
||||
self.stPSAutoDetected.Disable()
|
||||
|
||||
self.chProxyType.Bind(wx.EVT_CHOICE, self.OnCHProxyTypeSelect)
|
||||
|
||||
@@ -5,9 +5,10 @@ from gui.preferenceView import PreferenceView
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
from service.settings import StatViewSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFStatViewPref(PreferenceView):
|
||||
title = "Statistics Panel"
|
||||
|
||||
def __init__(self):
|
||||
self.dirtySettings = False
|
||||
@@ -18,6 +19,7 @@ class PFStatViewPref(PreferenceView):
|
||||
|
||||
# noinspection PyAttributeOutsideInit
|
||||
def populatePanel(self, panel):
|
||||
self.title = _t("Statistics Panel")
|
||||
mainSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.stTitle = wx.StaticText(panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
@@ -26,7 +28,7 @@ class PFStatViewPref(PreferenceView):
|
||||
mainSizer.Add(self.stTitle, 0, wx.EXPAND | wx.ALL, 5)
|
||||
|
||||
self.stSubTitle = wx.StaticText(panel, wx.ID_ANY,
|
||||
"Changes require restart of pyfa to take effect.",
|
||||
_t("Changes require restart of pyfa to take effect."),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.stSubTitle.Wrap(-1)
|
||||
mainSizer.Add(self.stSubTitle, 0, wx.ALL, 3)
|
||||
@@ -37,21 +39,24 @@ class PFStatViewPref(PreferenceView):
|
||||
|
||||
rbSizerRow1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbResources = wx.RadioBox(panel, -1, "Resources", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbResources = wx.RadioBox(panel, -1, _t("Resources"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
|
||||
wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbResources.EnableItem(1, False)
|
||||
self.rbResources.SetSelection(self.settings.get('resources'))
|
||||
rbSizerRow1.Add(self.rbResources, 1, wx.TOP | wx.RIGHT, 5)
|
||||
self.rbResources.Bind(wx.EVT_RADIOBOX, self.OnResourcesChange)
|
||||
|
||||
self.rbResistances = wx.RadioBox(panel, -1, "Resistances", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbResistances = wx.RadioBox(panel, -1, _t("Resistances"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
|
||||
wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbResistances.EnableItem(1, False)
|
||||
self.rbResistances.SetSelection(self.settings.get('resistances'))
|
||||
rbSizerRow1.Add(self.rbResistances, 1, wx.ALL, 5)
|
||||
self.rbResistances.Bind(wx.EVT_RADIOBOX, self.OnResistancesChange)
|
||||
|
||||
self.rbRecharge = wx.RadioBox(panel, -1, "Shield/Armor Tank", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbRecharge = wx.RadioBox(panel, -1, _t("Shield/Armor Tank"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
|
||||
wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbRecharge.EnableItem(1, False)
|
||||
self.rbRecharge.SetSelection(self.settings.get('recharge'))
|
||||
@@ -63,21 +68,23 @@ class PFStatViewPref(PreferenceView):
|
||||
# Row 2
|
||||
rbSizerRow2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbFirepower = wx.RadioBox(panel, -1, "Firepower", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbFirepower = wx.RadioBox(panel, -1, _t("Firepower"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
|
||||
wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbFirepower.EnableItem(1, False)
|
||||
self.rbFirepower.SetSelection(self.settings.get('firepower'))
|
||||
rbSizerRow2.Add(self.rbFirepower, 1, wx.TOP | wx.RIGHT, 5)
|
||||
self.rbFirepower.Bind(wx.EVT_RADIOBOX, self.OnFirepowerChange)
|
||||
|
||||
self.rbCapacitor = wx.RadioBox(panel, -1, "Capacitor", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbCapacitor = wx.RadioBox(panel, -1, _t("Capacitor"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1,
|
||||
wx.RA_SPECIFY_COLS)
|
||||
# Disable minimal as we don't have a view for this yet
|
||||
self.rbCapacitor.EnableItem(1, False)
|
||||
self.rbCapacitor.SetSelection(self.settings.get('capacitor'))
|
||||
rbSizerRow2.Add(self.rbCapacitor, 1, wx.ALL, 5)
|
||||
self.rbCapacitor.Bind(wx.EVT_RADIOBOX, self.OnCapacitorChange)
|
||||
|
||||
self.rbMisc = wx.RadioBox(panel, -1, "Misc", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbMisc = wx.RadioBox(panel, -1, _t("Misc"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1, wx.RA_SPECIFY_COLS)
|
||||
# Disable full as we don't have a view for this yet
|
||||
self.rbMisc.EnableItem(2, False)
|
||||
self.rbMisc.SetSelection(self.settings.get('targetingMisc'))
|
||||
@@ -89,12 +96,12 @@ class PFStatViewPref(PreferenceView):
|
||||
# Row 3
|
||||
rbSizerRow3 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.rbPrice = wx.RadioBox(panel, -1, "Price", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbPrice = wx.RadioBox(panel, -1, _t("Price"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbPrice.SetSelection(self.settings.get('price'))
|
||||
rbSizerRow3.Add(self.rbPrice, 1, wx.TOP | wx.RIGHT, 5)
|
||||
self.rbPrice.Bind(wx.EVT_RADIOBOX, self.OnPriceChange)
|
||||
|
||||
self.rbOutgoing = wx.RadioBox(panel, -1, "Remote Reps", wx.DefaultPosition, wx.DefaultSize, ['None', 'Minimal', 'Full'], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbOutgoing = wx.RadioBox(panel, -1, _t("Remote Reps"), wx.DefaultPosition, wx.DefaultSize, [_t('None'), _t('Minimal'), _t('Full')], 1, wx.RA_SPECIFY_COLS)
|
||||
self.rbOutgoing.SetSelection(self.settings.get('outgoing'))
|
||||
rbSizerRow3.Add(self.rbOutgoing, 1, wx.TOP | wx.RIGHT, 5)
|
||||
self.rbOutgoing.Bind(wx.EVT_RADIOBOX, self.OnOutgoingChange)
|
||||
|
||||
@@ -5,15 +5,17 @@ from gui.preferenceView import PreferenceView
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
from service.settings import UpdateSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PFUpdatePref(PreferenceView):
|
||||
title = "Updates"
|
||||
desc = ("Pyfa can automatically check and notify you of new releases. "
|
||||
"This feature is toggled in the Network settings. "
|
||||
"Here, you may allow pre-release notifications and view "
|
||||
"suppressed release notifications, if any.")
|
||||
|
||||
def populatePanel(self, panel):
|
||||
self.title = _t("Updates")
|
||||
self.desc = _t("Pyfa can automatically check and notify you of new releases. "
|
||||
"This feature is toggled in the Network settings. "
|
||||
"Here, you may allow pre-release notifications and view "
|
||||
"suppressed release notifications, if any.")
|
||||
self.UpdateSettings = UpdateSettings.getInstance()
|
||||
self.dirtySettings = False
|
||||
|
||||
@@ -33,7 +35,7 @@ class PFUpdatePref(PreferenceView):
|
||||
self.stDesc.Wrap(dlgWidth - 50)
|
||||
mainSizer.Add(self.stDesc, 0, wx.ALL, 5)
|
||||
|
||||
self.suppressPrerelease = wx.CheckBox(panel, wx.ID_ANY, "Allow pre-release notifications", wx.DefaultPosition,
|
||||
self.suppressPrerelease = wx.CheckBox(panel, wx.ID_ANY, _t("Allow pre-release notifications"), wx.DefaultPosition,
|
||||
wx.DefaultSize, 0)
|
||||
self.suppressPrerelease.Bind(wx.EVT_CHECKBOX, self.OnPrereleaseStateChange)
|
||||
self.suppressPrerelease.SetValue(not self.UpdateSettings.get('prerelease'))
|
||||
@@ -43,14 +45,14 @@ class PFUpdatePref(PreferenceView):
|
||||
if self.UpdateSettings.get('version'):
|
||||
self.versionSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.versionTitle = wx.StaticText(panel, wx.ID_ANY, "Suppressing {0} Notifications".format(
|
||||
self.versionTitle = wx.StaticText(panel, wx.ID_ANY, _t("Suppressing {0} Notifications").format(
|
||||
self.UpdateSettings.get('version')), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.versionTitle.Wrap(-1)
|
||||
self.versionTitle.SetFont(wx.Font(12, 70, 90, 90, False, wx.EmptyString))
|
||||
|
||||
self.versionInfo = ("There is a release available which you have chosen to suppress. "
|
||||
"You can choose to reset notification suppression for this release, "
|
||||
"or download the new release from GitHub.")
|
||||
self.versionInfo = _t("There is a release available which you have chosen to suppress. "
|
||||
"You can choose to reset notification suppression for this release, "
|
||||
"or download the new release from GitHub.")
|
||||
|
||||
self.versionSizer.AddStretchSpacer()
|
||||
|
||||
@@ -66,12 +68,12 @@ class PFUpdatePref(PreferenceView):
|
||||
actionSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
resetSizer = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.downloadButton = wx.Button(panel, wx.ID_ANY, "Download", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.downloadButton = wx.Button(panel, wx.ID_ANY, _t("Download"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.downloadButton.Bind(wx.EVT_BUTTON, self.OnDownload)
|
||||
resetSizer.Add(self.downloadButton, 0, wx.ALL, 5)
|
||||
actionSizer.Add(resetSizer, 1, wx.EXPAND, 5)
|
||||
|
||||
self.resetButton = wx.Button(panel, wx.ID_ANY, "Reset Suppression", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.resetButton = wx.Button(panel, wx.ID_ANY, _t("Reset Suppression"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.resetButton.Bind(wx.EVT_BUTTON, self.ResetSuppression)
|
||||
actionSizer.Add(self.resetButton, 0, wx.ALL, 5)
|
||||
self.versionSizer.Add(actionSizer, 0, wx.EXPAND, 5)
|
||||
|
||||
@@ -20,6 +20,7 @@ from service.fit import Fit
|
||||
from .events import BoosterListUpdated, FitSelected, ImportSelected, SearchSelected, Stage3Selected
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class FitItem(SFItem.SFBrowserItem):
|
||||
@@ -103,9 +104,9 @@ class FitItem(SFItem.SFBrowserItem):
|
||||
self.SetDraggable()
|
||||
|
||||
self.boosterBtn = self.toolbar.AddButton(self.boosterBmp, "Booster", show=self.fitBooster)
|
||||
self.toolbar.AddButton(self.copyBmp, "Copy", self.copyBtnCB)
|
||||
self.renameBtn = self.toolbar.AddButton(self.renameBmp, "Rename", self.renameBtnCB)
|
||||
self.toolbar.AddButton(self.deleteBmp, "Delete", self.deleteBtnCB)
|
||||
self.toolbar.AddButton(self.copyBmp, _t("Copy"), self.copyBtnCB)
|
||||
self.renameBtn = self.toolbar.AddButton(self.renameBmp, _t("Rename"), self.renameBtnCB)
|
||||
self.toolbar.AddButton(self.deleteBmp, _t("Delete"), self.deleteBtnCB)
|
||||
|
||||
self.tcFitName = wx.TextCtrl(self, wx.ID_ANY, "%s" % self.fitName, wx.DefaultPosition, (self.editWidth, -1),
|
||||
wx.TE_PROCESS_ENTER)
|
||||
@@ -223,13 +224,13 @@ class FitItem(SFItem.SFBrowserItem):
|
||||
# menu.AppendSubMenu(boosterMenu, 'Set Booster')
|
||||
|
||||
if fit:
|
||||
newTabItem = menu.Append(wx.ID_ANY, "Open in new tab")
|
||||
newTabItem = menu.Append(wx.ID_ANY, _t("Open in new tab"))
|
||||
self.Bind(wx.EVT_MENU, self.OpenNewTab, newTabItem)
|
||||
|
||||
projectedItem = menu.Append(wx.ID_ANY, "Project onto Active Fit")
|
||||
projectedItem = menu.Append(wx.ID_ANY, _t("Project onto Active Fit"))
|
||||
self.Bind(wx.EVT_MENU, self.OnProjectToFit, projectedItem)
|
||||
|
||||
commandItem = menu.Append(wx.ID_ANY, "Add Command Booster")
|
||||
commandItem = menu.Append(wx.ID_ANY, _t("Add Command Booster"))
|
||||
self.Bind(wx.EVT_MENU, self.OnAddCommandFit, commandItem)
|
||||
|
||||
self.PopupMenu(menu, pos)
|
||||
|
||||
@@ -14,8 +14,8 @@ from service.fit import Fit
|
||||
from utils.cjk import isStringCjk
|
||||
from .events import FitSelected, SearchSelected, ImportSelected, Stage1Selected, Stage2Selected, Stage3Selected
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class NavigationPanel(SFItem.SFBrowserItem):
|
||||
@@ -45,20 +45,20 @@ class NavigationPanel(SFItem.SFBrowserItem):
|
||||
self.recentBmp = self.AdjustChannels(self.recentBmpH)
|
||||
self.newBmp = self.AdjustChannels(self.newBmpH)
|
||||
|
||||
self.toolbar.AddButton(self.resetBmp, "Ship groups", clickCallback=self.OnHistoryReset,
|
||||
self.toolbar.AddButton(self.resetBmp, _t("Ship groups"), clickCallback=self.OnHistoryReset,
|
||||
hoverBitmap=self.resetBmpH)
|
||||
self.toolbar.AddButton(self.rewBmp, "Back", clickCallback=self.OnHistoryBack, hoverBitmap=self.rewBmpH)
|
||||
self.btnNew = self.toolbar.AddButton(self.newBmp, "New fitting", clickCallback=self.OnNewFitting,
|
||||
self.toolbar.AddButton(self.rewBmp, _t("Back"), clickCallback=self.OnHistoryBack, hoverBitmap=self.rewBmpH)
|
||||
self.btnNew = self.toolbar.AddButton(self.newBmp, _t("New fitting"), clickCallback=self.OnNewFitting,
|
||||
hoverBitmap=self.newBmpH, show=False)
|
||||
self.btnSwitch = self.toolbar.AddButton(self.switchBmpD, "Hide empty ship groups",
|
||||
self.btnSwitch = self.toolbar.AddButton(self.switchBmpD, _t("Hide empty ship groups"),
|
||||
clickCallback=self.ToggleEmptyGroupsView, hoverBitmap=self.switchBmpH,
|
||||
show=False)
|
||||
self.btnRecent = self.toolbar.AddButton(self.recentBmpD, "Recent Fits",
|
||||
self.btnRecent = self.toolbar.AddButton(self.recentBmpD, _t("Recent Fits"),
|
||||
clickCallback=self.ToggleRecentShips, hoverBitmap=self.recentBmpH,
|
||||
show=True)
|
||||
|
||||
modifier = "CTRL" if 'wxMac' not in wx.PlatformInfo else "CMD"
|
||||
self.toolbar.AddButton(self.searchBmp, "Search fittings ({}+F)".format(modifier), clickCallback=self.ToggleSearchBox,
|
||||
self.toolbar.AddButton(self.searchBmp, _t("Search fittings") + " ({}+F)".format(modifier), clickCallback=self.ToggleSearchBox,
|
||||
hoverBitmap=self.searchBmpH)
|
||||
|
||||
self.padding = 4
|
||||
@@ -70,7 +70,7 @@ class NavigationPanel(SFItem.SFBrowserItem):
|
||||
w, h = size
|
||||
self.BrowserSearchBox = wx.TextCtrl(self, wx.ID_ANY, "", wx.DefaultPosition,
|
||||
(-1, h - 2 if 'wxGTK' in wx.PlatformInfo else -1),
|
||||
(wx.BORDER_NONE if 'wxGTK' in wx.PlatformInfo else 0))
|
||||
(wx.BORDER_NONE if 'wxGTK' in wx.PlatformInfo else 0))
|
||||
self.BrowserSearchBox.Show(False)
|
||||
|
||||
# self.BrowserSearchBox.Bind(wx.EVT_TEXT_ENTER, self.OnBrowserSearchBoxEnter)
|
||||
@@ -126,14 +126,14 @@ class NavigationPanel(SFItem.SFBrowserItem):
|
||||
|
||||
if not toggle:
|
||||
self.shipBrowser.recentFits = False
|
||||
self.btnRecent.label = "Recent Fits"
|
||||
self.btnRecent.label = _t("Recent Fits")
|
||||
self.btnRecent.normalBmp = self.recentBmpD
|
||||
|
||||
if emitEvent:
|
||||
wx.PostEvent(self.shipBrowser, Stage1Selected())
|
||||
else:
|
||||
self.shipBrowser.recentFits = True
|
||||
self.btnRecent.label = "Hide Recent Fits"
|
||||
self.btnRecent.label = _t("Hide Recent Fits")
|
||||
self.btnRecent.normalBmp = self.recentBmp
|
||||
|
||||
if emitEvent:
|
||||
@@ -144,11 +144,11 @@ class NavigationPanel(SFItem.SFBrowserItem):
|
||||
def ToggleEmptyGroupsView(self):
|
||||
if self.shipBrowser.filterShipsWithNoFits:
|
||||
self.shipBrowser.filterShipsWithNoFits = False
|
||||
self.btnSwitch.label = "Hide empty ship groups"
|
||||
self.btnSwitch.label = _t("Hide empty ship groups")
|
||||
self.btnSwitch.normalBmp = self.switchBmpD
|
||||
else:
|
||||
self.shipBrowser.filterShipsWithNoFits = True
|
||||
self.btnSwitch.label = "Show empty ship groups"
|
||||
self.btnSwitch.label = _t("Show empty ship groups")
|
||||
self.btnSwitch.normalBmp = self.switchBmp
|
||||
|
||||
stage = self.shipBrowser.GetActiveStage()
|
||||
|
||||
@@ -15,7 +15,7 @@ from service.market import Market
|
||||
from .events import FitSelected, Stage3Selected
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
class ShipItem(SFItem.SFBrowserItem):
|
||||
|
||||
@@ -108,7 +108,7 @@ class ShipItem(SFItem.SFBrowserItem):
|
||||
def OnShowPopup(self, event):
|
||||
pos = event.GetPosition()
|
||||
pos = self.ScreenToClient(pos)
|
||||
contexts = [("baseShip", "Ship Basic")]
|
||||
contexts = [("baseShip", _t("Ship Basic"))]
|
||||
menu = ContextMenu.getMenu(self, self.baseItem, (self.baseItem,), *contexts)
|
||||
self.PopupMenu(menu, pos)
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ from gui.statsView import StatsView
|
||||
from gui.bitmap_loader import BitmapLoader
|
||||
from gui.utils.numberFormatter import formatAmount, roundToPrec
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class CapacitorViewFull(StatsView):
|
||||
name = "capacitorViewFull"
|
||||
@@ -32,7 +34,7 @@ class CapacitorViewFull(StatsView):
|
||||
self.parent = parent
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Capacitor"
|
||||
return _t("Capacitor")
|
||||
|
||||
def getTextExtentW(self, text):
|
||||
width, height = self.parent.GetTextExtent(text)
|
||||
@@ -52,7 +54,7 @@ class CapacitorViewFull(StatsView):
|
||||
|
||||
sizerCapacitor.Add(baseBox, 0, wx.ALIGN_LEFT)
|
||||
bitmap = BitmapLoader.getStaticBitmap("capacitorInfo_big", parent, "gui")
|
||||
tooltip = wx.ToolTip("Capacitor stability")
|
||||
tooltip = wx.ToolTip(_t("Capacitor stability"))
|
||||
bitmap.SetToolTip(tooltip)
|
||||
baseBox.Add(bitmap, 0, wx.ALIGN_CENTER)
|
||||
|
||||
@@ -62,7 +64,7 @@ class CapacitorViewFull(StatsView):
|
||||
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(hbox, 0, wx.ALIGN_LEFT)
|
||||
|
||||
hbox.Add(wx.StaticText(parent, wx.ID_ANY, "Total: "), 0, wx.ALIGN_LEFT | wx.LEFT, 3)
|
||||
hbox.Add(wx.StaticText(parent, wx.ID_ANY, _t("Total: ")), 0, wx.ALIGN_LEFT | wx.LEFT, 3)
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
|
||||
setattr(self, "label%sCapacitorCapacity" % panel.capitalize(), lbl)
|
||||
hbox.Add(lbl, 0, wx.ALIGN_LEFT)
|
||||
@@ -72,11 +74,11 @@ class CapacitorViewFull(StatsView):
|
||||
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(hbox, 0, wx.ALIGN_LEFT)
|
||||
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "Lasts ")
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, _t("Lasts "))
|
||||
hbox.Add(lbl, 0, wx.ALIGN_LEFT | wx.LEFT, 3)
|
||||
setattr(self, "label%sCapacitorState" % panel.capitalize(), lbl)
|
||||
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0s")
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, _t("0s"))
|
||||
setattr(self, "label%sCapacitorTime" % panel.capitalize(), lbl)
|
||||
hbox.Add(lbl, 0, wx.ALIGN_LEFT)
|
||||
|
||||
@@ -85,7 +87,7 @@ class CapacitorViewFull(StatsView):
|
||||
|
||||
sizerCapacitor.Add(baseBox, 0, wx.ALIGN_CENTER_HORIZONTAL)
|
||||
|
||||
tooltip = wx.ToolTip("Extra stats")
|
||||
tooltip = wx.ToolTip(_t("Extra stats"))
|
||||
bitmap = BitmapLoader.getStaticBitmap("capacitorRecharge_big", parent, "gui")
|
||||
bitmap.SetToolTip(tooltip)
|
||||
baseBox.Add(bitmap, 0, wx.ALIGN_CENTER)
|
||||
@@ -134,10 +136,9 @@ class CapacitorViewFull(StatsView):
|
||||
label.SetToolTip(wx.ToolTip("%.1f" % value))
|
||||
|
||||
if labelName == 'label%sCapacitorDelta' and (cap_recharge or cap_use):
|
||||
lines = []
|
||||
lines.append('Capacitor delta:')
|
||||
lines.append(' +{} GJ/s'.format(formatAmount(cap_recharge, 3, 0, 3)))
|
||||
lines.append(' -{} GJ/s'.format(formatAmount(cap_use, 3, 0, 3)))
|
||||
lines = [_t('Capacitor delta:'),
|
||||
' +{} GJ/s'.format(formatAmount(cap_recharge, 3, 0, 3)),
|
||||
' -{} GJ/s'.format(formatAmount(cap_use, 3, 0, 3))]
|
||||
delta = round(cap_recharge - cap_use, 3)
|
||||
if delta > 0 and 0 < round(neut_res, 4) < 1:
|
||||
lines.append('')
|
||||
@@ -145,9 +146,9 @@ class CapacitorViewFull(StatsView):
|
||||
lines.append(' +{} GJ/s'.format(formatAmount(delta / neut_res, 3, 0, 3)))
|
||||
label.SetToolTip(wx.ToolTip('\n'.join(lines)))
|
||||
if labelName == 'label%sCapacitorResist':
|
||||
texts = ['Neutralizer resistance']
|
||||
texts = [_t('Neutralizer resistance')]
|
||||
if cap_amount > 0 and 0 < round(neut_res, 4) < 1:
|
||||
texts.append('Effective capacity: {} GJ'.format(formatAmount(cap_amount / neut_res, 3, 0, 9)))
|
||||
texts.append(_t('Effective capacity') + ': {} GJ'.format(formatAmount(cap_amount / neut_res, 3, 0, 9)))
|
||||
label.SetToolTip(wx.ToolTip('\n'.join(texts)))
|
||||
|
||||
capState = fit.capState if fit is not None else 0
|
||||
@@ -166,7 +167,7 @@ class CapacitorViewFull(StatsView):
|
||||
else:
|
||||
t = "%ds" % capState
|
||||
|
||||
s = "Stable: " if capStable else "Lasts "
|
||||
s = _t("Stable: ") if capStable else _t("Lasts ")
|
||||
|
||||
getattr(self, lblNameTime % panel).SetLabel(t)
|
||||
getattr(self, lblNameState % panel).SetLabel(s)
|
||||
|
||||
@@ -28,6 +28,8 @@ from gui.statsView import StatsView
|
||||
from gui.utils.numberFormatter import formatAmount, roundToPrec
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class FirepowerViewFull(StatsView):
|
||||
name = "firepowerViewFull"
|
||||
@@ -38,7 +40,7 @@ class FirepowerViewFull(StatsView):
|
||||
self._cachedValues = []
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Firepower"
|
||||
return _t("Firepower")
|
||||
|
||||
def getTextExtentW(self, text):
|
||||
width, height = self.parent.GetTextExtent(text)
|
||||
@@ -62,7 +64,7 @@ class FirepowerViewFull(StatsView):
|
||||
|
||||
counter = 0
|
||||
|
||||
for damageType, image in (("weapon", "turret"), ("drone", "droneDPS")):
|
||||
for label, image, attr in ((_t("Weapon"), "turret", "Weapon"), (_t("Drone"), "droneDPS", "Drone")):
|
||||
baseBox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
sizerFirepower.Add(baseBox, 1, wx.ALIGN_LEFT if counter == 0 else wx.ALIGN_CENTER_HORIZONTAL)
|
||||
|
||||
@@ -71,13 +73,13 @@ class FirepowerViewFull(StatsView):
|
||||
box = wx.BoxSizer(wx.VERTICAL)
|
||||
baseBox.Add(box, 0, wx.ALIGN_CENTER)
|
||||
|
||||
box.Add(wx.StaticText(parent, wx.ID_ANY, damageType.capitalize()), 0, wx.ALIGN_LEFT)
|
||||
box.Add(wx.StaticText(parent, wx.ID_ANY, label), 0, wx.ALIGN_LEFT)
|
||||
|
||||
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(hbox, 1, wx.ALIGN_CENTER)
|
||||
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0 DPS")
|
||||
setattr(self, "label%sDps%s" % (panel.capitalize(), damageType.capitalize()), lbl)
|
||||
setattr(self, "label%sDps%s" % (panel.capitalize(), attr), lbl)
|
||||
|
||||
hbox.Add(lbl, 0, wx.ALIGN_CENTER)
|
||||
self._cachedValues.append(0)
|
||||
@@ -95,14 +97,14 @@ class FirepowerViewFull(StatsView):
|
||||
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
|
||||
setattr(self, "label%sVolleyTotal" % panel.capitalize(), lbl)
|
||||
gridS.Add(wx.StaticText(parent, wx.ID_ANY, " Volley: "), 0, wx.ALL | wx.ALIGN_RIGHT)
|
||||
gridS.Add(wx.StaticText(parent, wx.ID_ANY, _t(" Volley: ")), 0, wx.ALL | wx.ALIGN_RIGHT)
|
||||
gridS.Add(lbl, 0, wx.ALIGN_LEFT)
|
||||
|
||||
self._cachedValues.append(0)
|
||||
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0.0")
|
||||
setattr(self, "label%sDpsTotal" % panel.capitalize(), lbl)
|
||||
gridS.Add(wx.StaticText(parent, wx.ID_ANY, " DPS: "), 0, wx.ALL | wx.ALIGN_RIGHT)
|
||||
gridS.Add(wx.StaticText(parent, wx.ID_ANY, _t(" DPS: ")), 0, wx.ALL | wx.ALIGN_RIGHT)
|
||||
|
||||
self._cachedValues.append(0)
|
||||
|
||||
@@ -110,7 +112,7 @@ class FirepowerViewFull(StatsView):
|
||||
|
||||
image = BitmapLoader.getBitmap("mining_small", "gui")
|
||||
self.miningyield = wx.BitmapButton(contentPanel, -1, image)
|
||||
self.miningyield.SetToolTip(wx.ToolTip("Click to toggle to Mining Yield "))
|
||||
self.miningyield.SetToolTip(wx.ToolTip(_t("Click to toggle to Mining Yield")))
|
||||
self.miningyield.Bind(wx.EVT_BUTTON, self.switchToMiningYieldView)
|
||||
sizerFirepower.Add(self.miningyield, 0, wx.ALIGN_LEFT)
|
||||
|
||||
@@ -164,20 +166,20 @@ class FirepowerViewFull(StatsView):
|
||||
hasSpool = hasSpoolUp(preSpool, fullSpool)
|
||||
lines = []
|
||||
if hasSpool:
|
||||
lines.append("Spool up: {}-{}".format(
|
||||
formatAmount(preSpool.total, prec, lowest, highest),
|
||||
formatAmount(fullSpool.total, prec, lowest, highest)))
|
||||
lines.append(_t("Spool up") + ": {}-{}".format(
|
||||
formatAmount(preSpool.total, prec, lowest, highest),
|
||||
formatAmount(fullSpool.total, prec, lowest, highest)))
|
||||
if getattr(normal, 'total', None):
|
||||
if hasSpool:
|
||||
lines.append("")
|
||||
lines.append("Current: {}".format(formatAmount(normal.total, prec, lowest, highest)))
|
||||
lines.append(_t("Current") + ": {}".format(formatAmount(normal.total, prec, lowest, highest)))
|
||||
for dmgType in normal.names():
|
||||
val = getattr(normal, dmgType, None)
|
||||
if val:
|
||||
lines.append("{}{}: {}%".format(
|
||||
" " if hasSpool else "",
|
||||
dmgType.capitalize(),
|
||||
formatAmount(val / normal.total * 100, 3, 0, 0)))
|
||||
" " if hasSpool else "",
|
||||
_t(dmgType).capitalize(),
|
||||
formatAmount(val / normal.total * 100, 3, 0, 0)))
|
||||
return "\n".join(lines)
|
||||
|
||||
defaultSpoolValue = eos.config.settings['globalDefaultSpoolupPercentage']
|
||||
@@ -216,8 +218,8 @@ class FirepowerViewFull(StatsView):
|
||||
if self._cachedValues[counter] != val:
|
||||
tooltipText = dpsToolTip(val, preSpoolVal, fullSpoolVal, prec, lowest, highest)
|
||||
label.SetLabel(valueFormat.format(
|
||||
formatAmount(0 if val is None else val.total, prec, lowest, highest),
|
||||
"\u02e2" if hasSpoolUp(preSpoolVal, fullSpoolVal) else ""))
|
||||
formatAmount(0 if val is None else val.total, prec, lowest, highest),
|
||||
"\u02e2" if hasSpoolUp(preSpoolVal, fullSpoolVal) else ""))
|
||||
label.SetToolTip(wx.ToolTip(tooltipText))
|
||||
self._cachedValues[counter] = val
|
||||
counter += 1
|
||||
|
||||
@@ -25,6 +25,7 @@ from gui.bitmap_loader import BitmapLoader
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
class MiningYieldViewFull(StatsView):
|
||||
name = "miningyieldViewFull"
|
||||
@@ -35,7 +36,7 @@ class MiningYieldViewFull(StatsView):
|
||||
self._cachedValues = []
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Mining Yield"
|
||||
return _t("Mining Yield")
|
||||
|
||||
def getTextExtentW(self, text):
|
||||
width, height = self.parent.GetTextExtent(text)
|
||||
@@ -64,7 +65,7 @@ class MiningYieldViewFull(StatsView):
|
||||
box = wx.BoxSizer(wx.VERTICAL)
|
||||
baseBox.Add(box, 0, wx.ALIGN_CENTER)
|
||||
|
||||
box.Add(wx.StaticText(parent, wx.ID_ANY, miningType.capitalize()), 0, wx.ALIGN_LEFT)
|
||||
box.Add(wx.StaticText(parent, wx.ID_ANY, _t(miningType).capitalize()), 0, wx.ALIGN_LEFT)
|
||||
|
||||
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(hbox, 1, wx.ALIGN_CENTER)
|
||||
@@ -85,7 +86,7 @@ class MiningYieldViewFull(StatsView):
|
||||
box = wx.BoxSizer(wx.VERTICAL)
|
||||
baseBox.Add(box, 0, wx.EXPAND)
|
||||
|
||||
box.Add(wx.StaticText(parent, wx.ID_ANY, "Total"), 0, wx.ALIGN_LEFT)
|
||||
box.Add(wx.StaticText(parent, wx.ID_ANY, _t("Total")), 0, wx.ALIGN_LEFT)
|
||||
|
||||
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(hbox, 1, wx.EXPAND)
|
||||
@@ -98,7 +99,7 @@ class MiningYieldViewFull(StatsView):
|
||||
|
||||
image = BitmapLoader.getBitmap("turret_small", "gui")
|
||||
firepower = wx.BitmapButton(contentPanel, -1, image)
|
||||
firepower.SetToolTip(wx.ToolTip("Click to toggle to Firepower View"))
|
||||
firepower.SetToolTip(wx.ToolTip(_t("Click to toggle to Firepower View")))
|
||||
firepower.Bind(wx.EVT_BUTTON, self.switchToFirepowerView)
|
||||
sizerMiningYield.Add(firepower, 0, wx.ALIGN_LEFT)
|
||||
|
||||
|
||||
@@ -25,28 +25,29 @@ from gui.utils.numberFormatter import formatAmount, roundToPrec
|
||||
from eos.utils.spoolSupport import SpoolType, SpoolOptions
|
||||
import eos.config
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
stats = [
|
||||
(
|
||||
"labelRemoteCapacitor", "Capacitor:", "{}{} GJ/s", "capacitorInfo", "Capacitor restored",
|
||||
"labelRemoteCapacitor", "Capacitor:", "{}{} GJ/s", "capacitorInfo", _t("Capacitor restored"),
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, spool, False)).capacitor,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)).capacitor,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)).capacitor,
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteShield", "Shield:", "{}{} HP/s", "shieldActive", "Shield restored",
|
||||
"labelRemoteShield", "Shield:", "{}{} HP/s", "shieldActive", _t("Shield restored"),
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, spool, False)).shield,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)).shield,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)).shield,
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteArmor", "Armor:", "{}{} HP/s", "armorActive", "Armor restored",
|
||||
"labelRemoteArmor", "Armor:", "{}{} HP/s", "armorActive", _t("Armor restored"),
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, spool, False)).armor,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)).armor,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)).armor,
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteHull", "Hull:", "{}{} HP/s", "hullActive", "Hull restored",
|
||||
"labelRemoteHull", "Hull:", "{}{} HP/s", "hullActive", _t("Hull restored"),
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, spool, False)).hull,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)).hull,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)).hull,
|
||||
@@ -62,7 +63,7 @@ class OutgoingViewFull(StatsView):
|
||||
self._cachedValues = []
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Remote Reps"
|
||||
return _t("Remote Reps")
|
||||
|
||||
def getTextExtentW(self, text):
|
||||
width, height = self.parent.GetTextExtent(text)
|
||||
|
||||
@@ -24,28 +24,29 @@ from gui.utils.numberFormatter import formatAmount, roundToPrec
|
||||
from eos.utils.spoolSupport import SpoolType, SpoolOptions
|
||||
import eos.config
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
stats = [
|
||||
(
|
||||
"labelRemoteCapacitor", "Capacitor:", "{}{} GJ/s", "capacitorInfo", "Capacitor restored",
|
||||
"labelRemoteCapacitor", "Capacitor:", "{}{} GJ/s", "capacitorInfo", _t("Capacitor restored"),
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, spool, False)).capacitor,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)).capacitor,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)).capacitor,
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteShield", "Shield:", "{}{} HP/s", "shieldActive", "Shield restored",
|
||||
"labelRemoteShield", "Shield:", "{}{} HP/s", "shieldActive", _t("Shield restored"),
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, spool, False)).shield,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)).shield,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)).shield,
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteArmor", "Armor:", "{}{} HP/s", "armorActive", "Armor restored",
|
||||
"labelRemoteArmor", "Armor:", "{}{} HP/s", "armorActive", _t("Armor restored"),
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, spool, False)).armor,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)).armor,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)).armor,
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteHull", "Hull:", "{}{} HP/s", "hullActive", "Hull restored",
|
||||
"labelRemoteHull", "Hull:", "{}{} HP/s", "hullActive", _t("Hull restored"),
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, spool, False)).hull,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 0, True)).hull,
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SPOOL_SCALE, 1, True)).hull,
|
||||
@@ -61,7 +62,7 @@ class OutgoingViewMinimal(StatsView):
|
||||
self._cachedValues = []
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Remote Reps"
|
||||
return _t("Remote Reps")
|
||||
|
||||
def getTextExtentW(self, text):
|
||||
width, height = self.parent.GetTextExtent(text)
|
||||
|
||||
@@ -25,6 +25,8 @@ from gui.utils.numberFormatter import formatAmount
|
||||
from service.price import Fit, Price
|
||||
from service.settings import MarketPriceSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PriceViewFull(StatsView):
|
||||
name = "priceViewFull"
|
||||
@@ -35,7 +37,7 @@ class PriceViewFull(StatsView):
|
||||
self.settings = MarketPriceSettings.getInstance()
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Price"
|
||||
return _t("Price")
|
||||
|
||||
def populatePanel(self, contentPanel, headerPanel):
|
||||
contentSizer = contentPanel.GetSizer()
|
||||
@@ -51,7 +53,10 @@ class PriceViewFull(StatsView):
|
||||
|
||||
gridPrice = wx.GridSizer(2, 3, 0, 0)
|
||||
contentSizer.Add(gridPrice, 0, wx.EXPAND | wx.ALL, 0)
|
||||
for _type in ("ship", "fittings", "character", "drones", "cargoBay", "total"):
|
||||
for _type, label in (
|
||||
("ship", _t("Ship")), ("fittings", _t("Fittings")), ("character", _t("Character")),
|
||||
("drones", _t("Drones")), ("cargoBay", _t("Cargo bay")), ("total", _t("Total"))
|
||||
):
|
||||
if _type in "ship":
|
||||
image = "ship_big"
|
||||
elif _type in ("fittings", "total"):
|
||||
@@ -67,7 +72,7 @@ class PriceViewFull(StatsView):
|
||||
vbox = wx.BoxSizer(wx.VERTICAL)
|
||||
box.Add(vbox, 1, wx.EXPAND)
|
||||
|
||||
vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, _type.capitalize()), 0, wx.ALIGN_LEFT)
|
||||
vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, label.capitalize()), 0, wx.ALIGN_LEFT)
|
||||
|
||||
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
vbox.Add(hbox)
|
||||
|
||||
@@ -25,6 +25,8 @@ from gui.utils.numberFormatter import formatAmount
|
||||
from service.price import Fit, Price
|
||||
from service.settings import MarketPriceSettings
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class PriceViewMinimal(StatsView):
|
||||
name = "priceViewMinimal"
|
||||
@@ -51,7 +53,9 @@ class PriceViewMinimal(StatsView):
|
||||
|
||||
gridPrice = wx.GridSizer(1, 3, 0, 0)
|
||||
contentSizer.Add(gridPrice, 0, wx.EXPAND | wx.ALL, 0)
|
||||
for _type in ("ship", "fittings", "total"):
|
||||
for _type, label in (
|
||||
("ship", _t("Ship")), ("fittings", _t("Fittings")), ("total", _t("Total"))
|
||||
):
|
||||
image = "%sPrice_big" % _type if _type != "ship" else "ship_big"
|
||||
box = wx.BoxSizer(wx.HORIZONTAL)
|
||||
gridPrice.Add(box, 0, wx.ALIGN_TOP)
|
||||
@@ -61,7 +65,7 @@ class PriceViewMinimal(StatsView):
|
||||
vbox = wx.BoxSizer(wx.VERTICAL)
|
||||
box.Add(vbox, 1, wx.EXPAND)
|
||||
|
||||
vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, _type.capitalize()), 0, wx.ALIGN_LEFT)
|
||||
vbox.Add(wx.StaticText(contentPanel, wx.ID_ANY, label), 0, wx.ALIGN_LEFT)
|
||||
|
||||
hbox = wx.BoxSizer(wx.HORIZONTAL)
|
||||
vbox.Add(hbox)
|
||||
|
||||
@@ -27,6 +27,8 @@ from gui.statsView import StatsView
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
from service.fit import Fit
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class RechargeViewFull(StatsView):
|
||||
name = "rechargeViewFull"
|
||||
@@ -38,7 +40,7 @@ class RechargeViewFull(StatsView):
|
||||
self.mainFrame.Bind(GE.EFFECTIVE_HP_TOGGLED, self.toggleEffective)
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Recharge rates"
|
||||
return _t("Recharge rates")
|
||||
|
||||
def getTextExtentW(self, text):
|
||||
width, height = self.parent.GetTextExtent(text)
|
||||
@@ -70,10 +72,10 @@ class RechargeViewFull(StatsView):
|
||||
# Add an empty label first for correct alignment.
|
||||
sizerTankStats.Add(wx.StaticText(contentPanel, wx.ID_ANY, ""), 0)
|
||||
toolTipText = {
|
||||
"shieldPassive": "Passive shield recharge",
|
||||
"shieldActive": "Active shield boost",
|
||||
"armorActive": "Armor repair amount",
|
||||
"hullActive": "Hull repair amount"}
|
||||
"shieldPassive": _t("Passive shield recharge"),
|
||||
"shieldActive": _t("Active shield boost"),
|
||||
"armorActive": _t("Armor repair amount"),
|
||||
"hullActive": _t("Hull repair amount")}
|
||||
for tankType in ("shieldPassive", "shieldActive", "armorActive", "hullActive"):
|
||||
bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui")
|
||||
tooltip = wx.ToolTip(toolTipText[tankType])
|
||||
@@ -81,8 +83,8 @@ class RechargeViewFull(StatsView):
|
||||
sizerTankStats.Add(bitmap, 0, wx.ALIGN_CENTER)
|
||||
|
||||
toolTipText = {
|
||||
"reinforced": "Reinforced",
|
||||
"sustained": "Sustained"}
|
||||
"reinforced": _t("Reinforced"),
|
||||
"sustained": _t("Sustained")}
|
||||
for stability in ("reinforced", "sustained"):
|
||||
bitmap = BitmapLoader.getStaticBitmap("regen%s_big" % stability.capitalize(), contentPanel, "gui")
|
||||
tooltip = wx.ToolTip(toolTipText[stability])
|
||||
|
||||
@@ -28,6 +28,8 @@ from gui.statsView import StatsView
|
||||
from gui.utils import fonts
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ResistancesViewFull(StatsView):
|
||||
name = "resistancesViewFull"
|
||||
@@ -42,7 +44,7 @@ class ResistancesViewFull(StatsView):
|
||||
self.mainFrame.Bind(GE.EFFECTIVE_HP_TOGGLED, self.ehpSwitch)
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Resistances"
|
||||
return _t("Resistances")
|
||||
|
||||
def getTextExtentW(self, text):
|
||||
width, height = self.parent.GetTextExtent(text)
|
||||
@@ -56,7 +58,7 @@ class ResistancesViewFull(StatsView):
|
||||
# Custom header EHP
|
||||
headerContentSizer = self.headerPanel.Parent.GetHeaderContentSizer()
|
||||
|
||||
self.stEff = wx.StaticText(headerPanel, wx.ID_ANY, "( Effective HP: ")
|
||||
self.stEff = wx.StaticText(headerPanel, wx.ID_ANY, "(" + _t("Effective HP: "))
|
||||
headerContentSizer.Add(self.stEff)
|
||||
headerPanel.GetParent().AddToggleItem(self.stEff)
|
||||
|
||||
@@ -64,7 +66,7 @@ class ResistancesViewFull(StatsView):
|
||||
headerContentSizer.Add(self.labelEhp, 0)
|
||||
headerPanel.GetParent().AddToggleItem(self.labelEhp)
|
||||
|
||||
stCls = wx.StaticText(headerPanel, wx.ID_ANY, " )")
|
||||
stCls = wx.StaticText(headerPanel, wx.ID_ANY, ")")
|
||||
|
||||
headerPanel.GetParent().AddToggleItem(stCls)
|
||||
headerContentSizer.Add(stCls)
|
||||
@@ -79,16 +81,20 @@ class ResistancesViewFull(StatsView):
|
||||
# Add an empty label, then the rest.
|
||||
sizerResistances.Add(wx.StaticText(contentPanel, wx.ID_ANY), wx.GBPosition(row, col), wx.GBSpan(1, 1))
|
||||
col += 1
|
||||
toolTipText = {"em": "Electromagnetic resistance", "thermal": "Thermal resistance",
|
||||
"kinetic": "Kinetic resistance", "explosive": "Explosive resistance"}
|
||||
toolTipText = {
|
||||
"em": _t("Electromagnetic resistance"),
|
||||
"thermal": _t("Thermal resistance"),
|
||||
"kinetic": _t("Kinetic resistance"),
|
||||
"explosive": _t("Explosive resistance")
|
||||
}
|
||||
for damageType in ("em", "thermal", "kinetic", "explosive"):
|
||||
bitmap = BitmapLoader.getStaticBitmap("%s_big" % damageType, contentPanel, "gui")
|
||||
tooltip = wx.ToolTip(toolTipText[damageType])
|
||||
bitmap.SetToolTip(tooltip)
|
||||
sizerResistances.Add(bitmap, wx.GBPosition(row, col), wx.GBSpan(1, 1), wx.ALIGN_CENTER)
|
||||
col += 1
|
||||
self.stEHPs = wx.Button(contentPanel, style=wx.BU_EXACTFIT, label="EHP")
|
||||
self.stEHPs.SetToolTip(wx.ToolTip("Click to toggle between effective HP and raw HP"))
|
||||
self.stEHPs = wx.Button(contentPanel, style=wx.BU_EXACTFIT, label=_t("EHP"))
|
||||
self.stEHPs.SetToolTip(wx.ToolTip(_t("Click to toggle between effective HP and raw HP")))
|
||||
|
||||
self.stEHPs.Bind(wx.EVT_BUTTON, self.toggleEHP)
|
||||
|
||||
@@ -102,8 +108,12 @@ class ResistancesViewFull(StatsView):
|
||||
gaugeColours = (((38, 133, 198), (52, 86, 98)), ((198, 38, 38), (83, 65, 67)), ((163, 163, 163), (74, 90, 93)),
|
||||
((198, 133, 38), (81, 83, 67)))
|
||||
|
||||
toolTipText = {"shield": "Shield resistance", "armor": "Armor resistance", "hull": "Hull resistance",
|
||||
"damagePattern": "Incoming damage pattern"}
|
||||
toolTipText = {
|
||||
"shield": _t("Shield resistance"),
|
||||
"armor": _t("Armor resistance"),
|
||||
"hull": _t("Hull resistance"),
|
||||
"damagePattern": _t("Incoming damage pattern")
|
||||
}
|
||||
for tankType in ("shield", "armor", "hull", "separator", "damagePattern"):
|
||||
if tankType != "separator":
|
||||
bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui")
|
||||
@@ -156,10 +166,10 @@ class ResistancesViewFull(StatsView):
|
||||
row += 1
|
||||
col = 0
|
||||
|
||||
self.stEHPs.SetToolTip(wx.ToolTip("Click to toggle between effective HP and raw HP"))
|
||||
self.stEHPs.SetToolTip(wx.ToolTip(_t("Click to toggle between effective HP and raw HP")))
|
||||
|
||||
def toggleEHP(self, event):
|
||||
wx.PostEvent(self.mainFrame, GE.EffectiveHpToggled(effective=self.stEHPs.GetLabel() == "HP"))
|
||||
wx.PostEvent(self.mainFrame, GE.EffectiveHpToggled(effective=self.stEHPs.GetLabel() == _t("HP")))
|
||||
|
||||
def ehpSwitch(self, event):
|
||||
event.Skip()
|
||||
@@ -174,7 +184,7 @@ class ResistancesViewFull(StatsView):
|
||||
wx.PostEvent(self.mainFrame, GE.EffectiveHpToggled(effective=True))
|
||||
return
|
||||
|
||||
self.stEHPs.SetLabel("EHP" if self.showEffective else "HP")
|
||||
self.stEHPs.SetLabel(_t("EHP") if self.showEffective else _t("HP"))
|
||||
self.activeFit = fit.ID if fit is not None else None
|
||||
|
||||
for tankType in ("shield", "armor", "hull"):
|
||||
@@ -193,24 +203,24 @@ class ResistancesViewFull(StatsView):
|
||||
|
||||
ehp = (fit.ehp if self.showEffective else fit.hp) if fit is not None else None
|
||||
total = 0
|
||||
for tankType in ("shield", "armor", "hull"):
|
||||
for tankType, tooltip in (("shield", _t("Shield: ")), ("armor", _t("Armor: ")), ("hull", _t("Hull: "))):
|
||||
lbl = getattr(self, "labelResistance%sEhp" % tankType.capitalize())
|
||||
if ehp is not None:
|
||||
total += ehp[tankType]
|
||||
rrFactor = fit.ehp[tankType] / fit.hp[tankType]
|
||||
lbl.SetLabel(formatAmount(ehp[tankType], 3, 0, 9))
|
||||
lbl.SetToolTip(
|
||||
wx.ToolTip("%s: %d\nResist Multiplier: x%.2f" % (tankType.capitalize(), ehp[tankType], rrFactor)))
|
||||
wx.ToolTip(tooltip + "%d\n" % ehp[tankType] + _t("Resist Multiplier: ") + "%.2fx" % rrFactor))
|
||||
else:
|
||||
lbl.SetLabel("0")
|
||||
|
||||
self.labelEhp.SetLabel("%s" % formatAmount(total, 3, 0, 9))
|
||||
if self.showEffective:
|
||||
self.stEff.SetLabel("( Effective HP: ")
|
||||
self.labelEhp.SetToolTip(wx.ToolTip("Effective: %d HP" % total))
|
||||
self.stEff.SetLabel("(" + _t("Effective HP: "))
|
||||
self.labelEhp.SetToolTip(wx.ToolTip(_t("Effective: %d HP") % total))
|
||||
else:
|
||||
self.stEff.SetLabel("( Raw HP: ")
|
||||
self.labelEhp.SetToolTip(wx.ToolTip("Raw: %d HP" % total))
|
||||
self.stEff.SetLabel("(" + _t("Raw HP: "))
|
||||
self.labelEhp.SetToolTip(wx.ToolTip(_t("Raw: %d HP") % total))
|
||||
|
||||
damagePattern = fit.damagePattern if fit is not None and self.showEffective else None
|
||||
total = sum((damagePattern.emAmount, damagePattern.thermalAmount,
|
||||
|
||||
@@ -30,6 +30,8 @@ from eos.const import FittingHardpoint
|
||||
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class ResourcesViewFull(StatsView):
|
||||
name = "resourcesViewFull"
|
||||
@@ -79,7 +81,7 @@ class ResourcesViewFull(StatsView):
|
||||
self.headerPanel.Layout()
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Resources"
|
||||
return _t("Resources")
|
||||
|
||||
def getTextExtentW(self, text):
|
||||
width, height = self.parent.GetTextExtent(text)
|
||||
@@ -105,8 +107,13 @@ class ResourcesViewFull(StatsView):
|
||||
base = sizerResources
|
||||
sizer.AddStretchSpacer()
|
||||
# Turrets & launcher hardslots display
|
||||
tooltipText = {"turret": "Turret hardpoints", "launcher": "Launcher hardpoints", "drones": "Drones active",
|
||||
"fighter": "Fighter squadrons active", "calibration": "Calibration"}
|
||||
tooltipText = {
|
||||
"turret": _t("Turret hardpoints"),
|
||||
"launcher": _t("Launcher hardpoints"),
|
||||
"drones": _t("Drones active"),
|
||||
"fighter": _t("Fighter squadrons active"),
|
||||
"calibration": _t("Calibration")
|
||||
}
|
||||
for type_ in ("turret", "launcher", "drones", "fighter", "calibration"):
|
||||
box = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
@@ -118,8 +125,10 @@ class ResourcesViewFull(StatsView):
|
||||
|
||||
sizer.Add(box, 0, wx.ALIGN_CENTER)
|
||||
|
||||
suffix = {'turret': 'Hardpoints', 'launcher': 'Hardpoints', 'drones': 'Active', 'fighter': 'Tubes',
|
||||
'calibration': 'Points'}
|
||||
suffix = {
|
||||
'turret': 'Hardpoints', 'launcher': 'Hardpoints', 'drones': 'Active', 'fighter': 'Tubes',
|
||||
'calibration': 'Points'
|
||||
}
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, "0")
|
||||
setattr(self, "label%sUsed%s%s" % (panel.capitalize(), type_.capitalize(), suffix[type_].capitalize()), lbl)
|
||||
box.Add(lbl, 0, wx.ALIGN_CENTER | wx.LEFT, 5)
|
||||
@@ -140,8 +149,14 @@ class ResourcesViewFull(StatsView):
|
||||
gauge_font = wx.Font(fonts.NORMAL, wx.SWISS, wx.NORMAL, wx.NORMAL, False)
|
||||
|
||||
# PG, Cpu & drone stuff
|
||||
tooltipText = {"cpu": "CPU", "pg": "PowerGrid", "droneBay": "Drone bay", "fighterBay": "Fighter bay",
|
||||
"droneBandwidth": "Drone bandwidth", "cargoBay": "Cargo bay"}
|
||||
tooltipText = {
|
||||
"cpu": _t("CPU"),
|
||||
"pg": _t("PowerGrid"),
|
||||
"droneBay": _t("Drone bay"),
|
||||
"fighterBay": _t("Fighter bay"),
|
||||
"droneBandwidth": _t("Drone bandwidth"),
|
||||
"cargoBay": _t("Cargo bay")
|
||||
}
|
||||
for i, group in enumerate((("cpu", "pg"), ("cargoBay", "droneBay", "fighterBay", "droneBandwidth"))):
|
||||
main = wx.BoxSizer(wx.VERTICAL)
|
||||
base.Add(main, 1, wx.ALIGN_CENTER)
|
||||
|
||||
@@ -17,11 +17,15 @@
|
||||
# along with pyfa. If not, see <http://www.gnu.org/licenses/>.
|
||||
# =============================================================================
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
import wx
|
||||
|
||||
from gui.statsView import StatsView
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
from collections import OrderedDict
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class TargetingMiscViewMinimal(StatsView):
|
||||
@@ -33,7 +37,7 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
self._cachedValues = []
|
||||
|
||||
def getHeaderText(self, fit):
|
||||
return "Targeting && Misc"
|
||||
return _t("Targeting && Misc")
|
||||
|
||||
def getTextExtentW(self, text):
|
||||
width, height = self.parent.GetTextExtent(text)
|
||||
@@ -55,11 +59,11 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
|
||||
gridTargetingMisc.Add(gridTargeting, 0, wx.ALIGN_LEFT | wx.ALL, 5)
|
||||
|
||||
labels = (("Targets", "Targets", ""),
|
||||
("Range", "Range", "km"),
|
||||
("Scan res.", "ScanRes", "mm"),
|
||||
("Sensor str.", "SensorStr", ""),
|
||||
("Drone range", "CtrlRange", "km"))
|
||||
labels = ((_t("Targets"), "Targets", ""),
|
||||
(_t("Range"), "Range", "km"),
|
||||
(_t("Scan res."), "ScanRes", "mm"),
|
||||
(_t("Sensor str."), "SensorStr", ""),
|
||||
(_t("Drone range"), "CtrlRange", "km"))
|
||||
|
||||
for header, labelShort, unit in labels:
|
||||
gridTargeting.Add(wx.StaticText(contentPanel, wx.ID_ANY, "%s: " % header), 0, wx.ALIGN_LEFT)
|
||||
@@ -79,11 +83,11 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
gridMisc.AddGrowableCol(1)
|
||||
gridTargetingMisc.Add(gridMisc, 0, wx.ALIGN_LEFT | wx.ALL, 5)
|
||||
|
||||
labels = (("Speed", "Speed", "m/s"),
|
||||
("Align time", "AlignTime", "s"),
|
||||
("Signature", "SigRadius", "m"),
|
||||
("Warp Speed", "WarpSpeed", "AU/s"),
|
||||
("Cargo", "Cargo", "m\u00B3"))
|
||||
labels = ((_t("Speed"), "Speed", "m/s"),
|
||||
(_t("Align time"), "AlignTime", "s"),
|
||||
(_t("Signature"), "SigRadius", "m"),
|
||||
(_t("Warp Speed"), "WarpSpeed", "AU/s"),
|
||||
(_t("Cargo"), "Cargo", "m\u00B3"))
|
||||
|
||||
for header, labelShort, unit in labels:
|
||||
gridMisc.Add(wx.StaticText(contentPanel, wx.ID_ANY, "%s: " % header), 0, wx.ALIGN_LEFT)
|
||||
@@ -102,26 +106,27 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
|
||||
sensorValues = {
|
||||
"main": lambda: fit.scanStrength,
|
||||
"jamChance": lambda: fit.jamChance}
|
||||
"jamChance": lambda: fit.jamChance
|
||||
}
|
||||
|
||||
cargoNamesOrder = OrderedDict((
|
||||
("fleetHangarCapacity", "Fleet hangar"),
|
||||
("shipMaintenanceBayCapacity", "Maintenance bay"),
|
||||
("specialAmmoHoldCapacity", "Ammo hold"),
|
||||
("specialFuelBayCapacity", "Fuel bay"),
|
||||
("specialShipHoldCapacity", "Ship hold"),
|
||||
("specialSmallShipHoldCapacity", "Small ship hold"),
|
||||
("specialMediumShipHoldCapacity", "Medium ship hold"),
|
||||
("specialLargeShipHoldCapacity", "Large ship hold"),
|
||||
("specialIndustrialShipHoldCapacity", "Industrial ship hold"),
|
||||
("specialOreHoldCapacity", "Ore hold"),
|
||||
("specialMineralHoldCapacity", "Mineral hold"),
|
||||
("specialMaterialBayCapacity", "Material bay"),
|
||||
("specialGasHoldCapacity", "Gas hold"),
|
||||
("specialSalvageHoldCapacity", "Salvage hold"),
|
||||
("specialCommandCenterHoldCapacity", "Command center hold"),
|
||||
("specialPlanetaryCommoditiesHoldCapacity", "Planetary goods hold"),
|
||||
("specialQuafeHoldCapacity", "Quafe hold")))
|
||||
("fleetHangarCapacity", _t("Fleet hangar")),
|
||||
("shipMaintenanceBayCapacity", _t("Maintenance bay")),
|
||||
("specialAmmoHoldCapacity", _t("Ammo hold")),
|
||||
("specialFuelBayCapacity", _t("Fuel bay")),
|
||||
("specialShipHoldCapacity", _t("Ship hold")),
|
||||
("specialSmallShipHoldCapacity", _t("Small ship hold")),
|
||||
("specialMediumShipHoldCapacity", _t("Medium ship hold")),
|
||||
("specialLargeShipHoldCapacity", _t("Large ship hold")),
|
||||
("specialIndustrialShipHoldCapacity", _t("Industrial ship hold")),
|
||||
("specialOreHoldCapacity", _t("Ore hold")),
|
||||
("specialMineralHoldCapacity", _t("Mineral hold")),
|
||||
("specialMaterialBayCapacity", _t("Material bay")),
|
||||
("specialGasHoldCapacity", _t("Gas hold")),
|
||||
("specialSalvageHoldCapacity", _t("Salvage hold")),
|
||||
("specialCommandCenterHoldCapacity", _t("Command center hold")),
|
||||
("specialPlanetaryCommoditiesHoldCapacity", _t("Planetary goods hold")),
|
||||
("specialQuafeHoldCapacity", _t("Quafe hold"))))
|
||||
|
||||
cargoValues = {
|
||||
"main": lambda: fit.ship.getModifiedItemAttr("capacity"),
|
||||
@@ -141,7 +146,8 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
"specialSalvageHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialSalvageHoldCapacity"),
|
||||
"specialCommandCenterHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialCommandCenterHoldCapacity"),
|
||||
"specialPlanetaryCommoditiesHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialPlanetaryCommoditiesHoldCapacity"),
|
||||
"specialQuafeHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialQuafeHoldCapacity")}
|
||||
"specialQuafeHoldCapacity": lambda: fit.ship.getModifiedItemAttr("specialQuafeHoldCapacity")
|
||||
}
|
||||
|
||||
stats = (("labelTargets", {"main": lambda: fit.maxTargets}, 3, 0, 0, ""),
|
||||
("labelRange", {"main": lambda: fit.maxTargetRange / 1000}, 3, 0, 0, "km"),
|
||||
@@ -155,10 +161,10 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
("labelFullCargo", cargoValues, 4, 0, 9, "m\u00B3"))
|
||||
|
||||
counter = 0
|
||||
RADII = [("Pod", 25), ("Interceptor", 33), ("Frigate", 38),
|
||||
("Destroyer", 83), ("Cruiser", 130),
|
||||
("Battlecruiser", 265), ("Battleship", 420),
|
||||
("Carrier", 3000)]
|
||||
RADII = [(_t("Pod"), 25), (_t("Interceptor"), 33), (_t("Frigate"), 38),
|
||||
(_t("Destroyer"), 83), (_t("Cruiser"), 130),
|
||||
(_t("Battlecruiser"), 265), (_t("Battleship"), 420),
|
||||
(_t("Carrier"), 3000)]
|
||||
for labelName, valueDict, prec, lowest, highest, unit in stats:
|
||||
label = getattr(self, labelName)
|
||||
newValues = {}
|
||||
@@ -183,8 +189,8 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
ecmChance = round(ecmChance, 1)
|
||||
if ecmChance:
|
||||
label.SetLabel("{} ({}%)".format(
|
||||
formatAmount(mainValue, prec, lowest, highest),
|
||||
formatAmount(ecmChance, 3, 0, 0)))
|
||||
formatAmount(mainValue, prec, lowest, highest),
|
||||
formatAmount(ecmChance, 3, 0, 0)))
|
||||
else:
|
||||
label.SetLabel("{}".format(formatAmount(mainValue, prec, lowest, highest)))
|
||||
else:
|
||||
@@ -192,35 +198,35 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
# Tooltip stuff
|
||||
if fit:
|
||||
if labelName == "labelScanRes":
|
||||
lockTime = "%s\n" % "Lock Times".center(30)
|
||||
lockTime = "%s\n" % _t("Lock Times").center(30)
|
||||
for size, radius in RADII:
|
||||
left = "%.1fs" % fit.calculateLockTime(radius)
|
||||
right = "%s [%d]" % (size, radius)
|
||||
lockTime += "%5s\t%s\n" % (left, right)
|
||||
label.SetToolTip(wx.ToolTip(lockTime))
|
||||
elif labelName == "labelFullWarpSpeed":
|
||||
maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance
|
||||
maxWarpDistance = _t("Max Warp Distance: %.1f AU") % fit.maxWarpDistance
|
||||
if fit.ship.getModifiedItemAttr("warpScrambleStatus"):
|
||||
warpScrambleStatus = "Warp Core Strength: %.1f" % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1)
|
||||
warpScrambleStatus = _t("Warp Core Strength: %.1f") % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1)
|
||||
else:
|
||||
warpScrambleStatus = "Warp Core Strength: %.1f" % 0
|
||||
warpScrambleStatus = _t("Warp Core Strength: %.1f") % 0
|
||||
label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus)))
|
||||
elif labelName == "labelSensorStr":
|
||||
ecmChance = otherValues["jamChance"]
|
||||
ecmChance = round(ecmChance, 1)
|
||||
if ecmChance > 0:
|
||||
label.SetToolTip(wx.ToolTip("Type: {}\n{}% chance to be jammed".format(
|
||||
fit.scanType,
|
||||
formatAmount(ecmChance, 3, 0, 0))))
|
||||
label.SetToolTip(wx.ToolTip(_t("Type: {0}\n").foramt(_t(fit.scanType)) +
|
||||
# xgettext:no-python-format,python-brace-format
|
||||
_t("{}% chance to be jammed").format(formatAmount(ecmChance, 3, 0, 0))))
|
||||
else:
|
||||
label.SetToolTip(wx.ToolTip("Type: {}".format(fit.scanType)))
|
||||
label.SetToolTip(wx.ToolTip(_t("Type: {}").format(_t(fit.scanType))))
|
||||
elif labelName == "labelFullAlignTime":
|
||||
alignTime = "Align:\t%.3fs" % mainValue
|
||||
mass = 'Mass:\t{:,.0f}kg'.format(fit.ship.getModifiedItemAttr("mass"))
|
||||
agility = "Agility:\t%.3fx" % (fit.ship.getModifiedItemAttr("agility") or 0)
|
||||
alignTime = _t("Align:\t%.3fs") % mainValue
|
||||
mass = _t('Mass:\t{:,.0f}kg').format(fit.ship.getModifiedItemAttr("mass"))
|
||||
agility = _t("Agility:\t%.3fx") % (fit.ship.getModifiedItemAttr("agility") or 0)
|
||||
label.SetToolTip(wx.ToolTip("%s\n%s\n%s" % (alignTime, mass, agility)))
|
||||
elif labelName == "labelFullCargo":
|
||||
tipLines = ["Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, newValues["main"])]
|
||||
tipLines = [_t("Cargohold: ") + "{:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, newValues["main"])]
|
||||
for attrName, tipAlias in list(cargoNamesOrder.items()):
|
||||
if newValues[attrName] > 0:
|
||||
tipLines.append("{}: {:,.2f}m\u00B3".format(tipAlias, newValues[attrName]))
|
||||
@@ -232,11 +238,11 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
self._cachedValues[counter] = newValues
|
||||
elif labelName == "labelFullWarpSpeed":
|
||||
if fit:
|
||||
maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance
|
||||
maxWarpDistance = _t("Max Warp Distance: %.1f AU") % fit.maxWarpDistance
|
||||
if fit.ship.getModifiedItemAttr("warpScrambleStatus"):
|
||||
warpScrambleStatus = "Warp Core Strength: %.1f" % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1)
|
||||
warpScrambleStatus = _t("Warp Core Strength: %.1f") % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1)
|
||||
else:
|
||||
warpScrambleStatus = "Warp Core Strength: %.1f" % 0
|
||||
warpScrambleStatus = _t("Warp Core Strength: %.1f") % 0
|
||||
label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus)))
|
||||
else:
|
||||
label.SetToolTip(wx.ToolTip(""))
|
||||
@@ -245,7 +251,7 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
cachedCargo = self._cachedValues[counter]
|
||||
# if you add stuff to cargo, the capacity doesn't change and thus it is still cached
|
||||
# This assures us that we force refresh of cargo tooltip
|
||||
tipLines = ["Cargohold: {:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, cachedCargo["main"])]
|
||||
tipLines = [_t("Cargohold: ") + "{:,.2f}m\u00B3 / {:,.2f}m\u00B3".format(fit.cargoBayUsed, cachedCargo["main"])]
|
||||
for attrName, tipAlias in list(cargoNamesOrder.items()):
|
||||
if cachedCargo[attrName] > 0:
|
||||
tipLines.append("{}: {:,.2f}m\u00B3".format(tipAlias, cachedCargo[attrName]))
|
||||
@@ -256,7 +262,7 @@ class TargetingMiscViewMinimal(StatsView):
|
||||
# forces update of probe size, since this stat is used by both sig radius and sensor str
|
||||
if labelName == "labelFullSigRadius":
|
||||
if fit:
|
||||
label.SetToolTip(wx.ToolTip("Probe Size: %.3f" % (fit.probeSize or 0)))
|
||||
label.SetToolTip(wx.ToolTip(_t("Probe Size: %.3f") % (fit.probeSize or 0)))
|
||||
else:
|
||||
label.SetToolTip(wx.ToolTip(""))
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ from eos.saveddata.fighter import Fighter
|
||||
from gui.viewColumn import ViewColumn
|
||||
import gui.mainFrame
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class Abilities(ViewColumn):
|
||||
name = "Fighter Abilities"
|
||||
@@ -32,7 +34,7 @@ class Abilities(ViewColumn):
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.columnText = "Active Abilities"
|
||||
self.columnText = _t("Active Abilities")
|
||||
self.mask = wx.LIST_MASK_TEXT
|
||||
|
||||
def getText(self, stuff):
|
||||
|
||||
@@ -40,6 +40,7 @@ from service.market import Market
|
||||
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class BaseName(ViewColumn):
|
||||
@@ -51,9 +52,18 @@ class BaseName(ViewColumn):
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.columnText = "Name"
|
||||
self.columnText = _t("Name")
|
||||
self.mask = wx.LIST_MASK_TEXT
|
||||
self.projectedView = isinstance(fittingView, gui.builtinAdditionPanes.projectedView.ProjectedView)
|
||||
self.rackTranslations = {
|
||||
FittingSlot.HIGH: _t('High'),
|
||||
FittingSlot.MED: _t('Med'),
|
||||
FittingSlot.LOW: _t('Low'),
|
||||
FittingSlot.SUBSYSTEM: _t('Subsystem'),
|
||||
FittingSlot.RIG: _t('Rig'),
|
||||
FittingSlot.SERVICE: _t('Service')
|
||||
}
|
||||
|
||||
|
||||
def getText(self, stuff):
|
||||
if isinstance(stuff, BaseWrapper):
|
||||
@@ -89,9 +99,9 @@ class BaseName(ViewColumn):
|
||||
elif isinstance(stuff, Rack):
|
||||
if FitSvc.getInstance().serviceFittingOptions["rackLabels"]:
|
||||
if stuff.slot == FittingSlot.MODE:
|
||||
return '─ Tactical Mode ─'
|
||||
return '─ {} ─'.format(_t('Tactical Mode'))
|
||||
else:
|
||||
return '─ {} {} Slot{}─'.format(stuff.num, FittingSlot(stuff.slot).name.capitalize(), '' if stuff.num == 1 else 's')
|
||||
return '─ {} ─'.format(_t('{} {} Slot', '{} {} Slots', stuff.num).format(stuff.num, self.rackTranslations.get(stuff.slot, FittingSlot(stuff.slot).name.capitalize())))
|
||||
else:
|
||||
return ""
|
||||
elif isinstance(stuff, Module):
|
||||
|
||||
@@ -47,7 +47,7 @@ class Miscellanea(ViewColumn):
|
||||
self.imageId = -1
|
||||
|
||||
if params["displayName"] or self.imageId == -1:
|
||||
self.columnText = "Misc data"
|
||||
self.columnText = _("Misc data")
|
||||
self.mask |= wx.LIST_MASK_TEXT
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.fittingView = fittingView
|
||||
|
||||
@@ -24,6 +24,8 @@ from eos.saveddata.booster import Booster
|
||||
from gui.viewColumn import ViewColumn
|
||||
import gui.mainFrame
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
class SideEffects(ViewColumn):
|
||||
name = "Side Effects"
|
||||
@@ -32,7 +34,7 @@ class SideEffects(ViewColumn):
|
||||
ViewColumn.__init__(self, fittingView)
|
||||
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.columnText = "Active Side Effects"
|
||||
self.columnText = _t("Active Side Effects")
|
||||
self.mask = wx.LIST_MASK_TEXT
|
||||
|
||||
def getText(self, stuff):
|
||||
|
||||
@@ -45,6 +45,7 @@ from config import slotColourMap
|
||||
from gui.fitCommands.helpers import getSimilarModPositions
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
_t = wx.GetTranslation
|
||||
|
||||
|
||||
# Tab spawning handler
|
||||
@@ -644,23 +645,23 @@ class FittingView(d.Display):
|
||||
contexts = []
|
||||
if isinstance(mainMod, Module) and not mainMod.isEmpty:
|
||||
srcContext = "fittingModule"
|
||||
itemContext = sMkt.getCategoryByItem(mainMod.item).name
|
||||
itemContext = sMkt.getCategoryByItem(mainMod.item).displayName
|
||||
fullContext = (srcContext, itemContext)
|
||||
if srcContext not in tuple(fCtx[0] for fCtx in contexts):
|
||||
contexts.append(fullContext)
|
||||
if mainMod.charge is not None:
|
||||
srcContext = "fittingCharge"
|
||||
itemContext = sMkt.getCategoryByItem(mainMod.charge).name
|
||||
itemContext = sMkt.getCategoryByItem(mainMod.charge).displayName
|
||||
fullContext = (srcContext, itemContext)
|
||||
if srcContext not in tuple(fCtxt[0] for fCtxt in contexts):
|
||||
contexts.append(fullContext)
|
||||
elif isinstance(mainMod, Mode):
|
||||
srcContext = "fittingMode"
|
||||
itemContext = "Tactical Mode"
|
||||
itemContext = _t("Tactical Mode")
|
||||
fullContext = (srcContext, itemContext)
|
||||
if srcContext not in tuple(fCtx[0] for fCtx in contexts):
|
||||
contexts.append(fullContext)
|
||||
contexts.append(("fittingShip", "Ship" if not fit.isStructure else "Citadel"))
|
||||
contexts.append(("fittingShip", _t("Ship") if not fit.isStructure else _t("Citadel")))
|
||||
|
||||
menu = ContextMenu.getMenu(self, mainMod, selection, *contexts)
|
||||
self.PopupMenu(menu)
|
||||
|
||||
@@ -45,6 +45,7 @@ from service.esi import Esi
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
|
||||
_t = wx.GetTranslation
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
@@ -72,43 +73,21 @@ class CharacterTextValidor(BaseValidator):
|
||||
|
||||
try:
|
||||
if len(text) == 0:
|
||||
raise ValueError("You must supply a name for the Character!")
|
||||
raise ValueError(_t("You must supply a name for the Character!"))
|
||||
elif text in [x.name for x in sChar.getCharacterList()]:
|
||||
raise ValueError("Character name already in use, please choose another.")
|
||||
raise ValueError(_t("Character name already in use, please choose another."))
|
||||
|
||||
return True
|
||||
except ValueError as e:
|
||||
pyfalog.error(e)
|
||||
wx.MessageBox("{}".format(e), "Error")
|
||||
wx.MessageBox("{}".format(e), _t("Error"))
|
||||
textCtrl.SetFocus()
|
||||
return False
|
||||
|
||||
|
||||
class PlaceholderTextCtrl(wx.TextCtrl):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.default_text = kwargs.pop("placeholder", "")
|
||||
kwargs["value"] = self.default_text
|
||||
wx.TextCtrl.__init__(self, *args, **kwargs)
|
||||
self.Bind(wx.EVT_SET_FOCUS, self.OnFocus)
|
||||
self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
|
||||
|
||||
def OnFocus(self, evt):
|
||||
if self.GetValue() == self.default_text:
|
||||
self.SetValue("")
|
||||
evt.Skip()
|
||||
|
||||
def OnKillFocus(self, evt):
|
||||
if self.GetValue().strip() == "":
|
||||
self.SetValue(self.default_text)
|
||||
evt.Skip()
|
||||
|
||||
def Reset(self):
|
||||
self.SetValue(self.default_text)
|
||||
|
||||
|
||||
class CharacterEntityEditor(EntityEditor):
|
||||
def __init__(self, parent):
|
||||
EntityEditor.__init__(self, parent, "Character")
|
||||
EntityEditor.__init__(self, parent, _t("Character"))
|
||||
self.SetEditorValidator(CharacterTextValidor)
|
||||
|
||||
def getEntitiesFromContext(self):
|
||||
@@ -155,7 +134,7 @@ class CharacterEditor(AuxiliaryFrame):
|
||||
|
||||
def __init__(self, parent):
|
||||
super().__init__(
|
||||
parent, id=wx.ID_ANY, title="Character Editor", resizeable=True, pos=wx.DefaultPosition,
|
||||
parent, id=wx.ID_ANY, title=_t("Character Editor"), resizeable=True, pos=wx.DefaultPosition,
|
||||
size=wx.Size(950, 650) if "wxGTK" in wx.PlatformInfo else wx.Size(850, 600))
|
||||
|
||||
i = wx.Icon(BitmapLoader.getBitmap("character_small", "gui"))
|
||||
@@ -178,17 +157,17 @@ class CharacterEditor(AuxiliaryFrame):
|
||||
self.iview = ImplantEditorView(self.viewsNBContainer, self)
|
||||
self.aview = APIView(self.viewsNBContainer)
|
||||
|
||||
self.viewsNBContainer.AddPage(self.sview, "Skills")
|
||||
self.viewsNBContainer.AddPage(self.iview, "Implants")
|
||||
self.viewsNBContainer.AddPage(self.aview, "EVE SSO")
|
||||
self.viewsNBContainer.AddPage(self.sview, _t("Skills"))
|
||||
self.viewsNBContainer.AddPage(self.iview, _t("Implants"))
|
||||
self.viewsNBContainer.AddPage(self.aview, _t("EVE SSO"))
|
||||
|
||||
mainSizer.Add(self.viewsNBContainer, 1, wx.EXPAND | wx.ALL, 5)
|
||||
|
||||
bSizerButtons = wx.BoxSizer(wx.HORIZONTAL)
|
||||
|
||||
self.btnSaveChar = wx.Button(self, wx.ID_ANY, "Save")
|
||||
self.btnSaveAs = wx.Button(self, wx.ID_ANY, "Save As...")
|
||||
self.btnRevert = wx.Button(self, wx.ID_ANY, "Revert")
|
||||
self.btnSaveChar = wx.Button(self, wx.ID_SAVE)
|
||||
self.btnSaveAs = wx.Button(self, wx.ID_SAVEAS)
|
||||
self.btnRevert = wx.Button(self, wx.ID_REVERT_TO_SAVED)
|
||||
self.btnOK = wx.Button(self, wx.ID_OK)
|
||||
|
||||
bSizerButtons.Add(self.btnSaveChar, 0, wx.ALL, 5)
|
||||
@@ -299,10 +278,10 @@ class CharacterEditor(AuxiliaryFrame):
|
||||
|
||||
with TextEntryValidatedDialog(
|
||||
parent, CharacterTextValidor,
|
||||
"Enter a name for your new Character:",
|
||||
"Save Character As..."
|
||||
_t("Enter a name for your new Character:"),
|
||||
_t("Save Character As...")
|
||||
) as dlg:
|
||||
dlg.SetValue("{} Copy".format(name))
|
||||
dlg.SetValue(_t("{} Copy").format(name))
|
||||
dlg.txtctrl.SetInsertionPointEnd()
|
||||
dlg.CenterOnParent()
|
||||
|
||||
@@ -328,7 +307,7 @@ class SkillTreeView(wx.Panel):
|
||||
self.clonesChoice.SetSelection(i)
|
||||
hSizer.Add(self.clonesChoice, 5, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
self.searchInput = PlaceholderTextCtrl(self, wx.ID_ANY, placeholder="Search...")
|
||||
self.searchInput = wx.SearchCtrl(self, wx.ID_ANY)
|
||||
hSizer.Add(self.searchInput, 1, wx.ALL | wx.EXPAND, 5)
|
||||
self.searchInput.Bind(wx.EVT_TEXT, self.delaySearch)
|
||||
|
||||
@@ -344,7 +323,7 @@ class SkillTreeView(wx.Panel):
|
||||
self.clonesChoice.Bind(wx.EVT_CHOICE, self.cloneChanged)
|
||||
|
||||
self.clonesChoice.SetToolTip(
|
||||
wx.ToolTip("Setting an Alpha clone does not replace the character's skills, but rather caps them to Alpha levels."))
|
||||
wx.ToolTip(_t("Setting an Alpha clone does not replace the character's skills, but rather caps them to Alpha levels.")))
|
||||
|
||||
pmainSizer.Add(hSizer, 0, wx.EXPAND | wx.ALL, 5)
|
||||
|
||||
@@ -360,8 +339,8 @@ class SkillTreeView(wx.Panel):
|
||||
self.skillBookImageId = self.imageList.Add(wx.Icon(BitmapLoader.getBitmap("skill_small", "gui")))
|
||||
self.skillBookDirtyImageId = self.imageList.Add(wx.Icon(BitmapLoader.getBitmap("skill_small_red", "gui")))
|
||||
|
||||
tree.AppendColumn("Skill")
|
||||
tree.AppendColumn("Level", align=wx.ALIGN_CENTER)
|
||||
tree.AppendColumn(_t("Skill"))
|
||||
tree.AppendColumn(_t("Level"))
|
||||
# tree.SetMainColumn(0)
|
||||
|
||||
self.root = tree.GetRootItem()
|
||||
@@ -374,7 +353,8 @@ class SkillTreeView(wx.Panel):
|
||||
tree.SetColumnWidth(0, 525)
|
||||
tree.SetColumnWidth(1, 100)
|
||||
|
||||
self.btnSecStatus = wx.Button(self, wx.ID_ANY, "Sec Status: {0:.2f}".format(char.secStatus or 0.0))
|
||||
self.secStatusLabel = _t("Sec Status: {0:.2f}")
|
||||
self.btnSecStatus = wx.Button(self, wx.ID_ANY, self.secStatusLabel.format(char.secStatus or 0.0))
|
||||
self.btnSecStatus.Bind(wx.EVT_BUTTON, self.onSecStatus)
|
||||
|
||||
self.populateSkillTree()
|
||||
@@ -389,10 +369,10 @@ class SkillTreeView(wx.Panel):
|
||||
|
||||
bSizerButtons.AddStretchSpacer()
|
||||
|
||||
importExport = (("Import", wx.ART_FILE_OPEN, "from"),
|
||||
("Export", wx.ART_FILE_SAVE_AS, "to"))
|
||||
importExport = ((_t("Import skills from clipboard"), wx.ART_FILE_OPEN, "import"),
|
||||
(_t("Export skills from clipboard"), wx.ART_FILE_SAVE_AS, "export"))
|
||||
|
||||
for name, art, direction in importExport:
|
||||
for tooltip, art, attr in importExport:
|
||||
bitmap = wx.ArtProvider.GetBitmap(art, wx.ART_BUTTON)
|
||||
btn = wx.BitmapButton(self, wx.ID_ANY, bitmap)
|
||||
|
||||
@@ -400,11 +380,11 @@ class SkillTreeView(wx.Panel):
|
||||
btn.SetMaxSize(btn.GetSize())
|
||||
|
||||
btn.Layout()
|
||||
setattr(self, "{}Btn".format(name.lower()), btn)
|
||||
setattr(self, "{}Btn".format(attr), btn)
|
||||
btn.Enable(True)
|
||||
btn.SetToolTip("%s skills %s clipboard" % (name, direction))
|
||||
btn.SetToolTip(tooltip)
|
||||
bSizerButtons.Add(btn, 0, wx.ALL, 5)
|
||||
btn.Bind(wx.EVT_BUTTON, getattr(self, "{}Skills".format(name.lower())))
|
||||
btn.Bind(wx.EVT_BUTTON, getattr(self, "{}Skills".format(attr)))
|
||||
|
||||
pmainSizer.Add(bSizerButtons, 0, wx.EXPAND, 5)
|
||||
|
||||
@@ -416,7 +396,7 @@ class SkillTreeView(wx.Panel):
|
||||
self.idUnlearned = wx.NewId()
|
||||
self.levelIds = {}
|
||||
self.idLevels = {}
|
||||
self.levelIds[self.idUnlearned] = "Not learned"
|
||||
self.levelIds[self.idUnlearned] = _t("Not learned")
|
||||
for level in range(6):
|
||||
id = wx.NewId()
|
||||
self.levelIds[id] = level
|
||||
@@ -457,9 +437,9 @@ class SkillTreeView(wx.Panel):
|
||||
def importSkills(self, evt):
|
||||
|
||||
with wx.MessageDialog(
|
||||
self, ("Importing skills into this character will set the skill levels as pending. To save the skills "
|
||||
"permanently, please click the Save button at the bottom of the window after importing"),
|
||||
"Import Skills", wx.OK
|
||||
self, (_t("Importing skills into this character will set the skill levels as pending. To save the skills "
|
||||
"permanently, please click the Save button at the bottom of the window after importing")),
|
||||
_t("Import Skills"), wx.OK
|
||||
) as dlg:
|
||||
dlg.ShowModal()
|
||||
|
||||
@@ -480,7 +460,7 @@ class SkillTreeView(wx.Panel):
|
||||
raise
|
||||
except Exception as e:
|
||||
pyfalog.error(e)
|
||||
with wx.MessageDialog(self, "There was an error importing skills, please see log file", "Error", wx.ICON_ERROR) as dlg:
|
||||
with wx.MessageDialog(self, _t("There was an error importing skills, please see log file"), _t("Error"), wx.ICON_ERROR) as dlg:
|
||||
dlg.ShowModal()
|
||||
|
||||
finally:
|
||||
@@ -506,10 +486,10 @@ class SkillTreeView(wx.Panel):
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
value = dlg.floatSpin.GetValue()
|
||||
sChar.setSecStatus(char, value)
|
||||
self.btnSecStatus.SetLabel("Sec Status: {0:.2f}".format(value))
|
||||
self.btnSecStatus.SetLabel(self.secStatusLabel.format(value))
|
||||
|
||||
def delaySearch(self, evt):
|
||||
if self.searchInput.GetValue() == "" or self.searchInput.GetValue() == self.searchInput.default_text:
|
||||
if self.searchInput.GetValue() == "":
|
||||
self.populateSkillTree()
|
||||
else:
|
||||
self.searchTimer.Stop()
|
||||
@@ -521,14 +501,14 @@ class SkillTreeView(wx.Panel):
|
||||
self.populateSkillTree()
|
||||
|
||||
def charChanged(self, event=None):
|
||||
self.searchInput.Reset()
|
||||
self.searchInput.SetValue("")
|
||||
char = self.charEditor.entityEditor.getActiveEntity()
|
||||
for i in range(self.clonesChoice.GetCount()):
|
||||
cloneID = self.clonesChoice.GetClientData(i)
|
||||
if char.alphaCloneID == cloneID:
|
||||
self.clonesChoice.SetSelection(i)
|
||||
|
||||
self.btnSecStatus.SetLabel("Sec Status: {0:.2f}".format(char.secStatus or 0.0))
|
||||
self.btnSecStatus.SetLabel(self.secStatusLabel.format(char.secStatus or 0.0))
|
||||
|
||||
self.populateSkillTree(event)
|
||||
|
||||
@@ -549,7 +529,7 @@ class SkillTreeView(wx.Panel):
|
||||
iconId = self.skillBookDirtyImageId
|
||||
|
||||
childId = tree.AppendItem(root, name, iconId, data=('skill', id))
|
||||
tree.SetItemText(childId, 1, "Level %d" % int(level) if isinstance(level, float) else level)
|
||||
tree.SetItemText(childId, 1, _t("Level {}d").format(int(level)) if isinstance(level, float) else level)
|
||||
|
||||
def populateSkillTree(self, event=None):
|
||||
sChar = Character.getInstance()
|
||||
@@ -608,7 +588,7 @@ class SkillTreeView(wx.Panel):
|
||||
|
||||
childId = tree.AppendItem(root, name, iconId, data=('skill', id))
|
||||
|
||||
tree.SetItemText(childId, 1, "Level %d" % int(level) if isinstance(level, float) else level)
|
||||
tree.SetItemText(childId, 1, _t("Level {}").format(int(level)) if isinstance(level, float) else level)
|
||||
|
||||
def spawnMenu(self, event):
|
||||
item = event.GetItem()
|
||||
@@ -625,15 +605,15 @@ class SkillTreeView(wx.Panel):
|
||||
eveItem = Market.getInstance().getItem(id)
|
||||
|
||||
srcContext = "skillItem"
|
||||
itemContext = "Skill"
|
||||
itemContext = _t("Skill")
|
||||
context = (srcContext, itemContext)
|
||||
menu = ContextMenu.getMenu(self, eveItem, [eveItem], context)
|
||||
char = self.charEditor.entityEditor.getActiveEntity()
|
||||
if char.name not in ("All 0", "All 5"):
|
||||
menu.AppendSeparator()
|
||||
menu.Append(self.idUnlearned, "Unlearn")
|
||||
menu.Append(self.idUnlearned, _t("Unlearn"))
|
||||
for level in range(6):
|
||||
menu.Append(self.idLevels[level], "Level %d" % level)
|
||||
menu.Append(self.idLevels[level], _t("Level {}").format(level))
|
||||
menu.Bind(wx.EVT_MENU, self.changeLevel)
|
||||
|
||||
self.PopupMenu(menu)
|
||||
@@ -666,7 +646,7 @@ class SkillTreeView(wx.Panel):
|
||||
lvl, dirty = sChar.getSkillLevel(char.ID, skillID)
|
||||
self.skillTreeListCtrl.SetItemText(treeItem,
|
||||
1,
|
||||
"Level {}".format(int(lvl)) if not isinstance(lvl, str) else lvl)
|
||||
_t("Level {}").format(int(lvl)) if not isinstance(lvl, str) else lvl)
|
||||
|
||||
if not dirty:
|
||||
self.skillTreeListCtrl.SetItemImage(treeItem, self.skillBookImageId)
|
||||
@@ -774,8 +754,8 @@ class APIView(wx.Panel):
|
||||
hintSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
hintSizer.AddStretchSpacer()
|
||||
self.stDisabledTip = wx.StaticText(self, wx.ID_ANY,
|
||||
"You cannot link All 0 or All 5 characters to an EVE character.\n"
|
||||
"Please select another character or make a new one.", style=wx.ALIGN_CENTER)
|
||||
_t("You cannot link All 0 or All 5 characters to an EVE character.") + "\n" +
|
||||
_t("Please select another character or make a new one."), style=wx.ALIGN_CENTER)
|
||||
self.stDisabledTip.Wrap(-1)
|
||||
hintSizer.Add(self.stDisabledTip, 0, wx.TOP | wx.BOTTOM, 10)
|
||||
|
||||
@@ -788,14 +768,14 @@ class APIView(wx.Panel):
|
||||
fgSizerInput.SetFlexibleDirection(wx.BOTH)
|
||||
fgSizerInput.SetNonFlexibleGrowMode(wx.FLEX_GROWMODE_SPECIFIED)
|
||||
|
||||
self.m_staticCharText = wx.StaticText(self, wx.ID_ANY, "Character:", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticCharText = wx.StaticText(self, wx.ID_ANY, _t("Character:"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticCharText.Wrap(-1)
|
||||
fgSizerInput.Add(self.m_staticCharText, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 10)
|
||||
|
||||
self.charChoice = wx.Choice(self, wx.ID_ANY, style=0)
|
||||
fgSizerInput.Add(self.charChoice, 1, wx.TOP | wx.BOTTOM | wx.EXPAND, 10)
|
||||
|
||||
self.fetchButton = wx.Button(self, wx.ID_ANY, "Get Skills", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.fetchButton = wx.Button(self, wx.ID_ANY, _t("Get Skills"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.fetchButton.Bind(wx.EVT_BUTTON, self.fetchSkills)
|
||||
fgSizerInput.Add(self.fetchButton, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 10)
|
||||
|
||||
@@ -806,12 +786,12 @@ class APIView(wx.Panel):
|
||||
self.m_staticline1 = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
|
||||
pmainSizer.Add(self.m_staticline1, 0, wx.EXPAND | wx.ALL, 10)
|
||||
|
||||
self.noCharactersTip = wx.StaticText(self, wx.ID_ANY, "Don't see your EVE character in the list?", style=wx.ALIGN_CENTER)
|
||||
self.noCharactersTip = wx.StaticText(self, wx.ID_ANY, _t("Don't see your EVE character in the list?"), style=wx.ALIGN_CENTER)
|
||||
|
||||
self.noCharactersTip.Wrap(-1)
|
||||
pmainSizer.Add(self.noCharactersTip, 0, wx.CENTER | wx.TOP | wx.BOTTOM, 0)
|
||||
|
||||
self.addButton = wx.Button(self, wx.ID_ANY, "Log In with EVE SSO", wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.addButton = wx.Button(self, wx.ID_ANY, _t("Log In with EVE SSO"), wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.addButton.Bind(wx.EVT_BUTTON, self.addCharacter)
|
||||
pmainSizer.Add(self.addButton, 0, wx.ALL | wx.ALIGN_CENTER, 10)
|
||||
|
||||
@@ -872,7 +852,7 @@ class APIView(wx.Panel):
|
||||
|
||||
self.charChoice.Clear()
|
||||
|
||||
noneID = self.charChoice.Append("None", None)
|
||||
noneID = self.charChoice.Append(_t("None"), None)
|
||||
|
||||
for char in ssoChars:
|
||||
currId = self.charChoice.Append(char.characterName, char.ID)
|
||||
@@ -914,25 +894,25 @@ class APIView(wx.Panel):
|
||||
pyfalog.warn(exc_value)
|
||||
|
||||
wx.MessageBox(
|
||||
"Error fetching skill information",
|
||||
"Error", wx.ICON_ERROR | wx.STAY_ON_TOP)
|
||||
_t("Error fetching skill information"),
|
||||
_t("Error"), wx.ICON_ERROR | wx.STAY_ON_TOP)
|
||||
else:
|
||||
wx.MessageBox(
|
||||
"Successfully fetched skills", "Success", wx.ICON_INFORMATION | wx.STAY_ON_TOP)
|
||||
_t("Successfully fetched skills"), _t("Success"), wx.ICON_INFORMATION | wx.STAY_ON_TOP)
|
||||
|
||||
|
||||
class SecStatusDialog(wx.Dialog):
|
||||
|
||||
def __init__(self, parent, sec):
|
||||
super().__init__(parent, title="Set Security Status", size=(300, 175), style=wx.DEFAULT_DIALOG_STYLE)
|
||||
super().__init__(parent, title=_t("Set Security Status"), size=(300, 175), style=wx.DEFAULT_DIALOG_STYLE)
|
||||
|
||||
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
|
||||
|
||||
bSizer1 = wx.BoxSizer(wx.VERTICAL)
|
||||
|
||||
self.m_staticText1 = wx.StaticText(self, wx.ID_ANY,
|
||||
"Security Status is used in some CONCORD hull calculations",
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
_t("Security Status is used in some CONCORD hull calculations"),
|
||||
wx.DefaultPosition, wx.DefaultSize, 0)
|
||||
self.m_staticText1.Wrap(-1)
|
||||
bSizer1.Add(self.m_staticText1, 1, wx.ALL | wx.EXPAND, 5)
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ from gui.utils.clipboard import toClipboard
|
||||
from service.character import Character
|
||||
from service.fit import Fit
|
||||
|
||||
|
||||
_t = wx.GetTranslation
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class CharacterSelection(wx.Panel):
|
||||
mainSizer = wx.BoxSizer(wx.HORIZONTAL)
|
||||
self.SetSizer(mainSizer)
|
||||
|
||||
mainSizer.Add(wx.StaticText(self, wx.ID_ANY, "Character: "), 0, wx.CENTER | wx.RIGHT | wx.LEFT, 3)
|
||||
mainSizer.Add(wx.StaticText(self, wx.ID_ANY, _t("Character: ")), 0, wx.CENTER | wx.RIGHT | wx.LEFT, 3)
|
||||
|
||||
# cache current selection to fall back in case we choose to open char editor
|
||||
self.charCache = None
|
||||
@@ -65,7 +65,7 @@ class CharacterSelection(wx.Panel):
|
||||
|
||||
self.btnRefresh.SetMinSize(size)
|
||||
self.btnRefresh.SetMaxSize(size)
|
||||
self.btnRefresh.SetToolTip("Refresh API")
|
||||
self.btnRefresh.SetToolTip(_t("Refresh Skills"))
|
||||
|
||||
self.btnRefresh.Bind(wx.EVT_BUTTON, self.refreshApi)
|
||||
self.btnRefresh.Enable(False)
|
||||
@@ -99,10 +99,10 @@ class CharacterSelection(wx.Panel):
|
||||
|
||||
menu = wx.Menu()
|
||||
|
||||
grantItem = menu.Append(wx.ID_ANY, "Grant Missing Skills")
|
||||
grantItem = menu.Append(wx.ID_ANY, _t("Grant Missing Skills"))
|
||||
self.Bind(wx.EVT_MENU, self.grantMissingSkills, grantItem)
|
||||
|
||||
exportItem = menu.Append(wx.ID_ANY, "Copy Missing Skills")
|
||||
exportItem = menu.Append(wx.ID_ANY, _t("Copy Missing Skills"))
|
||||
self.Bind(wx.EVT_MENU, self.exportSkills, exportItem)
|
||||
|
||||
self.PopupMenu(menu, pos)
|
||||
@@ -147,7 +147,7 @@ class CharacterSelection(wx.Panel):
|
||||
sFit = Fit.getInstance()
|
||||
sFit.changeChar(fitID, charID)
|
||||
|
||||
choice.Append("\u2015 Open Character Editor \u2015", -1)
|
||||
choice.Append("\u2015 " + _t("Open Character Editor") + " \u2015", -1)
|
||||
self.charCache = self.charChoice.GetCurrentSelection()
|
||||
|
||||
if event is not None:
|
||||
@@ -170,8 +170,8 @@ class CharacterSelection(wx.Panel):
|
||||
pyfalog.warn(exc_value)
|
||||
|
||||
wx.MessageBox(
|
||||
"Error fetching skill information",
|
||||
"Error", wx.ICON_ERROR | wx.STAY_ON_TOP)
|
||||
_t("Error fetching skill information"),
|
||||
_t("Error"), wx.ICON_ERROR | wx.STAY_ON_TOP)
|
||||
|
||||
def charChanged(self, event):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
@@ -227,7 +227,7 @@ class CharacterSelection(wx.Panel):
|
||||
|
||||
if activeFitID is None:
|
||||
self.skillReqsStaticBitmap.SetBitmap(self.cleanSkills)
|
||||
self.skillReqsStaticBitmap.SetToolTip("No active fit")
|
||||
self.skillReqsStaticBitmap.SetToolTip(_t("No active fit"))
|
||||
else:
|
||||
sCharacter = Character.getInstance()
|
||||
self.reqs = sCharacter.checkRequirements(fit)
|
||||
@@ -235,11 +235,11 @@ class CharacterSelection(wx.Panel):
|
||||
sCharacter.skillReqsDict = {'charname': fit.character.name, 'skills': []}
|
||||
if len(self.reqs) == 0:
|
||||
self.needsSkills = False
|
||||
tip = "All skill prerequisites have been met"
|
||||
tip = _t("All skill prerequisites have been met")
|
||||
self.skillReqsStaticBitmap.SetBitmap(self.greenSkills)
|
||||
else:
|
||||
self.needsSkills = True
|
||||
tip = "Skills required:\n"
|
||||
tip = _t("Skills required:") + "\n"
|
||||
condensed = sFit.serviceFittingOptions["compactSkills"]
|
||||
if condensed:
|
||||
dict_ = self._buildSkillsTooltipCondensed(self.reqs, skillsMap={})
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user