Exemple #1
0
 def checkText(self, name):
     if self._currentName != name:
         self._currentName = name
         isAllowedResult, errorMsg = False, ''
         name, error = validateRosterItemGroup(self._currentName)
         if error:
             if self._currentName != '':
                 errorMsg = error.getMessage()
             else:
                 errorMsg = ''
         elif self.usersStorage.isGroupExists(name):
             errorMsg = i18n.makeString(MESSENGER.MESSENGER_CONTACTS_VIEW_ADDUSER_ERROR_GROUPALREADYEXIST)
         else:
             isAllowedResult = True
             self._currentName = name
         self.as_setLabelS(errorMsg)
         self.as_setOkBtnEnabledS(isAllowedResult)
 def checkText(self, name):
     name = name.strip()
     if self._currentName != name:
         self._currentName = name
         isAllowedResult, errorMsg = False, ''
         name, error = validateRosterItemGroup(self._currentName)
         if error:
             if self._currentName != '':
                 errorMsg = error.getMessage()
             else:
                 errorMsg = ''
         elif self.usersStorage.isGroupExists(name):
             errorMsg = i18n.makeString(MESSENGER.MESSENGER_CONTACTS_VIEW_ADDUSER_ERROR_GROUPALREADYEXIST)
         else:
             isAllowedResult = True
             self._currentName = name
         self.as_setLabelS(errorMsg)
         self.as_setOkBtnEnabledS(isAllowedResult)
Exemple #3
0
def _validateGroupName(name):
    return xmpp_string_utils.validateRosterItemGroup(name)[1]
Exemple #4
0
def _validateGroupName(name):
    return xmpp_string_utils.validateRosterItemGroup(name)[1]