summaryrefslogtreecommitdiff
path: root/indra/newview/llinspectavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinspectavatar.cpp')
-rw-r--r--indra/newview/llinspectavatar.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp
index bfad2b1624..8dc7833f6a 100644
--- a/indra/newview/llinspectavatar.cpp
+++ b/indra/newview/llinspectavatar.cpp
@@ -47,6 +47,7 @@
#include "llstartup.h"
#include "llviewermenu.h"
#include "llvoiceclient.h"
+#include "llviewerobjectlist.h"
// Linden libraries
#include "llfloater.h"
@@ -113,6 +114,7 @@ private:
void onClickFindOnMap();
bool onVisibleFindOnMap();
bool onVisibleFreezeEject();
+ bool onVisibleZoomIn();
void onClickMuteVolume();
void onVolumeChange(const LLSD& data);
@@ -188,7 +190,8 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd)
{
mCommitCallbackRegistrar.add("InspectAvatar.ViewProfile", boost::bind(&LLInspectAvatar::onClickViewProfile, this));
mCommitCallbackRegistrar.add("InspectAvatar.AddFriend", boost::bind(&LLInspectAvatar::onClickAddFriend, this));
- mCommitCallbackRegistrar.add("InspectAvatar.IM", boost::bind(&LLInspectAvatar::onClickIM, this));
+ mCommitCallbackRegistrar.add("InspectAvatar.IM",
+ boost::bind(&LLInspectAvatar::onClickIM, this));
mCommitCallbackRegistrar.add("InspectAvatar.Teleport", boost::bind(&LLInspectAvatar::onClickTeleport, this));
mCommitCallbackRegistrar.add("InspectAvatar.InviteToGroup", boost::bind(&LLInspectAvatar::onClickInviteToGroup, this));
mCommitCallbackRegistrar.add("InspectAvatar.Pay", boost::bind(&LLInspectAvatar::onClickPay, this));
@@ -203,6 +206,8 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd)
mVisibleCallbackRegistrar.add("InspectAvatar.VisibleFindOnMap", boost::bind(&LLInspectAvatar::onVisibleFindOnMap, this));
mVisibleCallbackRegistrar.add("InspectAvatar.VisibleFreezeEject",
boost::bind(&LLInspectAvatar::onVisibleFreezeEject, this));
+ mVisibleCallbackRegistrar.add("InspectAvatar.VisibleZoomIn",
+ boost::bind(&LLInspectAvatar::onVisibleZoomIn, this));
// can't make the properties request until the widgets are constructed
// as it might return immediately, so do it in postBuild.
@@ -306,7 +311,21 @@ void LLInspectAvatar::requestUpdate()
// You can't re-add someone as a friend if they are already your friend
bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarID) != NULL;
bool is_self = (mAvatarID == gAgentID);
- childSetEnabled("add_friend_btn", !is_friend && !is_self);
+ if (is_self)
+ {
+ getChild<LLUICtrl>("add_friend_btn")->setVisible(false);
+ getChild<LLUICtrl>("im_btn")->setVisible(false);
+ }
+ else if (is_friend)
+ {
+ getChild<LLUICtrl>("add_friend_btn")->setVisible(false);
+ getChild<LLUICtrl>("im_btn")->setVisible(true);
+ }
+ else
+ {
+ getChild<LLUICtrl>("add_friend_btn")->setVisible(true);
+ getChild<LLUICtrl>("im_btn")->setVisible(false);
+ }
// Use an avatar_icon even though the image id will come down with the
// avatar properties because the avatar_icon code maintains a cache of icons
@@ -464,6 +483,11 @@ bool LLInspectAvatar::onVisibleFreezeEject()
return enable_freeze_eject( LLSD(mAvatarID) );
}
+bool LLInspectAvatar::onVisibleZoomIn()
+{
+ return gObjectList.findObject(mAvatarID);
+}
+
void LLInspectAvatar::onClickIM()
{
LLAvatarActions::startIM(mAvatarID);