Merge branch 'master' of evefit.org:pyfa

This commit is contained in:
HomeWorld
2010-10-12 09:30:38 +03:00
3 changed files with 15 additions and 5 deletions

View File

@@ -36,11 +36,10 @@ class DamagePattern(ContextMenu):
if dp is None: if dp is None:
return None return None
l = []
index = self.patterns.index(dp) index = self.patterns.index(dp)
bitmap = bitmapLoader.getBitmap("state_active_small", "icons") bitmap = bitmapLoader.getBitmap("state_active_small", "icons")
for i in range(len(self.patterns)): l = [None] * len(self.patterns)
l.append(bitmap if i == index else None) l[index] = bitmap
return l return l

View File

@@ -486,7 +486,7 @@ class AvailableImplantsView(d.Display):
class APIView (wx.Panel): class APIView (wx.Panel):
def __init__(self, parent): def __init__(self, parent):
wx.Panel.__init__ (self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.TAB_TRAVERSAL) wx.Panel.__init__ (self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.Size(500, 300), style=wx.TAB_TRAVERSAL)
self.Parent.Parent.Bind(CHAR_CHANGED, self.charChanged)
pmainSizer = wx.BoxSizer(wx.VERTICAL) pmainSizer = wx.BoxSizer(wx.VERTICAL)
fgSizerInput = wx.FlexGridSizer(3, 2, 0, 0) fgSizerInput = wx.FlexGridSizer(3, 2, 0, 0)
@@ -534,6 +534,13 @@ class APIView (wx.Panel):
self.SetSizer(pmainSizer) self.SetSizer(pmainSizer)
self.Layout() self.Layout()
self.charChanged(None)
def charChanged(self, event):
cChar = service.Character.getInstance()
ID, key = cChar.getApiDetails(self.Parent.Parent.getActiveCharacter())
self.inputID.SetValue(str(ID))
self.inputKey.SetValue(key)
def fetchCharList(self, event): def fetchCharList(self, event):
cChar = service.Character.getInstance() cChar = service.Character.getInstance()

View File

@@ -86,6 +86,10 @@ class Character():
eos.db.commit() eos.db.commit()
eos.db.remove(char) eos.db.remove(char)
def getApiDetails(self, charID):
char = eos.db.getCharacter(charID)
return (char.apiID or "", char.apiKey or "")
def charList(self, charID, userID, apiKey): def charList(self, charID, userID, apiKey):
char = eos.db.getCharacter(charID) char = eos.db.getCharacter(charID)
char.apiID = userID char.apiID = userID