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);