diff options
author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2016-01-15 13:04:58 +0200 |
---|---|---|
committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2016-01-15 13:04:58 +0200 |
commit | 2ae77b29019433e8982e629bfacaf9d37a555636 (patch) | |
tree | ef11c2e94b6d22807ba01c19644b51865fdc1ea9 /indra/newview | |
parent | e057989f0b1e62dc4e5f1282c3f82fb4c68b8f23 (diff) |
MAINT-1429 Show permissions correctly for single non-root object and hide it if we didn't get valid base permissions.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llpanelpermissions.cpp | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index ce9231d6f2..84e563e842 100755 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -571,24 +571,49 @@ void LLPanelPermissions::refresh() U32 next_owner_mask_on = 0; U32 next_owner_mask_off = 0; - BOOL valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, + BOOL valid_base_perms = FALSE; + BOOL valid_group_perms= FALSE; + BOOL valid_everyone_perms= FALSE; + BOOL valid_next_perms= FALSE; + + if(root_selected) + { + valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, &base_mask_on, &base_mask_off); - //BOOL valid_owner_perms =// - LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, + //BOOL valid_owner_perms =// + LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, &owner_mask_on, &owner_mask_off); - BOOL valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, + valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, &group_mask_on, &group_mask_off); - BOOL valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, + valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, &everyone_mask_on, &everyone_mask_off); - BOOL valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, + valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, &next_owner_mask_on, &next_owner_mask_off); + } + else + { + if(object_count == 1) + { + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(); + if (node && node->mValid) + { + valid_base_perms = TRUE; + + base_mask_on = node->mPermissions->getMaskBase(); + owner_mask_on = node->mPermissions->getMaskOwner(); + group_mask_on = node->mPermissions->getMaskGroup(); + everyone_mask_on = node->mPermissions->getMaskEveryone(); + next_owner_mask_on = node->mPermissions->getMaskNextOwner(); + } + } + } if (gSavedSettings.getBOOL("DebugPermissions") ) @@ -610,6 +635,14 @@ void LLPanelPermissions::refresh() getChild<LLUICtrl>("N:")->setValue("N: " + mask_to_string(next_owner_mask_on)); getChildView("N:")->setVisible( TRUE); } + else + { + getChildView("B:")->setVisible(FALSE); + getChildView("O:")->setVisible(FALSE); + getChildView("G:")->setVisible(FALSE); + getChildView("E:")->setVisible(FALSE); + getChildView("N:")->setVisible(FALSE); + } U32 flag_mask = 0x0; if (objectp->permMove()) flag_mask |= PERM_MOVE; |