[PC-BSD Commits] r13139 - pcbsd/current/src-qt4/pc-sysinstaller

svn at pcbsd.org svn at pcbsd.org
Wed Oct 5 06:16:36 PDT 2011


Author: kris
Date: 2011-10-05 06:16:36 -0700 (Wed, 05 Oct 2011)
New Revision: 13139

Modified:
   pcbsd/current/src-qt4/pc-sysinstaller/sys-userwidget.cpp
   pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.h
   pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.ui
Log:

Use a validator on the username field instead of input mask



Modified: pcbsd/current/src-qt4/pc-sysinstaller/sys-userwidget.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-sysinstaller/sys-userwidget.cpp	2011-10-05 12:55:33 UTC (rev 13138)
+++ pcbsd/current/src-qt4/pc-sysinstaller/sys-userwidget.cpp	2011-10-05 13:16:36 UTC (rev 13139)
@@ -32,6 +32,8 @@
   //Setup any regular expressions we will need
   passwordRegExp.setPattern("([a-z]*[A-Z]*[0-9]*[!\"\xef\xbf\xbd$%^&*()_+=\xef\xbf\xbd#'`@~:?<>|{}\\-.]*)+");
 
+  usernameRegExp.setPattern("([a-z][A-Z][0-9]");
+
   // Disable add / apply buttons
   pushAddUser->setEnabled(false);
   pushApplyUser->setEnabled(false);
@@ -93,7 +95,7 @@
      textAcctNotify->setText(tr("Error: User passwords do not match!"));
 
    //Check username contains only letters and numbers  
-   if ((! passwordRegExp.exactMatch(lineUserName->text())) && (lineUserName->text() != "")) {
+   if ((! usernameRegExp.exactMatch(lineUserName->text())) && (lineUserName->text() != "")) {
      textAcctNotify->setText(tr("Username may contain only letters and numbers!"));
      ok = FALSE;
    }

Modified: pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.h
===================================================================
--- pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.h	2011-10-05 12:55:33 UTC (rev 13138)
+++ pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.h	2011-10-05 13:16:36 UTC (rev 13139)
@@ -142,6 +142,7 @@
     bool checkUserAccountInfo();
 
     QRegExp passwordRegExp;
+    QRegExp usernameRegExp;
 
     QString getDiskScheme(QString disk);
     void connectDiskSlots(); // Function to connect disk-related slots

Modified: pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.ui
===================================================================
--- pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.ui	2011-10-05 12:55:33 UTC (rev 13138)
+++ pcbsd/current/src-qt4/pc-sysinstaller/sysinstaller.ui	2011-10-05 13:16:36 UTC (rev 13139)
@@ -6904,11 +6904,8 @@
                         </item>
                         <item row="0" column="1">
                          <widget class="QLineEdit" name="lineUserName">
-                          <property name="inputMask">
-                           <string notr="true">NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN; </string>
-                          </property>
                           <property name="maxLength">
-                           <number>35</number>
+                           <number>64</number>
                           </property>
                          </widget>
                         </item>



More information about the Commits mailing list