From 09a51729adcc2bed1a063f827c37ef02aa1f3dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Fri, 6 Feb 2009 23:54:39 +0000 Subject: [PATCH] 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 --- src/apps/login/LoginView.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/apps/login/LoginView.cpp b/src/apps/login/LoginView.cpp index 8fa61c5a93..b269d3e4f3 100644 --- a/src/apps/login/LoginView.cpp +++ b/src/apps/login/LoginView.cpp @@ -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());