From b1a84d955144664eb83cebbb4eb6b9f5229b0219 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Thu, 29 Mar 2018 18:17:59 +0300 Subject: MAINT-2929 Group Role Permission "Eject Members from this Group" Is Poorly Described --- indra/newview/llpanelgrouproles.cpp | 47 +++++++++++++- indra/newview/llpanelgrouproles.h | 6 ++ .../skins/default/xui/en/panel_group_roles.xml | 74 ++++++++++++++++++++-- .../newview/skins/default/xui/en/role_actions.xml | 2 +- 4 files changed, 120 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 66a0a1d4ad..5ee272749c 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -821,8 +821,12 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) mMembersList = parent->getChild("member_list", recurse); mAssignedRolesList = parent->getChild("member_assigned_roles", recurse); mAllowedActionsList = parent->getChild("member_allowed_actions", recurse); + mActionDescription = parent->getChild("member_action_description", recurse); - if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList) return FALSE; + if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList || !mActionDescription) return FALSE; + + mAllowedActionsList->setCommitOnSelectionChange(TRUE); + mAllowedActionsList->setCommitCallback(boost::bind(&LLPanelGroupMembersSubTab::updateActionDescription, this)); // We want to be notified whenever a member is selected. mMembersList->setCommitOnSelectionChange(TRUE); @@ -889,6 +893,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() mAssignedRolesList->deleteAllItems(); mAllowedActionsList->deleteAllItems(); + mActionDescription->clear(); LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) @@ -1386,6 +1391,7 @@ void LLPanelGroupMembersSubTab::activate() update(GC_MEMBER_DATA); } } + mActionDescription->clear(); } void LLPanelGroupMembersSubTab::deactivate() @@ -1894,6 +1900,23 @@ bool LLPanelGroupMembersSubTab::handleBanCallback(const LLSD& notification, cons return false; } +void LLPanelGroupMembersSubTab::updateActionDescription() +{ + mActionDescription->setText(std::string()); + LLScrollListItem* action_item = mAllowedActionsList->getFirstSelected(); + if (!action_item || !mAllowedActionsList->getCanSelect()) + { + return; + } + + LLRoleAction* rap = (LLRoleAction*)action_item->getUserdata(); + if (rap) + { + std::string desc = rap->mLongDescription.empty() ? rap->mDescription : rap->mLongDescription; + mActionDescription->setText(desc); + } +} + void LLPanelGroupMembersSubTab::handleBanMember() { LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); @@ -1964,6 +1987,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) mRolesList = parent->getChild("role_list", recurse); mAssignedMembersList = parent->getChild("role_assigned_members", recurse); mAllowedActionsList = parent->getChild("role_allowed_actions", recurse); + mActionDescription = parent->getChild("role_action_description", recurse); mRoleName = parent->getChild("role_name", recurse); mRoleTitle = parent->getChild("role_title", recurse); @@ -1971,7 +1995,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) mMemberVisibleCheck = parent->getChild("role_visible_in_list", recurse); - if (!mRolesList || !mAssignedMembersList || !mAllowedActionsList + if (!mRolesList || !mAssignedMembersList || !mAllowedActionsList || !mActionDescription || !mRoleName || !mRoleTitle || !mRoleDescription || !mMemberVisibleCheck) { LL_WARNS() << "ARG! element not found." << LL_ENDL; @@ -2004,6 +2028,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) mMemberVisibleCheck->setCommitCallback(onMemberVisibilityChange, this); mAllowedActionsList->setCommitOnSelectionChange(TRUE); + mAllowedActionsList->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::updateActionDescription, this)); mRoleName->setCommitOnFocusLost(TRUE); mRoleName->setKeystrokeCallback(onPropertiesKey, this); @@ -2023,6 +2048,7 @@ void LLPanelGroupRolesSubTab::activate() { LLPanelGroupSubTab::activate(); + mActionDescription->clear(); mRolesList->deselectAllItems(); mAssignedMembersList->deleteAllItems(); mAllowedActionsList->deleteAllItems(); @@ -2707,6 +2733,23 @@ void LLPanelGroupRolesSubTab::saveRoleChanges(bool select_saved_role) } } +void LLPanelGroupRolesSubTab::updateActionDescription() +{ + mActionDescription->setText(std::string()); + LLScrollListItem* action_item = mAllowedActionsList->getFirstSelected(); + if (!action_item || !mAllowedActionsList->getCanSelect()) + { + return; + } + + LLRoleAction* rap = (LLRoleAction*)action_item->getUserdata(); + if (rap) + { + std::string desc = rap->mLongDescription.empty() ? rap->mDescription : rap->mLongDescription; + mActionDescription->setText(desc); + } +} + void LLPanelGroupRolesSubTab::setGroupID(const LLUUID& id) { if(mRolesList) mRolesList->deleteAllItems(); diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 1d1d69e0ae..99ee310dd6 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -182,6 +182,7 @@ public: bool handleBanCallback(const LLSD& notification, const LLSD& response); void confirmBanMembers(); + void updateActionDescription(); void applyMemberChanges(); bool addOwnerCB(const LLSD& notification, const LLSD& response); @@ -222,6 +223,8 @@ protected: BOOL mPendingMemberUpdate; BOOL mHasMatch; + LLTextEditor* mActionDescription; + member_role_changes_map_t mMemberRoleChangeData; U32 mNumOwnerAdditions; @@ -269,6 +272,8 @@ public: static void onDeleteRole(void*); void handleDeleteRole(); + void updateActionDescription(); + void saveRoleChanges(bool select_saved_role); virtual void setGroupID(const LLUUID& id); @@ -282,6 +287,7 @@ protected: LLScrollListCtrl* mRolesList; LLNameListCtrl* mAssignedMembersList; LLScrollListCtrl* mAllowedActionsList; + LLTextEditor* mActionDescription; LLLineEditor* mRoleName; LLLineEditor* mRoleTitle; 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 dac4371a38..714d4166c0 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -1,6 +1,6 @@ + name="action" /> + + This Ability is 'Eject Members from this Group'. Only an Owner can eject another Owner. + + + + name="action" /> + + + This Ability is 'Eject Members from this Group'. Only an Owner can eject another Owner. + + -