# HG changeset patch # User souliane # Date 1393857894 -3600 # Node ID c86d7a8d2c1ec34376162e271987589d7195fcb9 # Parent 76583fab7ea02a6b547eedea8eaf41dde8933fd0 browser_side: added a dialog in Settings/Account to update/delete the XMPP account diff -r 76583fab7ea0 -r c86d7a8d2c1e browser_side/menu.py --- a/browser_side/menu.py Mon Mar 03 15:44:13 2014 +0100 +++ b/browser_side/menu.py Mon Mar 03 15:44:54 2014 +0100 @@ -140,6 +140,7 @@ addMenu("Help", _("Help"), _("Social contract"), 'help', MenuCmd(self, "onSocialContract")) addMenu("Help", _("Help"), _("About"), 'help', MenuCmd(self, "onAbout")) + addMenu("Settings", _("Settings"), _("Account"), 'settings', MenuCmd(self, "onAccount")) addMenu("Settings", _("Settings"), _("Parameters"), 'settings', MenuCmd(self, "onParameters")) # XXX: temporary, will change when a full profile will be managed in SàT @@ -301,6 +302,16 @@ #Settings menu + def onAccount(self): + def gotUI(xmlui): + if not xmlui: + return + body = XMLUI(self.host, xmlui) + _dialog = dialog.GenericDialog("Manage your XMPP account", body, options=['NO_CLOSE']) + body.setCloseCb(_dialog.close) + _dialog.show() + self.host.bridge.call('getAccountDialogUI', gotUI) + def onParameters(self): def gotParams(xmlui): if not xmlui: diff -r 76583fab7ea0 -r c86d7a8d2c1e libervia.py --- a/libervia.py Mon Mar 03 15:44:13 2014 +0100 +++ b/libervia.py Mon Mar 03 15:44:54 2014 +0100 @@ -125,7 +125,7 @@ "getWaitingSub", "subscription", "delContact", "updateContact", "getCard", "getEntityData", "getParamsUI", "asyncGetParamA", "setParam", "launchAction", "disconnect", "chatStateComposing", "getNewAccountDomain", "confirmationAnswer", - "syntaxConvert", + "syntaxConvert", "getAccountDialogUI", ]) diff -r 76583fab7ea0 -r c86d7a8d2c1e libervia_server/__init__.py --- a/libervia_server/__init__.py Mon Mar 03 15:44:13 2014 +0100 +++ b/libervia_server/__init__.py Mon Mar 03 15:44:54 2014 +0100 @@ -454,6 +454,12 @@ profile = ISATSession(self.session).profile return self.sat_host.bridge.getCard(jid, profile) + def jsonrpc_getAccountDialogUI(self): + """Get the dialog for managing user account + @return: XML string of the XMLUI""" + profile = ISATSession(self.session).profile + return self.sat_host.bridge.getAccountDialogUI(profile) + def jsonrpc_getParamsUI(self): """Return the parameters XML for profile""" profile = ISATSession(self.session).profile