diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelgroupbulk.cpp | 36 | ||||
-rw-r--r-- | indra/newview/llpanelgroupbulkimpl.h | 23 | ||||
-rwxr-xr-x | indra/newview/llpanelgroupinvite.cpp | 5 |
3 files changed, 38 insertions, 26 deletions
diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp index ed05a5c7d1..86ac1867df 100644 --- a/indra/newview/llpanelgroupbulk.cpp +++ b/indra/newview/llpanelgroupbulk.cpp @@ -172,6 +172,12 @@ void LLPanelGroupBulkImpl::handleRemove() if (selection.empty()) return; + std::vector<LLScrollListItem*>::iterator iter; + for(iter = selection.begin(); iter != selection.end(); ++iter) + { + mInviteeIDs.erase((*iter)->getUUID()); + } + mBulkAgentList->deleteSelectedItems(); mRemoveButton->setEnabled(FALSE); @@ -195,26 +201,23 @@ void LLPanelGroupBulkImpl::addUsers(const std::vector<std::string>& names, const { std::string name; LLUUID id; + + if(names.size() + mInviteeIDs.size() > MAX_GROUP_INVITES) + { + // Fail! Show a warning and don't add any names. + LLSD msg; + msg["MESSAGE"] = mTooManySelected; + LLNotificationsUtil::add("GenericAlert", msg); + return; + } + for (S32 i = 0; i < (S32)names.size(); ++i) { name = names[i]; id = agent_ids[i]; - // Make sure this agent isn't already in the list. - bool already_in_list = false; - std::vector<LLScrollListItem*> items = mBulkAgentList->getAllData(); - std::vector<LLScrollListItem*>::iterator iter = items.begin(); - for (; iter != items.end(); ++iter) - { - LLScrollListItem* item = *iter; - if (item->getUUID() == id) - { - already_in_list = true; - break; - } - } - if (already_in_list) + if(mInviteeIDs.find(id) != mInviteeIDs.end()) { continue; } @@ -225,7 +228,8 @@ void LLPanelGroupBulkImpl::addUsers(const std::vector<std::string>& names, const row["columns"][0]["value"] = name; mBulkAgentList->addElement(row); - + mInviteeIDs.insert(id); + // We've successfully added someone to the list. if(mOKButton && !mOKButton->getEnabled()) mOKButton->setEnabled(TRUE); @@ -254,6 +258,8 @@ LLPanelGroupBulk::~LLPanelGroupBulk() void LLPanelGroupBulk::clear() { + mImplementation->mInviteeIDs.clear(); + if(mImplementation->mBulkAgentList) mImplementation->mBulkAgentList->deleteAllItems(); diff --git a/indra/newview/llpanelgroupbulkimpl.h b/indra/newview/llpanelgroupbulkimpl.h index 74da542eb8..3241c019de 100644 --- a/indra/newview/llpanelgroupbulkimpl.h +++ b/indra/newview/llpanelgroupbulkimpl.h @@ -1,6 +1,6 @@ /** * @file llpanelgroupbulkimpl.h -* @brief Header file for llpanelgroupbulkimpl +* @brief Class definition for implementation class of LLPanelGroupBulk * @author Baker@lindenlab.com * * $LicenseInfo:firstyear=2013&license=viewerlgpl$ @@ -35,6 +35,9 @@ class LLNameListCtrl; class LLTextBox; class LLComboBox; +////////////////////////////////////////////////////////////////////////// +// Implementation found in llpanelgroupbulk.cpp +////////////////////////////////////////////////////////////////////////// class LLPanelGroupBulkImpl { public: @@ -59,15 +62,19 @@ public: public: - LLUUID mGroupID; + static const S32 MAX_GROUP_INVITES = 100; // Max invites per request. 100 to match server cap. - LLNameListCtrl* mBulkAgentList; - LLButton* mOKButton; - LLButton* mRemoveButton; - LLTextBox* mGroupName; + LLUUID mGroupID; - std::string mLoadingText; - std::string mTooManySelected; + LLNameListCtrl* mBulkAgentList; + LLButton* mOKButton; + LLButton* mRemoveButton; + LLTextBox* mGroupName; + + std::string mLoadingText; + std::string mTooManySelected; + + std::set<LLUUID> mInviteeIDs; void (*mCloseCallback)(void* data); void* mCloseCallbackUserData; diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 43d94b36fc..19689e7f4b 100755 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -80,7 +80,7 @@ LLPanelGroupInvite::LLPanelGroupInvite(const LLUUID& group_id) : LLPanelGroupBul void LLPanelGroupInvite::clear() { LLPanelGroupBulk::clear(); - + if(mImplementation->mRoleNames) { mImplementation->mRoleNames->clear(); @@ -225,8 +225,7 @@ void LLPanelGroupInvite::submit() role_member_pairs[item->getUUID()] = role_id; } - const S32 MAX_GROUP_INVITES = 100; // Max invites per request. 100 to match server cap. - if (role_member_pairs.size() > MAX_GROUP_INVITES) + if (role_member_pairs.size() > LLPanelGroupBulkImpl::MAX_GROUP_INVITES) { // Fail! LLSD msg; |