From 3eeb14ee0abb5720e010d94eba52db09fa32237e Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 10 Jun 2011 16:20:30 -0700 Subject: EXP-856 FIX -- Inbox item count reflected as badge on inventory button * Modified badges to be parented to their owners if their owners have no parents * Modified side tray tab panels to create badges on side tab buttons when the xml specifies a badge. * Modified inbox to drive the badge value of the sidebar_inventory button. * Updated inbox and outbox sizes so scroll bars function as expected * Updated inventory_panel.xml to allow scroll tag to specify scroll bar properties, instead of just having them hardcoded. Reviewed by Richard --- indra/newview/llinventorypanel.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1dcb91ad4d..5b47e939a4 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -42,7 +42,6 @@ #include "llinventorymodelbackgroundfetch.h" #include "llsidepanelinventory.h" #include "llsidetray.h" -#include "llscrollcontainer.h" #include "llviewerattachmenu.h" #include "llviewerfoldertype.h" #include "llvoavatarself.h" @@ -184,13 +183,9 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { LLRect scroller_view_rect = getRect(); scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); - LLScrollContainer::Params p; - p.name("Inventory Scroller"); - p.rect(scroller_view_rect); - p.follows.flags(FOLLOWS_ALL); - p.reserve_scroll_corner(true); - p.tab_stop(true); - mScroller = LLUICtrlFactory::create(p); + LLScrollContainer::Params scroller_params(params.scroll()); + scroller_params.rect(scroller_view_rect); + mScroller = LLUICtrlFactory::create(scroller_params); addChild(mScroller); mScroller->addChild(mFolderRoot); mFolderRoot->setScrollContainer(mScroller); -- cgit v1.2.3 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/llinventorypanel.cpp | 324 ++++++++++++++++++------------------- 1 file changed, 160 insertions(+), 164 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1dcb91ad4d..1ff423056a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -132,8 +132,6 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mAllowMultiSelect(p.allow_multi_select), mShowItemLinkOverlays(p.show_item_link_overlays), mViewsInitialized(false), - mStartFolderString(p.start_folder), - mBuildDefaultHierarchy(true), mInvFVBridgeBuilder(NULL) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; @@ -146,11 +144,48 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2)); mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars)); - - if (mStartFolderString != "") + +} + +void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) +{ + // Determine the root folder in case specified, and + // build the views starting with that folder. + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder); + + LLUUID root_id; + + if ("LIBRARY" == params.start_folder()) { - mBuildDefaultHierarchy = false; + root_id = gInventory.getLibraryRootFolderID(); } + else + { + root_id = (preferred_type != LLFolderType::FT_NONE) + ? gInventory.findCategoryUUIDForType(preferred_type) + : LLUUID::null; + } + + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + LLFolderView::Params p; + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.parent_panel = this; + p.tool_tip = p.name; + p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + p.use_label_suffix = params.use_label_suffix; + p.allow_multiselect = mAllowMultiSelect; + mFolderRoot = LLUICtrlFactory::create(p); + } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) @@ -159,22 +194,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves - // Create root folder - { - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - p.tool_tip = p.name; - p.use_label_suffix = params.use_label_suffix; - mFolderRoot = LLUICtrlFactory::create(p); - mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); - } + buildFolderView(params); mCommitCallbackRegistrar.popScope(); @@ -206,7 +226,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) // Build view of inventory if we need default full hierarchy and inventory ready, // otherwise wait for idle callback. - if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mViewsInitialized) + if (mInventory->isInventoryUsable() && !mViewsInitialized) { initializeViews(); } @@ -264,6 +284,15 @@ LLInventoryFilter* LLInventoryPanel::getFilter() return NULL; } +const LLInventoryFilter* LLInventoryPanel::getFilter() const +{ + if (mFolderRoot) + { + return mFolderRoot->getFilter(); + } + return NULL; +} + void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type) { if (filter_type == LLInventoryFilter::FILTERTYPE_OBJECT) @@ -488,23 +517,16 @@ void LLInventoryPanel::onIdle(void *userdata) } } +const LLUUID& LLInventoryPanel::getRootFolderID() const +{ + return mFolderRoot->getListener()->getUUID(); +} + void LLInventoryPanel::initializeViews() { if (!gInventory.isInventoryUsable()) return; - // Determine the root folder in case specified, and - // build the views starting with that folder. - const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(mStartFolderString); - - if ("LIBRARY" == mStartFolderString) - { - mStartFolderID = gInventory.getLibraryRootFolderID(); - } - else - { - mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); - } - rebuildViewsFor(mStartFolderID); + rebuildViewsFor(getRootFolderID()); mViewsInitialized = true; @@ -533,7 +555,7 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { // Destroy the old view for this ID so we can rebuild it. LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); - if (old_view && id.notNull()) + if (old_view && old_view != mFolderRoot) { old_view->destroyView(); } @@ -543,118 +565,101 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) void LLInventoryPanel::buildNewViews(const LLUUID& id) { - LLMemType mt(LLMemType::MTYPE_INVENTORY_BUILD_NEW_VIEWS); - LLFolderViewItem* itemp = NULL; - LLInventoryObject* objectp = gInventory.getObject(id); - if (objectp) - { - const LLUUID &parent_id = objectp->getParentUUID(); - LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); - if (id == mStartFolderID) - { - parent_folder = mFolderRoot; - } - else if ((mStartFolderID != LLUUID::null) && (!gInventory.isObjectDescendentOf(id, mStartFolderID))) - { - // This item exists outside the inventory's hierarchy, so don't add it. - return; - } - - if (objectp->getType() <= LLAssetType::AT_NONE || - objectp->getType() >= LLAssetType::AT_COUNT) - { - llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " - << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() - << llendl; - return; - } - - if ((objectp->getType() == LLAssetType::AT_CATEGORY) && - (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) - { - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), - objectp->getType(), - LLInventoryType::IT_CATEGORY, - this, - mFolderRoot, - objectp->getUUID()); - if (new_listener) - { - LLFolderViewFolder::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.root = mFolderRoot; - params.listener = new_listener; - params.tool_tip = params.name; - LLFolderViewFolder* folderp = LLUICtrlFactory::create(params); - folderp->setItemSortOrder(mFolderRoot->getSortOrder()); - itemp = folderp; - - // Hide the root folder, so we can show the contents of a folder flat - // but still have the parent folder present for listener-related operations. - if (id == mStartFolderID) - { - folderp->setHidden(TRUE); - } - const LLViewerInventoryCategory *cat = dynamic_cast(objectp); - if (cat && getIsHiddenFolderType(cat->getPreferredType())) - { - folderp->setHidden(TRUE); - } - } - } - else - { - // Build new view for item. - LLInventoryItem* item = (LLInventoryItem*)objectp; - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), - item->getActualType(), - item->getInventoryType(), - this, - mFolderRoot, - item->getUUID(), - item->getFlags()); - - if (new_listener) - { - LLFolderViewItem::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.creation_date = new_listener->getCreationDate(); - params.root = mFolderRoot; - params.listener = new_listener; - params.rect = LLRect (0, 0, 0, 0); - params.tool_tip = params.name; - itemp = LLUICtrlFactory::create (params); - } - } - - if (itemp) - { - itemp->addToFolder(parent_folder, mFolderRoot); - - // Don't add children of hidden folders unless this is the panel's root folder. - if (itemp->getHidden() && (id != mStartFolderID)) - { - return; - } + LLInventoryObject const* objectp = gInventory.getObject(id); + LLUUID root_id = mFolderRoot->getListener()->getUUID(); + LLFolderViewFolder* parent_folder = NULL; + + if (id == root_id) + { + parent_folder = mFolderRoot; + } + else if (objectp) + { + LLFolderViewItem* itemp = NULL; + const LLUUID &parent_id = objectp->getParentUUID(); + parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); + + if (parent_folder) + { + if (objectp->getType() <= LLAssetType::AT_NONE || + objectp->getType() >= LLAssetType::AT_COUNT) + { + llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " + << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() + << llendl; + return; + } + + if ((objectp->getType() == LLAssetType::AT_CATEGORY) && + (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) + { + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), + objectp->getType(), + LLInventoryType::IT_CATEGORY, + this, + mFolderRoot, + objectp->getUUID()); + if (new_listener) + { + LLFolderViewFolder::Params params; + params.name = new_listener->getDisplayName(); + params.icon = new_listener->getIcon(); + params.icon_open = new_listener->getOpenIcon(); + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + params.root = mFolderRoot; + params.listener = new_listener; + params.tool_tip = params.name; + LLFolderViewFolder* folderp = LLUICtrlFactory::create(params); + folderp->setItemSortOrder(mFolderRoot->getSortOrder()); + itemp = folderp; + } + } + else + { + // Build new view for item. + LLInventoryItem* item = (LLInventoryItem*)objectp; + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), + item->getActualType(), + item->getInventoryType(), + this, + mFolderRoot, + item->getUUID(), + item->getFlags()); + + if (new_listener) + { + LLFolderViewItem::Params params; + params.name = new_listener->getDisplayName(); + params.icon = new_listener->getIcon(); + params.icon_open = new_listener->getOpenIcon(); + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + params.creation_date = new_listener->getCreationDate(); + params.root = mFolderRoot; + params.listener = new_listener; + params.rect = LLRect (0, 0, 0, 0); + params.tool_tip = params.name; + itemp = LLUICtrlFactory::create (params); + } + } + + if (itemp) + { + itemp->addToFolder(parent_folder, mFolderRoot); + } } } // If this is a folder, add the children of the folder and recursively add any // child folders. - if ((id == mStartFolderID) || - (objectp && objectp->getType() == LLAssetType::AT_CATEGORY)) + if (id.isNull() + || (objectp + && objectp->getType() == LLAssetType::AT_CATEGORY)) { LLViewerInventoryCategory::cat_array_t* categories; LLViewerInventoryItem::item_array_t* items; @@ -671,7 +676,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } } - if(items) + if(items && parent_folder) { for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin(); item_iter != items->end(); @@ -688,23 +693,17 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) // bit of a hack to make sure the inventory is open. void LLInventoryPanel::openStartFolderOrMyInventory() { - if (mStartFolderString != "") - { - mFolderRoot->openFolder(mStartFolderString); - } - else + // Find My Inventory folder and open it up by name + for (LLView *child = mFolderRoot->getFirstChild(); child; child = mFolderRoot->findNextSibling(child)) { - // Find My Inventory folder and open it up by name - for (LLView *child = mFolderRoot->getFirstChild(); child; child = mFolderRoot->findNextSibling(child)) + LLFolderViewFolder *fchild = dynamic_cast(child); + if (fchild + && fchild->getListener() + && fchild->getListener()->getUUID() == gInventory.getRootFolderID()) { - LLFolderViewFolder *fchild = dynamic_cast(child); - if (fchild && fchild->getListener() && - (fchild->getListener()->getUUID() == gInventory.getRootFolderID())) - { - const std::string& child_name = child->getName(); - mFolderRoot->openFolder(child_name); - break; - } + const std::string& child_name = child->getName(); + mFolderRoot->openFolder(child_name); + break; } } } @@ -1067,15 +1066,12 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type) { - if (!getIsHiddenFolderType(folder_type)) - { - mHiddenFolderTypes.push_back(folder_type); - } + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << folder_type)); } BOOL LLInventoryPanel::getIsHiddenFolderType(LLFolderType::EType folder_type) const { - return (std::find(mHiddenFolderTypes.begin(), mHiddenFolderTypes.end(), folder_type) != mHiddenFolderTypes.end()); + return !(getFilter()->getFilterCategoryTypes() & (1ULL << folder_type)); } -- cgit v1.2.3 From 21cc9a2868bc8260c7754df237e4abf1114be9e2 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 22 Jun 2011 17:02:11 -0400 Subject: EXP-919 FIX 2 -- Toggling InventoryDisplayInbox value to True in Viewer on Agni creates Inbox and Outbox system folders * Fixed the "start_in" folder tag to no longer create folders it is trying to track that do not exist. --- indra/newview/llinventorypanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 5b47e939a4..ebee1704f0 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -497,7 +497,7 @@ void LLInventoryPanel::initializeViews() } else { - mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); + mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type, false, false) : LLUUID::null); } rebuildViewsFor(mStartFolderID); -- 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/llinventorypanel.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1ff423056a..49e68402e5 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -463,9 +463,8 @@ void LLInventoryPanel::modelChanged(U32 mask) // This item already exists in both memory and UI. It was probably reparented. if (model_item && view_item) { - // Don't process the item if it's hanging from the root, since its - // model_item's parent will be NULL. - if (view_item->getRoot() != view_item->getParent()) + // Don't process the item if it is the root + if (view_item->getRoot() != view_item) { LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolderRoot->getItemByID(model_item->getParentUUID()); // Item has been moved. -- cgit v1.2.3 From e74f9fcc147edd24576a25bb6a0af69ac8d6a600 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 23 Jun 2011 18:11:55 -0400 Subject: EXP-919 FIX -- Toggling InventoryDisplayInbox value to True in Viewer on Agni creates Inbox and Outbox system folders * The badge no longer displays (2) when the folder does not exist. * The inbox panel no longer displays the inventory and library folders. * The inbox is supposed to display a string for the item not being found, but doesn't for an unknown reason. --- indra/newview/llinventorypanel.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 3666c51c82..0af6451108 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -150,7 +150,10 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) { // Determine the root folder in case specified, and // build the views starting with that folder. - const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder); + + std::string start_folder_name(params.start_folder()); + + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(start_folder_name); LLUUID root_id; @@ -164,6 +167,12 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) ? gInventory.findCategoryUUIDForType(preferred_type, false, false) : LLUUID::null; } + + if ((root_id == LLUUID::null) && !start_folder_name.empty()) + { + llwarns << "No category found that matches start_folder: " << start_folder_name << llendl; + root_id = LLUUID::generateNewID(); + } LLRect folder_rect(0, 0, @@ -184,7 +193,6 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) p.use_label_suffix = params.use_label_suffix; p.allow_multiselect = mAllowMultiSelect; mFolderRoot = LLUICtrlFactory::create(p); - } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) -- cgit v1.2.3 From c998f21c5201a4c117ad601fbd23c116fd9faa04 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 28 Jun 2011 14:45:09 -0700 Subject: EXP-922 FIX Purchased Direct Delivery items do not appear in Recent Inventory tab switched to using filters to hide inbox and show it for recent items only --- indra/newview/llinventorypanel.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 0af6451108..834da49c61 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -245,6 +245,9 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) } mFolderRoot->setSortOrder(getFilter()->getSortOrder()); + // hide inbox + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); + // Initialize base class params. LLPanel::initFromParams(params); } @@ -1090,6 +1093,13 @@ public: struct Params : public LLInitParam::Block {}; + void initFromParams(const Params& p) + { + LLInventoryPanel::initFromParams(p); + // turn on inbox for recent items + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX)); + } + protected: LLInventoryRecentItemsPanel (const Params&); friend class LLUICtrlFactory; -- cgit v1.2.3 From 6c12a5ca550e06730e06d1a909fbf43d7bda16f5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 30 Jun 2011 16:25:19 -0700 Subject: EXP-919 FIX -- Items not shown in Received Items panel EXP-929 FIX -- First Direct Delivery item purchased while logged in: Received Items folder visible in inventory and item not visible in Received items panel - no badge count update * Inbox and Outbox inventory panels now live in their own XML files and are hot loaded into place when appropriate, like when the "Received Items" folder is first created, for example. * The Inbox and Outbox panels now show relevant default messages when the folders are empty or do not exist * Added LLInventoryCategoryAddedObserver, a new inventory observer type to observe added folders * Hacked LLInventoryPanel to properly set up inbox and outbox inventory views for the "Received Items" folder and the "Merchant Outbox" folder that aren't created with the proper system folder type * Changed inventory badge count computation to use LLFolderView rather than the inventory directly * Applied various focus, selection and other inbox fixes to the outbox Reviewed by Richard. --- indra/newview/llinventorypanel.cpp | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 834da49c61..864e6a181e 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -161,6 +161,49 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) { root_id = gInventory.getLibraryRootFolderID(); } + // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type + else if (preferred_type == LLFolderType::FT_INBOX) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); + + if (cats) + { + for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) + { + LLInventoryCategory* cat = *cat_it; + + if (cat->getName() == "Received Items") + { + root_id = cat->getUUID(); + } + } + } + } + // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type + else if (preferred_type == LLFolderType::FT_OUTBOX) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); + + if (cats) + { + for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) + { + LLInventoryCategory* cat = *cat_it; + + if (cat->getName() == "Merchant Outbox") + { + root_id = cat->getUUID(); + } + } + } + } + // leslie -- end temporary HACK else { root_id = (preferred_type != LLFolderType::FT_NONE) -- cgit v1.2.3 From 2f21ec48a222662351c9f8e7243673eb6a31b457 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 5 Jul 2011 12:32:12 -0700 Subject: EXP-860 FIX -- Display NEW for items added to inbox * Added createFolderView, createFolderViewFolder and createFolderViewItem virtuals to LLInventoryPanel so these can be overridden by a derived class for custom display. * Added new LLInboxInventoryPanel class that overrides createFolderViewFolder with a LLInboxFolderViewFolder for custom display with NEW tags. * LLInboxFolderViewFolder NEW tag is tied to the mFresh variable that currently has no logic attached to it, meaning it remains off all the time. Reviewed by Richard. --- indra/newview/llinventorypanel.cpp | 120 +++++++++++++++++++++++-------------- 1 file changed, 74 insertions(+), 46 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 864e6a181e..49170caee8 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -216,26 +216,15 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) llwarns << "No category found that matches start_folder: " << start_folder_name << llendl; root_id = LLUUID::generateNewID(); } - - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - p.tool_tip = p.name; - p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, - LLAssetType::AT_CATEGORY, - LLInventoryType::IT_CATEGORY, - this, - NULL, - root_id); - p.use_label_suffix = params.use_label_suffix; - p.allow_multiselect = mAllowMultiSelect; - mFolderRoot = LLUICtrlFactory::create(p); + + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + + mFolderRoot = createFolderView(new_listener, params.use_label_suffix()); } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) @@ -611,6 +600,69 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) buildNewViews(id); } +LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix) +{ + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + + LLFolderView::Params p; + + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.parent_panel = this; + p.tool_tip = p.name; + p.listener = bridge; + p.use_label_suffix = useLabelSuffix; + p.allow_multiselect = mAllowMultiSelect; + + return LLUICtrlFactory::create(p); +} + +LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +{ + LLFolderViewFolder::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.root = mFolderRoot; + params.listener = bridge; + params.tool_tip = params.name; + + return LLUICtrlFactory::create(params); +} + +LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge) +{ + LLFolderViewItem::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.creation_date = bridge->getCreationDate(); + params.root = mFolderRoot; + params.listener = bridge; + params.rect = LLRect (0, 0, 0, 0); + params.tool_tip = params.name; + + return LLUICtrlFactory::create(params); +} + void LLInventoryPanel::buildNewViews(const LLUUID& id) { LLInventoryObject const* objectp = gInventory.getObject(id); @@ -649,18 +701,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) objectp->getUUID()); if (new_listener) { - LLFolderViewFolder::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.root = mFolderRoot; - params.listener = new_listener; - params.tool_tip = params.name; - LLFolderViewFolder* folderp = LLUICtrlFactory::create(params); + LLFolderViewFolder* folderp = createFolderViewFolder(new_listener); folderp->setItemSortOrder(mFolderRoot->getSortOrder()); itemp = folderp; } @@ -679,20 +720,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) if (new_listener) { - LLFolderViewItem::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.creation_date = new_listener->getCreationDate(); - params.root = mFolderRoot; - params.listener = new_listener; - params.rect = LLRect (0, 0, 0, 0); - params.tool_tip = params.name; - itemp = LLUICtrlFactory::create (params); + itemp = createFolderViewItem(new_listener); } } -- 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/llinventorypanel.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 49170caee8..25e43b34a6 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -130,6 +130,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mInventory(p.inventory), mAllowMultiSelect(p.allow_multi_select), mShowItemLinkOverlays(p.show_item_link_overlays), + mShowLoadStatus(p.show_load_status), mViewsInitialized(false), mInvFVBridgeBuilder(NULL) { @@ -617,6 +618,7 @@ LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool u p.listener = bridge; p.use_label_suffix = useLabelSuffix; p.allow_multiselect = mAllowMultiSelect; + p.show_load_status = mShowLoadStatus; return LLUICtrlFactory::create(p); } -- cgit v1.2.3 From e92d3dcf1013ab340fdef514b41ebf790f79e04c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 5 Jul 2011 23:40:19 -0700 Subject: EXP-971 FIX New Direct Delivery item does not sort as most recent item in Recent Tab if that tab is open when item delivered --- indra/newview/llinventorypanel.cpp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 25e43b34a6..d11e7572fe 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -35,6 +35,7 @@ #include "llavataractions.h" #include "llfloaterinventory.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llimfloater.h" #include "llimview.h" #include "llinventorybridge.h" @@ -340,6 +341,17 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType getFilter()->setFilterCategoryTypes(types); } +U32 LLInventoryPanel::getFilterObjectTypes() const +{ + return mFolderRoot->getFilterObjectTypes(); +} + +U32 LLInventoryPanel::getFilterPermMask() const +{ + return mFolderRoot->getFilterPermissions(); +} + + void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) { getFilter()->setFilterPermissions(filter_perm_mask); @@ -355,6 +367,12 @@ void LLInventoryPanel::setFilterSubString(const std::string& string) getFilter()->setFilterSubString(string); } +const std::string LLInventoryPanel::getFilterSubString() +{ + return mFolderRoot->getFilterSubString(); +} + + void LLInventoryPanel::setSortOrder(U32 order) { getFilter()->setSortOrder(order); @@ -366,6 +384,12 @@ void LLInventoryPanel::setSortOrder(U32 order) } } +U32 LLInventoryPanel::getSortOrder() const +{ + return mFolderRoot->getSortOrder(); +} + + void LLInventoryPanel::setSinceLogoff(BOOL sl) { getFilter()->setDateRangeLastLogoff(sl); @@ -537,6 +561,12 @@ void LLInventoryPanel::modelChanged(U32 mask) } } +LLFolderView* LLInventoryPanel::getRootFolder() +{ + return mFolderRoot; +} + + // static void LLInventoryPanel::onIdle(void *userdata) { @@ -800,6 +830,12 @@ void LLInventoryPanel::openSelected() bridge->openItem(); } +void LLInventoryPanel::unSelectAll() +{ + mFolderRoot->setSelection(NULL, FALSE, FALSE); +} + + BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask) { BOOL handled = LLView::handleHover(x, y, mask); @@ -879,7 +915,7 @@ void LLInventoryPanel::setSelection(const LLUUID& obj_id, BOOL take_keyboard_foc mFolderRoot->setSelectionByID(obj_id, take_keyboard_focus); } -void LLInventoryPanel::setSelectCallback(const LLFolderView::signal_t::slot_type& cb) +void LLInventoryPanel::setSelectCallback(const boost::function& items, BOOL user_action)>& cb) { if (mFolderRoot) { -- 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/llinventorypanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index d11e7572fe..8f947b15b9 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -623,7 +623,7 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { // Destroy the old view for this ID so we can rebuild it. LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); - if (old_view && old_view != mFolderRoot) + if (old_view) { old_view->destroyView(); } -- cgit v1.2.3 From 791da71c3ea45130cd3817a059a18418e43269b0 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 7 Jul 2011 10:37:50 -0700 Subject: EXP-983 FIX -- Viewer crashes around Place Profile and Landmarks listing in Viewer Experience * Fixed up some funny use of objects that had already been deleted. Reviewed by Richard. --- indra/newview/llinventorypanel.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 8f947b15b9..84199a895a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -471,7 +471,8 @@ void LLInventoryPanel::modelChanged(U32 mask) { view_item->destroyView(); } - buildNewViews(item_id); + view_item = buildNewViews(item_id); + view_folder = dynamic_cast(view_item); } ////////////////////////////// @@ -524,7 +525,7 @@ void LLInventoryPanel::modelChanged(U32 mask) ////////////////////////////// // STRUCTURE Operation // This item already exists in both memory and UI. It was probably reparented. - if (model_item && view_item) + else if (model_item && view_item) { // Don't process the item if it is the root if (view_item->getRoot() != view_item) @@ -552,7 +553,7 @@ void LLInventoryPanel::modelChanged(U32 mask) ////////////////////////////// // REMOVE Operation // This item has been removed from memory, but its associated UI element still exists. - if (!model_item && view_item) + else if (!model_item && view_item) { // Remove the item's UI. view_item->destroyView(); @@ -619,7 +620,7 @@ void LLInventoryPanel::initializeViews() } } -void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) +LLFolderViewItem* LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { // Destroy the old view for this ID so we can rebuild it. LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); @@ -628,7 +629,7 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) old_view->destroyView(); } - buildNewViews(id); + return buildNewViews(id); } LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix) @@ -695,19 +696,19 @@ LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge return LLUICtrlFactory::create(params); } -void LLInventoryPanel::buildNewViews(const LLUUID& id) +LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) { LLInventoryObject const* objectp = gInventory.getObject(id); LLUUID root_id = mFolderRoot->getListener()->getUUID(); LLFolderViewFolder* parent_folder = NULL; - + LLFolderViewItem* itemp = NULL; + if (id == root_id) { parent_folder = mFolderRoot; } else if (objectp) { - LLFolderViewItem* itemp = NULL; const LLUUID &parent_id = objectp->getParentUUID(); parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); @@ -719,7 +720,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() << llendl; - return; + return NULL; } if ((objectp->getType() == LLAssetType::AT_CATEGORY) && @@ -796,6 +797,8 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } mInventory->unlockDirectDescendentArrays(id); } + + return itemp; } // bit of a hack to make sure the inventory is open. -- cgit v1.2.3 From e4bb8a442dbaff26ef305945a6768e386b634718 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 7 Jul 2011 12:54:08 -0700 Subject: EXP-984 FIX -- My Inventory listing scrolls to bottom when Received Items panel is loaded with several items present * Updated initial view setup to clear selection from "My Inventory" or the root folder after opening it. Reviewed by Richard. --- indra/newview/llinventorypanel.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llinventorypanel.cpp') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 84199a895a..702e8d5a1f 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -814,6 +814,7 @@ void LLInventoryPanel::openStartFolderOrMyInventory() { const std::string& child_name = child->getName(); mFolderRoot->openFolder(child_name); + mFolderRoot->clearSelection(); // No need to keep it selected though! break; } } -- cgit v1.2.3