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
This commit is contained in:
Inusaito Sayori
2013-08-06 21:30:09 -04:00
parent 2e36b569ad
commit ae9eb0003e
2 changed files with 11 additions and 2 deletions

View File

@@ -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<LLButton>("connect_btn"));
findChild<LLPanel>("name_panel")->setDefaultBtn(connect_btn);
findChild<LLPanel>("password_panel")->setDefaultBtn(connect_btn);
findChild<LLPanel>("grids_panel")->setDefaultBtn(connect_btn);
findChild<LLPanel>("location_panel")->setDefaultBtn(connect_btn);
findChild<LLPanel>("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<LLComboBox>("username_combo")->getTextEntry(), first, last))

View File

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