diff --git a/indra/newview/app_settings/default_grids.xml b/indra/newview/app_settings/default_grids.xml index 918bffcd4..83b33cf15 100755 --- a/indra/newview/app_settings/default_grids.xml +++ b/indra/newview/app_settings/default_grids.xml @@ -1,10 +1,9 @@ - + + default_grids_version1 + diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d2bd71f55..0f9f1a610 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10741,7 +10741,7 @@ Type Boolean Value - 0 + 1 ShowTangentBasis diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index 8bd04972a..1cc6eca64 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -954,7 +954,7 @@ void HippoGridManager::saveFile() } // write client grid info file - std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"); + std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.xml"); llofstream file; file.open(fileName.c_str()); if (file.is_open()) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 5fae31fbb..b16fea04f 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -89,6 +89,10 @@ #include "llviewermessage.h" #include // +#include +#include "llstring.h" +#include + #define USE_VIEWER_AUTH 0 const S32 BLACK_BORDER_HEIGHT = 160; @@ -98,6 +102,30 @@ LLPanelLogin *LLPanelLogin::sInstance = NULL; BOOL LLPanelLogin::sCapslockDidNotification = FALSE; +static bool nameSplit(const std::string& full, std::string& first, std::string& last) { + std::vector fragments; + boost::algorithm::split(fragments, full, boost::is_any_of(" .")); + if (fragments.size() == 0) + return false; + first = fragments[0]; + if (fragments.size() == 1) + last = "resident"; + else + last = fragments[1]; + return (fragments.size() <= 2); +} + +static std::string nameJoin(const std::string& first,const std::string& last) { + if (last.empty() || boost::algorithm::iequals(last, "resident")) + return first; + else { + if(std::islower(last[0])) + return first + "." + last; + else + return first + " " + last; + } +} + class LLLoginRefreshHandler : public LLCommandHandler { public: @@ -216,16 +244,11 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, reshape(rect.getWidth(), rect.getHeight()); #if !USE_VIEWER_AUTH - LLComboBox* first_name_combo = sInstance->getChild("first_name_combo"); - first_name_combo->setCommitCallback(onSelectLoginEntry); - first_name_combo->setFocusLostCallback(onLoginComboLostFocus); - first_name_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNoSpace); - first_name_combo->setSuppressTentative(true); - - - LLLineEditor* last_name_edit = sInstance->getChild("last_name_edit"); - last_name_edit->setPrevalidate(LLLineEditor::prevalidatePrintableNoSpace); - last_name_edit->setCommitCallback(onLastNameEditLostFocus); + LLComboBox* name_combo = sInstance->getChild("name_combo"); + name_combo->setCommitCallback(onSelectLoginEntry); + name_combo->setFocusLostCallback(onLoginComboLostFocus); + name_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNotPipe); + name_combo->setSuppressTentative(true); childSetCommitCallback("remember_name_check", onNameCheckChanged); childSetCommitCallback("password_edit", mungePassword); @@ -445,7 +468,7 @@ void LLPanelLogin::setLoginHistory(LLSavedLogins const& login_history) { sInstance->mLoginHistoryData = login_history; - LLComboBox* login_combo = sInstance->getChild("first_name_combo"); + LLComboBox* login_combo = sInstance->getChild("name_combo"); llassert(login_combo); login_combo->clear(); @@ -454,7 +477,8 @@ void LLPanelLogin::setLoginHistory(LLSavedLogins const& login_history) i != saved_login_entries.rend(); ++i) { LLSD e = i->asLLSD(); - if (e.isMap()) login_combo->add(i->getDisplayString(), e); + if (e.isMap()) + login_combo->add(nameJoin(i->getFirstName(), i->getLastName()), e); } } @@ -571,7 +595,7 @@ void LLPanelLogin::giveFocus() if( sInstance ) { // Grab focus and move cursor to first blank input field - std::string first = sInstance->childGetText("first_name_combo"); + std::string first = sInstance->childGetText("name_combo"); std::string pass = sInstance->childGetText("password_edit"); BOOL have_first = !first.empty(); @@ -580,7 +604,7 @@ void LLPanelLogin::giveFocus() if (!have_first) { // User doesn't have a name, so start there. - LLComboBox* combo = sInstance->getChild("first_name_combo"); + LLComboBox* combo = sInstance->getChild("name_combo"); combo->setFocusText(TRUE); } else if (!have_pass) @@ -633,11 +657,10 @@ void LLPanelLogin::setFields(const std::string& firstname, return; } - LLComboBox* login_combo = sInstance->getChild("first_name_combo"); - sInstance->childSetText("last_name_edit", lastname); + LLComboBox* login_combo = sInstance->getChild("name_combo"); llassert_always(firstname.find(' ') == std::string::npos); - login_combo->setLabel(firstname); + login_combo->setLabel(nameJoin(firstname, lastname)); // Max "actual" password length is 16 characters. // Hex digests are always 32 characters. @@ -674,15 +697,11 @@ void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus) } LLCheckBoxCtrl* remember_pass_check = sInstance->getChild("remember_check"); - LLComboBox* login_combo = sInstance->getChild("first_name_combo"); - login_combo->setLabel(entry.getFirstName()); - login_combo->resetDirty(); - login_combo->resetTextDirty(); - - LLLineEditor* last_name = sInstance->getChild("last_name_edit"); - last_name->setText(entry.getLastName()); - last_name->resetDirty(); - + std::string fullname = nameJoin(entry.getFirstName(), entry.getLastName()); + LLComboBox* login_combo = sInstance->getChild("name_combo"); + login_combo->setLabel(fullname); + sInstance->childSetText("name_combo", fullname); + if (entry.getPassword().empty()) { sInstance->childSetText("password_edit", std::string("")); @@ -714,10 +733,8 @@ void LLPanelLogin::getFields(std::string *firstname, return; } - *firstname = sInstance->childGetText("first_name_combo"); + nameSplit(sInstance->childGetText("name_combo"), *firstname, *lastname); LLStringUtil::trim(*firstname); - - *lastname = sInstance->childGetText("last_name_edit"); LLStringUtil::trim(*lastname); *password = sInstance->mMungedPassword; @@ -1077,9 +1094,8 @@ void LLPanelLogin::onClickConnect(void *) // JC - Make sure the fields all get committed. sInstance->setFocus(FALSE); - std::string first = sInstance->childGetText("first_name_combo"); - std::string last = sInstance->childGetText("last_name_edit"); - if (!first.empty() && !last.empty()) + std::string first, last; + if (nameSplit(sInstance->childGetText("name_combo"), first, last)) { // has both first and last name typed sInstance->mCallback(0, sInstance->mCallbackData); @@ -1172,29 +1188,12 @@ void LLPanelLogin::onPassKey(LLLineEditor* caller, void* user_data) } } -// static -void LLPanelLogin::onLastNameEditLostFocus(LLUICtrl* ctrl, void* data) -{ - if (sInstance) - { - LLLineEditor* edit = sInstance->getChild("last_name_edit"); - if(ctrl == edit) - { - if (edit->isDirty()) - { - clearPassword(); - LLViewerLogin::getInstance()->setNameEditted(true); - } - } - } -} - // static void LLPanelLogin::onSelectLoginEntry(LLUICtrl* ctrl, void* data) { if (sInstance) { - LLComboBox* combo = sInstance->getChild("first_name_combo"); + LLComboBox* combo = sInstance->getChild("name_combo"); if (ctrl == combo) { LLSD selected_entry = combo->getSelectedValue(); @@ -1214,7 +1213,7 @@ void LLPanelLogin::onLoginComboLostFocus(LLFocusableElement* fe, void*) { if (sInstance) { - LLComboBox* combo = sInstance->getChild("first_name_combo"); + LLComboBox* combo = sInstance->getChild("name_combo"); if(fe == combo) { if (combo->isTextDirty()) diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 390830a9e..3c4887b85 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -79,7 +79,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 = true); + static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = false); //static void addServer(const std::string& server, S32 domain_name); static void refreshLocation( bool force_visible ); @@ -117,7 +117,6 @@ private: static void onPassKey(LLLineEditor* caller, void* user_data); //static void onSelectServer(LLUICtrl*, void*); //static void onServerComboLostFocus(LLFocusableElement*, void*); - static void onLastNameEditLostFocus(LLUICtrl* ctrl, void* data); static void onSelectLoginEntry(LLUICtrl*, void*); static void onLoginComboLostFocus(LLFocusableElement* fe, void*); static void onNameCheckChanged(LLUICtrl* ctrl, void* data); diff --git a/indra/newview/skins/default/xui/en-us/panel_login.xml b/indra/newview/skins/default/xui/en-us/panel_login.xml index 6c37057c1..6943f291a 100644 --- a/indra/newview/skins/default/xui/en-us/panel_login.xml +++ b/indra/newview/skins/default/xui/en-us/panel_login.xml @@ -14,66 +14,58 @@ - First Name: + left="32" mouse_opaque="true" name="name_label" v_pad="0" width="120"> + Name or Username: + max_chars="64" mouse_opaque="true" name="name_combo" + select_all_on_focus_received="true" width="155" allow_text_entry="true" /> - Last Name: - - - + left="203" mouse_opaque="true" name="password_text" v_pad="0" width="120"> Password: + left="199" mouse_opaque="true" name="remember_check" width="138" /> + left="339" mouse_opaque="true" name="grids_combo_text" v_pad="0" width="120"> Grid: + left="339" mouse_opaque="true" name="grids_combo" width="120" /> + +