[PC-BSD Commits] r21670 - pcbsd-projects/PCDM

svn at pcbsd.org svn at pcbsd.org
Wed Feb 27 13:34:27 PST 2013


Author: kenmoore
Date: 2013-02-27 21:34:26 +0000 (Wed, 27 Feb 2013)
New Revision: 21670

Modified:
   pcbsd-projects/PCDM/loginWidget.cpp
   pcbsd-projects/PCDM/loginWidget.h
Log:
Add a new signal to the login widget for when a user is selected/unselected, also remove an old function that is no longer necessary



Modified: pcbsd-projects/PCDM/loginWidget.cpp
===================================================================
--- pcbsd-projects/PCDM/loginWidget.cpp	2013-02-27 21:27:50 UTC (rev 21669)
+++ pcbsd-projects/PCDM/loginWidget.cpp	2013-02-27 21:34:26 UTC (rev 21670)
@@ -129,7 +129,8 @@
   pwVisible = FALSE;
   linePassword->clear(); //make sure the password is cleared if the user is changed
   updateWidget();
-  linePassword->setFocus(); 
+  linePassword->setFocus();
+  emit UserSelected(listUsers->currentText());
 }
 
 void LoginWidget::slotUserUnselected(){
@@ -138,6 +139,7 @@
   linePassword->clear(); //make sure the password is cleared if the user is changed
   updateWidget();
   listUsers->setFocus();
+  emit UserSelected("");
 }
 
 void LoginWidget::slotChangePWView(){
@@ -211,25 +213,6 @@
   }
 }
 
-void LoginWidget::setBackgroundFade(bool verticalFade, int percentfade, QString colorTL, QString colorBR){
-  //Set the background fade for the widget
-  QString style = "QGroupBox { background-color: qlineargradient(x1: 0, y1: 0, x2: %h, y2: %v, stop: 0 %c1, stop: 1 %c2); }";
-  if(percentfade >100){ percentfade = 100; }
-  if(percentfade < 0){percentfade = 0; }
-  double fade = percentfade/100.0;
-  if(verticalFade){
-    style.replace("%h","0");
-    style.replace("%v",QString::number(fade) );
-  }else{ //horizontal fade
-    style.replace("%v","0");
-    style.replace("%h",QString::number(fade) );
-  }
-  style.replace("%c1",colorTL);
-  style.replace("%c2",colorBR);
-  //qDebug() << "LoginWidget: background stylesheet:" << style;
-  this->setStyleSheet( style );
-}
-
 void LoginWidget::retranslateUi(){
   //Set all the text for the widget (to easily allow changing the locale)
   pushUserIcon->setText(tr("Select"));	

Modified: pcbsd-projects/PCDM/loginWidget.h
===================================================================
--- pcbsd-projects/PCDM/loginWidget.h	2013-02-27 21:27:50 UTC (rev 21669)
+++ pcbsd-projects/PCDM/loginWidget.h	2013-02-27 21:34:26 UTC (rev 21670)
@@ -45,7 +45,6 @@
 	void changeStyleSheet(QString item, QString style);
         
         void keyPressEvent(QKeyEvent *e);
-	void setBackgroundFade(bool verticalFade, int percentfade, QString colorTL, QString colorBR);
         void retranslateUi();
         void resetFocus(QString item="");
   
@@ -73,6 +72,7 @@
   signals:
 	//Emits these signals whenever a login request is detected
 	void loginRequested(QString user, QString password);
+	void UserSelected(QString user);
 	void escapePressed();
 
 };



More information about the Commits mailing list