diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelclassified.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llpanelclassified.h | 9 | ||||
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_picks.xml | 3 |
4 files changed, 36 insertions, 6 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..6905c7e546 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -687,6 +687,10 @@ void LLPanelPicks::onPanelClassifiedSave(LLPanelClassifiedEdit* panel) c_item->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); c_item->setMouseUpCallback(boost::bind(&LLPanelPicks::updateButtons, this)); c_item->childSetAction("info_chevron", boost::bind(&LLPanelPicks::onClickInfo, this)); + + // order does matter, showAccordion will invoke arrange for accordions. + mClassifiedsAccTab->changeOpenClose(false); + showAccordion("tab_classifieds", true); } else { @@ -740,6 +744,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); } } diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml index dbe76e553b..9cfbed432a 100644 --- a/indra/newview/skins/default/xui/en/panel_picks.xml +++ b/indra/newview/skins/default/xui/en/panel_picks.xml @@ -22,6 +22,7 @@ left="0" name="accordion" top="0" + single_expansion="true" width="313"> <accordion_tab can_resize="false" @@ -46,7 +47,7 @@ layout="topleft" height="235" name="tab_classifieds" - title="Classified" + title="Classifieds" visible="false"> <flat_list_view color="DkGray2" |