Confirmation for removing users, also reposition the remove button icon

This commit is contained in:
Inusaito Sayori
2014-06-14 15:38:33 -04:00
parent eebee9b7c1
commit 21e1359b37
4 changed files with 23 additions and 6 deletions

View File

@@ -154,7 +154,6 @@ public:
LLLoginRefreshHandler gLoginRefreshHandler;
//---------------------------------------------------------------------------
// Public methods
//---------------------------------------------------------------------------
@@ -191,7 +190,7 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
password_edit->setCommitCallback(mungePassword, this);
password_edit->setDrawAsterixes(TRUE);
getChild<LLUICtrl>("remove_login")->setCommitCallback(boost::bind(&LLPanelLogin::removeLogin, this));
getChild<LLUICtrl>("remove_login")->setCommitCallback(boost::bind(&LLPanelLogin::confirmDelete, this));
// change z sort of clickable text to be behind buttons
sendChildToBack(getChildView("channel_text"));
@@ -1132,8 +1131,14 @@ void LLPanelLogin::clearPassword()
sInstance->mMungedPassword = blank;
}
void LLPanelLogin::removeLogin()
void LLPanelLogin::confirmDelete()
{
LLNotificationsUtil::add("ConfirmDeleteUser", LLSD(), LLSD(), boost::bind(&LLPanelLogin::removeLogin, this, boost::bind(LLNotificationsUtil::getSelectedOption, _1, _2)));
}
void LLPanelLogin::removeLogin(bool not)
{
if (not) return;
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

View File

@@ -118,7 +118,8 @@ private:
void onLoginComboLostFocus(LLComboBox* combo_box);
static void onNameCheckChanged(LLUICtrl* ctrl, void* data);
static void clearPassword();
void removeLogin();
void confirmDelete();
void removeLogin(bool not);
public:

View File

@@ -9780,6 +9780,17 @@ AntiSpam: Blocked newline flood from [SOURCE] (over [AMOUNT] newlines).
</notification>
<notification
icon="alertmodal.tga"
name="ConfirmDeleteUser"
type="alertmodal">
Are you sure you want to delete the selected user?
<usetemplate
name="okcancelbuttonscanceldefault"
yestext="Yes"
notext="No"/>
</notification>
<notification
icon="alertmodal.tga"
name="RadarChatKeysRequest"

View File

@@ -14,7 +14,7 @@
http://secondlife.com/account/request.php
</string>
<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="183" min_width="0">
<layout_panel name="name_panel" left="0" user_resize="false" auto_resize="false" width="163" min_width="0">
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="44" drop_shadow_visible="true" follows="left|bottom"
font="SansSerif" h_pad="0" halign="left" height="16"
@@ -25,11 +25,11 @@
font="SansSerif" handle_edit_keys_directly="true" height="20" left="4"
max_chars="64" mouse_opaque="true" name="username_combo"
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"
follows="left|bottom" font="SansSerifSmall" height="16"
initial_value="true" label="Remember name"
left="0" mouse_opaque="true" name="remember_name_check" width="158" />
<button bottom_delta="0" left="140" 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"/>
</layout_panel>
<layout_panel name="password_panel" left="0" user_resize="false" auto_resize="false" width="134" min_width="0">
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"