summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelavatar.cpp
diff options
context:
space:
mode:
authorAndrew Dyukov <adyukov@productengine.com>2009-12-29 19:55:23 +0200
committerAndrew Dyukov <adyukov@productengine.com>2009-12-29 19:55:23 +0200
commit9737349a72189a7ff782e5f5a8a633dbd515d961 (patch)
tree45635f0d77be67ea0e194358b82b8e252c36e04f /indra/newview/llpanelavatar.cpp
parent540b88bdeda72b4821675f6fbf53d01079792aea (diff)
Fixed minor bug EXT-2955 ("Teleport" button is enabled in profile panel of offline avatar).
- Fixed not only "Teleport" button from profile, but also from IM (according to comment in JIRA). --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpanelavatar.cpp')
-rw-r--r--indra/newview/llpanelavatar.cpp67
1 files changed, 65 insertions, 2 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 913152e259..f3d6dbbb46 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -331,6 +331,33 @@ void LLPanelAvatarNotes::onShareButtonClick()
//*TODO not implemented.
}
+LLPanelAvatarNotes::~LLPanelAvatarNotes()
+{
+ if(getAvatarId().notNull())
+ {
+ LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this);
+ }
+}
+
+// virtual, called by LLAvatarTracker
+void LLPanelAvatarNotes::changed(U32 mask)
+{
+ childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId()));
+}
+
+void LLPanelAvatarNotes::setAvatarId(const LLUUID& id)
+{
+ if(id.notNull())
+ {
+ if(getAvatarId().notNull())
+ {
+ LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this);
+ }
+ LLPanelProfileTab::setAvatarId(id);
+ LLAvatarTracker::instance().addParticularFriendObserver(getAvatarId(), this);
+ }
+}
+
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
@@ -396,9 +423,18 @@ void LLPanelProfileTab::onMapButtonClick()
void LLPanelProfileTab::updateButtons()
{
- bool enable_map_btn = LLAvatarTracker::instance().isBuddyOnline(getAvatarId())
- && gAgent.isGodlike() || is_agent_mappable(getAvatarId());
+ bool is_avatar_online = LLAvatarTracker::instance().isBuddyOnline(getAvatarId());
+
+ if(LLAvatarActions::isFriend(getAvatarId()))
+ {
+ childSetEnabled("teleport", is_avatar_online);
+ }
+ else
+ {
+ childSetEnabled("teleport", true);
+ }
+ bool enable_map_btn = is_avatar_online && gAgent.isGodlike() || is_agent_mappable(getAvatarId());
childSetEnabled("show_on_map_btn", enable_map_btn);
childSetEnabled("call", LLAvatarActions::canCall(getAvatarId()));
}
@@ -716,6 +752,33 @@ void LLPanelAvatarProfile::onOverflowButtonClicked()
LLMenuGL::showPopup(this, mProfileMenu, rect.mRight, rect.mTop);
}
+LLPanelAvatarProfile::~LLPanelAvatarProfile()
+{
+ if(getAvatarId().notNull())
+ {
+ LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this);
+ }
+}
+
+// virtual, called by LLAvatarTracker
+void LLPanelAvatarProfile::changed(U32 mask)
+{
+ childSetEnabled("teleport", LLAvatarTracker::instance().isBuddyOnline(getAvatarId()));
+}
+
+void LLPanelAvatarProfile::setAvatarId(const LLUUID& id)
+{
+ if(id.notNull())
+ {
+ if(getAvatarId().notNull())
+ {
+ LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this);
+ }
+ LLPanelProfileTab::setAvatarId(id);
+ LLAvatarTracker::instance().addParticularFriendObserver(getAvatarId(), this);
+ }
+}
+
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////