comparison src/plugins/plugin_misc_account.py @ 987:3a96920c07b7

core, frontends: unify the roster management UIs in sat/stdui/ui_contact_list.py
author souliane <souliane@mailoo.org>
date Thu, 03 Apr 2014 16:10:44 +0200
parents 5925c9ebfcd2
children 301b342c697a
comparison
equal deleted inserted replaced
986:224cafc67324 987:3a96920c07b7
118 118
119 def __init__(self, host): 119 def __init__(self, host):
120 info(_(u"Plugin Account initialization")) 120 info(_(u"Plugin Account initialization"))
121 self.host = host 121 self.host = host
122 host.bridge.addMethod("registerSatAccount", ".plugin", in_sign='sss', out_sign='', method=self._registerAccount, async=True) 122 host.bridge.addMethod("registerSatAccount", ".plugin", in_sign='sss', out_sign='', method=self._registerAccount, async=True)
123 host.bridge.addMethod("getNewAccountDomain", ".plugin", in_sign='', out_sign='s', method=self._getNewAccountDomain, async=False) 123 host.bridge.addMethod("getNewAccountDomain", ".plugin", in_sign='', out_sign='s', method=self.getNewAccountDomain, async=False)
124 host.bridge.addMethod("getAccountDialogUI", ".plugin", in_sign='s', out_sign='s', method=self._getAccountDialogUI, async=False) 124 host.bridge.addMethod("getAccountDialogUI", ".plugin", in_sign='s', out_sign='s', method=self._getAccountDialogUI, async=False)
125 self._prosody_path = self.getConfig('prosody_path') 125 self._prosody_path = self.getConfig('prosody_path')
126 if self._prosody_path is None: 126 if self._prosody_path is None:
127 paths = which(self.getConfig('prosodyctl')) 127 paths = which(self.getConfig('prosodyctl'))
128 if not paths: 128 if not paths:
233 233
234 d_admin = sendmail(_email_host, _email_from, self.getConfig('admin_email'), msg.as_string()) 234 d_admin = sendmail(_email_host, _email_from, self.getConfig('admin_email'), msg.as_string())
235 d_admin.addCallbacks(email_ok, email_ko) 235 d_admin.addCallbacks(email_ok, email_ko)
236 return defer.DeferredList([d_user, d_admin]) 236 return defer.DeferredList([d_user, d_admin])
237 237
238 def _getNewAccountDomain(self): 238 def getNewAccountDomain(self):
239 """@return: the domain that will be set to new account""" 239 """@return: the domain that will be set to new account"""
240 return self.getConfig('new_account_domain') 240 return self.getConfig('new_account_domain')
241 241
242 def _getAccountDialogUI(self, profile): 242 def _getAccountDialogUI(self, profile):
243 """Get the main dialog to manage your account 243 """Get the main dialog to manage your account
340 @param profile 340 @param profile
341 """ 341 """
342 form_ui = xml_tools.XMLUI("form", title=D_("Delete your account?"), submit_id=self.__delete_account_id) 342 form_ui = xml_tools.XMLUI("form", title=D_("Delete your account?"), submit_id=self.__delete_account_id)
343 form_ui.addText(D_("If you confirm this dialog, you will be disconnected and then your XMPP account AND your SàT profile will both be DELETED.")) 343 form_ui.addText(D_("If you confirm this dialog, you will be disconnected and then your XMPP account AND your SàT profile will both be DELETED."))
344 target = D_('contact list, messages history, blog posts and comments' if 'GROUPBLOG' in self.host.plugins else D_('contact list and messages history')) 344 target = D_('contact list, messages history, blog posts and comments' if 'GROUPBLOG' in self.host.plugins else D_('contact list and messages history'))
345 form_ui.addText(D_("All your data stored on %(server)s, including your %(target)s will be erased.") % {'server': self._getNewAccountDomain(), 'target': target}) 345 form_ui.addText(D_("All your data stored on %(server)s, including your %(target)s will be erased.") % {'server': self.getNewAccountDomain(), 'target': target})
346 form_ui.addText(D_("There is no other confirmation dialog, this is the very last one! Are you sure?")) 346 form_ui.addText(D_("There is no other confirmation dialog, this is the very last one! Are you sure?"))
347 return {'xmlui': form_ui.toXml()} 347 return {'xmlui': form_ui.toXml()}
348 348
349 def __deleteAccountCb(self, data, profile): 349 def __deleteAccountCb(self, data, profile):
350 """Actually delete the XMPP account and SàT profile 350 """Actually delete the XMPP account and SàT profile