From 4945ae17d3692f089ce6c996f6585a5e5b308e4d Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Thu, 29 Aug 2013 11:36:45 -0700 Subject: Initial commit for GroupBan - Lots of crap isn't working as intended yet. --- indra/newview/llpanelgroupbulkban.cpp | 156 ++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 indra/newview/llpanelgroupbulkban.cpp (limited to 'indra/newview/llpanelgroupbulkban.cpp') diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp new file mode 100644 index 0000000000..57bab0c813 --- /dev/null +++ b/indra/newview/llpanelgroupbulkban.cpp @@ -0,0 +1,156 @@ +/** +* @file llpanelgroupbulkban.cpp +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelgroupbulkban.h" +#include "llpanelgroupbulk.h" +#include "llpanelgroupbulkimpl.h" + +#include "llagent.h" +#include "llavatarnamecache.h" +#include "llfloateravatarpicker.h" +#include "llbutton.h" +#include "llcallingcard.h" +#include "llcombobox.h" +#include "llgroupactions.h" +#include "llgroupmgr.h" +#include "llnamelistctrl.h" +#include "llnotificationsutil.h" +#include "llscrolllistitem.h" +#include "llspinctrl.h" +#include "lltextbox.h" +#include "llviewerobject.h" +#include "llviewerobjectlist.h" +#include "lluictrlfactory.h" +#include "llviewerwindow.h" + + +LLPanelGroupBulkBan::LLPanelGroupBulkBan(const LLUUID& group_id) : LLPanelGroupBulk(group_id) +{ + // Pass on construction of this panel to the control factory. + buildFromFile( "panel_group_bulk_ban.xml"); +} + +BOOL LLPanelGroupBulkBan::postBuild() +{ + BOOL recurse = TRUE; + + mImplementation->mLoadingText = getString("loading"); + mImplementation->mGroupName = getChild("group_name_text", recurse); + mImplementation->mBulkAgentList = getChild("banned_agent_list", recurse); + if ( mImplementation->mBulkAgentList ) + { + mImplementation->mBulkAgentList->setCommitOnSelectionChange(TRUE); + mImplementation->mBulkAgentList->setCommitCallback(LLPanelGroupBulkImpl::callbackSelect, mImplementation); + } + + LLButton* button = getChild("add_button", recurse); + if ( button ) + { + // default to opening avatarpicker automatically + // (*impl::callbackClickAdd)((void*)this); + button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickAdd, this); + } + + mImplementation->mRemoveButton = + getChild("remove_button", recurse); + if ( mImplementation->mRemoveButton ) + { + mImplementation->mRemoveButton->setClickedCallback(LLPanelGroupBulkImpl::callbackClickRemove, mImplementation); + mImplementation->mRemoveButton->setEnabled(FALSE); + } + + mImplementation->mOKButton = + getChild("ban_button", recurse); + if ( mImplementation->mOKButton ) + { + mImplementation->mOKButton->setClickedCallback(LLPanelGroupBulkBan::callbackClickSubmit, this); + mImplementation->mOKButton->setEnabled(FALSE); + } + + button = getChild("cancel_button", recurse); + if ( button ) + { + button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickCancel, mImplementation); + } + + mImplementation->mTooManySelected = getString("ban_selection_too_large"); + + update(); + + // return (mImplementation->mRoleNames && + // mImplementation->mBannedAgents && + // mImplementation->mRemoveButton); + + return (mImplementation->mBulkAgentList && + mImplementation->mRemoveButton); +} + + +void LLPanelGroupBulkBan::callbackClickSubmit(void* userdata) +{ + LLPanelGroupBulkBan* selfp = (LLPanelGroupBulkBan*)userdata; + + if(selfp) + selfp->submit(); +} + + +void LLPanelGroupBulkBan::submit() +{ + std::vector banned_agent_list; + std::vector agents = mImplementation->mBulkAgentList->getAllData(); + std::vector::iterator iter = agents.begin(); + for(;iter != agents.end(); ++iter) + { + LLScrollListItem* agent = *iter; + banned_agent_list.push_back(agent->getUUID()); + } + + const S32 MAX_GROUP_BANS = 100; // Max invites per request. 100 to match server cap. + if (banned_agent_list.size() > MAX_GROUP_BANS) + { + // Fail! + LLSD msg; + msg["MESSAGE"] = mImplementation->mTooManySelected; + LLNotificationsUtil::add("GenericAlert", msg); + (*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData); + return; + } + + LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_PUT, mImplementation->mGroupID, banned_agent_list); + + // BAKER TEMP: + // For now, don't close, but clear the list. + mImplementation->mBulkAgentList->deleteAllItems(); + + //then close + //(*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData); +} + + + + -- cgit v1.3 From 1299f6d63fbe313329e6e5ced7be797e2a23d6a7 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Fri, 30 Aug 2013 16:38:25 -0700 Subject: - Got all major functionality working - Changed PUT and DEL to POST which accepts an enum for a create or delete --- indra/newview/llgroupmgr.cpp | 43 ++++++++--------- indra/newview/llgroupmgr.h | 21 +++++--- indra/newview/llpanelgroupbulkban.cpp | 2 +- indra/newview/llpanelgroupinvite.cpp | 3 -- indra/newview/llpanelgrouproles.cpp | 90 ++++++++++++++++++++--------------- indra/newview/llpanelgrouproles.h | 4 +- 6 files changed, 88 insertions(+), 75 deletions(-) (limited to 'indra/newview/llpanelgroupbulkban.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 0d4b678019..bfdb8588e4 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -235,8 +235,7 @@ LLGroupMgrGroupData::LLGroupMgrGroupData(const LLUUID& id) : mRoleDataComplete(false), mRoleMemberDataComplete(false), mGroupPropertiesDataComplete(false), - mGroupBanStatus(STATUS_INIT), - mGroupBanDataComplete(false), + mGroupBanStatus(LLGroupMgrGroupData::STATUS_INIT), mPendingRoleMemberRequest(false), mAccessTime(0.0f) { @@ -748,13 +747,14 @@ void LLGroupMgrGroupData::cancelRoleChanges() void LLGroupMgrGroupData::createBanEntry(const LLUUID& ban_id, const LLGroupBanData& ban_data) { mBanList[ban_id] = ban_data; + // Refresh the list } -bool LLGroupMgrGroupData::removeBanEntry(const LLUUID& ban_id) +void LLGroupMgrGroupData::removeBanEntry(const LLUUID& ban_id) { // Once we get this hooked up to the backend, we want to confirm the create or delete worked. mBanList.erase(ban_id); - return true; + // Refresh the list } @@ -1880,7 +1880,10 @@ void GroupBanDataResponder::result(const LLSD& content) LLGroupMgr::processGroupBanRequest(content); } -void LLGroupMgr::sendGroupBanRequest(EBanRequestType request_type, const LLUUID& group_id, const std::vector ban_list /* = std::vector() */) +void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, + const LLUUID& group_id, + EBanRequestAction ban_action, /* = BAN_NO_ACTION */ + const std::vector ban_list) /* = std::vector() */ { LLViewerRegion* currentRegion = gAgent.getRegion(); if(!currentRegion) @@ -1902,39 +1905,31 @@ void LLGroupMgr::sendGroupBanRequest(EBanRequestType request_type, const LLUUID& { return; } + cap_url += "?group_id=" + group_id.asString(); - LLHTTPClient::ResponderPtr grp_ban_responder = new GroupBanDataResponder(); - // PUT to our service. Add a body containing the group_id and list of agents to ban. - LLSD ban_ids = LLSD::emptyMap(); - ban_ids["group_id"] = group_id; + LLSD body = LLSD::emptyMap(); + body["ban_action"] = ban_action; // Add our list of potential banned agents to the list - ban_ids["ban_ids"] = LLSD::emptyArray(); + body["ban_ids"] = LLSD::emptyArray(); LLSD ban_entry; - std::vector::const_iterator iter = ban_list.cbegin(); + + uuid_vec_t::const_iterator iter = ban_list.begin(); for(;iter != ban_list.end(); ++iter) { ban_entry = (*iter); - ban_ids["ban_ids"].append(ban_entry); + body["ban_ids"].append(ban_entry); } + LLHTTPClient::ResponderPtr grp_ban_responder = new GroupBanDataResponder(); switch(request_type) { case REQUEST_GET: - cap_url += "?group_id=" + group_id.asString(); LLHTTPClient::get(cap_url, grp_ban_responder); break; - case REQUEST_PUT: - // BAKER TODO: Figure out which 'body' is correct. - LLHTTPClient::put(cap_url, ban_ids, grp_ban_responder, LLSD(), 60); - break; - case REQUEST_DEL: - LLHTTPClient::del(cap_url, grp_ban_responder, ban_ids, 60); + case REQUEST_POST: + LLHTTPClient::post(cap_url, body, grp_ban_responder); break; } - - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); - if (gdatap) - gdatap->setGroupBanStatus(LLGroupMgrGroupData::STATUS_REQUESTING); } @@ -1953,7 +1948,7 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content) if (!gdatap) return; - LLSD banlist = LLSD::emptyMap(); + //LLSD banlist = LLSD::emptyMap(); LLSD::map_const_iterator i = content["ban_list"].beginMap(); diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index 876883e87e..49e354a26c 100755 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -215,7 +215,7 @@ friend class LLGroupMgr; public: enum EGroupDataStatus { - STATUS_NONE, + STATUS_INIT, STATUS_REQUESTING, STATUS_COMPLETE }; @@ -250,7 +250,6 @@ public: bool isRoleDataComplete() { return mRoleDataComplete; } bool isRoleMemberDataComplete() { return mRoleMemberDataComplete; } bool isGroupPropertiesDataComplete() { return mGroupPropertiesDataComplete; } - bool isGroupBanDataComplete() { return mGroupBanDataComplete; } EGroupDataStatus getGroupBanStatus() { return mGroupBanStatus; } void setGroupBanStatus(EGroupDataStatus status) { mGroupBanStatus = status; } @@ -269,7 +268,7 @@ public: const LLGroupBanData& getBanEntry(const LLUUID& ban_id) { return mBanList[ban_id]; } void createBanEntry(const LLUUID& ban_id, const LLGroupBanData& ban_data = LLGroupBanData()); - bool removeBanEntry(const LLUUID& ban_id); + void removeBanEntry(const LLUUID& ban_id); @@ -322,8 +321,6 @@ private: bool mGroupPropertiesDataComplete; EGroupDataStatus mGroupBanStatus; - bool mGroupBanDataComplete; - bool mGroupBanDataPending; bool mPendingRoleMemberRequest; F32 mAccessTime; @@ -356,10 +353,18 @@ public: enum EBanRequestType { REQUEST_GET = 0, + REQUEST_POST, REQUEST_PUT, REQUEST_DEL }; + enum EBanRequestAction + { + BAN_NO_ACTION = 0, + BAN_CREATE = 1, + BAN_DELETE = 2 + }; + public: LLGroupMgr(); ~LLGroupMgr(); @@ -394,7 +399,11 @@ public: static void sendGroupMemberEjects(const LLUUID& group_id, uuid_vec_t& member_ids); // BAKER - Group Ban - static void sendGroupBanRequest(EBanRequestType request_type, const LLUUID& group_id, const std::vector ban_list = std::vector()); + static void sendGroupBanRequest(EBanRequestType request_type, + const LLUUID& group_id, + EBanRequestAction ban_action = BAN_NO_ACTION, + const uuid_vec_t ban_list = uuid_vec_t()); + static void processGroupBanRequest(const LLSD& content); // BAKER diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp index 57bab0c813..d6bb669275 100644 --- a/indra/newview/llpanelgroupbulkban.cpp +++ b/indra/newview/llpanelgroupbulkban.cpp @@ -141,7 +141,7 @@ void LLPanelGroupBulkBan::submit() return; } - LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_PUT, mImplementation->mGroupID, banned_agent_list); + LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mImplementation->mGroupID, LLGroupMgr::BAN_CREATE, banned_agent_list); // BAKER TEMP: // For now, don't close, but clear the list. diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index c990584d22..43d94b36fc 100755 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -48,9 +48,6 @@ #include "llviewerwindow.h" -// BAKER TODO: -// Figure out how to use LLHandle to make this safer -//bool invite_owner_callback(LLPanelGroupInvite panel, const LLSD& notification, const LLSD& response) bool invite_owner_callback(LLHandle panel_handle, const LLSD& notification, const LLSD& response) { LLPanelGroupInvite* panel = dynamic_cast(panel_handle.get()); diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 8d7b3c38ee..f3cb9900fe 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1763,18 +1763,20 @@ void LLPanelGroupMembersSubTab::handleBanMember() return; } + uuid_vec_t ban_ids; std::vector::iterator itor; for(itor = selection.begin(); itor != selection.end(); ++itor) { LLUUID ban_id = (*itor)->getUUID(); + ban_ids.push_back(ban_id); + LLGroupBanData ban_data; - - // DEL to People API somewhere in this chain... gdatap->createBanEntry(ban_id, ban_data); - mMembersList->removeNameItem(ban_id); - } + LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mGroupID, LLGroupMgr::BAN_CREATE, ban_ids); + // Will this work? + handleEjectMembers(); } @@ -2721,8 +2723,7 @@ LLPanelGroupBanListSubTab::LLPanelGroupBanListSubTab() : LLPanelGroupSubTab(), mBanList(NULL), mCreateBanButton(NULL), - mDeleteBanButton(NULL), - mUpdateBanList(true) + mDeleteBanButton(NULL) { LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::ctor()" << LL_ENDL; } @@ -2763,6 +2764,13 @@ BOOL LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root) setFooterEnabled(FALSE); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); + if(gdatap && (gdatap->getGroupBanStatus() == LLGroupMgrGroupData::STATUS_INIT)) + { + LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); + gdatap->setGroupBanStatus(LLGroupMgrGroupData::STATUS_REQUESTING); + } + return TRUE; } @@ -2809,8 +2817,8 @@ void LLPanelGroupBanListSubTab::update(LLGroupChange gc) { LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::update()" << LL_ENDL; - if (gc != GC_ALL || gc != GC_BANLIST) - return; + //if (gc != GC_ALL && gc != GC_BANLIST) + // return; LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if(!gdatap) @@ -2826,6 +2834,7 @@ void LLPanelGroupBanListSubTab::update(LLGroupChange gc) // Request our ban list! case LLGroupMgrGroupData::STATUS_INIT: LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); + gdatap->setGroupBanStatus(LLGroupMgrGroupData::STATUS_REQUESTING); break; // Already have a request out -- don't bother sending another one @@ -2839,31 +2848,38 @@ void LLPanelGroupBanListSubTab::update(LLGroupChange gc) // [SOMETHING CHANGED] - Don't panic! Just repopulate the ban list! case LLGroupMgrGroupData::STATUS_COMPLETE: populateBanList(); - - break; } } +void LLPanelGroupBanListSubTab::draw() +{ + LLPanelGroupSubTab::draw(); + + // if(mPendingBanUpdate) + // populateBanList(); +} void LLPanelGroupBanListSubTab::populateBanList() { - //if(gdatap->getGroupBanStatus() == ) - + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); + if(!gdatap) + { + LL_INFOS("BAKER") << "[BAKER] No group data!" << LL_ENDL; + return; + } + if(gdatap->getGroupBanStatus() != LLGroupMgrGroupData::STATUS_COMPLETE) + return; -// mBanList->deleteAllItems(); -// LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); -// -// std::map::const_iterator entry = gdatap->mBanList.begin(); -// for(; entry != gdatap->mBanList.end(); entry++) -// { -// LLNameListCtrl::NameItem ban_entry; -// ban_entry.value = entry->first; -// mBanList->addNameItemRow(ban_entry); -// } - - mUpdateBanList = false; + mBanList->deleteAllItems(); + std::map::const_iterator entry = gdatap->mBanList.begin(); + for(; entry != gdatap->mBanList.end(); entry++) + { + LLNameListCtrl::NameItem ban_entry; + ban_entry.value = entry->first; + mBanList->addNameItemRow(ban_entry); + } } @@ -2885,7 +2901,7 @@ void LLPanelGroupBanListSubTab::handleBanEntrySelect() // BAKER TODO: -- MOVE TO SELECT BAN ENTRY // Make sure only authorized people have access to adding / deleting bans //if (gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS)) - mCreateBanButton->setEnabled(TRUE); + mCreateBanButton->setEnabled(TRUE); // Check if the agent has the ability to unban this person //if (gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS)) @@ -3000,26 +3016,22 @@ void LLPanelGroupBanListSubTab::handleDeleteBanEntry() } } + std::vector ban_ids; std::vector::iterator itor; for(itor = selection.begin(); itor != selection.end(); ++itor) { - // STUB - // Attempt to remove entry from the database - // If there was a problem with the delete, don't remove it from the list yet! - // Otherwise, remove it from our local list. - // - LLUUID ban_id = (*itor)->getUUID(); - if(gdatap->removeBanEntry(ban_id)) - { - mBanList->removeNameItem(ban_id); - // Removing an item removes the selection, we shouldn't be able to click - // the button anymore until we reselect another entry. - mDeleteBanButton->setEnabled(FALSE); - } + ban_ids.push_back(ban_id); + + //gdatap->removeBanEntry(ban_id); + //mBanList->removeNameItem(ban_id); + + // Removing an item removes the selection, we shouldn't be able to click + // the button anymore until we reselect another entry. + mDeleteBanButton->setEnabled(FALSE); } - + LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mGroupID, LLGroupMgr::BAN_DELETE, ban_ids); } diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 1695097fc5..01c1d8c16d 100755 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -335,6 +335,8 @@ public: // Triggered when group information changes in the group manager. virtual void update(LLGroupChange gc); + // + virtual void draw(); static void onBanEntrySelect(LLUICtrl* ctrl, void* user_data); void handleBanEntrySelect(); @@ -358,8 +360,6 @@ protected: LLNameListCtrl* mBanList; LLButton* mCreateBanButton; LLButton* mDeleteBanButton; - - bool mUpdateBanList; }; -- cgit v1.3 From 34f561db55868185f0a946009f41f4f212366484 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Fri, 13 Sep 2013 17:20:04 -0700 Subject: - Added ban date to ban list ui - Code cleanup --- indra/newview/llgroupmgr.cpp | 17 +- indra/newview/llgroupmgr.h | 11 +- indra/newview/llnamelistctrl.cpp | 29 +-- indra/newview/llnamelistctrl.h | 3 - indra/newview/llpanelgroupbulk.cpp | 3 + indra/newview/llpanelgroupbulkban.cpp | 9 +- indra/newview/llpanelgrouproles.cpp | 274 ++++----------------- indra/newview/llpanelgrouproles.h | 27 +- .../skins/default/xui/en/panel_group_roles.xml | 5 +- 9 files changed, 67 insertions(+), 311 deletions(-) (limited to 'indra/newview/llpanelgroupbulkban.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 7cb53066ea..7e7098420d 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1872,7 +1872,6 @@ void GroupBanDataResponder::errorWithContent(U32 pStatus, const std::string& pRe void GroupBanDataResponder::result(const LLSD& content) { - LL_INFOS("GrpMgr") << "[BAKER] Received ban data!" << LL_ENDL; LLGroupMgr::processGroupBanRequest(content); } @@ -1934,7 +1933,7 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content) // Did we get anything in content? if(!content.size()) { - LL_DEBUGS("GrpMgr") << "No group member data received." << LL_ENDL; + LL_WARNS("GrpMgr") << "No group member data received." << LL_ENDL; return; } @@ -1949,14 +1948,18 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content) for(;i != iEnd; ++i) { const LLUUID ban_id(i->first); - // We have nothing right now inside our banlist map. - // Once ban_date is implemented, set that here! - // - gdatap->createBanEntry(ban_id, LLGroupBanData()); + LLSD ban_entry(i->second); + + LLGroupBanData ban_data; + if(ban_entry.has("ban_date")) + { + ban_data.mBanDate = ban_entry["ban_date"].asDate(); + } + + gdatap->createBanEntry(ban_id, ban_data); } gdatap->mChanged = TRUE; -// gdatap->setGroupBanStatus(LLGroupMgrGroupData::STATUS_COMPLETE); LLGroupMgr::getInstance()->notifyObservers(GC_BANLIST); } diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index 7e3297b757..ba767b91ad 100755 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -195,10 +195,10 @@ struct lluuid_pair_less struct LLGroupBanData { - LLGroupBanData() { mBanDate = "00/00/0000"; } + LLGroupBanData(): mBanDate() {} ~LLGroupBanData() {} - std::string mBanDate; // Just store something here to ensure it works. + LLDate mBanDate; // Just store something here to ensure it works. }; @@ -248,11 +248,7 @@ public: const LLUUID& getMemberVersion() const { return mMemberVersion; } - ////////////////////////////////////////////////////////////////////////// - // BAN LIST - ////////////////////////////////////////////////////////////////////////// void clearBanList() { mBanList.clear(); } - void getBanList(const LLUUID& group_id, LLGroupBanData& ban_data); const LLGroupBanData& getBanEntry(const LLUUID& ban_id) { return mBanList[ban_id]; } @@ -383,7 +379,7 @@ public: static void sendGroupMemberInvites(const LLUUID& group_id, std::map& role_member_pairs); static void sendGroupMemberEjects(const LLUUID& group_id, uuid_vec_t& member_ids); - // BAKER - Group Ban + static void sendGroupBanRequest(EBanRequestType request_type, const LLUUID& group_id, EBanRequestAction ban_action = BAN_NO_ACTION, @@ -391,7 +387,6 @@ public: static void processGroupBanRequest(const LLSD& content); - // BAKER void sendCapGroupMembersRequest(const LLUUID& group_id); static void processCapGroupMembersRequest(const LLSD& content); diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index ed684004f0..141f893945 100755 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -73,19 +73,11 @@ LLNameListCtrl::LLNameListCtrl(const LLNameListCtrl::Params& p) LLScrollListItem* LLNameListCtrl::addNameItem(const LLUUID& agent_id, EAddPosition pos, BOOL enabled, const std::string& suffix) { - //llinfos << "LLNameListCtrl::addNameItem " << agent_id << llendl; - NameItem item; item.value = agent_id; item.enabled = enabled; item.target = INDIVIDUAL; - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl - //mPendingLookupsRemaining--; - ////////////////////////////////////////////////////////////////////////// - - return addNameItemRow(item, pos, suffix); } @@ -282,12 +274,6 @@ void LLNameListCtrl::addGroupNameItem(LLNameListCtrl::NameItem& item, EAddPositi LLScrollListItem* LLNameListCtrl::addNameItem(LLNameListCtrl::NameItem& item, EAddPosition pos) { item.target = INDIVIDUAL; - - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl - //mPendingLookupsRemaining--; - ////////////////////////////////////////////////////////////////////////// - return addNameItemRow(item, pos); } @@ -297,12 +283,6 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& element, EAddPosition p LLParamSDParser parser; parser.readSD(element, item_params); item_params.userdata = userdata; - - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl - //mPendingLookupsRemaining--; - ////////////////////////////////////////////////////////////////////////// - return addNameItemRow(item_params, pos); } @@ -355,10 +335,9 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( } mAvatarNameCacheConnection = LLAvatarNameCache::get(id,boost::bind(&LLNameListCtrl::onAvatarNameCache,this, _1, _2, item->getHandle())); - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl if(mPendingLookupsRemaining <= 0) { + // BAKER TODO: // We might get into a state where mPendingLookupsRemaining might // go negative. So just reset it right now and figure out if it's // possible later :) @@ -366,8 +345,6 @@ LLScrollListItem* LLNameListCtrl::addNameItemRow( mNameListCompleteSignal(false); } mPendingLookupsRemaining++; - ////////////////////////////////////////////////////////////////////////// - } break; } @@ -420,11 +397,7 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) selectNthItem(idx); // not sure whether this is needed, taken from previous implementation deleteSingleItem(idx); - ////////////////////////////////////////////////////////////////////////// - // BAKER - FIX NameListCtrl mPendingLookupsRemaining--; - ////////////////////////////////////////////////////////////////////////// - } } diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 80ed081fd3..856af84e23 100755 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -165,8 +165,6 @@ private: bool mShortNames; // display name only, no SLID boost::signals2::connection mAvatarNameCacheConnection; - ////////////////////////////////////////////////////////////////////////// - // BAKER: Fixing name list control not being updated properly. S32 mPendingLookupsRemaining; namelist_complete_signal_t mNameListCompleteSignal; @@ -175,7 +173,6 @@ public: { return mNameListCompleteSignal.connect(onNameListCompleteCallback); } - ////////////////////////////////////////////////////////////////////////// }; diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp index 6c6fd8cfe0..ed05a5c7d1 100644 --- a/indra/newview/llpanelgroupbulk.cpp +++ b/indra/newview/llpanelgroupbulk.cpp @@ -294,7 +294,10 @@ void LLPanelGroupBulk::updateGroupData() { LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mImplementation->mGroupID); if(!gdatap) + { + LL_WARNS("Groups") << "Unable to get group data for group " << mImplementation->mGroupID << LL_ENDL; return; + } if(gdatap->isGroupPropertiesDataComplete()) mPendingGroupPropertiesUpdate = false; diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp index d6bb669275..af1809b1f8 100644 --- a/indra/newview/llpanelgroupbulkban.cpp +++ b/indra/newview/llpanelgroupbulkban.cpp @@ -143,14 +143,7 @@ void LLPanelGroupBulkBan::submit() LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mImplementation->mGroupID, LLGroupMgr::BAN_CREATE, banned_agent_list); - // BAKER TEMP: - // For now, don't close, but clear the list. - mImplementation->mBulkAgentList->deleteAllItems(); - //then close - //(*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData); + (*(mImplementation->mCloseCallback))(mImplementation->mCloseCallbackUserData); } - - - diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 76cb3cc498..01baedefb7 100755 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -110,6 +110,7 @@ bool agentCanAddToRole(const LLUUID& group_id, return false; } + // LLPanelGroupRoles ///////////////////////////////////////////////////// // static @@ -299,7 +300,6 @@ bool LLPanelGroupRoles::onModalClose(const LLSD& notification, const LLSD& respo return false; } - bool LLPanelGroupRoles::apply(std::string& mesg) { // Pass this along to the currently visible sub tab. @@ -336,7 +336,6 @@ void LLPanelGroupRoles::update(LLGroupChange gc) { if (mGroupID.isNull()) return; - LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); if (panelp) { @@ -353,39 +352,33 @@ void LLPanelGroupRoles::activate() { // Start requesting member and role data if needed. LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); - //if (!gdatap || mFirstUse) + if (!gdatap || !gdatap->isMemberDataComplete() ) { - // Check member data. - - if (!gdatap || !gdatap->isMemberDataComplete() ) - { - LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); - } - - // Check role data. - if (!gdatap || !gdatap->isRoleDataComplete() ) - { - // Mildly hackish - clear all pending changes - cancel(); + LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID); + } - LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mGroupID); - } + if (!gdatap || !gdatap->isRoleDataComplete() ) + { + // Mildly hackish - clear all pending changes + cancel(); - // Check role-member mapping data. - if (!gdatap || !gdatap->isRoleMemberDataComplete() ) - { - LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID); - } + LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mGroupID); + } - // Need this to get base group member powers - if (!gdatap || !gdatap->isGroupPropertiesDataComplete() ) - { - LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mGroupID); - } + // Check role-member mapping data. + if (!gdatap || !gdatap->isRoleMemberDataComplete() ) + { + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID); + } - mFirstUse = FALSE; + // Need this to get base group member powers + if (!gdatap || !gdatap->isGroupPropertiesDataComplete() ) + { + LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mGroupID); } + mFirstUse = FALSE; + LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); if (panelp) panelp->activate(); } @@ -414,7 +407,6 @@ BOOL LLPanelGroupRoles::hasModal() return panelp->hasModal(); } -// BAKER -- Moved this from all the way at the bottom void LLPanelGroupRoles::setGroupID(const LLUUID& id) { LLPanelGroupTab::setGroupID(id); @@ -439,14 +431,8 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id) activate(); } -////////////////////////////////////////////////////////////////////////// - // LLPanelGroupSubTab //////////////////////////////////////////////////// - -//////////////////////////// -// LLPanelGroupSubTab -//////////////////////////// LLPanelGroupSubTab::LLPanelGroupSubTab() : LLPanelGroupTab(), mHeader(NULL), @@ -759,14 +745,8 @@ void LLPanelGroupSubTab::setFooterEnabled(BOOL enable) } } -////////////////////////////////////////////////////////////////////////// - // LLPanelGroupMembersSubTab ///////////////////////////////////////////// - -//////////////////////////// -// LLPanelGroupMembersSubTab -//////////////////////////// static LLRegisterPanelClassWrapper t_panel_group_members_subtab("panel_group_members_subtab"); LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab() @@ -851,7 +831,6 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) mBanBtn->setEnabled(FALSE); } - return TRUE; } @@ -930,14 +909,8 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() LLGroupMgrGroupData::role_list_t::iterator iter = gdatap->mRoles.begin(); LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end(); - ////////////////////////////////////////////////////////////////////////// - // BAKER STUB: - // Check if the member has the power to ban (just like the eject below) - // Right now, just give it to them (for testing) BOOL can_ban_members = gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS); - ////////////////////////////////////////////////////////////////////////// - BOOL can_eject_members = gAgent.hasPowerInGroup(mGroupID, - GP_MEMBER_EJECT); + BOOL can_eject_members = gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_EJECT); BOOL member_is_owner = FALSE; for( ; iter != end; ++iter) @@ -1146,8 +1119,7 @@ void LLPanelGroupMembersSubTab::handleEjectMembers() sendEjectNotifications(mGroupID, selected_members); - LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, - selected_members); + LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, selected_members); } void LLPanelGroupMembersSubTab::sendEjectNotifications(const LLUUID& group_id, const uuid_vec_t& selected_members) @@ -1180,7 +1152,6 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, BOOL is_owner_role = ( gdatap->mOwnerRole == role_id ); LLUUID member_id; - std::vector selection = mMembersList->getAllSelected(); if (selection.empty()) @@ -1191,7 +1162,6 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, for (std::vector::iterator itor = selection.begin() ; itor != selection.end(); ++itor) { - member_id = (*itor)->getUUID(); //see if we requested a change for this member before @@ -1304,8 +1274,6 @@ void LLPanelGroupMembersSubTab::deactivate() bool LLPanelGroupMembersSubTab::needsApply(std::string& mesg) { - LL_INFOS("BAKER") << "[BAKER] needsApply()" << LL_ENDL; - return mChanged; } @@ -1627,8 +1595,9 @@ void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data) item_params.columns.add().column("donated").value(donated.getString()) .font.name("SANSSERIF_SMALL").style("NORMAL"); - item_params.columns.add().column("online").value(data->getOnlineStatus()) - .font.name("SANSSERIF_SMALL").style("NORMAL"); + item_params.columns.add().column("online").value(data->getOnlineStatus()) + .font.name("SANSSERIF_SMALL").style("NORMAL"); + mMembersList->addNameItemRow(item_params); mHasMatch = TRUE; @@ -1686,7 +1655,6 @@ void LLPanelGroupMembersSubTab::updateMembers() mMembersList->deleteAllItems(); } - LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end(); LLTimer update_time; @@ -1739,7 +1707,6 @@ void LLPanelGroupMembersSubTab::updateMembers() handleMemberSelect(); } -// BAKER void LLPanelGroupMembersSubTab::onBanMember(void* user_data) { LLPanelGroupMembersSubTab* self = static_cast(user_data); @@ -1748,20 +1715,16 @@ void LLPanelGroupMembersSubTab::onBanMember(void* user_data) void LLPanelGroupMembersSubTab::handleBanMember() { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupMembersSubTab::handleBanMember()" << LL_ENDL; - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if(!gdatap) { - llwarns << "LLPanelGroupMembersSubTab::handleMemberSelect() " - << "-- No group data!" << llendl; + LL_WARNS("Groups") << "Unable to get group data for group " << mGroupID << LL_ENDL; return; } std::vector selection = mMembersList->getAllSelected(); if(selection.empty()) { - LL_WARNS("BAKER") << "[BAKER] Empty selection!" << LL_ENDL; return; } @@ -1777,19 +1740,11 @@ void LLPanelGroupMembersSubTab::handleBanMember() } LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mGroupID, LLGroupMgr::BAN_CREATE, ban_ids); - // Will this work? handleEjectMembers(); - } -////////////////////////////////////////////////////////////////////////// - // LLPanelGroupRolesSubTab /////////////////////////////////////////////// - -//////////////////////////// -// LLPanelGroupRolesSubTab -//////////////////////////// static LLRegisterPanelClassWrapper t_panel_group_roles_subtab("panel_group_roles_subtab"); LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() @@ -2520,14 +2475,8 @@ void LLPanelGroupRolesSubTab::setGroupID(const LLUUID& id) LLPanelGroupSubTab::setGroupID(id); } -////////////////////////////////////////////////////////////////////////// - // LLPanelGroupActionsSubTab ///////////////////////////////////////////// - -//////////////////////////// -// LLPanelGroupActionsSubTab -//////////////////////////// static LLRegisterPanelClassWrapper t_panel_group_actions_subtab("panel_group_actions_subtab"); LLPanelGroupActionsSubTab::LLPanelGroupActionsSubTab() @@ -2714,9 +2663,7 @@ void LLPanelGroupActionsSubTab::setGroupID(const LLUUID& id) } -//////////////////////////// -// LLPanelGroupBanListSubTab -//////////////////////////// +// LLPanelGroupBanListSubTab ///////////////////////////////////////////// static LLRegisterPanelClassWrapper t_panel_group_ban_subtab("panel_group_banlist_subtab"); LLPanelGroupBanListSubTab::LLPanelGroupBanListSubTab() @@ -2784,91 +2731,21 @@ void LLPanelGroupBanListSubTab::activate() update(GC_ALL); } -void LLPanelGroupBanListSubTab::deactivate() -{ - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::deactivate()" << LL_ENDL; - - LLPanelGroupSubTab::deactivate(); -} - -bool LLPanelGroupBanListSubTab::needsApply(std::string& mesg) -{ - LL_INFOS("BAKER") << "LLPanelGroupBanListSubTab::needsApply()" << LL_ENDL; - - // STUB - return false; -} - -bool LLPanelGroupBanListSubTab::apply(std::string& mesg) -{ - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::apply()" << LL_ENDL; - - - - - // STUB - return true; -} - void LLPanelGroupBanListSubTab::update(LLGroupChange gc) { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::update()" << LL_ENDL; - - //if (gc != GC_ALL && gc != GC_BANLIST) - // return; - -// LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); -// if(!gdatap) -// { -// LL_INFOS("BAKER") << "[BAKER] No group data!" << LL_ENDL; -// return; -// } - populateBanList(); -// // Do I even need this anymore? -// switch(gdatap->getGroupBanStatus()) -// { -// // Must be initial update [ Check if I should request this at panel creation -// // with everything else -- might as well] -// // Request our ban list! -// case LLGroupMgrGroupData::STATUS_INIT: -// LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); -// gdatap->setGroupBanStatus(LLGroupMgrGroupData::STATUS_REQUESTING); -// break; -// -// // Already have a request out -- don't bother sending another one -// // Repeat sending won't make a difference, as it'll be behind a load balancer -// case LLGroupMgrGroupData::STATUS_REQUESTING: -// // Maybe here we call populate ban list as well, and see about how many -// // more names we need to complete the ban list -// break; -// -// // See if the list needs updating -- if we call update, but nothing changed, -// // there's no reason to send another request. -// // [NOTHING CHANGED] - Do Nothing! -// // [SOMETHING CHANGED] - Don't panic! Just repopulate the ban list! -// case LLGroupMgrGroupData::STATUS_COMPLETE: -// populateBanList(); -// break; -// } -// - - } void LLPanelGroupBanListSubTab::draw() { LLPanelGroupSubTab::draw(); - //if(mPendingBanUpdate) + // BAKER: Might be good to put it here instead of update, maybe.. See how often draw gets hit. // populateBanList(); } - void LLPanelGroupBanListSubTab::onBanEntrySelect(LLUICtrl* ctrl, void* user_data) { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::onBanEntrySelect()" << LL_ENDL; - LLPanelGroupBanListSubTab* self = static_cast(user_data); if (!self) return; @@ -2878,49 +2755,12 @@ void LLPanelGroupBanListSubTab::onBanEntrySelect(LLUICtrl* ctrl, void* user_data void LLPanelGroupBanListSubTab::handleBanEntrySelect() { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::handleBanEntrySelect()" << LL_ENDL; - - // BAKER TODO: -- MOVE TO SELECT BAN ENTRY - // Make sure only authorized people have access to adding / deleting bans - //if (gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS)) - mCreateBanButton->setEnabled(TRUE); - - // Check if the agent has the ability to unban this person - //if (gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS)) + if (gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS)) mDeleteBanButton->setEnabled(TRUE); } - -void LLPanelGroupBanListSubTab::onBanGroupMember(void* user_data) -{ - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::onBanGroupMember()" << LL_ENDL; - - LLPanelGroupBanListSubTab* self = static_cast(user_data); - if (!self) - return; - - self->handleBanGroupMember(); -} - -void LLPanelGroupBanListSubTab::handleBanGroupMember() -{ - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::handleBanGroupMember()" << LL_ENDL; - - ////////////////////////////////////////////////////////////////////////// - // BAKER TEMP - // Getting viewer functionality working, so I'm gonna cheat a bit here for now - // Assume everything worked on the back end - // - // First, get the entries added to the ban list - ////////////////////////////////////////////////////////////////////////// - -} - - void LLPanelGroupBanListSubTab::onCreateBanEntry(void* user_data) { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::onCreateBanEntry()" << LL_ENDL; - LLPanelGroupBanListSubTab* self = static_cast(user_data); if (!self) return; @@ -2930,26 +2770,12 @@ void LLPanelGroupBanListSubTab::onCreateBanEntry(void* user_data) void LLPanelGroupBanListSubTab::handleCreateBanEntry() { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::handleCreateBanEntry()" << LL_ENDL; - - // STUB - // Attempt to add an entry into the database - // If there was a problem, don't add the entry to the local list - // Otherwise, add it - // - // For now, let's just add it to the local list for testing. We can hook it up - // at the end. - - LLFloaterGroupBulkBan::showForGroup(mGroupID); - + populateBanList(); } - void LLPanelGroupBanListSubTab::onDeleteBanEntry(void* user_data) { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::onDeleteBanEntry()" << LL_ENDL; - LLPanelGroupBanListSubTab* self = static_cast(user_data); if (!self) return; @@ -2959,33 +2785,25 @@ void LLPanelGroupBanListSubTab::onDeleteBanEntry(void* user_data) void LLPanelGroupBanListSubTab::handleDeleteBanEntry() { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::handleDeleteBanEntry()" << LL_ENDL; - LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if(!gdatap) { - llwarns << "LLPanelGroupMembersSubTab::handleMemberSelect() " - << "-- No group data!" << llendl; + LL_WARNS("Groups") << "Unable to get group data for group " << mGroupID << LL_ENDL; return; } std::vector selection = mBanList->getAllSelected(); if(selection.empty()) { - LL_WARNS("BAKER") << "[BAKER] Empty selection!" << LL_ENDL; return; } - ////////////////////////////////////////////////////////////////////////// - // BAKER STUB: - // Check if the member has the power to ban (just like the eject below) bool can_ban_members = false; if (gAgent.isGodlike() || gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS)) { can_ban_members = true; } - ////////////////////////////////////////////////////////////////////////// // Owners can ban anyone in the group. LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find(gAgent.getID()); @@ -3005,8 +2823,8 @@ void LLPanelGroupBanListSubTab::handleDeleteBanEntry() LLUUID ban_id = (*itor)->getUUID(); ban_ids.push_back(ban_id); - //gdatap->removeBanEntry(ban_id); - //mBanList->removeNameItem(ban_id); + gdatap->removeBanEntry(ban_id); + mBanList->removeNameItem(ban_id); // Removing an item removes the selection, we shouldn't be able to click // the button anymore until we reselect another entry. @@ -3016,11 +2834,8 @@ void LLPanelGroupBanListSubTab::handleDeleteBanEntry() LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mGroupID, LLGroupMgr::BAN_DELETE, ban_ids); } - void LLPanelGroupBanListSubTab::onRefreshBanList(void* user_data) { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::onRefreshBanList()" << LL_ENDL; - LLPanelGroupBanListSubTab* self = static_cast(user_data); if (!self) return; @@ -3030,13 +2845,10 @@ void LLPanelGroupBanListSubTab::onRefreshBanList(void* user_data) void LLPanelGroupBanListSubTab::handleRefreshBanList() { - LL_INFOS("BAKER") << "[BAKER] LLPanelGroupBanListSubTab::handleRefreshBanList()" << LL_ENDL; - mRefreshBanListButton->setEnabled(FALSE); LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); } - void LLPanelGroupBanListSubTab::onBanListCompleted(bool isComplete) { if(isComplete) @@ -3051,7 +2863,7 @@ void LLPanelGroupBanListSubTab::populateBanList() LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if(!gdatap) { - LL_INFOS("BAKER") << "[BAKER] No group data!" << LL_ENDL; + LL_WARNS("Groups") << "Unable to get group data for group " << mGroupID << LL_ENDL; return; } @@ -3061,25 +2873,23 @@ void LLPanelGroupBanListSubTab::populateBanList() { LLNameListCtrl::NameItem ban_entry; ban_entry.value = entry->first; + LLGroupBanData bd = entry->second; + + ban_entry.columns.add().column("name").font.name("SANSSERIF_SMALL").style("NORMAL"); + ban_entry.columns.add().column("ban_date").value(bd.mBanDate.toHTTPDateString("%Y/%m/%d")).font.name("SANSSERIF_SMALL").style("NORMAL"); + mBanList->addNameItemRow(ban_entry); } - + mRefreshBanListButton->setEnabled(TRUE); } - void LLPanelGroupBanListSubTab::setGroupID(const LLUUID& id) { if(mBanList) mBanList->deleteAllItems(); setFooterEnabled(FALSE); - LLPanelGroupSubTab::setGroupID(id); + LLPanelGroupSubTab::setGroupID(id); } - - - - - - diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 2f37805f48..851f73bba0 100755 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -39,11 +39,9 @@ class LLScrollListCtrl; class LLScrollListItem; class LLTextEditor; -// Forward declare for friend usage. -//virtual BOOL LLPanelGroupSubTab::postBuildSubTab(LLView*); - typedef std::map icon_map_t; + class LLPanelGroupRoles : public LLPanelGroupTab { public: @@ -92,6 +90,7 @@ protected: std::string mWantApplyMesg; }; + class LLPanelGroupSubTab : public LLPanelGroupTab { public: @@ -147,6 +146,7 @@ protected: void setOthersVisible(BOOL b); }; + class LLPanelGroupMembersSubTab : public LLPanelGroupSubTab { public: @@ -222,6 +222,7 @@ protected: boost::signals2::connection mAvatarNameCacheConnection; }; + class LLPanelGroupRolesSubTab : public LLPanelGroupSubTab { public: @@ -284,6 +285,7 @@ protected: std::string mRemoveEveryoneTxt; }; + class LLPanelGroupActionsSubTab : public LLPanelGroupSubTab { public: @@ -310,6 +312,7 @@ protected: LLTextEditor* mActionDescription; }; + class LLPanelGroupBanListSubTab : public LLPanelGroupSubTab { public: @@ -318,30 +321,12 @@ public: virtual BOOL postBuildSubTab(LLView* root); - // Triggered when the tab becomes active. virtual void activate(); - - // Triggered when the tab becomes inactive. - virtual void deactivate(); - - // Asks if something needs to be applied. - // If returning true, this function should modify the message to the user. - virtual bool needsApply(std::string& mesg); - - // Request to apply current data. - // If returning fail, this function should modify the message to the user. - virtual bool apply(std::string& mesg); - - // Triggered when group information changes in the group manager. virtual void update(LLGroupChange gc); - virtual void draw(); static void onBanEntrySelect(LLUICtrl* ctrl, void* user_data); void handleBanEntrySelect(); - - static void onBanGroupMember(void* user_data); - void handleBanGroupMember(); static void onCreateBanEntry(void* user_data); void handleCreateBanEntry(); diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 70d19de848..15ddc8f313 100755 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -327,14 +327,11 @@ name="name" font.name="SANSSERIF_SMALL" font.style="NORMAL" - relative_width="0.4" /> + relative_width="0.7" /> -