diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-09-07 22:55:07 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-09-07 22:55:07 +0000 |
commit | 79653dfed48105019b8ecca9cf4bfaa2a390e100 (patch) | |
tree | 455943795bf3371bbff0689604cf5eedd903fae4 /indra/newview/llpanelteleporthistory.cpp | |
parent | a9b2296b2b5664cfc8d86c7f99c00c10268e250a (diff) |
merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1566 https://svn.aws.productengine.com/secondlife/pe/stable-2@1580 -> viewer-2.0.0-3
* Bugs: EXT-807 EXT-810 EXT-811 EXT-784 EXT-820 EXT-393 EXT-826 EXT-811 EXT-801 EXT-808 EXT-393 EXT-743 EXT-699 EXT-397 EXT-812 EXT-736 EXT-744 EXT-809 EXT-306 EXT-854 EXT-857 EXT-790
* New Dev: EXT-694 EXT-393 EXT-367 EXT-819 EXT-795 EXT-827 EXT-788
* EXT-272 - Draggable Landmarks
* EXT-715 - Block List Panel
* EXT-782 - Implement advanced place information accordions
Diffstat (limited to 'indra/newview/llpanelteleporthistory.cpp')
-rw-r--r-- | indra/newview/llpanelteleporthistory.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 8b378c33e3..df48ee5d08 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -37,6 +37,7 @@ #include "llpanelteleporthistory.h" #include "llsidetray.h" #include "llworldmap.h" +#include "llteleporthistorystorage.h" // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLRegisterPanelClassWrapper<LLTeleportHistoryPanel> t_teleport_history("panel_teleport_history"); @@ -56,7 +57,7 @@ LLTeleportHistoryPanel::~LLTeleportHistoryPanel() BOOL LLTeleportHistoryPanel::postBuild() { - mTeleportHistory = LLTeleportHistory::getInstance(); + mTeleportHistory = LLTeleportHistoryStorage::getInstance(); if (mTeleportHistory) { mTeleportHistory->setHistoryChangedCallback(boost::bind(&LLTeleportHistoryPanel::showTeleportHistory, this)); @@ -92,9 +93,7 @@ void LLTeleportHistoryPanel::onShowOnMap() S32 index = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); - const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems(); - - LLVector3d global_pos = hist_items[index].mGlobalPos; + LLVector3d global_pos = mTeleportHistory->getItems()[index].mGlobalPos; if (!global_pos.isExactlyZero()) { @@ -153,7 +152,7 @@ void LLTeleportHistoryPanel::updateVerbs() if (itemp) { index = itemp->getColumn(LIST_INDEX)->getValue().asInteger(); - cur_item = mTeleportHistory->getCurrentItemIndex(); + cur_item = mTeleportHistory->getItems().size() - 1; } mTeleportBtn->setEnabled(index != cur_item); @@ -162,13 +161,11 @@ void LLTeleportHistoryPanel::updateVerbs() void LLTeleportHistoryPanel::showTeleportHistory() { - const LLTeleportHistory::slurl_list_t& hist_items = mTeleportHistory->getItems(); + const LLTeleportHistoryStorage::slurl_list_t& hist_items = mTeleportHistory->getItems(); mHistoryItems->deleteAllItems(); - S32 cur_item = mTeleportHistory->getCurrentItemIndex(); - - for (LLTeleportHistory::slurl_list_t::const_iterator iter = hist_items.begin(); + for (LLTeleportHistoryStorage::slurl_list_t::const_iterator iter = hist_items.begin(); iter != hist_items.end(); ++iter) { std::string landmark_title = (*iter).mTitle; @@ -181,7 +178,6 @@ void LLTeleportHistoryPanel::showTeleportHistory() continue; S32 index = iter - hist_items.begin(); - LLSD row; row["id"] = index; @@ -201,14 +197,12 @@ void LLTeleportHistoryPanel::showTeleportHistory() index_column["value"] = index; mHistoryItems->addElement(row, ADD_TOP); - - if (cur_item == index) - { - LLScrollListItem* itemp = mHistoryItems->getItem(index); - ((LLScrollListText*)itemp->getColumn(LIST_ITEM_TITLE))->setFontStyle(LLFontGL::BOLD); - } } + // Consider last item (most recent) as current + LLScrollListItem* itemp = mHistoryItems->getItem((S32)hist_items.size() - 1); + ((LLScrollListText*)itemp->getColumn(LIST_ITEM_TITLE))->setFontStyle(LLFontGL::BOLD); + updateVerbs(); } |