Mercurial > libervia-web
changeset 655:048401e5c506 frontends_multi_profiles
browser_side: implements setStatusOnline since it is not used only for setting the connected state on/off, but also to update the user presence and status
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 27 Feb 2015 02:41:11 +0100 |
parents | 40c72f3b7638 |
children | 4dbd99de3aaa |
files | src/browser/libervia_main.py src/browser/sat_browser/main_panel.py |
diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/browser/libervia_main.py Fri Feb 27 02:39:43 2015 +0100 +++ b/src/browser/libervia_main.py Fri Feb 27 02:41:11 2015 +0100 @@ -385,8 +385,11 @@ QuickApp.disconnectedHandler(self, profile) Window.getLocation().reload() - def setStatusOnline(self, online=True, show="", statuses={}, profile=C.PROF_KEY_NONE): - log.warning("setStatusOnline is not implemented, as session are for unique profile which is always online for now") + def setStatusOnline(self, online=True, show='', statuses={}, profile=C.PROF_KEY_NONE): + self.presence_status_panel.setPresence(show) + if statuses: + # FIXME: retrieve user language status or fallback to 'default' + self.presence_status_panel.setStatus(statuses.values()[0]) def _tryAutoConnect(self, skip_validation=False): """This method retrieve the eventual URL parameters to auto-connect the user.
--- a/src/browser/sat_browser/main_panel.py Fri Feb 27 02:39:43 2015 +0100 +++ b/src/browser/sat_browser/main_panel.py Fri Feb 27 02:41:11 2015 +0100 @@ -174,7 +174,7 @@ self.addMenuItem([u"◉", presence], [u"◉", html], '', base_menu.MenuCmd(self, 'changePresenceCb', presence), asHTML=True) self.parent_panel = parent - def changePresenceCb(self, presence): + def changePresenceCb(self, presence=''): """Callback to notice the backend of a new presence set by the user. @param presence (str): the new presence is a value in ('', 'chat', 'away', 'dnd', 'xa') """