diff options
author | Rider Linden <rider@lindenlab.com> | 2018-08-03 16:19:47 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-08-03 16:19:47 -0700 |
commit | 56c773b3bc52d72a5a7056d6eb9ce014dedbc0d8 (patch) | |
tree | e9c39e4c9255a909ce0996b4cf228d562020fddb /indra/newview/llpanelpermissions.cpp | |
parent | 8779b29487dd3d18220b17be8dd501ffeabe274f (diff) | |
parent | 09f97172bb478a2c977d8b7b0958196e7e98c433 (diff) |
Merge
Diffstat (limited to 'indra/newview/llpanelpermissions.cpp')
-rw-r--r-- | indra/newview/llpanelpermissions.cpp | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index a7c53a7050..ef16427713 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -100,6 +100,10 @@ U8 string_value_to_click_action(std::string p_value) { return CLICK_ACTION_ZOOM; } + if (p_value == "None") + { + return CLICK_ACTION_DISABLED; + } return CLICK_ACTION_TOUCH; } @@ -126,6 +130,9 @@ std::string click_action_to_string_value( U8 action) case CLICK_ACTION_ZOOM: return "Zoom"; break; + case CLICK_ACTION_DISABLED: + return "None"; + break; } } @@ -1203,23 +1210,34 @@ void LLPanelPermissions::setAllSaleInfo() LLSaleInfo new_sale_info(sale_type, price); LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(new_sale_info); - struct f : public LLSelectedObjectFunctor + // Note: won't work right if a root and non-root are both single-selected (here and other places). + BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() + && LLSelectMgr::getInstance()->selectGetRootsModify()) + || LLSelectMgr::getInstance()->selectGetModify(); + BOOL is_nonpermanent_enforced = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() + && LLSelectMgr::getInstance()->selectGetRootsNonPermanentEnforced()) + || LLSelectMgr::getInstance()->selectGetNonPermanentEnforced(); + + if (is_perm_modify && is_nonpermanent_enforced) { - virtual bool apply(LLViewerObject* object) + struct f : public LLSelectedObjectFunctor { - return object->getClickAction() == CLICK_ACTION_BUY - || object->getClickAction() == CLICK_ACTION_TOUCH; + virtual bool apply(LLViewerObject* object) + { + return object->getClickAction() == CLICK_ACTION_BUY + || object->getClickAction() == CLICK_ACTION_TOUCH; + } + } check_actions; + + // Selection should only contain objects that are of target + // action already or of action we are aiming to remove. + bool default_actions = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&check_actions); + + if (default_actions && old_sale_info.isForSale() != new_sale_info.isForSale()) + { + U8 new_click_action = new_sale_info.isForSale() ? CLICK_ACTION_BUY : CLICK_ACTION_TOUCH; + LLSelectMgr::getInstance()->selectionSetClickAction(new_click_action); } - } check_actions; - - // Selection should only contain objects that are of target - // action already or of action we are aiming to remove. - bool default_actions = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&check_actions); - - if (default_actions && old_sale_info.isForSale() != new_sale_info.isForSale()) - { - U8 new_click_action = new_sale_info.isForSale() ? CLICK_ACTION_BUY : CLICK_ACTION_TOUCH; - LLSelectMgr::getInstance()->selectionSetClickAction(new_click_action); } } |