diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2009-08-05 16:10:15 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2009-08-05 16:10:15 -0400 |
commit | 07129bf928f79246849e66b396fab44a7a228216 (patch) | |
tree | e4e19b342540450ff84dad75f90d5acb5b3d6269 /indra/newview/llpanelteleporthistory.cpp | |
parent | 03ebc43132331b9a8dcb3c418ec9c319a6beddda (diff) | |
parent | dc62495da6e5c153c0df57fdbce6b0f40c0208f2 (diff) |
Merge recent changes
Diffstat (limited to 'indra/newview/llpanelteleporthistory.cpp')
-rw-r--r-- | indra/newview/llpanelteleporthistory.cpp | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index eb35834dc0..51cd05376a 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -92,8 +92,15 @@ void LLTeleportHistoryPanel::onShowOnMap() S32 index = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); - // teleport to existing item in history, so we don't add it again - mTeleportHistory->goToItem(index); + const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems(); + + LLVector3d global_pos = hist_items[index].mGlobalPos; + + if (!global_pos.isExactlyZero()) + { + LLFloaterWorldMap::getInstance()->trackLocation(global_pos); + LLFloaterReg::showInstance("world_map", "center"); + } } // virtual @@ -104,7 +111,8 @@ void LLTeleportHistoryPanel::onTeleport() return; S32 index = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); - + + // teleport to existing item in history, so we don't add it again mTeleportHistory->goToItem(index); } @@ -132,6 +140,26 @@ void LLTeleportHistoryPanel::onCopySLURL() } */ +// virtual +void LLTeleportHistoryPanel::updateVerbs() +{ + if (!isTabVisible()) + return; + + S32 index = 0; + S32 cur_item = 0; + + LLScrollListItem* itemp = mHistoryItems->getFirstSelected(); + if (itemp) + { + index = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); + cur_item = mTeleportHistory->getCurrentItemIndex(); + } + + mTeleportBtn->setEnabled(index != cur_item); + mShowOnMapBtn->setEnabled(itemp != NULL); +} + void LLTeleportHistoryPanel::showTeleportHistory() { const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems(); @@ -181,17 +209,12 @@ void LLTeleportHistoryPanel::showTeleportHistory() } } - togglePanelPlacesButtons(mHistoryItems->getFirstSelected() != NULL); + updateVerbs(); } void LLTeleportHistoryPanel::handleItemSelect(const LLSD& data) { - LLScrollListItem* itemp = mHistoryItems->getFirstSelected(); - - if (!itemp) - return; - - togglePanelPlacesButtons(TRUE); + updateVerbs(); } //static @@ -204,7 +227,7 @@ void LLTeleportHistoryPanel::onDoubleClickItem(void* user_data) return; LLSD key; - key["type"] = LLPanelPlaces::TELEPORT_HISTORY; + key["type"] = "teleport_history"; key["id"] = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); LLSideTray::getInstance()->showPanel("panel_places", key); |