diff options
Diffstat (limited to 'indra/newview/llpanelgrouproles.cpp')
-rw-r--r-- | indra/newview/llpanelgrouproles.cpp | 77 |
1 files changed, 60 insertions, 17 deletions
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 66a0a1d4ad..087e0a0759 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -465,12 +465,12 @@ BOOL LLPanelGroupSubTab::postBuild() { // Hook up the search widgets. bool recurse = true; - mSearchEditor = getChild<LLFilterEditor>("filter_input", recurse); - if (!mSearchEditor) - return FALSE; - - mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2)); + mSearchEditor = findChild<LLFilterEditor>("filter_input", recurse); + if (mSearchEditor) // SubTab doesn't implement this, only some of derived classes + { + mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2)); + } return LLPanelGroupTab::postBuild(); } @@ -815,14 +815,18 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) // Look recursively from the parent to find all our widgets. bool recurse = true; - mHeader = parent->getChild<LLPanel>("members_header", recurse); - mFooter = parent->getChild<LLPanel>("members_footer", recurse); + mHeader = parent->findChild<LLPanel>("members_header", recurse); + mFooter = parent->findChild<LLPanel>("members_footer", recurse); 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); @@ -1957,13 +1980,14 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) // Look recursively from the parent to find all our widgets. bool recurse = true; - mHeader = parent->getChild<LLPanel>("roles_header", recurse); - mFooter = parent->getChild<LLPanel>("roles_footer", recurse); + mHeader = parent->findChild<LLPanel>("roles_header", recurse); + mFooter = parent->findChild<LLPanel>("roles_footer", recurse); 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(); @@ -2746,8 +2789,8 @@ BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root) // Look recursively from the parent to find all our widgets. bool recurse = true; - mHeader = parent->getChild<LLPanel>("actions_header", recurse); - mFooter = parent->getChild<LLPanel>("actions_footer", recurse); + mHeader = parent->findChild<LLPanel>("actions_header", recurse); + mFooter = parent->findChild<LLPanel>("actions_footer", recurse); mActionDescription = parent->getChild<LLTextEditor>("action_description", recurse); @@ -2953,10 +2996,10 @@ BOOL LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root) // Look recursively from the parent to find all our widgets. bool recurse = true; - - mHeader = parent->getChild<LLPanel>("banlist_header", recurse); - mFooter = parent->getChild<LLPanel>("banlist_footer", recurse); - + + mHeader = parent->findChild<LLPanel>("banlist_header", recurse); + mFooter = parent->findChild<LLPanel>("banlist_footer", recurse); + mBanList = parent->getChild<LLNameListCtrl>("ban_list", recurse); mCreateBanButton = parent->getChild<LLButton>("ban_create", recurse); |