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

svn at pcbsd.org svn at pcbsd.org
Wed Aug 1 12:41:12 PDT 2012


Author: kenmoore
Date: 2012-08-01 19:41:12 +0000 (Wed, 01 Aug 2012)
New Revision: 18079

Modified:
   pcbsd-projects/PCDM/fancySwitcher.cpp
   pcbsd-projects/PCDM/pcdm-gui.cpp
Log:
Clean up the keyboard interface for PCDM a bit (ctrl+[up/down/left/right] keyboard shortcuts for fancySwitcher class)



Modified: pcbsd-projects/PCDM/fancySwitcher.cpp
===================================================================
--- pcbsd-projects/PCDM/fancySwitcher.cpp	2012-08-01 18:48:06 UTC (rev 18078)
+++ pcbsd-projects/PCDM/fancySwitcher.cpp	2012-08-01 19:41:12 UTC (rev 18079)
@@ -33,7 +33,9 @@
   if(isHorizontal){
     iconViewer->setFixedSize(2*iconSize,iconSize+2);
     pushBack->setIcon(QIcon(":images/left.png"));
+    pushBack->setShortcut(tr("Ctrl+Left"));
     pushForward->setIcon(QIcon(":images/right.png"));
+    pushForward->setShortcut(tr("Ctrl+Right"));
     layout->addWidget(pushBack,1,1);
     layout->addWidget(iconViewer,1,2);
     layout->addWidget(pushForward,1,3);
@@ -41,7 +43,9 @@
   }else{ //vertical
     iconViewer->setFixedSize(iconSize+2,2*iconSize);
     pushBack->setIcon(QIcon(":images/up.png"));
+    pushBack->setShortcut(tr("Ctrl+Up"));
     pushForward->setIcon(QIcon(":images/down.png"));
+    pushForward->setShortcut(tr("Ctrl+Down"));
     layout->addWidget(pushBack,1,1);
     layout->addWidget(iconViewer,2,1);
     layout->addWidget(textLabel,3,1);

Modified: pcbsd-projects/PCDM/pcdm-gui.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-gui.cpp	2012-08-01 18:48:06 UTC (rev 18078)
+++ pcbsd-projects/PCDM/pcdm-gui.cpp	2012-08-01 19:41:12 UTC (rev 18079)
@@ -218,20 +218,32 @@
   QString username = Backend::getUsernameFromDisplayname(displayname);
   QString password = pwline->text();
   QString binary = Backend::getDesktopBinary(deSwitcher->currentItem());
-  qDebug() << displayname << username << password << binary; 
   //Disable user input while confirming login
-  
+  unameline->setEnabled(FALSE);
+  pwline->setEnabled(FALSE);
+  deSwitcher->setEnabled(FALSE);
+  toolbar->setEnabled(FALSE);
   //Try to login
-  bool success = Backend::startUserLogin(username, password, binary);
-  qDebug() << displayname << username << password << binary << success;  
+  bool success = Backend::startUserLogin(username, password, binary); 
   if(success){
     slotClosePCDM();
   }else{
     pwline->setText("");
     //Display an info box that the login failed
-    
+    QMessageBox notice;
+    notice.setWindowTitle(tr("Invalid Username/Password"));
+    notice.setIcon(QMessageBox::Warning);
+    notice.setText(tr("Username/Password combination is invalid, please try again."));
+    notice.setInformativeText("("+tr("Tip")+": "+tr("Make sure that caps-lock is turned off.")+")");
+    notice.setStandardButtons(QMessageBox::Ok);
+    notice.setDefaultButton(QMessageBox::Ok);
+    notice.exec();
   }
-
+  //Re-Enable user input
+  unameline->setEnabled(TRUE);
+  pwline->setEnabled(TRUE);
+  deSwitcher->setEnabled(TRUE);
+  toolbar->setEnabled(TRUE);
 }
 
 void PCDMgui::slotShutdownComputer(){



More information about the Commits mailing list