diff options
Diffstat (limited to 'src/leap/gui/wizard.py')
-rw-r--r-- | src/leap/gui/wizard.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/leap/gui/wizard.py b/src/leap/gui/wizard.py index f8a1f833..ef4eafdb 100644 --- a/src/leap/gui/wizard.py +++ b/src/leap/gui/wizard.py @@ -49,6 +49,8 @@ class Wizard(QtGui.QWizard): WEAK_PASSWORDS = ("123456", "qweasd", "qwerty", "password") + BARE_USERNAME_REGEX = r"^[A-Za-z\d_]+$" + def __init__(self, checker): QtGui.QWizard.__init__(self) @@ -110,6 +112,10 @@ class Wizard(QtGui.QWizard): self.ui.btnRegister.clicked.connect( self._register) + usernameRe = QtCore.QRegExp(self.BARE_USERNAME_REGEX) + self.ui.lblUser.setValidator( + QtGui.QRegExpValidator(usernameRe, self)) + self._username = None self._password = None |