summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAlexei Arabadji <aarabadji@productengine.com>2009-11-27 11:38:21 +0200
committerAlexei Arabadji <aarabadji@productengine.com>2009-11-27 11:38:21 +0200
commit4441b83e3304baad458be13a36a4f676269c9ded (patch)
tree45497b72532fcf4e5a5db5814481a98757f61cff /indra/newview
parent1f8dcafe98566fc169586fb1fe61b334643e4613 (diff)
parenta67af8e7e8823b068cee909bcdc3d8a622a407d5 (diff)
Automated merge with https://hg.aws.productengine.com/secondlife/viewer-2-0/
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelavatar.cpp23
-rw-r--r--indra/newview/llpanelavatar.h4
-rw-r--r--indra/newview/llpanelpicks.h4
3 files changed, 30 insertions, 1 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));
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index 527e1c0d34..dc94ff02ca 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -106,6 +106,10 @@ protected:
*/
void scrollToTop();
+ virtual void onMapButtonClick();
+
+ virtual void updateButtons();
+
private:
LLUUID mAvatarId;
diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h
index b17b6d6fe9..b21b1c64b1 100644
--- a/indra/newview/llpanelpicks.h
+++ b/indra/newview/llpanelpicks.h
@@ -86,6 +86,9 @@ public:
// parent panels failed to work (picks related code was in my profile panel)
void setProfilePanel(LLPanelProfile* profile_panel);
+protected:
+ /*virtual*/void updateButtons();
+
private:
void onClickDelete();
void onClickTeleport();
@@ -125,7 +128,6 @@ private:
bool callbackDeleteClassified(const LLSD& notification, const LLSD& response);
bool callbackTeleport(const LLSD& notification, const LLSD& response);
- void updateButtons();
virtual void onDoubleClickPickItem(LLUICtrl* item);
virtual void onDoubleClickClassifiedItem(LLUICtrl* item);