frontends (primitivus): fixes setting the presence and status (for now all the profiles share the same info)
This commit is contained in:
parent
5169c7f602
commit
723cb3cce4
1 changed files with 4 additions and 3 deletions
|
|
@ -39,7 +39,7 @@ class StatusBar(urwid.Columns):
|
||||||
urwid.connect_signal(self.status, 'click', self.onStatusClick)
|
urwid.connect_signal(self.status, 'click', self.onStatusClick)
|
||||||
|
|
||||||
def onPresenceClick(self, sender=None):
|
def onPresenceClick(self, sender=None):
|
||||||
if not self.host.bridge.isConnected(self.host.profile):
|
if not self.host.bridge.isConnected(self.host.current_profile): # FIXME: manage multi-profiles
|
||||||
return
|
return
|
||||||
options = [commonConst.PRESENCE[presence] for presence in commonConst.PRESENCE]
|
options = [commonConst.PRESENCE[presence] for presence in commonConst.PRESENCE]
|
||||||
list_widget = sat_widgets.GenericList(options=options, option_type=sat_widgets.ClickableText, on_click=self.onChange)
|
list_widget = sat_widgets.GenericList(options=options, option_type=sat_widgets.ClickableText, on_click=self.onChange)
|
||||||
|
|
@ -47,7 +47,7 @@ class StatusBar(urwid.Columns):
|
||||||
self.host.showPopUp(decorated)
|
self.host.showPopUp(decorated)
|
||||||
|
|
||||||
def onStatusClick(self, sender=None):
|
def onStatusClick(self, sender=None):
|
||||||
if not self.host.bridge.isConnected(self.host.profile):
|
if not self.host.bridge.isConnected(self.host.current_profile): # FIXME: manage multi-profiles
|
||||||
return
|
return
|
||||||
pop_up_widget = sat_widgets.InputDialog(_('Set your status'), _('New status'), default_txt=self.status.get_text(),
|
pop_up_widget = sat_widgets.InputDialog(_('Set your status'), _('New status'), default_txt=self.status.get_text(),
|
||||||
cancel_cb=self.host.removePopUp, ok_cb=self.onChange)
|
cancel_cb=self.host.removePopUp, ok_cb=self.onChange)
|
||||||
|
|
@ -61,7 +61,8 @@ class StatusBar(urwid.Columns):
|
||||||
elif isinstance(user_data, sat_widgets.AdvancedEdit):
|
elif isinstance(user_data, sat_widgets.AdvancedEdit):
|
||||||
new = (previous[0], new_value[0])
|
new = (previous[0], new_value[0])
|
||||||
if new != previous:
|
if new != previous:
|
||||||
self.host.bridge.setPresence(show=new[0], statuses={'default': new[1]}, profile_key=self.host.profile) #FIXME: manage multilingual statuses
|
for profile in self.host.profiles: # FIXME: for now all the profiles share the same status
|
||||||
|
self.host.bridge.setPresence(show=new[0], statuses={'default': new[1]}, profile_key=profile) # FIXME: manage multilingual statuses
|
||||||
self.setPresenceStatus(new[0], new[1])
|
self.setPresenceStatus(new[0], new[1])
|
||||||
self.host.removePopUp()
|
self.host.removePopUp()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue