[PC-BSD Commits] r508 - pcbsd/trunk/PCInstall

svn at pcbsd.org svn at pcbsd.org
Tue Jul 17 10:35:01 PDT 2007


Author: tim
Date: 2007-07-17 18:35:00 +0100 (Tue, 17 Jul 2007)
New Revision: 508

Modified:
   pcbsd/trunk/PCInstall/pcinstall.ui
   pcbsd/trunk/PCInstall/pcinstall.ui.h
Log:
Changed password fields so that colouration due to passwords not matching only takes place when focus is lost.

Modified: pcbsd/trunk/PCInstall/pcinstall.ui
===================================================================
--- pcbsd/trunk/PCInstall/pcinstall.ui	2007-07-17 17:35:00 UTC (rev 507)
+++ pcbsd/trunk/PCInstall/pcinstall.ui	2007-07-17 17:35:00 UTC (rev 508)
@@ -2602,11 +2602,11 @@
             </widget>
             <widget class="QLineEdit">
                 <property name="name">
-                    <cstring>linePassword</cstring>
+                    <cstring>linePassword2</cstring>
                 </property>
                 <property name="geometry">
                     <rect>
-                        <x>110</x>
+                        <x>450</x>
                         <y>20</y>
                         <width>140</width>
                         <height>30</height>
@@ -2616,36 +2616,36 @@
                     <enum>Password</enum>
                 </property>
             </widget>
-            <widget class="QLineEdit">
+            <widget class="QLabel">
                 <property name="name">
-                    <cstring>linePassword2</cstring>
+                    <cstring>textLabel5</cstring>
                 </property>
                 <property name="geometry">
                     <rect>
-                        <x>450</x>
+                        <x>270</x>
                         <y>20</y>
-                        <width>140</width>
+                        <width>180</width>
                         <height>30</height>
                     </rect>
                 </property>
-                <property name="echoMode">
-                    <enum>Password</enum>
+                <property name="text">
+                    <string>Verify password:</string>
                 </property>
             </widget>
-            <widget class="QLabel">
+            <widget class="QLineEdit">
                 <property name="name">
-                    <cstring>textLabel5</cstring>
+                    <cstring>linePassword</cstring>
                 </property>
                 <property name="geometry">
                     <rect>
-                        <x>270</x>
+                        <x>110</x>
                         <y>20</y>
-                        <width>180</width>
+                        <width>140</width>
                         <height>30</height>
                     </rect>
                 </property>
-                <property name="text">
-                    <string>Verify password:</string>
+                <property name="echoMode">
+                    <enum>Password</enum>
                 </property>
             </widget>
         </widget>
@@ -7761,7 +7761,7 @@
     <slot>ProgramInit()</slot>
     <slot>PageChangedSlot( const QString &amp; Page )</slot>
     <slot>ChangeLicAgreeSlot( bool clicked )</slot>
-    <slot access="private">CheckAccountInfo()</slot>
+    <slot>CheckAccountInfo()</slot>
     <slot>passwordTextChanged()</slot>
     <slot>reject()</slot>
     <slot access="private">addUserButton()</slot>
@@ -7819,6 +7819,8 @@
     <slot access="private">slotRunInstallLangCD()</slot>
     <slot access="private">slotRunInstallComponents()</slot>
     <slot access="private">readInstallComponentSlot()</slot>
+    <slot>rootPasswordLineEditLostFocus()</slot>
+    <slot access="private">userPasswordLineEditLostFocus()</slot>
 </slots>
 <functions>
     <function access="private">loadLangs()</function>

Modified: pcbsd/trunk/PCInstall/pcinstall.ui.h
===================================================================
--- pcbsd/trunk/PCInstall/pcinstall.ui.h	2007-07-17 17:35:00 UTC (rev 507)
+++ pcbsd/trunk/PCInstall/pcinstall.ui.h	2007-07-17 17:35:00 UTC (rev 508)
@@ -38,12 +38,14 @@
     // Connect the various username objects and slots to the check function
     connect( linePassword, SIGNAL( textChanged(const QString &) ), this, SLOT(passwordTextChanged() ) );
     connect( linePassword2, SIGNAL( textChanged(const QString &) ), this, SLOT(passwordTextChanged() ) );
+    connect( linePassword2, SIGNAL(lostFocus()), this, SLOT(rootPasswordLineEditLostFocus()));
     
     // Connect the username fields to the enable / disable function for the pushbuttons
      connect( lineUserName, SIGNAL( textChanged(const QString &) ), this, SLOT(checkUserLinesChanged(const QString & ) ) );
      connect( lineFullName, SIGNAL( textChanged(const QString &) ), this, SLOT(checkUserLinesChanged(const QString & ) ) );
      connect( lineUserPassword, SIGNAL( textChanged(const QString &) ), this, SLOT(checkUserLinesChanged(const QString & ) ) );
      connect( lineUserPassword2, SIGNAL( textChanged(const QString &) ), this, SLOT(checkUserLinesChanged(const QString & ) ) );
