diff --git a/gui/mainFrame.py b/gui/mainFrame.py index c893449c0..b36f9b4ce 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -237,10 +237,6 @@ class MainFrame(wx.Frame): self.sUpdate.CheckUpdate(self.ShowUpdateBox) self.Bind(GE.EVT_SSO_LOGIN, self.onSSOLogin) - self.Bind(GE.EVT_SSO_LOGOUT, self.onSSOLogout) - - self.titleTimer = wx.Timer(self) - self.Bind(wx.EVT_TIMER, self.updateTitle, self.titleTimer) def ShowUpdateBox(self, release, version): dlg = UpdateDialog(self, release, version) @@ -612,36 +608,11 @@ class MainFrame(wx.Frame): dlg = CrestFittings(self) dlg.Show() - def updateTitle(self, event): - sCrest = Esi.getInstance() - char = sCrest.implicitCharacter - if char: - t = time.gmtime(char.eve.expires - time.time()) - sTime = time.strftime("%H:%M:%S", t) - newTitle = "%s | %s - %s" % (self.title, char.name, sTime) - self.SetTitle(newTitle) - def onSSOLogin(self, event): menu = self.GetMenuBar() menu.Enable(menu.eveFittingsId, True) menu.Enable(menu.exportToEveId, True) - if event.type == CrestModes.IMPLICIT: - menu.SetLabel(menu.ssoLoginId, "Logout Character") - self.titleTimer.Start(1000) - - def onSSOLogout(self, event): - self.titleTimer.Stop() - self.SetTitle(self.title) - - menu = self.GetMenuBar() - if event.type == CrestModes.IMPLICIT or event.numChars == 0: - menu.Enable(menu.eveFittingsId, False) - menu.Enable(menu.exportToEveId, False) - - if event.type == CrestModes.IMPLICIT: - menu.SetLabel(menu.ssoLoginId, "Login to EVE") - def updateCrestMenus(self, type): # in case we are logged in when switching, change title back self.titleTimer.Stop() diff --git a/service/esi.py b/service/esi.py index 274797af6..1fe3a7cac 100644 --- a/service/esi.py +++ b/service/esi.py @@ -100,7 +100,7 @@ class Esi(object): return self.settings.get('server') == Servers.SISI def delSsoCharacter(self, id): - char = eos.db.getSsoCharacter(id) + char = eos.db.getSsoCharacter(id, config.getClientSecret()) eos.db.remove(char) def getSsoCharacters(self): @@ -236,4 +236,5 @@ class Esi(object): Esi.update_token(currentCharacter, auth_response) # this also sets the esi security token eos.db.save(currentCharacter) + wx.PostEvent(self.mainFrame, GE.SsoLogin(character = currentCharacter))