From ae9eb0003eb1d6fcebd37ea1d121ff9d5e48363d Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 6 Aug 2013 21:30:09 -0400 Subject: [PATCH] Fix Issue 938: Pressing enter on the login screen doesn't log in Fixes side issue with location combo's focus not being lost during onClickConnect --- indra/newview/llpanellogin.cpp | 11 ++++++++++- indra/newview/llpanellogin.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index fa9f8a326..11ae08101 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -245,6 +245,15 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, childSetAction("connect_btn", onClickConnect, this); setDefaultBtn("connect_btn"); + // Also set default button for subpanels, otherwise hitting enter in text entry fields won't login + { + LLButton* connect_btn(findChild("connect_btn")); + findChild("name_panel")->setDefaultBtn(connect_btn); + findChild("password_panel")->setDefaultBtn(connect_btn); + findChild("grids_panel")->setDefaultBtn(connect_btn); + findChild("location_panel")->setDefaultBtn(connect_btn); + findChild("login_html")->setDefaultBtn(connect_btn); + } childSetAction("grids_btn", onClickGrids, this); @@ -888,7 +897,7 @@ void LLPanelLogin::onClickConnect(void *) { // JC - Make sure the fields all get committed. - sInstance->setFocus(FALSE); + gFocusMgr.setKeyboardFocus(NULL); std::string first, last, password; if (nameSplit(sInstance->getChild("username_combo")->getTextEntry(), first, last)) diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 2158105e0..b1a7ff935 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -78,7 +78,7 @@ public: * @brief Set the values of the displayed fields from a populated history entry. * @param entry History entry containing all necessary fields. */ - static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = false); + static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = true); static void getFields(std::string *firstname, std::string *lastname, std::string *password);