@@ -355,24 +361,28 @@ class AddAccountDialog(base_class, ui_class):
...
@@ -355,24 +361,28 @@ class AddAccountDialog(base_class, ui_class):
def_SH_ValidityStatusChanged(self):
def_SH_ValidityStatusChanged(self):
red='#cc0000'
red='#cc0000'
# validate the add panel
# validate the add panel
ifnotself.display_name_editor.valid:
ifnotself.display_name_editor.text_valid:
self.add_status_label.value=Status("Display name cannot be empty",color=red)
self.add_status_label.value=Status("Display name cannot be empty",color=red)
elifnotself.sip_address_editor.valid:
elifnotself.sip_address_editor.text_correct:
self.add_status_label.value=Status("SIP address should be specified as user@domain",color=red)
self.add_status_label.value=Status("SIP address should be specified as user@domain",color=red)
elifnotself.password_editor.valid:
elifnotself.sip_address_editor.text_allowed:
self.add_status_label.value=Status("SIP address in use by another account",color=red)
elifnotself.password_editor.text_valid:
self.add_status_label.value=Status("Password cannot be empty",color=red)
self.add_status_label.value=Status("Password cannot be empty",color=red)
else:
else:
self.add_status_label.value=None
self.add_status_label.value=None
# validate the create panel
# validate the create panel
ifnotself.name_editor.valid:
ifnotself.name_editor.text_valid:
self.create_status_label.value=Status("Name cannot be empty",color=red)
self.create_status_label.value=Status("Name cannot be empty",color=red)
elifnotself.username_editor.valid:
elifnotself.username_editor.text_correct:
self.create_status_label.value=Status("Username should have 5 to 32 characters, start with a letter or non-zero digit, contain only letters, digits or .-_ and end with a letter or digit",color=red)
self.create_status_label.value=Status("Username should have 5 to 32 characters, start with a letter or non-zero digit, contain only letters, digits or .-_ and end with a letter or digit",color=red)
elifnotself.new_password_editor.valid:
elifnotself.username_editor.text_allowed:
self.create_status_label.value=Status("The username you requested is already taken. Please choose another one and try again.",color=red)
elifnotself.new_password_editor.text_valid:
self.create_status_label.value=Status("Password should contain at least 8 characters",color=red)
self.create_status_label.value=Status("Password should contain at least 8 characters",color=red)
elifnotself.verify_password_editor.valid:
elifnotself.verify_password_editor.text_valid:
self.create_status_label.value=Status("Passwords do not match",color=red)
self.create_status_label.value=Status("Passwords do not match",color=red)
elifnotself.email_address_editor.valid:
elifnotself.email_address_editor.text_valid:
self.create_status_label.value=Status("E-mail address should be specified as user@domain",color=red)
self.create_status_label.value=Status("E-mail address should be specified as user@domain",color=red)
else:
else:
self.create_status_label.value=None
self.create_status_label.value=None
...
@@ -381,7 +391,7 @@ class AddAccountDialog(base_class, ui_class):
...
@@ -381,7 +391,7 @@ class AddAccountDialog(base_class, ui_class):
call_in_gui_thread(setattr,self.create_status_label,'value',Status('The username you requested is already taken. Please choose another one and try again.',color=red))