From 353da63a07b07b75ad73b9f5cb8e463d07ebea3a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Jun 2011 15:24:24 -0700 Subject: EXP-915 FIX remove mHidden and mStartFolderID from LLFolderView* cleaned up and refactored inventory code a bit reviewed by Leyla --- indra/newview/llfolderview.cpp | 49 +++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 27 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 3884b94b60..260693ebc7 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -167,13 +167,22 @@ void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item) ///---------------------------------------------------------------------------- /// Class LLFolderView ///---------------------------------------------------------------------------- +LLFolderView::Params::Params() +: task_id("task_id"), + title("title"), + use_label_suffix("use_label_suffix"), + allow_multiselect("allow_multiselect", true), + use_ellipses("use_ellipses", false) +{ +} + // Default constructor LLFolderView::LLFolderView(const Params& p) : LLFolderViewFolder(p), mScrollContainer( NULL ), mPopupMenuHandle(), - mAllowMultiSelect(TRUE), + mAllowMultiSelect(p.allow_multiselect), mShowFolderHierarchy(FALSE), mSourceID(p.task_id), mRenameItem( NULL ), @@ -194,10 +203,12 @@ LLFolderView::LLFolderView(const Params& p) mDragAndDropThisFrame(FALSE), mCallbackRegistrar(NULL), mParentPanel(p.parent_panel), - mUseEllipses(false), + mUseEllipses(p.use_ellipses), mDraggingOverItem(NULL), mStatusTextBox(NULL) { + mRoot = this; + LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); setRect( rect ); @@ -424,11 +435,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter } - // Need to call arrange regardless of visibility, since children's visibility - // might need to be changed too (e.g. even though a folder is invisible, its - // children also need to be set invisible for state-tracking purposes, e.g. - // llfolderviewitem::filter). - // if (folderp->getVisible()) + if (folderp->getVisible()) { S32 child_height = 0; S32 child_width = 0; @@ -764,7 +771,7 @@ void LLFolderView::sanitizeSelection() } // Don't allow invisible items (such as root folders) to be selected. - if (item->getHidden()) + if (item == getRoot()) { items_to_remove.push_back(item); } @@ -787,7 +794,7 @@ void LLFolderView::sanitizeSelection() parent_folder; parent_folder = parent_folder->getParentFolder()) { - if (parent_folder->potentiallyVisible() && !parent_folder->getHidden()) + if (parent_folder->potentiallyVisible()) { // give initial selection to first ancestor folder that potentially passes the filter if (!new_selection) @@ -808,11 +815,6 @@ void LLFolderView::sanitizeSelection() { // nothing selected to start with, so pick "My Inventory" as best guess new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } } if (new_selection) @@ -962,7 +964,9 @@ void LLFolderView::draw() } - LLFolderViewFolder::draw(); + // skip over LLFolderViewFolder::draw since we don't want the folder icon, label, + // and arrow for the root folder + LLView::draw(); mDragAndDropThisFrame = FALSE; } @@ -1642,11 +1646,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) LLFolderViewItem* parent_folder = last_selected->getParentFolder(); if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) { - // Don't change selectin to hidden folder. See EXT-5328. - if (!parent_folder->getHidden()) - { - setSelection(parent_folder, FALSE, TRUE); - } + setSelection(parent_folder, FALSE, TRUE); } else { @@ -2031,7 +2031,7 @@ void LLFolderView::removeItemID(const LLUUID& id) LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) { - if (id.isNull()) + if (id == getListener()->getUUID()) { return this; } @@ -2048,7 +2048,7 @@ LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) LLFolderViewFolder* LLFolderView::getFolderByID(const LLUUID& id) { - if (id.isNull()) + if (id == getListener()->getUUID()) { return this; } @@ -2496,11 +2496,6 @@ BOOL LLFolderView::isFilterModified() return mFilter->isNotDefault(); } -BOOL LLFolderView::getAllowMultiSelect() -{ - return mAllowMultiSelect; -} - void delete_selected_item(void* user_data) { if(user_data) -- cgit v1.2.3 From 917e2d18973bd17929d589ee58b3f47a09c7157b Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 21 Jun 2011 14:16:27 -0700 Subject: EXP-895 Selecting items in Marketplace Inbox does not change focus in inventory panel away from items selected in inventory panel --- indra/newview/llfolderview.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 3884b94b60..ba6fa18aab 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -806,13 +806,7 @@ void LLFolderView::sanitizeSelection() } else { - // nothing selected to start with, so pick "My Inventory" as best guess - new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } + new_selection = NULL; } if (new_selection) -- cgit v1.2.3 From ae2cbe5258ad76e22420be2760379480e10fb72c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 22 Jun 2011 19:18:41 -0700 Subject: EXP-923 FIX Landmarks moved to new folders do not show as moved until relog in viewer - Delete, Copy, and Paste functions not working as well --- indra/newview/llfolderview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 260693ebc7..bfc4fcaec6 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -274,6 +274,7 @@ LLFolderView::LLFolderView(const Params& p) menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor")); mPopupMenuHandle = menu->getHandle(); + mListener->openItem(); } // Destroys the object -- cgit v1.2.3 From e7d86046d9bba6f0da34a6417e6bb45be518accd Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 23 Jun 2011 15:49:16 -0400 Subject: Build fixes from the merge. Recommended by Richard. --- indra/newview/llfolderview.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 27b58bec4e..bfc4fcaec6 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -816,11 +816,6 @@ void LLFolderView::sanitizeSelection() { // nothing selected to start with, so pick "My Inventory" as best guess new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } } if (new_selection) -- cgit v1.2.3 From 37bc2b2fe89674b3ffbd4e2152554e05cdf6abe3 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 1 Jul 2011 13:14:17 -0700 Subject: EXP-895 fixing selection problems - again --- indra/newview/llfolderview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index bfc4fcaec6..bfbe8ac96e 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -814,8 +814,7 @@ void LLFolderView::sanitizeSelection() } else { - // nothing selected to start with, so pick "My Inventory" as best guess - new_selection = getItemByID(gInventory.getRootFolderID()); + new_selection = NULL; } if (new_selection) -- cgit v1.2.3 From 610c788dd5bbaf886ff5d66b0687d8e8b2a371b7 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 5 Jul 2011 15:15:00 -0700 Subject: EXP-981 Selecting Wear and detach options for an object in Received Items folder causes issues with Profile, Share, and Wear buttons --- indra/newview/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index bfbe8ac96e..20d948de70 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2183,7 +2183,7 @@ void LLFolderView::doIdle() LLFastTimer t3(FTM_AUTO_SELECT); // select new item only if a filtered item not currently selected LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back(); - if ((!selected_itemp || !selected_itemp->getFiltered()) && !mAutoSelectOverride) + if ((selected_itemp && !selected_itemp->getFiltered()) && !mAutoSelectOverride) { // select first filtered item LLSelectFirstFilteredItem filter; -- cgit v1.2.3 From f0e853d5d6de793137e8ee67760f7fa6ddde952e Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 5 Jul 2011 15:16:06 -0700 Subject: updating code comment for EXP-981 --- indra/newview/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 20d948de70..8fd69304ad 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2173,7 +2173,7 @@ void LLFolderView::doIdle() // filter to determine visiblity before arranging filterFromRoot(); - // automatically show matching items, and select first one + // automatically show matching items, and select first one if we had a selection // do this every frame until user puts keyboard focus into the inventory window // signaling the end of the automatic update // only do this when mNeedsFilter is set, meaning filtered items have -- cgit v1.2.3 From 72c7525e677b8e5391abf5b552aa8d068f0e82d6 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 5 Jul 2011 16:07:09 -0700 Subject: EXP-916 FIX -- Folder in Inbox indicates loading when all items are displayed in folder * Updated inbox inventory to not ever display the loading status like other inventory windows. * show_load_status is now an optional parameter for LLInventoryPanel and LLFolderView. Its default value is true but it is overridden to be false for the LLInboxInventoryPanel. Reviewed by Richard. --- indra/newview/llfolderview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index bfbe8ac96e..b04ab493bf 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -172,6 +172,7 @@ LLFolderView::Params::Params() title("title"), use_label_suffix("use_label_suffix"), allow_multiselect("allow_multiselect", true), + show_load_status("show_load_status", true), use_ellipses("use_ellipses", false) { } @@ -208,6 +209,8 @@ LLFolderView::LLFolderView(const Params& p) mStatusTextBox(NULL) { mRoot = this; + + mShowLoadStatus = p.show_load_status(); LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); @@ -354,7 +357,7 @@ BOOL LLFolderView::addFolder( LLFolderViewFolder* folder) { recursiveIncrementNumDescendantsSelected(folder->numSelected()); } - folder->setShowLoadStatus(true); + folder->setShowLoadStatus(mShowLoadStatus); folder->setOrigin(0, 0); folder->reshape(getRect().getWidth(), 0); folder->setVisible(FALSE); -- cgit v1.2.3 From 60f6d809262d97de3b41dcf18a43d783b4b485dc Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 6 Jul 2011 15:48:33 -0700 Subject: EXP-980 Inbox sorting does not persist between sessions --- indra/newview/llfolderview.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 8fd69304ad..29ed70dea5 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -320,15 +320,10 @@ void LLFolderView::setSortOrder(U32 order) if (order != mSortOrder) { LLFastTimer t(FTM_SORT); + mSortOrder = order; - - for (folders_t::iterator iter = mFolders.begin(); - iter != mFolders.end();) - { - folders_t::iterator fit = iter++; - (*fit)->sortBy(order); - } - + + sortBy(order); arrangeAll(); } } -- cgit v1.2.3 From f12f186a38d6df53348c313cc5a41cc0e492952c Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Wed, 6 Jul 2011 17:36:45 -0700 Subject: Null check in case this is causing the places crash --- indra/newview/llfolderview.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 28b95e751e..50c3f9a734 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -931,14 +931,15 @@ void LLFolderView::draw() if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration()) { mStatusText = LLTrans::getString("Searching"); - //font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } else { - LLStringUtil::format_map_t args; - args["[SEARCH_TERM]"] = LLURI::escape(getFilter()->getFilterSubStringOrig()); - mStatusText = LLTrans::getString(getFilter()->getEmptyLookupMessage(), args); - //font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + if (getFilter()) + { + LLStringUtil::format_map_t args; + args["[SEARCH_TERM]"] = LLURI::escape(getFilter()->getFilterSubStringOrig()); + mStatusText = LLTrans::getString(getFilter()->getEmptyLookupMessage(), args); + } } mStatusTextBox->setValue(mStatusText); mStatusTextBox->setVisible( TRUE ); -- cgit v1.2.3 From 77e99e0887b8b1f60ccfe1aeb1cf31c56517f81d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 6 Jul 2011 20:01:12 -0700 Subject: EXP-983 WIP potential fix for crash when using Place Profile in viewer experience --- indra/newview/llfolderview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 50c3f9a734..e8a2d5539b 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1926,8 +1926,11 @@ void LLFolderView::deleteAllChildren() closeRenamer(); LLView::deleteViewByHandle(mPopupMenuHandle); mPopupMenuHandle = LLHandle(); - mRenamer = NULL; + mScrollContainer = NULL; mRenameItem = NULL; + mRenamer = NULL; + mStatusTextBox = NULL; + clearSelection(); LLView::deleteAllChildren(); } -- cgit v1.2.3 From 884f89cb7058c97c4e23997c66f3dbfbb2501009 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 8 Jul 2011 10:24:58 -0700 Subject: EXP-983 FIX -- Viewer crashes around Place Profile and Landmarks listing in Viewer Experience Drag and drop for LLFolderView now handles the empty mFolders case. --- indra/newview/llfolderview.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfolderview.cpp') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index e8a2d5539b..e90b6c1c3d 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1910,7 +1910,14 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, // by the folder which is the hierarchy root. if (!handled && !hasVisibleChildren()) { - handled = mFolders.front()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); + if (mFolders.empty()) + { + handled = handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); + } + else + { + handled = mFolders.front()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); + } } if (handled) -- cgit v1.2.3