Esempio n. 1
0
def add_group():
    group = GetTextFromUser(_("Please enter a group name:"), _("Add Group"))
    if group is None or not group.strip():
        return

    protos = [acct.connection for acct in profile.account_manager.connected_accounts]
    for proto in protos:
        with traceguard:
            proto.add_group(group)
Esempio n. 2
0
    def show(email = None):
        val = GetTextFromUser(_('Enter an email address:'),
                              _('Edit Account Email: {username}').format(username=oscar.self_buddy.name),
                              default_value = email or '')

        if val is None or not val.strip():
            return

        log.info('setting new account email %r', val)
        return set(val)
Esempio n. 3
0
def add_group():
    group = GetTextFromUser(_('Please enter a group name:'), _('Add Group'))
    if group is None or not group.strip():
        return

    protos = [
        acct.connection for acct in profile.account_manager.connected_accounts
    ]
    for proto in protos:
        with traceguard:
            proto.add_group(group)
Esempio n. 4
0
    def rename_gui(self):
        from gui.toolbox import GetTextFromUser

        localalias = self.alias
        if localalias is None:
            localalias = ''

        s = GetTextFromUser(_('Enter an alias for %s:') % self.name,
                                           caption = _('Rename %s') % self.name,
                                           default_value = localalias )
        if s is not None:
            if s == '' or s.strip():
                # dialog returns None if "Cancel" button is pressed -- that means do nothing

                # rename expects None to mean "no alias" and anything else to mean an alias--so
                # do the bool check to turn '' into None here.
                self.rename(s if s else None)
                return s
Esempio n. 5
0
    def rename_gui(self):
        from gui.toolbox import GetTextFromUser

        localalias = self.alias
        if localalias is None:
            localalias = ''

        s = GetTextFromUser(_('Enter an alias for %s:') % self.name,
                            caption=_('Rename %s') % self.name,
                            default_value=localalias)
        if s is not None:
            if s == '' or s.strip():
                # dialog returns None if "Cancel" button is pressed -- that means do nothing

                # rename expects None to mean "no alias" and anything else to mean an alias--so
                # do the bool check to turn '' into None here.
                self.rename(s if s else None)
                return s