diff options
author | maxim_productengine <mnikolenko@productengine.com> | 2018-03-29 18:17:59 +0300 |
---|---|---|
committer | maxim_productengine <mnikolenko@productengine.com> | 2018-03-29 18:17:59 +0300 |
commit | b1a84d955144664eb83cebbb4eb6b9f5229b0219 (patch) | |
tree | c6fb44357c65f3d25668ebe5b38856a9255c2743 /indra | |
parent | 536a99c7aebdc42b26b150bee269edd2f430e289 (diff) |
MAINT-2929 Group Role Permission "Eject Members from this Group" Is Poorly Described
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelgrouproles.cpp | 47 | ||||
-rw-r--r-- | indra/newview/llpanelgrouproles.h | 6 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_group_roles.xml | 74 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/role_actions.xml | 2 |
4 files changed, 120 insertions, 9 deletions
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<LLNameListCtrl>("member_list", recurse); mAssignedRolesList = parent->getChild<LLScrollListCtrl>("member_assigned_roles", recurse); mAllowedActionsList = parent->getChild<LLScrollListCtrl>("member_allowed_actions", recurse); + mActionDescription = parent->getChild<LLTextEditor>("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<LLScrollListCtrl>("role_list", recurse); mAssignedMembersList = parent->getChild<LLNameListCtrl>("role_assigned_members", recurse); mAllowedActionsList = parent->getChild<LLScrollListCtrl>("role_allowed_actions", recurse); + mActionDescription = parent->getChild<LLTextEditor>("role_action_description", recurse); mRoleName = parent->getChild<LLLineEditor>("role_name", recurse); mRoleTitle = parent->getChild<LLLineEditor>("role_title", recurse); @@ -1971,7 +1995,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) mMemberVisibleCheck = parent->getChild<LLCheckBoxCtrl>("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 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel - height="680" + height="750" label="Members & Roles" layout="topleft" left="0" @@ -284,8 +284,7 @@ clicking on their names. width="20" /> <scroll_list.columns label="" - name="action" - width="270" /> + name="action" /> </scroll_list> </panel> <panel @@ -451,7 +450,39 @@ clicking on their names. </scroll_list> </panel> <panel - height="550" + height="90" + background_visible="false" + bg_alpha_color="FloaterUnfocusBorderColor" + layout="topleft" + follows="top|left|right" + left="0" + right="-1" + width="313" + mouse_opaque="false" + name="members_header" + top_pad="3" + visible="false"> + <text_editor + bg_readonly_color="Transparent" + text_readonly_color="EmphasisColor" + font="SansSerifSmall" + type="string" + enabled="false" + halign="left" + layout="topleft" + top_pad="0" + follows="left|top|right" + left="0" + right="-1" + height="90" + max_length="512" + name="member_action_description" + word_wrap="true"> + This Ability is 'Eject Members from this Group'. Only an Owner can eject another Owner. + </text_editor> + </panel> + <panel + height="460" background_visible="false" bg_alpha_color="FloaterUnfocusBorderColor" layout="topleft" @@ -599,11 +630,42 @@ clicking on their names. width="20" /> <scroll_list.columns label="" - name="action" - width="270" /> + name="action" /> </scroll_list> </panel> <panel + height="90" + background_visible="false" + bg_alpha_color="FloaterUnfocusBorderColor" + layout="topleft" + follows="top|left|right" + left="0" + right="-1" + width="313" + mouse_opaque="false" + name="roles_header" + top_pad="3" + visible="false"> + <text_editor + bg_readonly_color="Transparent" + text_readonly_color="EmphasisColor" + font="SansSerifSmall" + type="string" + enabled="false" + halign="left" + layout="topleft" + top_pad="0" + follows="left|top|right" + left="0" + right="-1" + height="90" + max_length="512" + name="role_action_description" + word_wrap="true"> + This Ability is 'Eject Members from this Group'. Only an Owner can eject another Owner. + </text_editor> + </panel> + <panel height="424" background_visible="false" bg_alpha_color="FloaterUnfocusBorderColor" diff --git a/indra/newview/skins/default/xui/en/role_actions.xml b/indra/newview/skins/default/xui/en/role_actions.xml index 8d058b0b53..a9523d9dca 100644 --- a/indra/newview/skins/default/xui/en/role_actions.xml +++ b/indra/newview/skins/default/xui/en/role_actions.xml @@ -6,7 +6,7 @@ <action description="Invite People to this Group" longdescription="Invite People to this Group using the 'Invite' button in the Roles section > Members tab." name="member invite" value="1" /> - <action description="Eject Members from this Group" + <action description="Eject Members belonging to the 'Everyone' role from this Group" longdescription="Eject Members from this Group using the 'Eject' button in the Roles section > Members tab. An Owner can eject anyone except another Owner. If you're not an Owner, a Member can be ejected from a group if, and only if, they're only in the Everyone Role, and NO other Roles. To remove Members from Roles, you need to have the 'Remove Members from Roles' Ability." name="member eject" value="2" /> <action description="Manage ban list" |