summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorsimon <none@none>2014-04-21 12:48:50 -0700
committersimon <none@none>2014-04-21 12:48:50 -0700
commita5a0a0b1362da5d00cc6d09bb841ef6167bb2922 (patch)
tree0b58bf76487dca0bc439d1f99cd568f970b9cc32 /indra/llui
parent114084bb80d4991519e2ca4020823319810c64b2 (diff)
parent0b9a777bfd3c85390c55d91fc3dc5c4bee9bf71b (diff)
Merge downstream code
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llfolderview.cpp30
-rwxr-xr-xindra/llui/llfolderview.h7
2 files changed, 24 insertions, 13 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index c9ea0c0e1b..ddc0e595bb 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -167,13 +167,14 @@ LLFolderView::LLFolderView(const Params& p)
mMinWidth(0),
mDragAndDropThisFrame(FALSE),
mCallbackRegistrar(NULL),
- mParentPanel(p.parent_panel),
mUseEllipses(p.use_ellipses),
mDraggingOverItem(NULL),
mStatusTextBox(NULL),
mShowItemLinkOverlays(p.show_item_link_overlays),
mViewModel(p.view_model)
{
+ LLPanel* panel = p.parent_panel;
+ mParentPanel = panel->getHandle();
mViewModel->setFolderView(this);
mRoot = this;
@@ -264,6 +265,7 @@ LLFolderView::~LLFolderView( void )
mItems.clear();
mFolders.clear();
+ //mViewModel->setFolderView(NULL);
mViewModel = NULL;
}
@@ -325,7 +327,7 @@ void LLFolderView::filter( LLFolderViewFilter& filter )
{
// Entry point of inventory filtering (CHUI-849)
LLFastTimer t2(FTM_FILTER);
- filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100));
+ filter.resetTime(llclamp(LLUI::sSettingGroups["config"]->getS32(mParentPanel.get()->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100));
// Note: we filter the model, not the view
getViewModelItem()->filter(filter);
@@ -419,7 +421,7 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL openitem,
if( selection && take_keyboard_focus)
{
- mParentPanel->setFocus(TRUE);
+ mParentPanel.get()->setFocus(TRUE);
}
// clear selection down here because change of keyboard focus can potentially
@@ -759,7 +761,7 @@ void LLFolderView::removeSelectedItems()
if (item_to_delete->remove())
{
// change selection on successful delete
- setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel->hasFocus());
+ setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus());
}
}
arrangeAll();
@@ -769,7 +771,7 @@ void LLFolderView::removeSelectedItems()
LLDynamicArray<LLFolderViewModelItem*> listeners;
LLFolderViewModelItem* listener;
- setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel->hasFocus());
+ setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus());
for(S32 i = 0; i < count; ++i)
{
@@ -949,7 +951,7 @@ void LLFolderView::cut()
}
// Update the selection
- setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel->hasFocus());
+ setSelection(item_to_select, item_to_select ? item_to_select->isOpen() : false, mParentPanel.get()->hasFocus());
}
mSearchString.clear();
}
@@ -1289,7 +1291,7 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char)
}
BOOL handled = FALSE;
- if (mParentPanel->hasFocus())
+ if (mParentPanel.get()->hasFocus())
{
// SL-51858: Key presses are not being passed to the Popup menu.
// A proper fix is non-trivial so instead just close the menu.
@@ -1323,7 +1325,7 @@ BOOL LLFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
mKeyboardSelection = FALSE;
mSearchString.clear();
- mParentPanel->setFocus(TRUE);
+ mParentPanel.get()->setFocus(TRUE);
LLEditMenuHandler::gEditMenuHandler = this;
@@ -1406,7 +1408,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
{
// all user operations move keyboard focus to inventory
// this way, we know when to stop auto-updating a search
- mParentPanel->setFocus(TRUE);
+ mParentPanel.get()->setFocus(TRUE);
BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL;
S32 count = mSelectedItems.size();
@@ -1598,6 +1600,12 @@ void LLFolderView::update()
// If this is associated with the user's inventory, don't do anything
// until that inventory is loaded up.
LLFastTimer t2(FTM_INVENTORY);
+
+ // If there's no model, the view is in suspended state (being deleted) and shouldn't be updated
+ if (getFolderViewModel() == NULL)
+ {
+ return;
+ }
LLFolderViewFilter& filter_object = getFolderViewModel()->getFilter();
@@ -1646,8 +1654,8 @@ void LLFolderView::update()
BOOL filter_finished = getViewModelItem()->passedFilter()
&& mViewModel->contentsReady();
if (filter_finished
- || gFocusMgr.childHasKeyboardFocus(mParentPanel)
- || gFocusMgr.childHasMouseCapture(mParentPanel))
+ || gFocusMgr.childHasKeyboardFocus(mParentPanel.get())
+ || gFocusMgr.childHasMouseCapture(mParentPanel.get()))
{
// finishing the filter process, giving focus to the folder view, or dragging the scrollbar all stop the auto select process
mNeedsAutoSelect = FALSE;
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index c28660819f..8729bce752 100755
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -229,7 +229,7 @@ public:
void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; }
- LLPanel* getParentPanel() { return mParentPanel; }
+ LLPanel* getParentPanel() { return mParentPanel.get(); }
// DEBUG only
void dumpSelectionInformation();
@@ -238,6 +238,9 @@ public:
bool useLabelSuffix() { return mUseLabelSuffix; }
virtual void updateMenu();
+ // Note: We may eventually have to move that method up the hierarchy to LLFolderViewItem.
+ LLHandle<LLFolderView> getHandle() const { return getDerivedHandle<LLFolderView>(); }
+
private:
void updateMenuOptions(LLMenuGL* menu);
void updateRenamerPosition();
@@ -295,7 +298,7 @@ protected:
S32 mMinWidth;
BOOL mDragAndDropThisFrame;
- LLPanel* mParentPanel;
+ LLHandle<LLPanel> mParentPanel;
LLFolderViewModelInterface* mViewModel;