Focus the password field on Enter if it's empty and not yet active.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29145 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2009-02-06 23:54:39 +00:00
parent 4a9f6b4a06
commit 09a51729ad

View File

@ -158,6 +158,14 @@ LoginView::MessageReceived(BMessage *message)
break;
case kAttemptLogin:
{
// if no pass specified and we were selecting the user,
// give a chance to enter the password
// else we might want to enter an empty password.
if (strlen(fPasswordControl->Text()) < 1
&& (fUserList->IsFocus() || fLoginControl->IsFocus())) {
fPasswordControl->MakeFocus();
break;
}
BMessage *m = new BMessage(kAttemptLogin);
m->AddString("login", fLoginControl->Text());
m->AddString("password", fPasswordControl->Text());