From 0a07aba7cae7e4de1a1d954f64616f00a1354fbc Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Mon, 11 Oct 2010 23:14:58 +0200 Subject: [PATCH] Fix bug #102: saved API details not being displayed --- gui/characterEditor.py | 11 +++++++++-- service/character.py | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gui/characterEditor.py b/gui/characterEditor.py index 0263c7b2d..b8dc2a468 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -42,7 +42,7 @@ class CharacterEditor(wx.Frame): self.disableWin=wx.WindowDisabler(self) self.SetSizeHintsSz(wx.Size(640, 600), wx.DefaultSize) self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_BTNFACE ) ) - + mainSizer = wx.BoxSizer(wx.VERTICAL) self.navSizer = wx.BoxSizer(wx.HORIZONTAL) @@ -486,7 +486,7 @@ class AvailableImplantsView(d.Display): class APIView (wx.Panel): 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) - + self.Parent.Parent.Bind(CHAR_CHANGED, self.charChanged) pmainSizer = wx.BoxSizer(wx.VERTICAL) fgSizerInput = wx.FlexGridSizer(3, 2, 0, 0) @@ -534,6 +534,13 @@ class APIView (wx.Panel): self.SetSizer(pmainSizer) 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): cChar = service.Character.getInstance() diff --git a/service/character.py b/service/character.py index b1ee50987..923d0ce20 100644 --- a/service/character.py +++ b/service/character.py @@ -86,6 +86,10 @@ class Character(): eos.db.commit() 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): char = eos.db.getCharacter(charID) char.apiID = userID