Solve Issue 1541: Remove old Logins
Little trash button next to the username box added, as its tooltip explains, if you have a valid entry selected and you click it, that entry will be removed. My test avatar was a fake entry by the name Garbage Tax Just thought I'd give that to the googles... enjoy~
This commit is contained in:
@@ -191,6 +191,8 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
|
|||||||
password_edit->setCommitCallback(mungePassword, this);
|
password_edit->setCommitCallback(mungePassword, this);
|
||||||
password_edit->setDrawAsterixes(TRUE);
|
password_edit->setDrawAsterixes(TRUE);
|
||||||
|
|
||||||
|
getChild<LLUICtrl>("remove_login")->setCommitCallback(boost::bind(&LLPanelLogin::removeLogin, this));
|
||||||
|
|
||||||
// change z sort of clickable text to be behind buttons
|
// change z sort of clickable text to be behind buttons
|
||||||
sendChildToBack(getChildView("channel_text"));
|
sendChildToBack(getChildView("channel_text"));
|
||||||
sendChildToBack(getChildView("forgot_password_text"));
|
sendChildToBack(getChildView("forgot_password_text"));
|
||||||
@@ -354,6 +356,8 @@ void LLPanelLogin::reshapeBrowser()
|
|||||||
|
|
||||||
LLPanelLogin::~LLPanelLogin()
|
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;
|
LLPanelLogin::sInstance = NULL;
|
||||||
|
|
||||||
if ( gFocusMgr.getDefaultKeyboardFocus() == this )
|
if ( gFocusMgr.getDefaultKeyboardFocus() == this )
|
||||||
@@ -1127,3 +1131,17 @@ void LLPanelLogin::clearPassword()
|
|||||||
sInstance->mIncomingPassword = blank;
|
sInstance->mIncomingPassword = blank;
|
||||||
sInstance->mMungedPassword = blank;
|
sInstance->mMungedPassword = blank;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLPanelLogin::removeLogin()
|
||||||
|
{
|
||||||
|
LLComboBox* combo(getChild<LLComboBox>("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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ private:
|
|||||||
void onLoginComboLostFocus(LLComboBox* combo_box);
|
void onLoginComboLostFocus(LLComboBox* combo_box);
|
||||||
static void onNameCheckChanged(LLUICtrl* ctrl, void* data);
|
static void onNameCheckChanged(LLUICtrl* ctrl, void* data);
|
||||||
static void clearPassword();
|
static void clearPassword();
|
||||||
|
void removeLogin();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ public:
|
|||||||
* @brief Deletes a login history entry by looking up its name and grid.
|
* @brief Deletes a login history entry by looking up its name and grid.
|
||||||
* @param firstname First name to find and delete.
|
* @param firstname First name to find and delete.
|
||||||
* @param lastname Last 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);
|
void deleteEntry(const std::string& firstname, const std::string& lastname, const std::string& grid);
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
http://secondlife.com/account/request.php
|
http://secondlife.com/account/request.php
|
||||||
</string>
|
</string>
|
||||||
<layout_stack name="element_stack" border_size="0" left="28" right="800" top="70" bottom="10" follows="left|bottom" orientation="horizontal">
|
<layout_stack name="element_stack" border_size="0" left="28" right="800" top="70" bottom="10" follows="left|bottom" orientation="horizontal">
|
||||||
<layout_panel name="name_panel" left="0" user_resize="false" auto_resize="false" width="163" min_width="0">
|
<layout_panel name="name_panel" left="0" user_resize="false" auto_resize="false" width="183" min_width="0">
|
||||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||||
bottom="44" drop_shadow_visible="true" follows="left|bottom"
|
bottom="44" drop_shadow_visible="true" follows="left|bottom"
|
||||||
font="SansSerif" h_pad="0" halign="left" height="16"
|
font="SansSerif" h_pad="0" halign="left" height="16"
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
font="SansSerif" handle_edit_keys_directly="true" height="20" left="4"
|
font="SansSerif" handle_edit_keys_directly="true" height="20" left="4"
|
||||||
max_chars="64" mouse_opaque="true" name="username_combo"
|
max_chars="64" mouse_opaque="true" name="username_combo"
|
||||||
select_all_on_focus_received="true" width="155" allow_text_entry="true" />
|
select_all_on_focus_received="true" width="155" allow_text_entry="true" />
|
||||||
|
<button bottom_delta="0" left_delta="155" height="20" width="20" follows="left|bottom" image_overlay="inv_folder_trash.tga" scale_image="true" label="" tool_tip="Delete the currently selected remembered login info, if any." name="remove_login"/>
|
||||||
<check_box bottom="0" control_name="RememberName"
|
<check_box bottom="0" control_name="RememberName"
|
||||||
follows="left|bottom" font="SansSerifSmall" height="16"
|
follows="left|bottom" font="SansSerifSmall" height="16"
|
||||||
initial_value="true" label="Remember name"
|
initial_value="true" label="Remember name"
|
||||||
|
|||||||
Reference in New Issue
Block a user