diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-08-28 20:47:43 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-08-28 20:47:43 -0400 |
commit | cde1174345224d33d6b45b1e3243fa39043223e5 (patch) | |
tree | 6c8db6e0499622d8c7206a11c997eb173ebd478f /indra/newview/llpanelgrouproles.cpp | |
parent | 6f454ad8366ed33bbe199c3fc3ed69e6d3448cec (diff) | |
parent | 35efadf78315f9b351415930dca4fae251ef4dd0 (diff) |
Merge branch 'main' into release/luau-scripting.
Diffstat (limited to 'indra/newview/llpanelgrouproles.cpp')
-rw-r--r-- | indra/newview/llpanelgrouproles.cpp | 362 |
1 files changed, 182 insertions, 180 deletions
diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 89dcd9182e..bc56b49e5d 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -119,7 +119,7 @@ LLPanelGroupRoles::LLPanelGroupRoles() mCurrentTab(NULL), mRequestedTab( NULL ), mSubTabContainer( NULL ), - mFirstUse( TRUE ) + mFirstUse( true ) { } @@ -127,13 +127,13 @@ LLPanelGroupRoles::~LLPanelGroupRoles() { } -BOOL LLPanelGroupRoles::postBuild() +bool LLPanelGroupRoles::postBuild() { LL_DEBUGS() << "LLPanelGroupRoles::postBuild()" << LL_ENDL; mSubTabContainer = getChild<LLTabContainer>("roles_tab_container"); - if (!mSubTabContainer) return FALSE; + if (!mSubTabContainer) return false; // Hook up each sub-tabs callback and widgets. for (S32 i = 0; i < mSubTabContainer->getTabCount(); ++i) @@ -143,13 +143,13 @@ BOOL LLPanelGroupRoles::postBuild() if (!subtabp) { LL_WARNS() << "Invalid subtab panel: " << panel->getName() << LL_ENDL; - return FALSE; + return false; } // Hand the subtab a pointer to this LLPanelGroupRoles, so that it can // look around for the widgets it is interested in. if (!subtabp->postBuildSubTab(this)) - return FALSE; + return false; //subtabp->addObserver(this); } @@ -165,7 +165,7 @@ BOOL LLPanelGroupRoles::postBuild() mCurrentTab = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); } - if (!mCurrentTab) return FALSE; + if (!mCurrentTab) return false; // Act as though this tab was just activated. mCurrentTab->activate(); @@ -177,7 +177,7 @@ BOOL LLPanelGroupRoles::postBuild() return LLPanelGroupTab::postBuild(); } -BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp) +bool LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp) { /* This power was removed to make group roles simpler return agentp->hasPowerInGroup(mGroupID, @@ -221,9 +221,9 @@ bool LLPanelGroupRoles::handleSubTabSwitch(const LLSD& data) args["WANT_APPLY_MESSAGE"] = mWantApplyMesg; LLNotificationsUtil::add("PanelGroupApply", args, LLSD(), boost::bind(&LLPanelGroupRoles::handleNotifyCallback, this, _1, _2)); - mHasModal = TRUE; + mHasModal = true; - // Returning FALSE will block a close action from finishing until + // Returning false will block a close action from finishing until // we get a response back from the user. return false; } @@ -253,7 +253,7 @@ void LLPanelGroupRoles::transitionToTab() bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - mHasModal = FALSE; + mHasModal = false; LLPanelGroupTab* transition_tab = mRequestedTab; switch (option) { @@ -266,7 +266,7 @@ bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLS // There was a problem doing the apply. if ( !apply_mesg.empty() ) { - mHasModal = TRUE; + mHasModal = true; LLSD args; args["MESSAGE"] = apply_mesg; LLNotificationsUtil::add("GenericAlert", args, LLSD(), boost::bind(&LLPanelGroupRoles::onModalClose, this, _1, _2)); @@ -296,7 +296,7 @@ bool LLPanelGroupRoles::handleNotifyCallback(const LLSD& notification, const LLS bool LLPanelGroupRoles::onModalClose(const LLSD& notification, const LLSD& response) { - mHasModal = FALSE; + mHasModal = false; return false; } @@ -369,7 +369,7 @@ void LLPanelGroupRoles::activate() LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mGroupID); } - mFirstUse = FALSE; + mFirstUse = false; LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); if (panelp) panelp->activate(); @@ -389,12 +389,12 @@ bool LLPanelGroupRoles::needsApply(std::string& mesg) return panelp->needsApply(mesg); } -BOOL LLPanelGroupRoles::hasModal() +bool LLPanelGroupRoles::hasModal() { - if (mHasModal) return TRUE; + if (mHasModal) return true; LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); - if (!panelp) return FALSE; + if (!panelp) return false; return panelp->hasModal(); } @@ -419,7 +419,7 @@ void LLPanelGroupRoles::setGroupID(const LLUUID& id) if(mSubTabContainer) mSubTabContainer->selectTab(1); - group_roles_tab->mFirstOpen = TRUE; + group_roles_tab->mFirstOpen = true; activate(); } @@ -437,9 +437,10 @@ LLPanelGroupSubTab::LLPanelGroupSubTab() LLPanelGroupSubTab::~LLPanelGroupSubTab() { + mSearchCommitConnection.disconnect(); } -BOOL LLPanelGroupSubTab::postBuildSubTab(LLView* root) +bool LLPanelGroupSubTab::postBuildSubTab(LLView* root) { // Get icons for later use. mActionIcons.clear(); @@ -458,18 +459,19 @@ BOOL LLPanelGroupSubTab::postBuildSubTab(LLView* root) { mActionIcons["partial"] = getString("power_partial_icon"); } - return TRUE; + return true; } -BOOL LLPanelGroupSubTab::postBuild() +bool LLPanelGroupSubTab::postBuild() { // Hook up the search widgets. - bool recurse = true; + constexpr bool recurse = true; 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)); + // panel + mSearchCommitConnection = mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2)); } return LLPanelGroupTab::postBuild(); @@ -499,15 +501,15 @@ void LLPanelGroupSubTab::setSearchFilter(const std::string& filter) void LLPanelGroupSubTab::activate() { - setOthersVisible(TRUE); + setOthersVisible(true); } void LLPanelGroupSubTab::deactivate() { - setOthersVisible(FALSE); + setOthersVisible(false); } -void LLPanelGroupSubTab::setOthersVisible(BOOL b) +void LLPanelGroupSubTab::setOthersVisible(bool b) { if (mHeader) { @@ -543,9 +545,9 @@ void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, U64 allowed_by_some, U64 allowed_by_all, LLUICtrl::commit_callback_t commit_callback, - BOOL show_all, - BOOL filter, - BOOL is_owner_role) + bool show_all, + bool filter, + bool is_owner_role) { if (LLGroupMgr::getInstance()->mRoleActionSets.empty()) { @@ -575,9 +577,9 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, U64 allowed_by_all, LLRoleActionSet* action_set, LLUICtrl::commit_callback_t commit_callback, - BOOL show_all, - BOOL filter, - BOOL is_owner_role) + bool show_all, + bool filter, + bool is_owner_role) { LL_DEBUGS() << "Building role list for: " << action_set->mActionSetData->mName << LL_ENDL; // See if the allow mask matches anything in this category. @@ -613,7 +615,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, std::vector<LLRoleAction*>::iterator ra_end = action_set->mActions.end(); bool items_match_filter = false; - BOOL can_change_actions = (!is_owner_role && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CHANGE_ACTIONS)); + bool can_change_actions = (!is_owner_role && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CHANGE_ACTIONS)); for ( ; ra_it != ra_end; ++ra_it) { @@ -724,26 +726,26 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, if (show_all) { - check->setTentative(FALSE); + check->setTentative(false); if (allowed_by_some & (*ra_it)->mPowerBit) { - check->set(TRUE); + check->set(true); } else { - check->set(FALSE); + check->set(false); } } else { - check->set(TRUE); + check->set(true); if (show_full_strength) { - check->setTentative(FALSE); + check->setTentative(false); } else { - check->setTentative(TRUE); + check->setTentative(true); } } @@ -766,7 +768,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl, } } -void LLPanelGroupSubTab::setFooterEnabled(BOOL enable) +void LLPanelGroupSubTab::setFooterEnabled(bool enable) { if (mFooter) { @@ -783,9 +785,9 @@ LLPanelGroupMembersSubTab::LLPanelGroupMembersSubTab() mMembersList(NULL), mAssignedRolesList(NULL), mAllowedActionsList(NULL), - mChanged(FALSE), - mPendingMemberUpdate(FALSE), - mHasMatch(FALSE), + mChanged(false), + mPendingMemberUpdate(false), + mHasMatch(false), mNumOwnerAdditions(0) { } @@ -806,7 +808,7 @@ LLPanelGroupMembersSubTab::~LLPanelGroupMembersSubTab() } } -BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) +bool LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) { LLPanelGroupSubTab::postBuildSubTab(root); @@ -823,13 +825,13 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) mAllowedActionsList = parent->getChild<LLScrollListCtrl>("member_allowed_actions", recurse); mActionDescription = parent->getChild<LLTextEditor>("member_action_description", recurse); - if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList || !mActionDescription) return FALSE; + if (!mMembersList || !mAssignedRolesList || !mAllowedActionsList || !mActionDescription) return false; - mAllowedActionsList->setCommitOnSelectionChange(TRUE); + mAllowedActionsList->setCommitOnSelectionChange(true); mAllowedActionsList->setCommitCallback(boost::bind(&LLPanelGroupMembersSubTab::updateActionDescription, this)); // We want to be notified whenever a member is selected. - mMembersList->setCommitOnSelectionChange(TRUE); + mMembersList->setCommitOnSelectionChange(true); mMembersList->setCommitCallback(onMemberSelect, this); // Show the member's profile on double click. mMembersList->setDoubleClickCallback(onMemberDoubleClick, this); @@ -844,7 +846,7 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) std::string order_by = gSavedSettings.getString("GroupMembersSortOrder"); if(!order_by.empty()) { - mMembersList->sortByColumn(order_by, TRUE); + mMembersList->sortByColumn(order_by, true); } LLButton* button = parent->getChild<LLButton>("member_invite", recurse); @@ -858,17 +860,17 @@ BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root) if ( mEjectBtn ) { mEjectBtn->setClickedCallback(onEjectMembers, this); - mEjectBtn->setEnabled(FALSE); + mEjectBtn->setEnabled(false); } mBanBtn = parent->getChild<LLButton>("member_ban", recurse); if(mBanBtn) { mBanBtn->setClickedCallback(onBanMember, this); - mBanBtn->setEnabled(FALSE); + mBanBtn->setEnabled(false); } - return TRUE; + return true; } void LLPanelGroupMembersSubTab::setGroupID(const LLUUID& id) @@ -936,9 +938,9 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() allowed_by_some, allowed_by_all, NULL, - FALSE, - FALSE, - FALSE); + false, + false, + false); ////////////////////////////////// // Build the assigned roles list. @@ -947,9 +949,9 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() LLGroupMgrGroupData::role_list_t::iterator iter = gdatap->mRoles.begin(); LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end(); - BOOL can_ban_members = gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS); - BOOL can_eject_members = gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_EJECT); - BOOL member_is_owner = FALSE; + bool can_ban_members = gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS); + bool can_eject_members = gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_EJECT); + bool member_is_owner = false; for( ; iter != end; ++iter) { @@ -959,14 +961,14 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() if (group_role_data) { - const BOOL needs_sort = FALSE; + const bool needs_sort = false; S32 count = group_role_data->getMembersInRole( selected_members, needs_sort); //check if the user has permissions to assign/remove //members to/from the role (but the ability to add/remove //should only be based on the "saved" changes to the role //not in the temp/meta data. -jwolk - BOOL cb_enable = ( (count > 0) ? + bool cb_enable = ( (count > 0) ? agentCanRemoveFromRole(mGroupID, role_id) : agentCanAddToRole(mGroupID, role_id) ); @@ -994,8 +996,8 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() if ( member_data && member_data->isInRole(gdatap->mOwnerRole) ) { // Can't remove other owners. - cb_enable = FALSE; - can_ban_members = FALSE; + cb_enable = false; + can_ban_members = false; break; } } @@ -1017,10 +1019,10 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() // If anyone selected is in any role besides 'Everyone' then they can't be ejected. if (role_id.notNull() && (count > 0)) { - can_eject_members = FALSE; + can_eject_members = false; if (role_id == gdatap->mOwnerRole) { - member_is_owner = TRUE; + member_is_owner = true; } } @@ -1076,12 +1078,12 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() LL_WARNS() << "No group role data for " << iter->second << LL_ENDL; } } - mAssignedRolesList->setEnabled(TRUE); + mAssignedRolesList->setEnabled(true); if (gAgent.isGodlike()) { - can_eject_members = TRUE; - // can_ban_members = TRUE; + can_eject_members = true; + // can_ban_members = true; } if (!can_eject_members && !member_is_owner) @@ -1094,8 +1096,8 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() if ( member_data && member_data->isInRole(gdatap->mOwnerRole) ) { - can_eject_members = TRUE; - //can_ban_members = TRUE; + can_eject_members = true; + //can_ban_members = true; } } @@ -1107,12 +1109,12 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() { if( gAgent.hasPowerInGroup(mGroupID, GP_MEMBER_EJECT)) { - can_eject_members = TRUE; + can_eject_members = true; } if( gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS)) { - can_ban_members = TRUE; + can_ban_members = true; } } @@ -1124,8 +1126,8 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() // Don't count the agent. if ((*member_iter) == gAgent.getID()) { - can_eject_members = FALSE; - can_ban_members = FALSE; + can_eject_members = false; + can_ban_members = false; } } @@ -1171,7 +1173,7 @@ void LLPanelGroupMembersSubTab::confirmEjectMembers() std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected(); if (selection.empty()) return; - S32 selection_count = selection.size(); + auto selection_count = selection.size(); if (selection_count == 1) { LLSD args; @@ -1257,7 +1259,7 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, U64 powers_all_have = GP_ALL_POWERS; U64 powers_some_have = 0; - BOOL is_owner_role = ( gdatap->mOwnerRole == role_id ); + bool is_owner_role = ( gdatap->mOwnerRole == role_id ); LLUUID member_id; std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected(); @@ -1329,9 +1331,9 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, powers_some_have, powers_all_have, NULL, - FALSE, - FALSE, - FALSE); + false, + false, + false); } // static @@ -1414,7 +1416,7 @@ void LLPanelGroupMembersSubTab::cancel() DeletePairedPointer()); mMemberRoleChangeData.clear(); - mChanged = FALSE; + mChanged = false; notifyObservers(); } } @@ -1441,7 +1443,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg) if ( gdatap->getRoleData(gdatap->mOwnerRole, rd) ) { - mHasModal = TRUE; + mHasModal = true; args["ROLE_NAME"] = rd.mRoleName; LLNotificationsUtil::add("AddGroupOwnerWarning", args, @@ -1469,7 +1471,7 @@ bool LLPanelGroupMembersSubTab::apply(std::string& mesg) bool LLPanelGroupMembersSubTab::addOwnerCB(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - mHasModal = FALSE; + mHasModal = false; if (0 == option) { @@ -1512,7 +1514,7 @@ void LLPanelGroupMembersSubTab::applyMemberChanges() //force a UI update handleMemberSelect(); - mChanged = FALSE; + mChanged = false; mNumOwnerAdditions = 0; notifyObservers(); } @@ -1680,8 +1682,8 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc) && gdatap->isRoleMemberDataComplete()) { mMemberProgress = gdatap->mMembers.begin(); - mPendingMemberUpdate = TRUE; - mHasMatch = FALSE; + mPendingMemberUpdate = true; + mHasMatch = false; } else { @@ -1710,7 +1712,7 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc) // Still busy retreiving role/member mappings. retrieved << "Retrieving role member mappings..."; } - mMembersList->setEnabled(FALSE); + mMembersList->setEnabled(false); mMembersList->setCommentText(retrieved.str()); } } @@ -1736,7 +1738,7 @@ void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data) mMembersList->addNameItemRow(item_params); - mHasMatch = TRUE; + mHasMatch = true; } void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemberData* member, const LLAvatarName& av_name, const LLUUID& av_id) @@ -1765,7 +1767,7 @@ void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemb addMemberToList(member); if(!mMembersList->getEnabled()) { - mMembersList->setEnabled(TRUE); + mMembersList->setEnabled(true); } } @@ -1773,7 +1775,7 @@ void LLPanelGroupMembersSubTab::onNameCache(const LLUUID& update_id, LLGroupMemb void LLPanelGroupMembersSubTab::updateMembers() { - mPendingMemberUpdate = FALSE; + mPendingMemberUpdate = false; // Rebuild the members list. @@ -1838,17 +1840,17 @@ void LLPanelGroupMembersSubTab::updateMembers() { if (mHasMatch) { - mMembersList->setEnabled(TRUE); + mMembersList->setEnabled(true); } else if (gdatap->mMembers.size()) { - mMembersList->setEnabled(FALSE); + mMembersList->setEnabled(false); mMembersList->setCommentText(std::string("No match.")); } } else { - mPendingMemberUpdate = TRUE; + mPendingMemberUpdate = true; } // This should clear the other two lists, since nothing is selected. @@ -1866,7 +1868,7 @@ void LLPanelGroupMembersSubTab::confirmBanMembers() std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected(); if (selection.empty()) return; - S32 selection_count = selection.size(); + auto selection_count = selection.size(); if (selection_count == 1) { LLSD args; @@ -1964,8 +1966,8 @@ LLPanelGroupRolesSubTab::LLPanelGroupRolesSubTab() mDeleteRoleButton(NULL), mCopyRoleButton(NULL), mCreateRoleButton(NULL), - mFirstOpen(TRUE), - mHasRoleChange(FALSE) + mFirstOpen(true), + mHasRoleChange(false) { } @@ -1973,7 +1975,7 @@ LLPanelGroupRolesSubTab::~LLPanelGroupRolesSubTab() { } -BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) +bool LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) { LLPanelGroupSubTab::postBuildSubTab(root); @@ -2001,7 +2003,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) || !mRoleName || !mRoleTitle || !mRoleDescription || !mMemberVisibleCheck) { LL_WARNS() << "ARG! element not found." << LL_ENDL; - return FALSE; + return false; } mRemoveEveryoneTxt = getString("cant_delete_role"); @@ -2011,7 +2013,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) if ( mCreateRoleButton ) { mCreateRoleButton->setClickedCallback(onCreateRole, this); - mCreateRoleButton->setEnabled(FALSE); + mCreateRoleButton->setEnabled(false); } mCopyRoleButton = @@ -2019,7 +2021,7 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) if ( mCopyRoleButton ) { mCopyRoleButton->setClickedCallback(onCopyRole, this); - mCopyRoleButton->setEnabled(FALSE); + mCopyRoleButton->setEnabled(false); } mDeleteRoleButton = @@ -2027,31 +2029,31 @@ BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root) if ( mDeleteRoleButton ) { mDeleteRoleButton->setClickedCallback(onDeleteRole, this); - mDeleteRoleButton->setEnabled(FALSE); + mDeleteRoleButton->setEnabled(false); } - mRolesList->setCommitOnSelectionChange(TRUE); + mRolesList->setCommitOnSelectionChange(true); mRolesList->setCommitCallback(onRoleSelect, this); mAssignedMembersList->setContextMenu(LLScrollListCtrl::MENU_AVATAR); mMemberVisibleCheck->setCommitCallback(onMemberVisibilityChange, this); - mAllowedActionsList->setCommitOnSelectionChange(TRUE); + mAllowedActionsList->setCommitOnSelectionChange(true); mAllowedActionsList->setCommitCallback(boost::bind(&LLPanelGroupRolesSubTab::updateActionDescription, this)); - mRoleName->setCommitOnFocusLost(TRUE); + mRoleName->setCommitOnFocusLost(true); mRoleName->setKeystrokeCallback(onPropertiesKey, this); - mRoleTitle->setCommitOnFocusLost(TRUE); + mRoleTitle->setCommitOnFocusLost(true); mRoleTitle->setKeystrokeCallback(onPropertiesKey, this); - mRoleDescription->setCommitOnFocusLost(TRUE); + mRoleDescription->setCommitOnFocusLost(true); mRoleDescription->setKeystrokeCallback(boost::bind(&LLPanelGroupRolesSubTab::onDescriptionKeyStroke, this, _1)); - setFooterEnabled(FALSE); + setFooterEnabled(false); - return TRUE; + return true; } void LLPanelGroupRolesSubTab::activate() @@ -2066,9 +2068,9 @@ void LLPanelGroupRolesSubTab::activate() mRoleDescription->clear(); mRoleTitle->clear(); - setFooterEnabled(FALSE); + setFooterEnabled(false); - mHasRoleChange = FALSE; + mHasRoleChange = false; update(GC_ALL); } @@ -2077,7 +2079,7 @@ void LLPanelGroupRolesSubTab::deactivate() LL_DEBUGS() << "LLPanelGroupRolesSubTab::deactivate()" << LL_ENDL; LLPanelGroupSubTab::deactivate(); - mFirstOpen = FALSE; + mFirstOpen = false; } bool LLPanelGroupRolesSubTab::needsApply(std::string& mesg) @@ -2101,7 +2103,7 @@ bool LLPanelGroupRolesSubTab::apply(std::string& mesg) LL_DEBUGS() << "LLPanelGroupRolesSubTab::apply()" << LL_ENDL; saveRoleChanges(true); - mFirstOpen = FALSE; + mFirstOpen = false; LLGroupMgr::getInstance()->sendGroupRoleChanges(mGroupID); notifyObservers(); @@ -2111,7 +2113,7 @@ bool LLPanelGroupRolesSubTab::apply(std::string& mesg) void LLPanelGroupRolesSubTab::cancel() { - mHasRoleChange = FALSE; + mHasRoleChange = false; LLGroupMgr::getInstance()->cancelGroupRoleChanges(mGroupID); notifyObservers(); @@ -2195,12 +2197,12 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) if (matchesSearchFilter(rd.mRoleName, rd.mRoleTitle)) { // If this is the everyone role, then EVERYONE is in it. - S32 members_in_role = (*rit).first.isNull() ? gdatap->mMembers.size() : (*rit).second->getTotalMembersInRole(); + S32 members_in_role = (*rit).first.isNull() ? static_cast<S32>(gdatap->mMembers.size()) : (*rit).second->getTotalMembersInRole(); LLSD row = createRoleItem((*rit).first,rd.mRoleName, rd.mRoleTitle, members_in_role); item = mRolesList->addElement(row, ((*rit).first.isNull()) ? ADD_TOP : ADD_BOTTOM, this); if (had_selection && ((*rit).first == last_selected)) { - item->setSelected(TRUE); + item->setSelected(true); } } } @@ -2210,16 +2212,16 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) } } - mRolesList->sortByColumn(std::string("name"), TRUE); + mRolesList->sortByColumn(std::string("name"), true); if ( (gdatap->mRoles.size() < (U32)MAX_ROLES) && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CREATE) ) { - mCreateRoleButton->setEnabled(TRUE); + mCreateRoleButton->setEnabled(true); } else { - mCreateRoleButton->setEnabled(FALSE); + mCreateRoleButton->setEnabled(false); } if (had_selection) @@ -2233,9 +2235,9 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) mRoleName->clear(); mRoleDescription->clear(); mRoleTitle->clear(); - setFooterEnabled(FALSE); - mDeleteRoleButton->setEnabled(FALSE); - mCopyRoleButton->setEnabled(FALSE); + setFooterEnabled(false); + mDeleteRoleButton->setEnabled(false); + mCopyRoleButton->setEnabled(false); } } @@ -2260,7 +2262,7 @@ void LLPanelGroupRolesSubTab::onRoleSelect(LLUICtrl* ctrl, void* user_data) void LLPanelGroupRolesSubTab::handleRoleSelect() { - BOOL can_delete = TRUE; + bool can_delete = true; LL_DEBUGS() << "LLPanelGroupRolesSubTab::handleRoleSelect()" << LL_ENDL; mAssignedMembersList->deleteAllItems(); @@ -2280,16 +2282,16 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() LLScrollListItem* item = mRolesList->getFirstSelected(); if (!item) { - setFooterEnabled(FALSE); + setFooterEnabled(false); return; } - setFooterEnabled(TRUE); + setFooterEnabled(true); LLRoleData rd; if (gdatap->getRoleData(item->getUUID(),rd)) { - BOOL is_owner_role = ( gdatap->mOwnerRole == item->getUUID() ); + bool is_owner_role = ( gdatap->mOwnerRole == item->getUUID() ); mRoleName->setText(rd.mRoleName); mRoleTitle->setText(rd.mRoleTitle); mRoleDescription->setText(rd.mRoleDescription); @@ -2300,8 +2302,8 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() rd.mRolePowers, 0LL, boost::bind(&LLPanelGroupRolesSubTab::handleActionCheck, this, _1, false), - TRUE, - FALSE, + true, + false, is_owner_role); @@ -2314,9 +2316,9 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() if ( is_owner_role ) { // you can't delete the owner role - can_delete = FALSE; + can_delete = false; // ... or hide members with this role - mMemberVisibleCheck->setEnabled(FALSE); + mMemberVisibleCheck->setEnabled(false); } else { @@ -2326,9 +2328,9 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() if (item->getUUID().isNull()) { // Everyone role, can't edit description or name or delete - mRoleDescription->setEnabled(FALSE); - mRoleName->setEnabled(FALSE); - can_delete = FALSE; + mRoleDescription->setEnabled(false); + mRoleName->setEnabled(false); + can_delete = false; } } else @@ -2339,9 +2341,9 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() mRoleName->clear(); mRoleDescription->clear(); mRoleTitle->clear(); - setFooterEnabled(FALSE); + setFooterEnabled(false); - can_delete = FALSE; + can_delete = false; } mSelectedRole = item->getUUID(); buildMembersList(); @@ -2445,7 +2447,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force) { // Uncheck the item, for now. It will be // checked if they click 'Yes', below. - check->set(FALSE); + check->set(false); LLRoleData rd; LLSD args; @@ -2454,7 +2456,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force) { args["ACTION_NAME"] = rap->mDescription; args["ROLE_NAME"] = rd.mRoleName; - mHasModal = TRUE; + mHasModal = true; std::string warning = "AssignDangerousActionWarning"; if (GP_ROLE_CHANGE_ACTIONS == power) { @@ -2481,7 +2483,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force) { args["ACTION_NAME"] = rap->mDescription; args["ROLE_NAME"] = rd.mRoleName; - mHasModal = TRUE; + mHasModal = true; std::vector<LLScrollListItem*> all_data = mAllowedActionsList->getAllData(); std::vector<LLScrollListItem*>::iterator ad_it = all_data.begin(); @@ -2527,9 +2529,9 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force) current_role_powers, current_role_powers, boost::bind(&LLPanelGroupRolesSubTab::handleActionCheck, this, _1, false), - TRUE, - FALSE, - FALSE); + true, + false, + false); } @@ -2545,7 +2547,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLUICtrl* ctrl, bool force) gdatap->removeRolePower(role_id,power); } - mHasRoleChange = TRUE; + mHasRoleChange = true; notifyObservers(); } @@ -2554,13 +2556,13 @@ bool LLPanelGroupRolesSubTab::addActionCB(const LLSD& notification, const LLSD& { if (!check) return false; - mHasModal = FALSE; + mHasModal = false; S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) { // User clicked "Yes" - check->set(TRUE); + check->set(true); const bool force_add = true; handleActionCheck(check, force_add); } @@ -2573,13 +2575,13 @@ void LLPanelGroupRolesSubTab::onPropertiesKey(LLLineEditor* ctrl, void* user_dat LLPanelGroupRolesSubTab* self = static_cast<LLPanelGroupRolesSubTab*>(user_data); if (!self) return; - self->mHasRoleChange = TRUE; + self->mHasRoleChange = true; self->notifyObservers(); } void LLPanelGroupRolesSubTab::onDescriptionKeyStroke(LLTextEditor* caller) { - mHasRoleChange = TRUE; + mHasRoleChange = true; notifyObservers(); } @@ -2589,7 +2591,7 @@ void LLPanelGroupRolesSubTab::onDescriptionCommit(LLUICtrl* ctrl, void* user_dat LLPanelGroupRolesSubTab* self = static_cast<LLPanelGroupRolesSubTab*>(user_data); if (!self) return; - self->mHasRoleChange = TRUE; + self->mHasRoleChange = true; self->notifyObservers(); } @@ -2653,7 +2655,7 @@ void LLPanelGroupRolesSubTab::handleCreateRole() rd.mRoleName = "New Role"; gdatap->createRole(new_role_id,rd); - mRolesList->deselectAllItems(TRUE); + mRolesList->deselectAllItems(true); LLSD row; row["id"] = new_role_id; row["columns"][0]["column"] = "name"; @@ -2664,7 +2666,7 @@ void LLPanelGroupRolesSubTab::handleCreateRole() // put focus on name field and select its contents if(mRoleName) { - mRoleName->setFocus(TRUE); + mRoleName->setFocus(true); mRoleName->onTabInto(); gFocusMgr.triggerFocusFlash(); } @@ -2704,7 +2706,7 @@ void LLPanelGroupRolesSubTab::handleCopyRole() rd.mRoleName += "(Copy)"; gdatap->createRole(new_role_id,rd); - mRolesList->deselectAllItems(TRUE); + mRolesList->deselectAllItems(true); LLSD row; row["id"] = new_role_id; row["columns"][0]["column"] = "name"; @@ -2715,7 +2717,7 @@ void LLPanelGroupRolesSubTab::handleCopyRole() // put focus on name field and select its contents if(mRoleName) { - mRoleName->setFocus(TRUE); + mRoleName->setFocus(true); mRoleName->onTabInto(); gFocusMgr.triggerFocusFlash(); } @@ -2792,7 +2794,7 @@ void LLPanelGroupRolesSubTab::saveRoleChanges(bool select_saved_role) LLScrollListItem* item = mRolesList->addElement(row, ADD_BOTTOM, this); item->setSelected(select_saved_role); - mHasRoleChange = FALSE; + mHasRoleChange = false; } } @@ -2823,9 +2825,9 @@ void LLPanelGroupRolesSubTab::setGroupID(const LLUUID& id) if(mRoleDescription) mRoleDescription->clear(); if(mRoleTitle) mRoleTitle->clear(); - mHasRoleChange = FALSE; + mHasRoleChange = false; - setFooterEnabled(FALSE); + setFooterEnabled(false); LLPanelGroupSubTab::setGroupID(id); } @@ -2843,7 +2845,7 @@ LLPanelGroupActionsSubTab::~LLPanelGroupActionsSubTab() { } -BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root) +bool LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root) { LLPanelGroupSubTab::postBuildSubTab(root); @@ -2861,15 +2863,15 @@ BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root) mActionRoles = parent->getChild<LLScrollListCtrl>("action_roles",recurse); mActionMembers = parent->getChild<LLNameListCtrl>("action_members",recurse); - if (!mActionList || !mActionDescription || !mActionRoles || !mActionMembers) return FALSE; + if (!mActionList || !mActionDescription || !mActionRoles || !mActionMembers) return false; - mActionList->setCommitOnSelectionChange(TRUE); + mActionList->setCommitOnSelectionChange(true); mActionList->setCommitCallback(boost::bind(&LLPanelGroupActionsSubTab::handleActionSelect, this)); mActionList->setContextMenu(LLScrollListCtrl::MENU_AVATAR); update(GC_ALL); - return TRUE; + return true; } void LLPanelGroupActionsSubTab::activate() @@ -2884,9 +2886,9 @@ void LLPanelGroupActionsSubTab::activate() GP_ALL_POWERS, GP_ALL_POWERS, NULL, - FALSE, - TRUE, - FALSE); + false, + true, + false); } void LLPanelGroupActionsSubTab::deactivate() @@ -2937,9 +2939,9 @@ void LLPanelGroupActionsSubTab::onFilterChanged() GP_ALL_POWERS, GP_ALL_POWERS, NULL, - FALSE, - TRUE, - FALSE); + false, + true, + false); } void LLPanelGroupActionsSubTab::handleActionSelect() @@ -3050,7 +3052,7 @@ LLPanelGroupBanListSubTab::LLPanelGroupBanListSubTab() mDeleteBanButton(NULL) {} -BOOL LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root) +bool LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root) { LLPanelGroupSubTab::postBuildSubTab(root); @@ -3071,19 +3073,19 @@ BOOL LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root) mBanCountText = parent->getChild<LLTextBase>("ban_count", recurse); if(!mBanList || !mCreateBanButton || !mDeleteBanButton || !mRefreshBanListButton || !mBanCountText) - return FALSE; + return false; - mBanList->setCommitOnSelectionChange(TRUE); + mBanList->setCommitOnSelectionChange(true); mBanList->setCommitCallback(onBanEntrySelect, this); mCreateBanButton->setClickedCallback(onCreateBanEntry, this); - mCreateBanButton->setEnabled(FALSE); + mCreateBanButton->setEnabled(false); mDeleteBanButton->setClickedCallback(onDeleteBanEntry, this); - mDeleteBanButton->setEnabled(FALSE); + mDeleteBanButton->setEnabled(false); mRefreshBanListButton->setClickedCallback(onRefreshBanList, this); - mRefreshBanListButton->setEnabled(FALSE); + mRefreshBanListButton->setEnabled(false); setBanCount(0); @@ -3091,8 +3093,8 @@ BOOL LLPanelGroupBanListSubTab::postBuildSubTab(LLView* root) populateBanList(); - setFooterEnabled(FALSE); - return TRUE; + setFooterEnabled(false); + return true; } void LLPanelGroupBanListSubTab::activate() @@ -3100,18 +3102,18 @@ void LLPanelGroupBanListSubTab::activate() LLPanelGroupSubTab::activate(); mBanList->deselectAllItems(); - mDeleteBanButton->setEnabled(FALSE); + mDeleteBanButton->setEnabled(false); LLGroupMgrGroupData * group_datap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (group_datap) { mCreateBanButton->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS) && group_datap->mBanList.size() < GB_MAX_BANNED_AGENTS); - setBanCount(group_datap->mBanList.size()); + setBanCount(static_cast<U32>(group_datap->mBanList.size())); } else { - mCreateBanButton->setEnabled(FALSE); + mCreateBanButton->setEnabled(false); setBanCount(0); } @@ -3122,7 +3124,7 @@ void LLPanelGroupBanListSubTab::activate() // LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); - setFooterEnabled(FALSE); + setFooterEnabled(false); update(GC_ALL); } @@ -3153,7 +3155,7 @@ void LLPanelGroupBanListSubTab::handleBanEntrySelect() { if (gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS)) { - mDeleteBanButton->setEnabled(TRUE); + mDeleteBanButton->setEnabled(true); } } @@ -3229,12 +3231,12 @@ void LLPanelGroupBanListSubTab::handleDeleteBanEntry() // Removing an item removes the selection, we shouldn't be able to click // the button anymore until we reselect another entry. - mDeleteBanButton->setEnabled(FALSE); + mDeleteBanButton->setEnabled(false); } // update ban-count related elements - mCreateBanButton->setEnabled(TRUE); - setBanCount(gdatap->mBanList.size()); + mCreateBanButton->setEnabled(true); + setBanCount(static_cast<U32>(gdatap->mBanList.size())); LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_POST, mGroupID, LLGroupMgr::BAN_DELETE, ban_ids); } @@ -3250,7 +3252,7 @@ void LLPanelGroupBanListSubTab::onRefreshBanList(void* user_data) void LLPanelGroupBanListSubTab::handleRefreshBanList() { - mRefreshBanListButton->setEnabled(FALSE); + mRefreshBanListButton->setEnabled(false); LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); } @@ -3258,7 +3260,7 @@ void LLPanelGroupBanListSubTab::onBanListCompleted(bool isComplete) { if(isComplete) { - mRefreshBanListButton->setEnabled(TRUE); + mRefreshBanListButton->setEnabled(true); populateBanList(); } } @@ -3309,10 +3311,10 @@ void LLPanelGroupBanListSubTab::populateBanList() mBanList->addNameItemRow(ban_entry); } - mRefreshBanListButton->setEnabled(TRUE); + mRefreshBanListButton->setEnabled(true); mCreateBanButton->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_GROUP_BAN_ACCESS) && gdatap->mBanList.size() < GB_MAX_BANNED_AGENTS); - setBanCount(gdatap->mBanList.size()); + setBanCount(static_cast<U32>(gdatap->mBanList.size())); } void LLPanelGroupBanListSubTab::setGroupID(const LLUUID& id) @@ -3320,6 +3322,6 @@ void LLPanelGroupBanListSubTab::setGroupID(const LLUUID& id) if(mBanList) mBanList->deleteAllItems(); - setFooterEnabled(FALSE); + setFooterEnabled(false); LLPanelGroupSubTab::setGroupID(id); } |