MAINT-2007 FIXED Restored the code for ejecting confirmation. Confirmation on banning was added.
parent
5e241cf621
commit
4fa3e33c4d
|
|
@ -1155,7 +1155,37 @@ void LLPanelGroupMembersSubTab::onEjectMembers(void *userdata)
|
|||
|
||||
if ( selfp )
|
||||
{
|
||||
selfp->handleEjectMembers();
|
||||
selfp->confirmEjectMembers();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelGroupMembersSubTab::confirmEjectMembers()
|
||||
{
|
||||
std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected();
|
||||
if (selection.empty()) return;
|
||||
|
||||
S32 selection_count = selection.size();
|
||||
if (selection_count == 1)
|
||||
{
|
||||
LLSD args;
|
||||
std::string fullname;
|
||||
gCacheName->getFullName(mMembersList->getValue(), fullname);
|
||||
args["AVATAR_NAME"] = fullname;
|
||||
LLSD payload;
|
||||
LLNotificationsUtil::add("EjectGroupMemberWarning",
|
||||
args,
|
||||
payload,
|
||||
boost::bind(&LLPanelGroupMembersSubTab::handleEjectCallback, this, _1, _2));
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSD args;
|
||||
args["COUNT"] = llformat("%d", selection_count);
|
||||
LLSD payload;
|
||||
LLNotificationsUtil::add("EjectGroupMembersWarning",
|
||||
args,
|
||||
payload,
|
||||
boost::bind(&LLPanelGroupMembersSubTab::handleEjectCallback, this, _1, _2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1182,6 +1212,16 @@ void LLPanelGroupMembersSubTab::handleEjectMembers()
|
|||
LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, selected_members);
|
||||
}
|
||||
|
||||
bool LLPanelGroupMembersSubTab::handleEjectCallback(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if (0 == option) // Eject button
|
||||
{
|
||||
handleEjectMembers();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, const uuid_vec_t& selected_members)
|
||||
{
|
||||
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id);
|
||||
|
|
@ -1804,7 +1844,47 @@ void LLPanelGroupMembersSubTab::updateMembers()
|
|||
void LLPanelGroupMembersSubTab::onBanMember(void* user_data)
|
||||
{
|
||||
LLPanelGroupMembersSubTab* self = static_cast<LLPanelGroupMembersSubTab*>(user_data);
|
||||
self->handleBanMember();
|
||||
self->confirmBanMembers();
|
||||
}
|
||||
|
||||
void LLPanelGroupMembersSubTab::confirmBanMembers()
|
||||
{
|
||||
std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected();
|
||||
if (selection.empty()) return;
|
||||
|
||||
S32 selection_count = selection.size();
|
||||
if (selection_count == 1)
|
||||
{
|
||||
LLSD args;
|
||||
std::string fullname;
|
||||
gCacheName->getFullName(mMembersList->getValue(), fullname);
|
||||
args["AVATAR_NAME"] = fullname;
|
||||
LLSD payload;
|
||||
LLNotificationsUtil::add("BanGroupMemberWarning",
|
||||
args,
|
||||
payload,
|
||||
boost::bind(&LLPanelGroupMembersSubTab::handleBanCallback, this, _1, _2));
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSD args;
|
||||
args["COUNT"] = llformat("%d", selection_count);
|
||||
LLSD payload;
|
||||
LLNotificationsUtil::add("BanGroupMembersWarning",
|
||||
args,
|
||||
payload,
|
||||
boost::bind(&LLPanelGroupMembersSubTab::handleBanCallback, this, _1, _2));
|
||||
}
|
||||
}
|
||||
|
||||
bool LLPanelGroupMembersSubTab::handleBanCallback(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
if (0 == option) // Eject button
|
||||
{
|
||||
handleBanMember();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLPanelGroupMembersSubTab::handleBanMember()
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ public:
|
|||
void handleEjectMembers();
|
||||
void sendEjectNotifications(const LLUUID& group_id, const uuid_vec_t& selected_members);
|
||||
bool handleEjectCallback(const LLSD& notification, const LLSD& response);
|
||||
void confirmEjectMembers();
|
||||
|
||||
static void onRoleCheck(LLUICtrl* check, void* user_data);
|
||||
void handleRoleCheck(const LLUUID& role_id,
|
||||
|
|
@ -178,6 +179,8 @@ public:
|
|||
|
||||
static void onBanMember(void* user_data);
|
||||
void handleBanMember();
|
||||
bool handleBanCallback(const LLSD& notification, const LLSD& response);
|
||||
void confirmBanMembers();
|
||||
|
||||
|
||||
void applyMemberChanges();
|
||||
|
|
|
|||
|
|
@ -577,6 +577,33 @@ If you no longer wish to have these abilities granted to this role, disable them
|
|||
notext="Cancel"
|
||||
yestext="Eject"/>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="BanGroupMemberWarning"
|
||||
type="alertmodal">
|
||||
You are about to ban [AVATAR_NAME] from the group.
|
||||
<tag>group</tag>
|
||||
<tag>confirm</tag>
|
||||
<usetemplate
|
||||
ignoretext="Confirm banning a participant from group"
|
||||
name="okcancelignore"
|
||||
notext="Cancel"
|
||||
yestext="Ban"/>
|
||||
</notification>
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="BanGroupMembersWarning"
|
||||
type="alertmodal">
|
||||
You are about to ban [COUNT] members from group.
|
||||
<tag>group</tag>
|
||||
<tag>confirm</tag>
|
||||
<usetemplate
|
||||
ignoretext="Confirm banning multiple members from group"
|
||||
name="okcancelignore"
|
||||
notext="Cancel"
|
||||
yestext="Ban"/>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
|
|
|
|||
Loading…
Reference in New Issue