summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelteleporthistory.cpp
diff options
context:
space:
mode:
authorPalmer <palmer@lindenlab.com>2009-08-06 14:51:11 -0700
committerPalmer <palmer@lindenlab.com>2009-08-06 14:51:11 -0700
commitb2632c50efc12eacdcadace64e6c0f1906b86ff6 (patch)
treec32d7e9b29e37d5c30ac16dfac55733456d7eee0 /indra/newview/llpanelteleporthistory.cpp
parent27cf39cdbf27fe52dcf9c70cfdadcc18ddf2e75c (diff)
parenta8d216e194327c7bee8a42c983f7f2ca01adb385 (diff)
Merge of my DEV-36732 work and all the main line login api work that went on.
Diffstat (limited to 'indra/newview/llpanelteleporthistory.cpp')
-rw-r--r--indra/newview/llpanelteleporthistory.cpp45
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);