summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelclassified.cpp25
-rw-r--r--indra/newview/llpanelclassified.h9
-rw-r--r--indra/newview/llpanelpicks.cpp1
3 files changed, 30 insertions, 5 deletions
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 5679233844..67a2704501 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -1167,7 +1167,9 @@ LLPanelClassifiedInfo* LLPanelClassifiedInfo::create()
BOOL LLPanelClassifiedInfo::postBuild()
{
- childSetAction("back_btn", boost::bind(&LLPanelClassifiedInfo::onExit, this), NULL);
+ childSetAction("back_btn", boost::bind(&LLPanelClassifiedInfo::onExit, this));
+ childSetAction("show_on_map_btn", boost::bind(&LLPanelClassifiedInfo::onMapClick, this));
+ childSetAction("teleport_btn", boost::bind(&LLPanelClassifiedInfo::onTeleportClick, this));
return TRUE;
}
@@ -1177,6 +1179,11 @@ void LLPanelClassifiedInfo::setExitCallback(const commit_callback_t& cb)
getChild<LLButton>("back_btn")->setClickedCallback(cb);
}
+void LLPanelClassifiedInfo::setEditClassifiedCallback(const commit_callback_t& cb)
+{
+ getChild<LLButton>("edit_btn")->setClickedCallback(cb);
+}
+
void LLPanelClassifiedInfo::onOpen(const LLSD& key)
{
LLUUID avatar_id = key["avatar_id"];
@@ -1216,6 +1223,7 @@ void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType t
setDescription(c_info->description);
setSnapshotId(c_info->snapshot_id);
setParcelId(c_info->parcel_id);
+ setPosGlobal(c_info->pos_global);
setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global));
childSetValue("category", LLClassifiedInfo::sCategories[c_info->category]);
@@ -1325,6 +1333,21 @@ std::string LLPanelClassifiedInfo::createLocationText(
return location_text;
}
+void LLPanelClassifiedInfo::onMapClick()
+{
+ LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal());
+ LLFloaterReg::showInstance("world_map", "center");
+}
+
+void LLPanelClassifiedInfo::onTeleportClick()
+{
+ if (!getPosGlobal().isExactlyZero())
+ {
+ gAgent.teleportViaLocation(getPosGlobal());
+ LLFloaterWorldMap::getInstance()->trackLocation(getPosGlobal());
+ }
+}
+
void LLPanelClassifiedInfo::onExit()
{
LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this);
diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h
index 187bdbb37e..8b32495854 100644
--- a/indra/newview/llpanelclassified.h
+++ b/indra/newview/llpanelclassified.h
@@ -249,7 +249,9 @@ public:
void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; }
- virtual void setExitCallback(const commit_callback_t& cb);
+ void setExitCallback(const commit_callback_t& cb);
+
+ void setEditClassifiedCallback(const commit_callback_t& cb);
protected:
@@ -264,9 +266,8 @@ protected:
const std::string& sim_name,
const LLVector3d& pos_global);
- void onClickMap();
- void onClickTeleport();
- void onClickBack();
+ void onMapClick();
+ void onTeleportClick();
void onExit();
private:
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index c30658755a..4be8f12e32 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -740,6 +740,7 @@ void LLPanelPicks::createClassifiedInfoPanel()
{
mPanelClassifiedInfo = LLPanelClassifiedInfo::create();
mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedInfo));
+ mPanelClassifiedInfo->setEditClassifiedCallback(boost::bind(&LLPanelPicks::onPanelClassifiedEdit, this));
mPanelClassifiedInfo->setVisible(FALSE);
}
}