diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llinspectavatar.cpp | 9 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 8dc7833f6a..baddd90d46 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -117,6 +117,9 @@ private: bool onVisibleZoomIn(); void onClickMuteVolume(); void onVolumeChange(const LLSD& data); + + // Is used to determine if "Add friend" option should be enabled in gear menu + bool isNotFriend(); // Callback for gCacheName to look up avatar name void nameUpdatedCallback( @@ -208,6 +211,7 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd) boost::bind(&LLInspectAvatar::onVisibleFreezeEject, this)); mVisibleCallbackRegistrar.add("InspectAvatar.VisibleZoomIn", boost::bind(&LLInspectAvatar::onVisibleZoomIn, this)); + mEnableCallbackRegistrar.add("InspectAvatar.Gear.Enable", boost::bind(&LLInspectAvatar::isNotFriend, this)); // can't make the properties request until the widgets are constructed // as it might return immediately, so do it in postBuild. @@ -473,6 +477,11 @@ void LLInspectAvatar::onClickViewProfile() closeFloater(); } +bool LLInspectAvatar::isNotFriend() +{ + return !LLAvatarActions::isFriend(mAvatarID); +} + bool LLInspectAvatar::onVisibleFindOnMap() { return gAgent.isGodlike() || is_agent_mappable(mAvatarID); diff --git a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml index 590621062c..a731996a1a 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml @@ -17,6 +17,8 @@ name="add_friend">
<menu_item_call.on_click
function="InspectAvatar.AddFriend"/>
+ <menu_item_call.on_enable
+ function="InspectAvatar.Gear.Enable"/>
</menu_item_call>
<menu_item_call
label="IM"
|