summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellogin.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-11-05 16:34:12 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-11-05 16:34:12 -0500
commit379bc7bd1db5a728a730f7e0e7d0a3bfbdfc3870 (patch)
tree1fcc28c339e30905c276556d2718a66dc6094db1 /indra/newview/llpanellogin.cpp
parentad4102db1b0b6730d6d1fe7119cab2149bb48e2c (diff)
STEAM-14: login when user presses Enter at username or password.
The tricky thing about this fix is that the "Log In" button used to be in the same layout_panel as the username and password fields. Now it's not, so the fact that it's the default button for its layout_panel doesn't matter because that layout_panel doesn't have focus. Richard pointed out that we can make the commit action for the username and password fields initiate login -- as long as neither field implicitly runs its commit action when it loses focus!
Diffstat (limited to 'indra/newview/llpanellogin.cpp')
-rw-r--r--indra/newview/llpanellogin.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 58e9a6b342..bcb90bcb56 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -139,14 +139,17 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
mLogoImage = LLUI::getUIImage("startup_logo");
buildFromFile( "panel_login.xml");
-
+
reshape(rect.getWidth(), rect.getHeight());
- getChild<LLLineEditor>("password_edit")->setKeystrokeCallback(onPassKey, this);
+ LLLineEditor* password_edit(getChild<LLLineEditor>("password_edit"));
+ password_edit->setKeystrokeCallback(onPassKey, this);
+ // STEAM-14: When user presses Enter with this field in focus, initiate login
+ password_edit->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnect, this));
// change z sort of clickable text to be behind buttons
sendChildToBack(getChildView("forgot_password_text"));
-
+
LLComboBox* location_combo = getChild<LLComboBox>("start_location_combo");
updateLocationSelectorsVisibility(); // separate so that it can be called from preferences
location_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLocationSLURL, this));
@@ -220,14 +223,17 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
// get the web browser control
LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html");
web_browser->addObserver(this);
-
+
reshapeBrowser();
loadLoginPage();
-
+
// Show last logged in user favorites in "Start at" combo.
addUsersWithFavoritesToUsername();
- getChild<LLComboBox>("username_combo")->setTextChangedCallback(boost::bind(&LLPanelLogin::addFavoritesToStartLocation, this));
+ LLComboBox* username_combo(getChild<LLComboBox>("username_combo"));
+ username_combo->setTextChangedCallback(boost::bind(&LLPanelLogin::addFavoritesToStartLocation, this));
+ // STEAM-14: When user presses Enter with this field in focus, initiate login
+ username_combo->setCommitCallback(boost::bind(&LLPanelLogin::onClickConnect, this));
}
void LLPanelLogin::addUsersWithFavoritesToUsername()