diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index e96e4d368..852add435 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -191,6 +191,8 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect) password_edit->setCommitCallback(mungePassword, this); password_edit->setDrawAsterixes(TRUE); + getChild("remove_login")->setCommitCallback(boost::bind(&LLPanelLogin::removeLogin, this)); + // change z sort of clickable text to be behind buttons sendChildToBack(getChildView("channel_text")); sendChildToBack(getChildView("forgot_password_text")); @@ -354,6 +356,8 @@ void LLPanelLogin::reshapeBrowser() LLPanelLogin::~LLPanelLogin() { + std::string login_hist_filepath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "saved_logins_sg2.xml"); + LLSavedLogins::saveFile(mLoginHistoryData, login_hist_filepath); LLPanelLogin::sInstance = NULL; if ( gFocusMgr.getDefaultKeyboardFocus() == this ) @@ -1127,3 +1131,17 @@ void LLPanelLogin::clearPassword() sInstance->mIncomingPassword = blank; sInstance->mMungedPassword = blank; } + +void LLPanelLogin::removeLogin() +{ + LLComboBox* combo(getChild("username_combo")); + const std::string label(combo->getTextEntry()); + if (combo->isTextDirty() || !combo->itemExists(label)) return; // Text entries aren't in the list + const LLSD& selected = combo->getSelectedValue(); + if (!selected.isUndefined()) + { + mLoginHistoryData.deleteEntry(selected.get("firstname").asString(), selected.get("lastname").asString(), selected.get("grid").asString()); + combo->remove(label); + combo->selectFirstItem(); + } +} diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 05c4c3b18..1030eb332 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -118,6 +118,7 @@ private: void onLoginComboLostFocus(LLComboBox* combo_box); static void onNameCheckChanged(LLUICtrl* ctrl, void* data); static void clearPassword(); + void removeLogin(); public: diff --git a/indra/newview/llsavedlogins.h b/indra/newview/llsavedlogins.h index 5461bae8e..1ca24c132 100644 --- a/indra/newview/llsavedlogins.h +++ b/indra/newview/llsavedlogins.h @@ -158,7 +158,7 @@ public: * @brief Deletes a login history entry by looking up its name and grid. * @param firstname First name to find and delete. * @param lastname Last name to find and delete. - * @param grid grif nickname to find and delete. + * @param grid grid nickname to find and delete. */ void deleteEntry(const std::string& firstname, const std::string& lastname, const std::string& grid); /** 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 cc2257ab7..d545394f9 100644 --- a/indra/newview/skins/default/xui/en-us/panel_login.xml +++ b/indra/newview/skins/default/xui/en-us/panel_login.xml @@ -14,7 +14,7 @@ http://secondlife.com/account/request.php - + +