+     connect( lineUserPassword2, SIGNAL(lostFocus()), this, SLOT(userPasswordLineEditLostFocus()));
      connect( listBoxUsers, SIGNAL( selectionChanged ()  ), this, SLOT(listBoxUsersChanged() ) );
     
      
@@ -448,7 +450,6 @@
 {
     int ok = 0;
     
-    
     if ( linePassword->text() == "" )
     {
        	textAcctNotify->setText("");
@@ -459,33 +460,21 @@
     if ( AddUserName[0].isEmpty() )
     {
 	textAcctNotify->setText(tr("You must setup at least one username to continue. "));
-	linePassword->setPaletteBackgroundColor(colourWhite);
-	linePassword2->setPaletteBackgroundColor(colourWhite);
 	ok = 1;
     }
     
-    
-     //Check if passwords match 
-    if (linePassword->text() != linePassword2->text() && ! linePassword->text().isEmpty() && ! linePassword2->text().isEmpty() ) {
-	textAcctNotify->setText(tr("Root passwords must match to continue."));
-	linePassword->setPaletteBackgroundColor(colourRed);
-	linePassword2->setPaletteBackgroundColor(colourRed);
-	ok = 1;
-    }
-    
-    
     //Check username password contains only letters and numbers
     if ((! passwordRegExp.exactMatch(linePassword->text())) && (linePassword->text() != "")) {
 	textAcctNotify->setText(tr("Warning: Root password may normally only use letters and numbers!"));
 	linePassword->setPaletteBackgroundColor(colourRed);
 	ok = 1;
     }
+    if (linePassword->text() != linePassword2->text() && ! linePassword->text().isEmpty() && ! linePassword2->text().isEmpty() )
+    {
+	textAcctNotify->setText(tr("Root passwords must match to continue."));
+	ok = 1;
+    }
     
-
-    
-    
-    
-    
     if(ok == 0)
     {
 	linePassword->setPaletteBackgroundColor(colourWhite);
@@ -2295,8 +2284,6 @@
     textAcctNotify->setText("");
     
     lineUserName->setPaletteBackgroundColor(colourWhite);
-    lineUserPassword->setPaletteBackgroundColor(colourWhite);
-    lineUserPassword2->setPaletteBackgroundColor(colourWhite);
     
             // Check if we are missing  some values
     if ( lineUserName->text().isEmpty() )
@@ -2339,8 +2326,6 @@
     if ( lineUserPassword->text() != lineUserPassword2->text() && ! lineUserPassword->text().isEmpty() && ! lineUserPassword2->text().isEmpty() )
     {
 	textAcctNotify->setText(tr("Error: User passwords do not match!"));
-	lineUserPassword->setPaletteBackgroundColor(colourRed);
-	lineUserPassword2->setPaletteBackgroundColor(colourRed);
 	ok = FALSE;
     }
     
@@ -3114,3 +3099,38 @@
     textLicense->setText(lic);
     
 }
+
+
+void PCInstall::rootPasswordLineEditLostFocus()
+{
+    //Check if passwords match 
+    if (linePassword->text() != linePassword2->text() && ! linePassword->text().isEmpty() && ! linePassword2->text().isEmpty() )
+    {
+	textAcctNotify->setText(tr("Root passwords must match to continue."));
+	linePassword->setPaletteBackgroundColor(colourRed);
+	linePassword2->setPaletteBackgroundColor(colourRed);
+    }
+    else
+    {
+	textAcctNotify->setText(tr(""));
+	linePassword->setPaletteBackgroundColor(colourWhite);
+	linePassword2->setPaletteBackgroundColor(colourWhite);
+    }
+}
+
+
+void PCInstall::userPasswordLineEditLostFocus()
+{
+    //Check if passwords match 
+    if (lineUserPassword->text() != lineUserPassword2->text() && ! lineUserPassword->text().isEmpty() && ! lineUserPassword2->text().isEmpty() )
+    {
+	lineUserPassword->setPaletteBackgroundColor(colourRed);
+	lineUserPassword2->setPaletteBackgroundColor(colourRed);
+    }
+    else
+    {
+	lineUserPassword->setPaletteBackgroundColor(colourWhite);
+	lineUserPassword2->setPaletteBackgroundColor(colourWhite);
+    }
+    
+}



More information about the Commits mailing list