diff options
-rw-r--r-- | indra/newview/llpanellogin.cpp | 47 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_login.xml | 18 |
2 files changed, 46 insertions, 19 deletions
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 87d101b00f..46420ce503 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -213,7 +213,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } #if !USE_VIEWER_AUTH - childSetPrevalidate("first_name_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); + //childSetPrevalidate("login_id_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); childSetPrevalidate("last_name_edit", LLLineEditor::prevalidateASCIIPrintableNoSpace); childSetCommitCallback("password_edit", mungePassword, this); @@ -498,7 +498,7 @@ void LLPanelLogin::giveFocus() if( sInstance ) { // Grab focus and move cursor to first blank input field - std::string first = sInstance->childGetText("first_name_edit"); + std::string first = sInstance->childGetText("login_id_edit"); std::string pass = sInstance->childGetText("password_edit"); BOOL have_first = !first.empty(); @@ -514,7 +514,7 @@ void LLPanelLogin::giveFocus() else { // User doesn't have a name, so start there. - edit = sInstance->getChild<LLLineEditor>("first_name_edit"); + edit = sInstance->getChild<LLLineEditor>("login_id_edit"); } if (edit) @@ -536,8 +536,8 @@ void LLPanelLogin::showLoginWidgets() // *TODO: Append all the usual login parameters, like first_login=Y etc. std::string splash_screen_url = sInstance->getString("real_url"); web_browser->navigateTo( splash_screen_url, "text/html" ); - LLUICtrl* first_name_edit = sInstance->getChild<LLUICtrl>("first_name_edit"); - first_name_edit->setFocus(TRUE); + LLUICtrl* login_id_edit = sInstance->getChild<LLUICtrl>("login_id_edit"); + login_id_edit->setFocus(TRUE); } // static @@ -569,8 +569,15 @@ void LLPanelLogin::setFields(const std::string& firstname, return; } - sInstance->childSetText("first_name_edit", firstname); - sInstance->childSetText("last_name_edit", lastname); + std::string login_id = firstname; + if (!lastname.empty()) + { + // support traditional First Last name slurls + login_id += " "; + login_id += lastname; + } + sInstance->childSetText("login_id_edit", login_id); + sInstance->childSetText("last_name_edit", std::string()); // Max "actual" password length is 16 characters. // Hex digests are always 32 characters. @@ -623,10 +630,24 @@ void LLPanelLogin::getFields(std::string *firstname, return; } - *firstname = sInstance->childGetText("first_name_edit"); - LLStringUtil::trim(*firstname); + std::string login_id = sInstance->childGetText("login_id_edit"); + LLStringUtil::trim(login_id); - *lastname = sInstance->childGetText("last_name_edit"); + U32 pos = login_id.find(' '); + if (pos != std::string::npos) + { + // old-style Firstname Lastname + *firstname = login_id.substr(0, pos); + *lastname = login_id.substr(pos+1); + } + else + { + // new-style single SLID string + *firstname = login_id; + *lastname = "Resident"; + } + + LLStringUtil::trim(*firstname); LLStringUtil::trim(*lastname); *password = sInstance->mMungedPassword; @@ -896,8 +917,10 @@ void LLPanelLogin::onClickConnect(void *) // JC - Make sure the fields all get committed. sInstance->setFocus(FALSE); - std::string first = sInstance->childGetText("first_name_edit"); - std::string last = sInstance->childGetText("last_name_edit"); + // Do SLID "Resident" name mangling + std::string first, last, unused_password; + getFields(&first, &last, &unused_password); + LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo"); std::string combo_text = combo->getSimple(); diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index df942b1a26..30506dcde4 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -60,7 +60,7 @@ name="first_name_text" top="20" left="20" width="150"> -First name: + Second Life ID: </text> <line_editor follows="left|bottom" @@ -69,20 +69,23 @@ height="22" label="First" left_delta="0" max_length="31" -name="first_name_edit" +name="login_id_edit" +prevalidate_callback="ascii" select_on_focus="true" -tool_tip="[SECOND_LIFE] First Name" +tool_tip="[SECOND_LIFE] ID" top_pad="0" - width="135" /> + width="200" /> <text follows="left|bottom" font="SansSerifSmall" height="16" - left_pad="8" + left="230" name="last_name_text" top="20" + visible="false" width="150"> - Last name: </text> + Last name: + </text> <line_editor follows="left|bottom" handle_edit_keys_directly="true" @@ -93,12 +96,13 @@ name="last_name_edit" select_on_focus="true" tool_tip="[SECOND_LIFE] Last Name" top_pad="0" + visible="false" width="135" /> <text follows="left|bottom" font="SansSerifSmall" height="15" -left_pad="8" +left="230" name="password_text" top="20" width="150"> |