diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-10-19 01:45:44 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-10-19 01:45:44 +0000 |
commit | 8103710c054ec6ea4a46f9732e569e543691184b (patch) | |
tree | ac03dd6d385e3345c57eff0e1064a011597fe5d6 /indra/newview/llfloaterinventory.cpp | |
parent | 4ee757b45d527699b094bf9422244171fdd7d693 (diff) |
Merging revisions 2046-2068 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0, respecting ancestry
* Bugs: EXT-1414 EXT-1213 EXT-1539 EXT-1253 EXT-1446 EXT-1438 EXT-1233 EXT-1466 EXT-1446 EXT-1512 EXT-1231
* Dev: EXT-719 (landmarks) EXT-747 EXT-1446 EXT-1378 EXT-397 EXT-1476
* IM changes
Diffstat (limited to 'indra/newview/llfloaterinventory.cpp')
-rw-r--r-- | indra/newview/llfloaterinventory.cpp | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/indra/newview/llfloaterinventory.cpp b/indra/newview/llfloaterinventory.cpp index a8ab4303ba..a33a605f50 100644 --- a/indra/newview/llfloaterinventory.cpp +++ b/indra/newview/llfloaterinventory.cpp @@ -1161,6 +1161,7 @@ LLUIImagePtr get_item_icon(LLAssetType::EType asset_type, const std::string LLInventoryPanel::DEFAULT_SORT_ORDER = std::string("InventorySortOrder"); const std::string LLInventoryPanel::RECENTITEMS_SORT_ORDER = std::string("RecentItemsSortOrder"); const std::string LLInventoryPanel::INHERIT_SORT_ORDER = std::string(""); +static const LLInventoryFVBridgeBuilder INVENTORY_BRIDGE_BUILDER; LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : LLPanel(p), @@ -1172,7 +1173,12 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) mAllowMultiSelect(p.allow_multi_select), mHasInventoryConnection(false), mStartFolderString(p.start_folder) +, mBuildDefaultHierarchy(true) +, mRootInventoryItemUUID(LLUUID::null) +, mInvFVBridgeBuilder(NULL) { + mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; + // contex menu callbacks mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLInventoryPanel::doToSelected, this, _2)); mCommitCallbackRegistrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLAssetType::AT_TRASH)); @@ -1237,8 +1243,8 @@ BOOL LLInventoryPanel::postBuild() const LLAssetType::EType preferred_type = LLAssetType::lookupHumanReadable(mStartFolderString); mStartFolderID = (preferred_type != LLAssetType::AT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); - // build view of inventory if inventory ready, otherwise wait for modelChanged() callback - if (mInventory->isInventoryUsable() && !mHasInventoryConnection) + // build view of inventory if we need default full hierarchy and inventory ready, otherwise wait for modelChanged() callback + if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mHasInventoryConnection) { rebuildViewsFor(mStartFolderID); mHasInventoryConnection = true; @@ -1456,6 +1462,25 @@ void LLInventoryPanel::modelChanged(U32 mask) } } +void LLInventoryPanel::setInvFVBridgeBuilder(const LLInventoryFVBridgeBuilder* bridge_builder) +{ + if (NULL == bridge_builder) + { + llwarns << "NULL is passed as Inventory Bridge Builder. Default will be used." << llendl; + } + else + { + mInvFVBridgeBuilder = bridge_builder; + } + + if (mInventory->isInventoryUsable() && !mHasInventoryConnection) + { + rebuildViewsFor(mRootInventoryItemUUID); + mHasInventoryConnection = true; + } +} + + void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { LLFolderViewItem* old_view = NULL; @@ -1493,11 +1518,11 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) else if (objectp->getType() == LLAssetType::AT_CATEGORY && objectp->getActualType() != LLAssetType::AT_LINK_FOLDER) { - LLInvFVBridge* new_listener = LLInvFVBridge::createBridge(objectp->getType(), - objectp->getType(), - LLInventoryType::IT_CATEGORY, - this, - objectp->getUUID()); + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), + objectp->getType(), + LLInventoryType::IT_CATEGORY, + this, + objectp->getUUID()); if (new_listener) { @@ -1516,12 +1541,12 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) { // Build new view for item LLInventoryItem* item = (LLInventoryItem*)objectp; - LLInvFVBridge* new_listener = LLInvFVBridge::createBridge(item->getType(), - item->getActualType(), - item->getInventoryType(), - this, - item->getUUID(), - item->getFlags()); + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), + item->getActualType(), + item->getInventoryType(), + this, + item->getUUID(), + item->getFlags()); if (new_listener) { |