Add an option not to export charges to ESI

This commit is contained in:
DarkPhoenix
2020-06-15 23:38:07 +03:00
parent c38f05902a
commit b558ae3810
5 changed files with 20 additions and 8 deletions

View File

@@ -177,7 +177,7 @@ class CopySelectDialog(wx.Dialog):
def exportEsi(self, options, callback):
fit = getFit(self.mainFrame.getActiveFit())
Port.exportESI(fit, callback)
Port.exportESI(fit, True, callback)
def exportXml(self, options, callback):
fit = getFit(self.mainFrame.getActiveFit())

View File

@@ -18,6 +18,7 @@ from service.esiAccess import APIException
from service.fit import Fit
from service.port import Port
from service.port.esi import ESIExportException
from service.settings import EsiSettings
pyfalog = Logger(__name__)
@@ -207,7 +208,7 @@ class ExportToEve(AuxiliaryFrame):
def __init__(self, parent):
super().__init__(
parent, id=wx.ID_ANY, title="Export fit to EVE", pos=wx.DefaultPosition,
size=wx.Size(400, 120) if "wxGTK" in wx.PlatformInfo else wx.Size(350, 100), resizeable=True)
size=wx.Size(400, 140) if "wxGTK" in wx.PlatformInfo else wx.Size(350, 115), resizeable=True)
self.mainFrame = parent
@@ -224,6 +225,11 @@ class ExportToEve(AuxiliaryFrame):
mainSizer.Add(hSizer, 0, wx.EXPAND, 5)
self.exportChargesCb = wx.CheckBox(self, wx.ID_ANY, 'Export Charges', wx.DefaultPosition, wx.DefaultSize, 0)
self.exportChargesCb.SetValue(EsiSettings.getInstance().get('exportCharges'))
self.exportChargesCb.Bind(wx.EVT_CHECKBOX, self.OnChargeExportChange)
mainSizer.Add(self.exportChargesCb, 0, 0, 5)
self.exportBtn.Bind(wx.EVT_BUTTON, self.exportFitting)
self.statusbar = wx.StatusBar(self)
@@ -239,6 +245,10 @@ class ExportToEve(AuxiliaryFrame):
self.Center(wx.BOTH)
def OnChargeExportChange(self, event):
EsiSettings.getInstance().set('exportCharges', self.exportChargesCb.GetValue())
event.Skip()
def updateCharList(self):
sEsi = Esi.getInstance()
chars = sEsi.getSsoCharacters()
@@ -274,8 +284,9 @@ class ExportToEve(AuxiliaryFrame):
sEsi = Esi.getInstance()
sFit = Fit.getInstance()
exportCharges = self.exportChargesCb.GetValue()
try:
data = sPort.exportESI(sFit.getFit(fitID))
data = sPort.exportESI(sFit.getFit(fitID), exportCharges)
except ESIExportException as e:
msg = str(e)
if not msg: