diff options
author | Alexei Arabadji <aarabadji@productengine.com> | 2009-11-27 11:37:48 +0200 |
---|---|---|
committer | Alexei Arabadji <aarabadji@productengine.com> | 2009-11-27 11:37:48 +0200 |
commit | a67af8e7e8823b068cee909bcdc3d8a622a407d5 (patch) | |
tree | 964093b2e162849d07d7c8150207946cf8379c57 /indra/newview/llpanelavatar.cpp | |
parent | 87ed47c9145c22e7b9e26f4bbca5282c128ac746 (diff) |
fixed EXT-2566 "Unable to locate other avatars on map via "map" button (previously "show on map")"
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llpanelavatar.cpp')
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 6f753b6176..87f1ac1f9f 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -48,6 +48,8 @@ #include "llscrollcontainer.h" #include "llavatariconctrl.h" #include "llweb.h" +#include "llfloaterworldmap.h" +#include "llfloaterreg.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLDropTarget @@ -150,6 +152,8 @@ BOOL LLPanelAvatarNotes::postBuild() childSetCommitCallback("call", boost::bind(&LLPanelAvatarNotes::onCallButtonClick, this), NULL); childSetCommitCallback("teleport", boost::bind(&LLPanelAvatarNotes::onTeleportButtonClick, this), NULL); childSetCommitCallback("share", boost::bind(&LLPanelAvatarNotes::onShareButtonClick, this), NULL); + childSetCommitCallback("show_on_map_btn", (boost::bind( + &LLPanelAvatarNotes::onMapButtonClick, this)), NULL); LLTextEditor* te = getChild<LLTextEditor>("notes_edit"); te->setCommitCallback(boost::bind(&LLPanelAvatarNotes::onCommitNotes,this)); @@ -311,6 +315,7 @@ void LLPanelProfileTab::onOpen(const LLSD& key) // Update data even if we are viewing same avatar profile as some data might been changed. setAvatarId(key.asUUID()); updateData(); + updateButtons(); } void LLPanelProfileTab::scrollToTop() @@ -320,6 +325,22 @@ void LLPanelProfileTab::scrollToTop() scrollContainer->goToTop(); } +void LLPanelProfileTab::onMapButtonClick() +{ + std::string name; + gCacheName->getFullName(getAvatarId(), name); + gFloaterWorldMap->trackAvatar(getAvatarId(), name); + LLFloaterReg::showInstance("world_map"); +} + +void LLPanelProfileTab::updateButtons() +{ + bool enable_map_btn = LLAvatarTracker::instance().isBuddyOnline(getAvatarId()) + && gAgent.isGodlike() || is_agent_mappable(getAvatarId()); + + childSetEnabled("show_on_map_btn", enable_map_btn); +} + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -338,6 +359,8 @@ BOOL LLPanelAvatarProfile::postBuild() childSetCommitCallback("teleport",(boost::bind(&LLPanelAvatarProfile::onTeleportButtonClick,this)),NULL); childSetCommitCallback("overflow_btn", boost::bind(&LLPanelAvatarProfile::onOverflowButtonClicked, this), NULL); childSetCommitCallback("share",(boost::bind(&LLPanelAvatarProfile::onShareButtonClick,this)),NULL); + childSetCommitCallback("show_on_map_btn", (boost::bind( + &LLPanelAvatarProfile::onMapButtonClick, this)), NULL); LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; registrar.add("Profile.Pay", boost::bind(&LLPanelAvatarProfile::pay, this)); |