diff options
author | Baker Linden <baker@lindenlab.com> | 2013-09-13 17:20:04 -0700 |
---|---|---|
committer | Baker Linden <baker@lindenlab.com> | 2013-09-13 17:20:04 -0700 |
commit | 34f561db55868185f0a946009f41f4f212366484 (patch) | |
tree | a6637f68a05acf87d0326bcf9d1a4013e852cc6f /indra/newview | |
parent | bf34eccf9c68f204c41d3daea791e50e87d868db (diff) |
- Added ban date to ban list ui
- Code cleanup
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llgroupmgr.cpp | 17 | ||||
-rwxr-xr-x | indra/newview/llgroupmgr.h | 11 | ||||
-rwxr-xr-x | indra/newview/llnamelistctrl.cpp | 29 | ||||
-rwxr-xr-x | indra/newview/llnamelistctrl.h | 3 | ||||
-rw-r--r-- | indra/newview/llpanelgroupbulk.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llpanelgroupbulkban.cpp | 9 | ||||
-rwxr-xr-x | indra/newview/llpanelgrouproles.cpp | 274 | ||||
-rwxr-xr-x | indra/newview/llpanelgrouproles.h | 27 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/panel_group_roles.xml | 5 |
9 files changed, 67 insertions, 311 deletions
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<LLUUID,LLUUID>& 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<LLPanelGroupMembersSubTab> 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<LLScrollListItem*> selection = mMembersList->getAllSelected(); if (selection.empty()) @@ -1191,7 +1162,6 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, for (std::vector<LLScrollListItem*>::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<LLPanelGroupMembersSubTab*>(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<LLScrollListItem*> 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<LLPanelGroupRolesSubTab> 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<LLPanelGroupActionsSubTab> 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<LLPanelGroupBanListSubTab> 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<LLPanelGroupBanListSubTab*>(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<LLPanelGroupBanListSubTab*>(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<LLPanelGroupBanListSubTab*>(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<LLPanelGroupBanListSubTab*>(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<LLScrollListItem*> 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<LLPanelGroupBanListSubTab*>(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<std::string,std::string> 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" /> <name_list.columns label="Date Banned" name="ban_date" relative_width="0.3" /> - <name_list.columns - label="Reason" - name="ban_reason" /> </name_list> <button follows="top|left" |