MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / charChanged

Method charChanged

gui/characterEditor.py:875–923  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

873 self.charChanged(event)
874
875 def charChanged(self, event):
876 sChar = Character.getInstance()
877 sEsi = Esi.getInstance()
878
879 activeChar = self.charEditor.entityEditor.getActiveEntity()
880
881 if event and event.EventType == GE.EVT_SSO_LOGIN.typeId and hasattr(event, 'character'):
882 # Automatically assign the character that was just logged into
883 sChar.setSsoCharacter(activeChar.ID, event.character.ID)
884
885 sso = sChar.getSsoCharacter(activeChar.ID)
886
887 self.fetchButton.Enable(sso is not None)
888
889 ssoChars = sEsi.getSsoCharacters()
890
891 self.charChoice.Clear()
892
893 noneID = self.charChoice.Append(_t("None"), None)
894
895 for char in ssoChars:
896 currId = self.charChoice.Append(char.characterDisplay, char.ID)
897
898 if sso is not None and char.ID == sso.ID:
899 self.charChoice.SetSelection(currId)
900
901 if sso is None:
902 self.charChoice.SetSelection(noneID)
903
904 #
905 # if chars:
906 # for charName in chars:
907 # self.charChoice.Append(charName)
908 # self.charChoice.SetStringSelection(char)
909 # else:
910 # self.charChoice.Append("No characters...", 0)
911 # self.charChoice.SetSelection(0)
912 #
913 if activeChar.name in ("All 0", "All 5"):
914 self.Enable(False)
915 self.stDisabledTip.Show()
916 self.Layout()
917 else:
918 self.Enable()
919 self.stDisabledTip.Hide()
920 self.Layout()
921
922 if event is not None:
923 event.Skip()
924
925 @staticmethod
926 def fetchCallback(e=None):

Callers 1

ssoListChangedMethod · 0.95

Calls 10

getActiveEntityMethod · 0.80
getSsoCharactersMethod · 0.80
SetSelectionMethod · 0.80
HideMethod · 0.80
_tFunction · 0.50
getInstanceMethod · 0.45
setSsoCharacterMethod · 0.45
getSsoCharacterMethod · 0.45
ClearMethod · 0.45
ShowMethod · 0.45

Tested by

no test coverage detected