From 2e32d44e7165775936beae5d9ef636ff9d3f2bd2 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 19 Feb 2008 21:42:32 +0000 Subject: merge svn+ssh://svn.lindenlab.com/svn/linden/qa/combo-merge-ui-2008-02-13 -r 79986 : 80178 -> release. QAR-290 = QAR-271 + QAR-191 --- indra/newview/llpanelgrouproles.cpp | 103 ++++++++++++++---------------------- 1 file changed, 41 insertions(+), 62 deletions(-) (limited to 'indra/newview/llpanelgrouproles.cpp') diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 1556f24afa..6ca3e1e085 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -133,7 +133,7 @@ BOOL LLPanelGroupRoles::postBuild() { lldebugs << "LLPanelGroupRoles::postBuild()" << llendl; - mSubTabContainer = (LLTabContainerCommon*) getChildByName("roles_tab_container"); + mSubTabContainer = getChild("roles_tab_container"); if (!mSubTabContainer) return FALSE; @@ -169,20 +169,8 @@ BOOL LLPanelGroupRoles::postBuild() mCurrentTab->activate(); // Read apply text from the xml file. - LLTextBox* txt; - // Don't recurse for this, since we don't currently have a recursive removeChild() - txt = (LLTextBox*)getChildByName("default_needs_apply_text"); - if (txt) - { - mDefaultNeedsApplyMesg = txt->getText(); - removeChild(txt, TRUE); - } - txt = (LLTextBox*)getChildByName("want_apply_text"); - if (txt) - { - mWantApplyMesg = txt->getText(); - removeChild(txt, TRUE); - } + mDefaultNeedsApplyMesg = getString("default_needs_apply_text"); + mWantApplyMesg = getString("want_apply_text"); return LLPanelGroupTab::postBuild(); } @@ -515,20 +503,20 @@ BOOL LLPanelGroupSubTab::postBuild() { // Hook up the search widgets. bool recurse = true; - mSearchLineEditor = (LLLineEditor*) getChildByName("search_text", recurse); + mSearchLineEditor = getChild("search_text", recurse); if (!mSearchLineEditor) return FALSE; mSearchLineEditor->setKeystrokeCallback(onSearchKeystroke); mSearchLineEditor->setCallbackUserData(this); - mSearchButton = (LLButton*) getChildByName("search_button", recurse); + mSearchButton = getChild("search_button", recurse); if (!mSearchButton) return FALSE; mSearchButton->setClickedCallback(onClickSearch); mSearchButton->setCallbackUserData(this); mSearchButton->setEnabled(FALSE); - mShowAllButton = (LLButton*) getChildByName("show_all_button", recurse); + mShowAllButton = getChild("show_all_button", recurse); if (!mShowAllButton) return FALSE; mShowAllButton->setClickedCallback(onClickShowAll); @@ -540,21 +528,21 @@ BOOL LLPanelGroupSubTab::postBuild() bool no_recurse = false; - LLIconCtrl* icon = (LLIconCtrl*) getChildByName("power_folder_icon",no_recurse); + LLIconCtrl* icon = getChild("power_folder_icon",no_recurse); if (icon && icon->getImage().notNull()) { mActionIcons["folder"] = icon->getImage(); removeChild(icon, TRUE); } - icon = (LLIconCtrl*) getChildByName("power_all_have_icon",no_recurse); + icon = getChild("power_all_have_icon",no_recurse); if (icon && icon->getImage().notNull()) { mActionIcons["full"] = icon->getImage(); removeChild(icon, TRUE); } - icon = (LLIconCtrl*) getChildByName("power_partial_icon",no_recurse); + icon = getChild("power_partial_icon",no_recurse); if (icon && icon->getImage().notNull()) { mActionIcons["partial"] = icon->getImage(); @@ -913,12 +901,12 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) // Look recursively from the parent to find all our widgets. bool recurse = true; - mHeader = (LLPanel*) parent->getChildByName("members_header", recurse); - mFooter = (LLPanel*) parent->getChildByName("members_footer", recurse); + mHeader = parent->getChild("members_header", recurse); + mFooter = parent->getChild("members_footer", recurse); - mMembersList = (LLNameListCtrl*) parent->getChildByName("member_list", recurse); - mAssignedRolesList = (LLScrollListCtrl*) parent->getChildByName("member_assigned_roles", recurse); - mAllowedActionsList = (LLScrollListCtrl*) parent->getChildByName("member_allowed_actions", recurse); + mMembersList = parent->getChild("member_list", recurse); + mAssignedRolesList = parent->getChild("member_assigned_roles", recurse); + mAllowedActionsList = parent->getChild("member_allowed_actions", recurse); if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList) return FALSE; @@ -929,7 +917,7 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) // Show the member's profile on double click. mMembersList->setDoubleClickCallback(onMemberDoubleClick); - LLButton* button = (LLButton*) parent->getChildByName("member_invite", recurse); + LLButton* button = parent->getChild("member_invite", recurse); if ( button ) { button->setClickedCallback(onInviteMember); @@ -937,7 +925,7 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE)); } - mEjectBtn = (LLButton*) parent->getChildByName("member_eject", recurse); + mEjectBtn = parent->getChild("member_eject", recurse); if ( mEjectBtn ) { mEjectBtn->setClickedCallback(onEjectMembers); @@ -1483,19 +1471,16 @@ void LLPanelGroupMembersSubTab::applyMemberChanges() notifyObservers(); } -bool LLPanelGroupMembersSubTab::matchesSearchFilter(char* first, char* last) +bool LLPanelGroupMembersSubTab::matchesSearchFilter(const std::string& fullname) { // If the search filter is empty, everything passes. if (mSearchFilter.empty()) return true; // Create a full name, and compare it to the search filter. - LLString fullname; - fullname.assign(first); - fullname.append(1, ' '); - fullname.append(last); - LLString::toLower(fullname); + std::string fullname_lc(fullname); + LLString::toLower(fullname_lc); - std::string::size_type match = fullname.find(mSearchFilter); + std::string::size_type match = fullname_lc.find(mSearchFilter); if (std::string::npos == match) { @@ -1709,8 +1694,6 @@ void LLPanelGroupMembersSubTab::updateMembers() LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end(); - char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ S32 i = 0; for( ; mMemberProgress != end && igetName(mMemberProgress->first, first, last)) + std::string fullname; + if (gCacheName->getFullName(mMemberProgress->first, fullname)) { - if ( !matchesSearchFilter(first, last) ) + if ( !matchesSearchFilter(fullname) ) { add_member = false; } @@ -1802,19 +1786,19 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) // Look recursively from the parent to find all our widgets. bool recurse = true; - mHeader = (LLPanel*) parent->getChildByName("roles_header", recurse); - mFooter = (LLPanel*) parent->getChildByName("roles_footer", recurse); + mHeader = parent->getChild("roles_header", recurse); + mFooter = parent->getChild("roles_footer", recurse); - mRolesList = (LLScrollListCtrl*) parent->getChildByName("role_list", recurse); - mAssignedMembersList = (LLNameListCtrl*) parent->getChildByName("role_assigned_members", recurse); - mAllowedActionsList = (LLScrollListCtrl*) parent->getChildByName("role_allowed_actions", recurse); + mRolesList = parent->getChild("role_list", recurse); + mAssignedMembersList = parent->getChild("role_assigned_members", recurse); + mAllowedActionsList = parent->getChild("role_allowed_actions", recurse); - mRoleName = (LLLineEditor*) parent->getChildByName("role_name", recurse); - mRoleTitle = (LLLineEditor*) parent->getChildByName("role_title", recurse); - mRoleDescription = (LLTextEditor*) parent->getChildByName("role_description", recurse); + mRoleName = parent->getChild("role_name", recurse); + mRoleTitle = parent->getChild("role_title", recurse); + mRoleDescription = parent->getChild("role_description", recurse); - mMemberVisibleCheck = (LLCheckBoxCtrl*) parent->getChildByName("role_visible_in_list", recurse); + mMemberVisibleCheck = parent->getChild("role_visible_in_list", recurse); if (!mRolesList || !mAssignedMembersList || !mAllowedActionsList || !mRoleName || !mRoleTitle || !mRoleDescription || !mMemberVisibleCheck) @@ -1823,15 +1807,10 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) return FALSE; } - LLTextBox* txt = (LLTextBox*) parent->getChildByName("cant_delete_role", FALSE); - if (txt) - { - mRemoveEveryoneTxt = txt->getText(); - parent->removeChild(txt, TRUE); - } + mRemoveEveryoneTxt = getString("cant_delete_role"); mCreateRoleButton = - (LLButton*) parent->getChildByName("role_create", recurse); + parent->getChild("role_create", recurse); if ( mCreateRoleButton ) { mCreateRoleButton->setCallbackUserData(this); @@ -1840,7 +1819,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) } mDeleteRoleButton = - (LLButton*) parent->getChildByName("role_delete", recurse); + parent->getChild("role_delete", recurse); if ( mDeleteRoleButton ) { mDeleteRoleButton->setCallbackUserData(this); @@ -2515,14 +2494,14 @@ BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root) // Look recursively from the parent to find all our widgets. bool recurse = true; - mHeader = (LLPanel*) parent->getChildByName("actions_header", recurse); - mFooter = (LLPanel*) parent->getChildByName("actions_footer", recurse); + mHeader = parent->getChild("actions_header", recurse); + mFooter = parent->getChild("actions_footer", recurse); - mActionDescription = (LLTextEditor*) parent->getChildByName("action_description", recurse); + mActionDescription = parent->getChild("action_description", recurse); - mActionList = (LLScrollListCtrl*) parent->getChildByName("action_list",recurse); - mActionRoles = (LLScrollListCtrl*) parent->getChildByName("action_roles",recurse); - mActionMembers = (LLNameListCtrl*) parent->getChildByName("action_members",recurse); + mActionList = parent->getChild("action_list",recurse); + mActionRoles = parent->getChild("action_roles",recurse); + mActionMembers = parent->getChild("action_members",recurse); if (!mActionList || !mActionDescription || !mActionRoles || !mActionMembers) return FALSE; -- cgit v1.2.3