diff options
Diffstat (limited to 'indra/newview/llpanelteleporthistory.cpp')
-rw-r--r-- | indra/newview/llpanelteleporthistory.cpp | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index eb35834dc0..c271ca34b9 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,23 @@ void LLTeleportHistoryPanel::onCopySLURL() } */ +// virtual +void LLTeleportHistoryPanel::updateVerbs() +{ + 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 +206,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 |