diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-04-01 17:54:08 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-04-01 17:54:08 -0400 |
commit | 2854008e8edd3419fe37a8c4971223eda5945bfa (patch) | |
tree | 83640a42fcc5f71200a19e173a95da433760cf74 /indra/newview/llpanelteleporthistory.cpp | |
parent | 1ec47c39a6c4a6e7e518d0b91a87f50596362f06 (diff) | |
parent | 406b595e8c6811c2550340ba316328289d8b856f (diff) |
automated merge
Diffstat (limited to 'indra/newview/llpanelteleporthistory.cpp')
-rw-r--r-- | indra/newview/llpanelteleporthistory.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 90c8f2551f..0a34531eee 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -348,7 +348,7 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu() void LLTeleportHistoryPanel::ContextMenu::onTeleport() { - LLTeleportHistoryStorage::getInstance()->goToItem(mIndex); + confirmTeleport(mIndex); } void LLTeleportHistoryPanel::ContextMenu::onInfo() @@ -507,7 +507,7 @@ void LLTeleportHistoryPanel::onTeleport() return; // teleport to existing item in history, so we don't add it again - mTeleportHistory->goToItem(itemp->getIndex()); + confirmTeleport(itemp->getIndex()); } /* @@ -1058,3 +1058,27 @@ void LLTeleportHistoryPanel::onAccordionExpand(LLUICtrl* ctrl, const LLSD& param mLastSelectedFlatlList->resetSelection(); } } + +// static +void LLTeleportHistoryPanel::confirmTeleport(S32 hist_idx) +{ + LLSD args; + args["HISTORY_ENTRY"] = LLTeleportHistoryStorage::getInstance()->getItems()[hist_idx].mTitle; + LLNotificationsUtil::add("TeleportToHistoryEntry", args, LLSD(), + boost::bind(&LLTeleportHistoryPanel::onTeleportConfirmation, _1, _2, hist_idx)); +} + +// Called when user reacts upon teleport confirmation dialog. +// static +bool LLTeleportHistoryPanel::onTeleportConfirmation(const LLSD& notification, const LLSD& response, S32 hist_idx) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (0 == option) + { + // Teleport to given history item. + LLTeleportHistoryStorage::getInstance()->goToItem(hist_idx); + } + + return false; +} |