aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelgrouproles.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpanelgrouproles.cpp')
-rw-r--r--linden/indra/newview/llpanelgrouproles.cpp103
1 files changed, 41 insertions, 62 deletions
diff --git a/linden/indra/newview/llpanelgrouproles.cpp b/linden/indra/newview/llpanelgrouproles.cpp
index 5a2d9db..194f880 100644
--- a/linden/indra/newview/llpanelgrouproles.cpp
+++ b/linden/indra/newview/llpanelgrouproles.cpp
@@ -133,7 +133,7 @@ BOOL LLPanelGroupRoles::postBuild()
133{ 133{
134 lldebugs << "LLPanelGroupRoles::postBuild()" << llendl; 134 lldebugs << "LLPanelGroupRoles::postBuild()" << llendl;
135 135
136 mSubTabContainer = (LLTabContainerCommon*) getChildByName("roles_tab_container"); 136 mSubTabContainer = getChild<LLTabContainer>("roles_tab_container");
137 137
138 if (!mSubTabContainer) return FALSE; 138 if (!mSubTabContainer) return FALSE;
139 139
@@ -169,20 +169,8 @@ BOOL LLPanelGroupRoles::postBuild()
169 mCurrentTab->activate(); 169 mCurrentTab->activate();
170 170
171 // Read apply text from the xml file. 171 // Read apply text from the xml file.
172 LLTextBox* txt; 172 mDefaultNeedsApplyMesg = getString("default_needs_apply_text");
173 // Don't recurse for this, since we don't currently have a recursive removeChild() 173 mWantApplyMesg = getString("want_apply_text");
174 txt = (LLTextBox*)getChildByName("default_needs_apply_text");
175 if (txt)
176 {
177 mDefaultNeedsApplyMesg = txt->getText();
178 removeChild(txt, TRUE);
179 }
180 txt = (LLTextBox*)getChildByName("want_apply_text");
181 if (txt)
182 {
183 mWantApplyMesg = txt->getText();
184 removeChild(txt, TRUE);
185 }
186 174
187 return LLPanelGroupTab::postBuild(); 175 return LLPanelGroupTab::postBuild();
188} 176}
@@ -515,20 +503,20 @@ BOOL LLPanelGroupSubTab::postBuild()
515{ 503{
516 // Hook up the search widgets. 504 // Hook up the search widgets.
517 bool recurse = true; 505 bool recurse = true;
518 mSearchLineEditor = (LLLineEditor*) getChildByName("search_text", recurse); 506 mSearchLineEditor = getChild<LLLineEditor>("search_text", recurse);
519 507
520 if (!mSearchLineEditor) return FALSE; 508 if (!mSearchLineEditor) return FALSE;
521 mSearchLineEditor->setKeystrokeCallback(onSearchKeystroke); 509 mSearchLineEditor->setKeystrokeCallback(onSearchKeystroke);
522 mSearchLineEditor->setCallbackUserData(this); 510 mSearchLineEditor->setCallbackUserData(this);
523 511
524 mSearchButton = (LLButton*) getChildByName("search_button", recurse); 512 mSearchButton = getChild<LLButton>("search_button", recurse);
525 513
526 if (!mSearchButton) return FALSE; 514 if (!mSearchButton) return FALSE;
527 mSearchButton->setClickedCallback(onClickSearch); 515 mSearchButton->setClickedCallback(onClickSearch);
528 mSearchButton->setCallbackUserData(this); 516 mSearchButton->setCallbackUserData(this);
529 mSearchButton->setEnabled(FALSE); 517 mSearchButton->setEnabled(FALSE);
530 518
531 mShowAllButton = (LLButton*) getChildByName("show_all_button", recurse); 519 mShowAllButton = getChild<LLButton>("show_all_button", recurse);
532 520
533 if (!mShowAllButton) return FALSE; 521 if (!mShowAllButton) return FALSE;
534 mShowAllButton->setClickedCallback(onClickShowAll); 522 mShowAllButton->setClickedCallback(onClickShowAll);
@@ -540,21 +528,21 @@ BOOL LLPanelGroupSubTab::postBuild()
540 528
541 bool no_recurse = false; 529 bool no_recurse = false;
542 530
543 LLIconCtrl* icon = (LLIconCtrl*) getChildByName("power_folder_icon",no_recurse); 531 LLIconCtrl* icon = getChild<LLIconCtrl>("power_folder_icon",no_recurse);
544 if (icon && icon->getImage().notNull()) 532 if (icon && icon->getImage().notNull())
545 { 533 {
546 mActionIcons["folder"] = icon->getImage(); 534 mActionIcons["folder"] = icon->getImage();
547 removeChild(icon, TRUE); 535 removeChild(icon, TRUE);
548 } 536 }
549 537
550 icon = (LLIconCtrl*) getChildByName("power_all_have_icon",no_recurse); 538 icon = getChild<LLIconCtrl>("power_all_have_icon",no_recurse);
551 if (icon && icon->getImage().notNull()) 539 if (icon && icon->getImage().notNull())
552 { 540 {
553 mActionIcons["full"] = icon->getImage(); 541 mActionIcons["full"] = icon->getImage();
554 removeChild(icon, TRUE); 542 removeChild(icon, TRUE);
555 } 543 }
556 544
557 icon = (LLIconCtrl*) getChildByName("power_partial_icon",no_recurse); 545 icon = getChild<LLIconCtrl>("power_partial_icon",no_recurse);
558 if (icon && icon->getImage().notNull()) 546 if (icon && icon->getImage().notNull())
559 { 547 {
560 mActionIcons["partial"] = icon->getImage(); 548 mActionIcons["partial"] = icon->getImage();
@@ -913,12 +901,12 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
913 901
914 // Look recursively from the parent to find all our widgets. 902 // Look recursively from the parent to find all our widgets.
915 bool recurse = true; 903 bool recurse = true;
916 mHeader = (LLPanel*) parent->getChildByName("members_header", recurse); 904 mHeader = parent->getChild<LLPanel>("members_header", recurse);
917 mFooter = (LLPanel*) parent->getChildByName("members_footer", recurse); 905 mFooter = parent->getChild<LLPanel>("members_footer", recurse);
918 906
919 mMembersList = (LLNameListCtrl*) parent->getChildByName("member_list", recurse); 907 mMembersList = parent->getChild<LLNameListCtrl>("member_list", recurse);
920 mAssignedRolesList = (LLScrollListCtrl*) parent->getChildByName("member_assigned_roles", recurse); 908 mAssignedRolesList = parent->getChild<LLScrollListCtrl>("member_assigned_roles", recurse);
921 mAllowedActionsList = (LLScrollListCtrl*) parent->getChildByName("member_allowed_actions", recurse); 909 mAllowedActionsList = parent->getChild<LLScrollListCtrl>("member_allowed_actions", recurse);
922 910
923 if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList) return FALSE; 911 if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList) return FALSE;
924 912
@@ -929,7 +917,7 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
929 // Show the member's profile on double click. 917 // Show the member's profile on double click.
930 mMembersList->setDoubleClickCallback(onMemberDoubleClick); 918 mMembersList->setDoubleClickCallback(onMemberDoubleClick);
931 919
932 LLButton* button = (LLButton*) parent->getChildByName("member_invite", recurse); 920 LLButton* button = parent->getChild<LLButton>("member_invite", recurse);
933 if ( button ) 921 if ( button )
934 { 922 {
935 button->setClickedCallback(onInviteMember); 923 button->setClickedCallback(onInviteMember);
@@ -937,7 +925,7 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
937 button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE)); 925 button->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_INVITE));
938 } 926 }
939 927
940 mEjectBtn = (LLButton*) parent->getChildByName("member_eject", recurse); 928 mEjectBtn = parent->getChild<LLButton>("member_eject", recurse);
941 if ( mEjectBtn ) 929 if ( mEjectBtn )
942 { 930 {
943 mEjectBtn->setClickedCallback(onEjectMembers); 931 mEjectBtn->setClickedCallback(onEjectMembers);
@@ -1467,19 +1455,16 @@ void LLPanelGroupMembersSubTab::applyMemberChanges()
1467 notifyObservers(); 1455 notifyObservers();
1468} 1456}
1469 1457
1470bool LLPanelGroupMembersSubTab::matchesSearchFilter(char* first, char* last) 1458bool LLPanelGroupMembersSubTab::matchesSearchFilter(const std::string& fullname)
1471{ 1459{
1472 // If the search filter is empty, everything passes. 1460 // If the search filter is empty, everything passes.
1473 if (mSearchFilter.empty()) return true; 1461 if (mSearchFilter.empty()) return true;
1474 1462
1475 // Create a full name, and compare it to the search filter. 1463 // Create a full name, and compare it to the search filter.
1476 LLString fullname; 1464 std::string fullname_lc(fullname);
1477 fullname.assign(first); 1465 LLString::toLower(fullname_lc);
1478 fullname.append(1, ' ');
1479 fullname.append(last);
1480 LLString::toLower(fullname);
1481 1466
1482 std::string::size_type match = fullname.find(mSearchFilter); 1467 std::string::size_type match = fullname_lc.find(mSearchFilter);
1483 1468
1484 if (std::string::npos == match) 1469 if (std::string::npos == match)
1485 { 1470 {
@@ -1682,8 +1667,6 @@ void LLPanelGroupMembersSubTab::updateMembers()
1682 1667
1683 LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end(); 1668 LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end();
1684 1669
1685 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1686 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1687 S32 i = 0; 1670 S32 i = 0;
1688 for( ; mMemberProgress != end && i<UPDATE_MEMBERS_PER_FRAME; 1671 for( ; mMemberProgress != end && i<UPDATE_MEMBERS_PER_FRAME;
1689 ++mMemberProgress, ++i) 1672 ++mMemberProgress, ++i)
@@ -1693,9 +1676,10 @@ void LLPanelGroupMembersSubTab::updateMembers()
1693 // Do filtering on name if it is already in the cache. 1676 // Do filtering on name if it is already in the cache.
1694 bool add_member = true; 1677 bool add_member = true;
1695 1678
1696 if (gCacheName->getName(mMemberProgress->first, first, last)) 1679 std::string fullname;
1680 if (gCacheName->getFullName(mMemberProgress->first, fullname))
1697 { 1681 {
1698 if ( !matchesSearchFilter(first, last) ) 1682 if ( !matchesSearchFilter(fullname) )
1699 { 1683 {
1700 add_member = false; 1684 add_member = false;
1701 } 1685 }
@@ -1775,19 +1759,19 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
1775 1759
1776 // Look recursively from the parent to find all our widgets. 1760 // Look recursively from the parent to find all our widgets.
1777 bool recurse = true; 1761 bool recurse = true;
1778 mHeader = (LLPanel*) parent->getChildByName("roles_header", recurse); 1762 mHeader = parent->getChild<LLPanel>("roles_header", recurse);
1779 mFooter = (LLPanel*) parent->getChildByName("roles_footer", recurse); 1763 mFooter = parent->getChild<LLPanel>("roles_footer", recurse);
1780 1764
1781 1765
1782 mRolesList = (LLScrollListCtrl*) parent->getChildByName("role_list", recurse); 1766 mRolesList = parent->getChild<LLScrollListCtrl>("role_list", recurse);
1783 mAssignedMembersList = (LLNameListCtrl*) parent->getChildByName("role_assigned_members", recurse); 1767 mAssignedMembersList = parent->getChild<LLNameListCtrl>("role_assigned_members", recurse);
1784 mAllowedActionsList = (LLScrollListCtrl*) parent->getChildByName("role_allowed_actions", recurse); 1768 mAllowedActionsList = parent->getChild<LLScrollListCtrl>("role_allowed_actions", recurse);
1785 1769
1786 mRoleName = (LLLineEditor*) parent->getChildByName("role_name", recurse); 1770 mRoleName = parent->getChild<LLLineEditor>("role_name", recurse);
1787 mRoleTitle = (LLLineEditor*) parent->getChildByName("role_title", recurse); 1771 mRoleTitle = parent->getChild<LLLineEditor>("role_title", recurse);
1788 mRoleDescription = (LLTextEditor*) parent->getChildByName("role_description", recurse); 1772 mRoleDescription = parent->getChild<LLTextEditor>("role_description", recurse);
1789 1773
1790 mMemberVisibleCheck = (LLCheckBoxCtrl*) parent->getChildByName("role_visible_in_list", recurse); 1774 mMemberVisibleCheck = parent->getChild<LLCheckBoxCtrl>("role_visible_in_list", recurse);
1791 1775
1792 if (!mRolesList || !mAssignedMembersList || !mAllowedActionsList 1776 if (!mRolesList || !mAssignedMembersList || !mAllowedActionsList
1793 || !mRoleName || !mRoleTitle || !mRoleDescription || !mMemberVisibleCheck) 1777 || !mRoleName || !mRoleTitle || !mRoleDescription || !mMemberVisibleCheck)
@@ -1796,15 +1780,10 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
1796 return FALSE; 1780 return FALSE;
1797 } 1781 }
1798 1782
1799 LLTextBox* txt = (LLTextBox*) parent->getChildByName("cant_delete_role", FALSE); 1783 mRemoveEveryoneTxt = getString("cant_delete_role");
1800 if (txt)
1801 {
1802 mRemoveEveryoneTxt = txt->getText();
1803 parent->removeChild(txt, TRUE);
1804 }
1805 1784
1806 mCreateRoleButton = 1785 mCreateRoleButton =
1807 (LLButton*) parent->getChildByName("role_create", recurse); 1786 parent->getChild<LLButton>("role_create", recurse);
1808 if ( mCreateRoleButton ) 1787 if ( mCreateRoleButton )
1809 { 1788 {
1810 mCreateRoleButton->setCallbackUserData(this); 1789 mCreateRoleButton->setCallbackUserData(this);
@@ -1813,7 +1792,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
1813 } 1792 }
1814 1793
1815 mDeleteRoleButton = 1794 mDeleteRoleButton =
1816 (LLButton*) parent->getChildByName("role_delete", recurse); 1795 parent->getChild<LLButton>("role_delete", recurse);
1817 if ( mDeleteRoleButton ) 1796 if ( mDeleteRoleButton )
1818 { 1797 {
1819 mDeleteRoleButton->setCallbackUserData(this); 1798 mDeleteRoleButton->setCallbackUserData(this);
@@ -2488,14 +2467,14 @@ BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root)
2488 2467
2489 // Look recursively from the parent to find all our widgets. 2468 // Look recursively from the parent to find all our widgets.
2490 bool recurse = true; 2469 bool recurse = true;
2491 mHeader = (LLPanel*) parent->getChildByName("actions_header", recurse); 2470 mHeader = parent->getChild<LLPanel>("actions_header", recurse);
2492 mFooter = (LLPanel*) parent->getChildByName("actions_footer", recurse); 2471 mFooter = parent->getChild<LLPanel>("actions_footer", recurse);
2493 2472
2494 mActionDescription = (LLTextEditor*) parent->getChildByName("action_description", recurse); 2473 mActionDescription = parent->getChild<LLTextEditor>("action_description", recurse);
2495 2474
2496 mActionList = (LLScrollListCtrl*) parent->getChildByName("action_list",recurse); 2475 mActionList = parent->getChild<LLScrollListCtrl>("action_list",recurse);
2497 mActionRoles = (LLScrollListCtrl*) parent->getChildByName("action_roles",recurse); 2476 mActionRoles = parent->getChild<LLScrollListCtrl>("action_roles",recurse);
2498 mActionMembers = (LLNameListCtrl*) parent->getChildByName("action_members",recurse); 2477 mActionMembers = parent->getChild<LLNameListCtrl>("action_members",recurse);
2499 2478
2500 if (!mActionList || !mActionDescription || !mActionRoles || !mActionMembers) return FALSE; 2479 if (!mActionList || !mActionDescription || !mActionRoles || !mActionMembers) return FALSE;
2501 2480