diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llpanelgrouproles.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanelgrouproles.cpp | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/linden/indra/newview/llpanelgrouproles.cpp b/linden/indra/newview/llpanelgrouproles.cpp index ccf776f..e956dff 100644 --- a/linden/indra/newview/llpanelgrouproles.cpp +++ b/linden/indra/newview/llpanelgrouproles.cpp | |||
@@ -61,6 +61,9 @@ bool agentCanRemoveFromRole(const LLUUID& group_id, | |||
61 | bool agentCanAddToRole(const LLUUID& group_id, | 61 | bool agentCanAddToRole(const LLUUID& group_id, |
62 | const LLUUID& role_id) | 62 | const LLUUID& role_id) |
63 | { | 63 | { |
64 | if (gAgent.isGodlike()) | ||
65 | return true; | ||
66 | |||
64 | LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); | 67 | LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); |
65 | if (!gdatap) | 68 | if (!gdatap) |
66 | { | 69 | { |
@@ -177,9 +180,6 @@ BOOL LLPanelGroupRoles::postBuild() | |||
177 | 180 | ||
178 | BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp) | 181 | BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp) |
179 | { | 182 | { |
180 | if (agentp->isGodlike()) | ||
181 | return TRUE; | ||
182 | |||
183 | /* This power was removed to make group roles simpler | 183 | /* This power was removed to make group roles simpler |
184 | return agentp->hasPowerInGroup(mGroupID, | 184 | return agentp->hasPowerInGroup(mGroupID, |
185 | GP_ROLE_CREATE | | 185 | GP_ROLE_CREATE | |
@@ -228,7 +228,7 @@ void LLPanelGroupRoles::handleClickSubTab() | |||
228 | BOOL LLPanelGroupRoles::attemptTransition() | 228 | BOOL LLPanelGroupRoles::attemptTransition() |
229 | { | 229 | { |
230 | // Check if the current tab needs to be applied. | 230 | // Check if the current tab needs to be applied. |
231 | LLString mesg; | 231 | std::string mesg; |
232 | if (mCurrentTab && mCurrentTab->needsApply(mesg)) | 232 | if (mCurrentTab && mCurrentTab->needsApply(mesg)) |
233 | { | 233 | { |
234 | // If no message was provided, give a generic one. | 234 | // If no message was provided, give a generic one. |
@@ -237,7 +237,7 @@ BOOL LLPanelGroupRoles::attemptTransition() | |||
237 | mesg = mDefaultNeedsApplyMesg; | 237 | mesg = mDefaultNeedsApplyMesg; |
238 | } | 238 | } |
239 | // Create a notify box, telling the user about the unapplied tab. | 239 | // Create a notify box, telling the user about the unapplied tab. |
240 | LLString::format_map_t args; | 240 | LLStringUtil::format_map_t args; |
241 | args["[NEEDS_APPLY_MESSAGE]"] = mesg; | 241 | args["[NEEDS_APPLY_MESSAGE]"] = mesg; |
242 | args["[WANT_APPLY_MESSAGE]"] = mWantApplyMesg; | 242 | args["[WANT_APPLY_MESSAGE]"] = mWantApplyMesg; |
243 | gViewerWindow->alertXml("PanelGroupApply", args, | 243 | gViewerWindow->alertXml("PanelGroupApply", args, |
@@ -300,14 +300,14 @@ void LLPanelGroupRoles::handleNotifyCallback(S32 option) | |||
300 | case 0: // "Apply Changes" | 300 | case 0: // "Apply Changes" |
301 | { | 301 | { |
302 | // Try to apply changes, and switch to the requested tab. | 302 | // Try to apply changes, and switch to the requested tab. |
303 | LLString apply_mesg; | 303 | std::string apply_mesg; |
304 | if ( !apply( apply_mesg ) ) | 304 | if ( !apply( apply_mesg ) ) |
305 | { | 305 | { |
306 | // There was a problem doing the apply. | 306 | // There was a problem doing the apply. |
307 | if ( !apply_mesg.empty() ) | 307 | if ( !apply_mesg.empty() ) |
308 | { | 308 | { |
309 | mHasModal = TRUE; | 309 | mHasModal = TRUE; |
310 | LLString::format_map_t args; | 310 | LLStringUtil::format_map_t args; |
311 | args["[MESSAGE]"] = apply_mesg; | 311 | args["[MESSAGE]"] = apply_mesg; |
312 | gViewerWindow->alertXml("GenericAlert", args, onModalClose, (void*) this); | 312 | gViewerWindow->alertXml("GenericAlert", args, onModalClose, (void*) this); |
313 | } | 313 | } |
@@ -350,7 +350,7 @@ void LLPanelGroupRoles::onModalClose(S32 option, void* user_data) | |||
350 | } | 350 | } |
351 | 351 | ||
352 | 352 | ||
353 | bool LLPanelGroupRoles::apply(LLString& mesg) | 353 | bool LLPanelGroupRoles::apply(std::string& mesg) |
354 | { | 354 | { |
355 | // Pass this along to the currently visible sub tab. | 355 | // Pass this along to the currently visible sub tab. |
356 | if (!mSubTabContainer) return false; | 356 | if (!mSubTabContainer) return false; |
@@ -359,7 +359,7 @@ bool LLPanelGroupRoles::apply(LLString& mesg) | |||
359 | if (!panelp) return false; | 359 | if (!panelp) return false; |
360 | 360 | ||
361 | // Ignore the needs apply message. | 361 | // Ignore the needs apply message. |
362 | LLString ignore_mesg; | 362 | std::string ignore_mesg; |
363 | if ( !panelp->needsApply(ignore_mesg) ) | 363 | if ( !panelp->needsApply(ignore_mesg) ) |
364 | { | 364 | { |
365 | // We don't need to apply anything. | 365 | // We don't need to apply anything. |
@@ -383,7 +383,7 @@ void LLPanelGroupRoles::cancel() | |||
383 | } | 383 | } |
384 | 384 | ||
385 | // Pass all of these messages to the currently visible sub tab. | 385 | // Pass all of these messages to the currently visible sub tab. |
386 | LLString LLPanelGroupRoles::getHelpText() const | 386 | std::string LLPanelGroupRoles::getHelpText() const |
387 | { | 387 | { |
388 | LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); | 388 | LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); |
389 | if (panelp) | 389 | if (panelp) |
@@ -458,7 +458,7 @@ void LLPanelGroupRoles::deactivate() | |||
458 | if (panelp) panelp->deactivate(); | 458 | if (panelp) panelp->deactivate(); |
459 | } | 459 | } |
460 | 460 | ||
461 | bool LLPanelGroupRoles::needsApply(LLString& mesg) | 461 | bool LLPanelGroupRoles::needsApply(std::string& mesg) |
462 | { | 462 | { |
463 | LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); | 463 | LLPanelGroupTab* panelp = (LLPanelGroupTab*) mSubTabContainer->getCurrentPanel(); |
464 | if (!panelp) return false; | 464 | if (!panelp) return false; |
@@ -606,15 +606,15 @@ void LLPanelGroupSubTab::onClickShowAll(void* user_data) | |||
606 | void LLPanelGroupSubTab::handleClickShowAll() | 606 | void LLPanelGroupSubTab::handleClickShowAll() |
607 | { | 607 | { |
608 | lldebugs << "LLPanelGroupSubTab::handleClickShowAll()" << llendl; | 608 | lldebugs << "LLPanelGroupSubTab::handleClickShowAll()" << llendl; |
609 | setSearchFilter( LLString::null ); | 609 | setSearchFilter( LLStringUtil::null ); |
610 | mShowAllButton->setEnabled(FALSE); | 610 | mShowAllButton->setEnabled(FALSE); |
611 | } | 611 | } |
612 | 612 | ||
613 | void LLPanelGroupSubTab::setSearchFilter(const LLString& filter) | 613 | void LLPanelGroupSubTab::setSearchFilter(const std::string& filter) |
614 | { | 614 | { |
615 | lldebugs << "LLPanelGroupSubTab::setSearchFilter() ==> '" << filter << "'" << llendl; | 615 | lldebugs << "LLPanelGroupSubTab::setSearchFilter() ==> '" << filter << "'" << llendl; |
616 | mSearchFilter = filter; | 616 | mSearchFilter = filter; |
617 | LLString::toLower(mSearchFilter); | 617 | LLStringUtil::toLower(mSearchFilter); |
618 | update(GC_ALL); | 618 | update(GC_ALL); |
619 | } | 619 | } |
620 | 620 | ||
@@ -656,7 +656,7 @@ bool LLPanelGroupSubTab::matchesActionSearchFilter(std::string action) | |||
656 | // If the search filter is empty, everything passes. | 656 | // If the search filter is empty, everything passes. |
657 | if (mSearchFilter.empty()) return true; | 657 | if (mSearchFilter.empty()) return true; |
658 | 658 | ||
659 | LLString::toLower(action); | 659 | LLStringUtil::toLower(action); |
660 | std::string::size_type match = action.find(mSearchFilter); | 660 | std::string::size_type match = action.find(mSearchFilter); |
661 | 661 | ||
662 | if (std::string::npos == match) | 662 | if (std::string::npos == match) |
@@ -1131,6 +1131,9 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() | |||
1131 | } | 1131 | } |
1132 | mAssignedRolesList->setEnabled(TRUE); | 1132 | mAssignedRolesList->setEnabled(TRUE); |
1133 | 1133 | ||
1134 | if (gAgent.isGodlike()) | ||
1135 | can_eject_members = TRUE; | ||
1136 | |||
1134 | if (!can_eject_members && !member_is_owner) | 1137 | if (!can_eject_members && !member_is_owner) |
1135 | { | 1138 | { |
1136 | // Maybe we can eject them because we are an owner... | 1139 | // Maybe we can eject them because we are an owner... |
@@ -1335,7 +1338,7 @@ void LLPanelGroupMembersSubTab::deactivate() | |||
1335 | LLPanelGroupSubTab::deactivate(); | 1338 | LLPanelGroupSubTab::deactivate(); |
1336 | } | 1339 | } |
1337 | 1340 | ||
1338 | bool LLPanelGroupMembersSubTab::needsApply(LLString& mesg) | 1341 | bool LLPanelGroupMembersSubTab::needsApply(std::string& mesg) |
1339 | { | 1342 | { |
1340 | return mChanged; | 1343 | return mChanged; |
1341 | } | 1344 | } |
@@ -1354,7 +1357,7 @@ void LLPanelGroupMembersSubTab::cancel() | |||
1354 | } | 1357 | } |
1355 | } | 1358 | } |
1356 | 1359 | ||
1357 | bool LLPanelGroupMembersSubTab::apply(LLString& mesg) | 1360 | bool LLPanelGroupMembersSubTab::apply(std::string& mesg) |
1358 | { | 1361 | { |
1359 | LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); | 1362 | LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); |
1360 | if (!gdatap) | 1363 | if (!gdatap) |
@@ -1372,7 +1375,7 @@ bool LLPanelGroupMembersSubTab::apply(LLString& mesg) | |||
1372 | if ( mNumOwnerAdditions > 0 ) | 1375 | if ( mNumOwnerAdditions > 0 ) |
1373 | { | 1376 | { |
1374 | LLRoleData rd; | 1377 | LLRoleData rd; |
1375 | LLStringBase<char>::format_map_t args; | 1378 | LLStringUtil::format_map_t args; |
1376 | 1379 | ||
1377 | if ( gdatap->getRoleData(gdatap->mOwnerRole, rd) ) | 1380 | if ( gdatap->getRoleData(gdatap->mOwnerRole, rd) ) |
1378 | { | 1381 | { |
@@ -1462,7 +1465,7 @@ bool LLPanelGroupMembersSubTab::matchesSearchFilter(const std::string& fullname) | |||
1462 | 1465 | ||
1463 | // Create a full name, and compare it to the search filter. | 1466 | // Create a full name, and compare it to the search filter. |
1464 | std::string fullname_lc(fullname); | 1467 | std::string fullname_lc(fullname); |
1465 | LLString::toLower(fullname_lc); | 1468 | LLStringUtil::toLower(fullname_lc); |
1466 | 1469 | ||
1467 | std::string::size_type match = fullname_lc.find(mSearchFilter); | 1470 | std::string::size_type match = fullname_lc.find(mSearchFilter); |
1468 | 1471 | ||
@@ -1718,7 +1721,7 @@ void LLPanelGroupMembersSubTab::updateMembers() | |||
1718 | else | 1721 | else |
1719 | { | 1722 | { |
1720 | mMembersList->setEnabled(FALSE); | 1723 | mMembersList->setEnabled(FALSE); |
1721 | mMembersList->addCommentText("No match."); | 1724 | mMembersList->addCommentText(std::string("No match.")); |
1722 | } | 1725 | } |
1723 | } | 1726 | } |
1724 | else | 1727 | else |
@@ -1852,7 +1855,7 @@ void LLPanelGroupRolesSubTab::deactivate() | |||
1852 | LLPanelGroupSubTab::deactivate(); | 1855 | LLPanelGroupSubTab::deactivate(); |
1853 | } | 1856 | } |
1854 | 1857 | ||
1855 | bool LLPanelGroupRolesSubTab::needsApply(LLString& mesg) | 1858 | bool LLPanelGroupRolesSubTab::needsApply(std::string& mesg) |
1856 | { | 1859 | { |
1857 | lldebugs << "LLPanelGroupRolesSubTab::needsApply()" << llendl; | 1860 | lldebugs << "LLPanelGroupRolesSubTab::needsApply()" << llendl; |
1858 | 1861 | ||
@@ -1862,7 +1865,7 @@ bool LLPanelGroupRolesSubTab::needsApply(LLString& mesg) | |||
1862 | || (gdatap && gdatap->pendingRoleChanges())); // Pending role changes in the group | 1865 | || (gdatap && gdatap->pendingRoleChanges())); // Pending role changes in the group |
1863 | } | 1866 | } |
1864 | 1867 | ||
1865 | bool LLPanelGroupRolesSubTab::apply(LLString& mesg) | 1868 | bool LLPanelGroupRolesSubTab::apply(std::string& mesg) |
1866 | { | 1869 | { |
1867 | lldebugs << "LLPanelGroupRolesSubTab::apply()" << llendl; | 1870 | lldebugs << "LLPanelGroupRolesSubTab::apply()" << llendl; |
1868 | 1871 | ||
@@ -1907,8 +1910,8 @@ bool LLPanelGroupRolesSubTab::matchesSearchFilter(std::string rolename, std::str | |||
1907 | // If the search filter is empty, everything passes. | 1910 | // If the search filter is empty, everything passes. |
1908 | if (mSearchFilter.empty()) return true; | 1911 | if (mSearchFilter.empty()) return true; |
1909 | 1912 | ||
1910 | LLString::toLower(rolename); | 1913 | LLStringUtil::toLower(rolename); |
1911 | LLString::toLower(roletitle); | 1914 | LLStringUtil::toLower(roletitle); |
1912 | std::string::size_type match_name = rolename.find(mSearchFilter); | 1915 | std::string::size_type match_name = rolename.find(mSearchFilter); |
1913 | std::string::size_type match_title = roletitle.find(mSearchFilter); | 1916 | std::string::size_type match_title = roletitle.find(mSearchFilter); |
1914 | 1917 | ||
@@ -1975,7 +1978,7 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) | |||
1975 | } | 1978 | } |
1976 | } | 1979 | } |
1977 | 1980 | ||
1978 | mRolesList->sortByColumn("name", TRUE); | 1981 | mRolesList->sortByColumn(std::string("name"), TRUE); |
1979 | 1982 | ||
1980 | if ( (gdatap->mRoles.size() < (U32)MAX_ROLES) | 1983 | if ( (gdatap->mRoles.size() < (U32)MAX_ROLES) |
1981 | && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CREATE) ) | 1984 | && gAgent.hasPowerInGroup(mGroupID, GP_ROLE_CREATE) ) |
@@ -2213,7 +2216,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLCheckBoxCtrl* check, bool forc | |||
2213 | check->set(FALSE); | 2216 | check->set(FALSE); |
2214 | 2217 | ||
2215 | LLRoleData rd; | 2218 | LLRoleData rd; |
2216 | LLStringBase<char>::format_map_t args; | 2219 | LLStringUtil::format_map_t args; |
2217 | 2220 | ||
2218 | if ( gdatap->getRoleData(role_id, rd) ) | 2221 | if ( gdatap->getRoleData(role_id, rd) ) |
2219 | { | 2222 | { |
@@ -2223,7 +2226,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLCheckBoxCtrl* check, bool forc | |||
2223 | cb_data->mSelf = this; | 2226 | cb_data->mSelf = this; |
2224 | cb_data->mCheck = check; | 2227 | cb_data->mCheck = check; |
2225 | mHasModal = TRUE; | 2228 | mHasModal = TRUE; |
2226 | LLString warning = "AssignDangerousActionWarning"; | 2229 | std::string warning = "AssignDangerousActionWarning"; |
2227 | if (GP_ROLE_CHANGE_ACTIONS == power) | 2230 | if (GP_ROLE_CHANGE_ACTIONS == power) |
2228 | { | 2231 | { |
2229 | warning = "AssignDangerousAbilityWarning"; | 2232 | warning = "AssignDangerousAbilityWarning"; |
@@ -2401,7 +2404,7 @@ void LLPanelGroupRolesSubTab::handleDeleteRole() | |||
2401 | 2404 | ||
2402 | if (role_item->getUUID().isNull() || role_item->getUUID() == gdatap->mOwnerRole) | 2405 | if (role_item->getUUID().isNull() || role_item->getUUID() == gdatap->mOwnerRole) |
2403 | { | 2406 | { |
2404 | LLString::format_map_t args; | 2407 | LLStringUtil::format_map_t args; |
2405 | args["[MESSAGE]"] = mRemoveEveryoneTxt; | 2408 | args["[MESSAGE]"] = mRemoveEveryoneTxt; |
2406 | LLNotifyBox::showXml("GenericNotify", args); | 2409 | LLNotifyBox::showXml("GenericNotify", args); |
2407 | return; | 2410 | return; |
@@ -2508,14 +2511,14 @@ void LLPanelGroupActionsSubTab::deactivate() | |||
2508 | LLPanelGroupSubTab::deactivate(); | 2511 | LLPanelGroupSubTab::deactivate(); |
2509 | } | 2512 | } |
2510 | 2513 | ||
2511 | bool LLPanelGroupActionsSubTab::needsApply(LLString& mesg) | 2514 | bool LLPanelGroupActionsSubTab::needsApply(std::string& mesg) |
2512 | { | 2515 | { |
2513 | lldebugs << "LLPanelGroupActionsSubTab::needsApply()" << llendl; | 2516 | lldebugs << "LLPanelGroupActionsSubTab::needsApply()" << llendl; |
2514 | 2517 | ||
2515 | return false; | 2518 | return false; |
2516 | } | 2519 | } |
2517 | 2520 | ||
2518 | bool LLPanelGroupActionsSubTab::apply(LLString& mesg) | 2521 | bool LLPanelGroupActionsSubTab::apply(std::string& mesg) |
2519 | { | 2522 | { |
2520 | lldebugs << "LLPanelGroupActionsSubTab::apply()" << llendl; | 2523 | lldebugs << "LLPanelGroupActionsSubTab::apply()" << llendl; |
2521 | return true; | 2524 | return true; |