summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelteleporthistory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelteleporthistory.cpp')
-rw-r--r--indra/newview/llpanelteleporthistory.cpp81
1 files changed, 49 insertions, 32 deletions
diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp
index 9b35e78134..d3543daff0 100644
--- a/indra/newview/llpanelteleporthistory.cpp
+++ b/indra/newview/llpanelteleporthistory.cpp
@@ -31,7 +31,6 @@
#include "llfloaterworldmap.h"
#include "llpanelteleporthistory.h"
-#include "llsidetray.h"
#include "llworldmap.h"
#include "llteleporthistorystorage.h"
#include "lltextutil.h"
@@ -39,6 +38,7 @@
#include "llaccordionctrl.h"
#include "llaccordionctrltab.h"
#include "llflatlistview.h"
+#include "llfloatersidepanelcontainer.h"
#include "llnotificationsutil.h"
#include "lltextbox.h"
#include "lltoggleablemenu.h"
@@ -221,7 +221,7 @@ void LLTeleportHistoryFlatItem::showPlaceInfoPanel(S32 index)
params["id"] = index;
params["type"] = "teleport_history";
- LLSideTray::getInstance()->showPanel("panel_places", params);
+ LLFloaterSidePanelContainer::showPanel("places", params);
}
void LLTeleportHistoryFlatItem::onProfileBtnClick()
@@ -388,7 +388,8 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()
LLTeleportHistoryPanel::~LLTeleportHistoryPanel()
{
LLTeleportHistoryFlatItemStorage::instance().purge();
- LLView::deleteViewByHandle(mGearMenuHandle);
+ delete mGearMenuHandle.get();
+ mTeleportHistoryChangedConnection.disconnect();
}
BOOL LLTeleportHistoryPanel::postBuild()
@@ -396,7 +397,7 @@ BOOL LLTeleportHistoryPanel::postBuild()
mTeleportHistory = LLTeleportHistoryStorage::getInstance();
if (mTeleportHistory)
{
- mTeleportHistory->setHistoryChangedCallback(boost::bind(&LLTeleportHistoryPanel::onTeleportHistoryChange, this, _1));
+ mTeleportHistoryChangedConnection = mTeleportHistory->setHistoryChangedCallback(boost::bind(&LLTeleportHistoryPanel::onTeleportHistoryChange, this, _1));
}
mHistoryAccordion = getChild<LLAccordionCtrl>("history_accordion");
@@ -679,29 +680,32 @@ void LLTeleportHistoryPanel::refresh()
// tab_boundary_date would be earliest possible date for this tab
S32 tab_idx = 0;
getNextTab(date, tab_idx, tab_boundary_date);
-
- LLAccordionCtrlTab* tab = mItemContainers.get(mItemContainers.size() - 1 - tab_idx);
- tab->setVisible(true);
-
- // Expand all accordion tabs when filtering
- if(!sFilterSubString.empty())
+ tab_idx = mItemContainers.size() - 1 - tab_idx;
+ if (tab_idx >= 0)
{
- //store accordion tab state when filter is not empty
- tab->notifyChildren(LLSD().with("action","store_state"));
-
- tab->setDisplayChildren(true);
- }
- // Restore each tab's expand state when not filtering
- else
- {
- bool collapsed = isAccordionCollapsedByUser(tab);
- tab->setDisplayChildren(!collapsed);
+ LLAccordionCtrlTab* tab = mItemContainers.get(tab_idx);
+ tab->setVisible(true);
+
+ // Expand all accordion tabs when filtering
+ if(!sFilterSubString.empty())
+ {
+ //store accordion tab state when filter is not empty
+ tab->notifyChildren(LLSD().with("action","store_state"));
- //restore accordion state after all those accodrion tabmanipulations
- tab->notifyChildren(LLSD().with("action","restore_state"));
- }
+ tab->setDisplayChildren(true);
+ }
+ // Restore each tab's expand state when not filtering
+ else
+ {
+ bool collapsed = isAccordionCollapsedByUser(tab);
+ tab->setDisplayChildren(!collapsed);
+
+ //restore accordion state after all those accodrion tabmanipulations
+ tab->notifyChildren(LLSD().with("action","restore_state"));
+ }
- curr_flat_view = getFlatListViewFromTab(tab);
+ curr_flat_view = getFlatListViewFromTab(tab);
+ }
}
if (curr_flat_view)
@@ -760,7 +764,12 @@ void LLTeleportHistoryPanel::onTeleportHistoryChange(S32 removed_index)
void LLTeleportHistoryPanel::replaceItem(S32 removed_index)
{
// Flat list for 'Today' (mItemContainers keeps accordion tabs in reverse order)
- LLFlatListView* fv = getFlatListViewFromTab(mItemContainers[mItemContainers.size() - 1]);
+ LLFlatListView* fv = NULL;
+
+ if (mItemContainers.size() > 0)
+ {
+ fv = getFlatListViewFromTab(mItemContainers[mItemContainers.size() - 1]);
+ }
// Empty flat list for 'Today' means that other flat lists are empty as well,
// so all items from teleport history should be added.
@@ -828,19 +837,27 @@ void LLTeleportHistoryPanel::showTeleportHistory()
// Starting to add items from last one, in reverse order,
// since TeleportHistory keeps most recent item at the end
+ if (!mTeleportHistory)
+ {
+ mTeleportHistory = LLTeleportHistoryStorage::getInstance();
+ }
+
mCurrentItem = mTeleportHistory->getItems().size() - 1;
for (S32 n = mItemContainers.size() - 1; n >= 0; --n)
{
LLAccordionCtrlTab* tab = mItemContainers.get(n);
- tab->setVisible(false);
-
- LLFlatListView* fv = getFlatListViewFromTab(tab);
- if (fv)
+ if (tab)
{
- // Detached panels are managed by LLTeleportHistoryFlatItemStorage
- std::vector<LLPanel*> detached_items;
- fv->detachItems(detached_items);
+ tab->setVisible(false);
+
+ LLFlatListView* fv = getFlatListViewFromTab(tab);
+ if (fv)
+ {
+ // Detached panels are managed by LLTeleportHistoryFlatItemStorage
+ std::vector<LLPanel*> detached_items;
+ fv->detachItems(detached_items);
+ }
}
}
}