comparison frontends/src/primitivus/status.py @ 1434:b06047e1c1fb

primitivus: fix setting the presence and status
author souliane <souliane@mailoo.org>
date Wed, 10 Jun 2015 09:18:34 +0200
parents 176de79c8c39
children d17772b0fe22
comparison
equal deleted inserted replaced
1433:5d42e2219d7c 1434:b06047e1c1fb
59 if isinstance(user_data, sat_widgets.ClickableText): 59 if isinstance(user_data, sat_widgets.ClickableText):
60 new = ([key for key in commonConst.PRESENCE if commonConst.PRESENCE[key] == new_value][0], previous[1]) 60 new = ([key for key in commonConst.PRESENCE if commonConst.PRESENCE[key] == new_value][0], previous[1])
61 elif isinstance(user_data, sat_widgets.AdvancedEdit): 61 elif isinstance(user_data, sat_widgets.AdvancedEdit):
62 new = (previous[0], new_value[0]) 62 new = (previous[0], new_value[0])
63 if new != previous: 63 if new != previous:
64 statuses = {C.PRESENCE_STATUSES_DEFAULT: new[1]} # FIXME: manage multilingual statuses
64 for profile in self.host.profiles: # FIXME: for now all the profiles share the same status 65 for profile in self.host.profiles: # FIXME: for now all the profiles share the same status
65 self.host.bridge.setPresence(show=new[0], status=new[1], profile_key=profile) # FIXME: manage multilingual statuses 66 self.host.bridge.setPresence(show=new[0], statuses=statuses, profile_key=profile)
66 self.setPresenceStatus(new[0], new[1]) 67 self.setPresenceStatus(new[0], new[1])
67 self.host.removePopUp() 68 self.host.removePopUp()
68 69
69 def setPresenceStatus(self, show, status): 70 def setPresenceStatus(self, show, status):
70 show_icon, show_attr = C.PRESENCE.get(show) 71 show_icon, show_attr = C.PRESENCE.get(show)