summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelgrouproles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelgrouproles.cpp')
-rw-r--r--indra/newview/llpanelgrouproles.cpp51
1 files changed, 39 insertions, 12 deletions
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp
index 7b5b232ad2..b6c58808ae 100644
--- a/indra/newview/llpanelgrouproles.cpp
+++ b/indra/newview/llpanelgrouproles.cpp
@@ -42,6 +42,8 @@
#include "lliconctrl.h"
#include "lllineeditor.h"
#include "llnamelistctrl.h"
+#include "llnotifications.h"
+#include "llnotificationsutil.h"
#include "llnotify.h"
#include "llpanelgrouproles.h"
#include "llscrolllistctrl.h"
@@ -231,7 +233,7 @@ BOOL LLPanelGroupRoles::attemptTransition()
LLSD args;
args["NEEDS_APPLY_MESSAGE"] = mesg;
args["WANT_APPLY_MESSAGE"] = mWantApplyMesg;
- LLNotifications::instance().add("PanelGroupApply", args, LLSD(),
+ LLNotificationsUtil::add("PanelGroupApply", args, LLSD(),
boost::bind(&LLPanelGroupRoles::handleNotifyCallback, this, _1, _2));
mHasModal = TRUE;
// We need to reselect the current tab, since it isn't finished.
@@ -275,7 +277,7 @@ void LLPanelGroupRoles::transitionToTab()
bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLSD& response)
{
- S32 option = LLNotification::getSelectedOption(notification, response);
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
mHasModal = FALSE;
switch (option)
{
@@ -291,7 +293,7 @@ bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLS
mHasModal = TRUE;
LLSD args;
args["MESSAGE"] = apply_mesg;
- LLNotifications::instance().add("GenericAlert", args, LLSD(), boost::bind(&LLPanelGroupRoles::onModalClose, this, _1, _2));
+ LLNotificationsUtil::add("GenericAlert", args, LLSD(), boost::bind(&LLPanelGroupRoles::onModalClose, this, _1, _2));
}
// Skip switching tabs.
break;
@@ -1100,10 +1102,33 @@ void LLPanelGroupMembersSubTab::handleEjectMembers()
mMembersList->deleteSelectedItems();
+ sendEjectNotifications(mGroupID, selected_members);
+
LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID,
selected_members);
}
+void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, const std::vector<LLUUID>& selected_members)
+{
+ LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(group_id);
+
+ if (group_data)
+ {
+ for (std::vector<LLUUID>::const_iterator i = selected_members.begin(); i != selected_members.end(); ++i)
+ {
+ LLSD args;
+ std::string name;
+
+ gCacheName->getFullName(*i, name);
+
+ args["AVATAR_NAME"] = name;
+ args["GROUP_NAME"] = group_data->mName;
+
+ LLNotifications::instance().add(LLNotification::Params("EjectAvatarFromGroup").substitutions(args));
+ }
+ }
+}
+
void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id,
LLRoleMemberChangeType type)
{
@@ -1279,7 +1304,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg)
{
mHasModal = TRUE;
args["ROLE_NAME"] = rd.mRoleName;
- LLNotifications::instance().add("AddGroupOwnerWarning",
+ LLNotificationsUtil::add("AddGroupOwnerWarning",
args,
LLSD(),
boost::bind(&LLPanelGroupMembersSubTab::addOwnerCB, this, _1, _2));
@@ -1304,7 +1329,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg)
bool LLPanelGroupMembersSubTab::addOwnerCB(const LLSD& notification, const LLSD& response)
{
- S32 option = LLNotification::getSelectedOption(notification, response);
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
mHasModal = FALSE;
if (0 == option)
@@ -1543,9 +1568,6 @@ void LLPanelGroupMembersSubTab::updateMembers()
mPendingMemberUpdate = FALSE;
// Rebuild the members list.
- mMembersList->deleteAllItems();
-
- lldebugs << "LLPanelGroupMembersSubTab::updateMembers()" << llendl;
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID);
if (!gdatap)
@@ -1562,7 +1584,12 @@ void LLPanelGroupMembersSubTab::updateMembers()
{
return;
}
-
+
+ //cleanup list only for first iretation
+ if(mMemberProgress == gdatap->mMembers.begin())
+ mMembersList->deleteAllItems();
+
+
LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end();
S32 i = 0;
@@ -2126,7 +2153,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force)
{
warning = "AssignDangerousAbilityWarning";
}
- LLNotifications::instance().add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check));
+ LLNotificationsUtil::add(warning, args, LLSD(), boost::bind(&LLPanelGroupRolesSubTab::addActionCB, this, _1, _2, check));
}
else
{
@@ -2154,7 +2181,7 @@ bool LLPanelGroupRolesSubTab::addActionCB(const LLSD& notification, const LLSD&
mHasModal = FALSE;
- S32 option = LLNotification::getSelectedOption(notification, response);
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (0 == option)
{
// User clicked "Yes"
@@ -2300,7 +2327,7 @@ void LLPanelGroupRolesSubTab::handleDeleteRole()
{
LLSD args;
args["MESSAGE"] = mRemoveEveryoneTxt;
- LLNotifications::instance().add("GenericAlert", args);
+ LLNotificationsUtil::add("GenericAlert", args);
return;
}