diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-11-23 17:46:30 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-11-23 17:46:30 -0500 |
commit | 2b54c8a084a3f387d6f15b9d4f61d8cb68b434e0 (patch) | |
tree | baea4cdf1fb4e1b1d10795225ce460ae1111acb0 /indra/newview/llinventorypanel.cpp | |
parent | fc1860bcc6bab4b538692662db2da4be1def5af4 (diff) |
EXT-2763 : Right-click on inventory doesn't bring up context menu
Also did some minor cleanup on header files.
--HG--
branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index e4dd70cdd1..47201b2ccc 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -78,7 +78,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mSortOrderSetting(p.sort_order_setting), mInventory(p.inventory), mAllowMultiSelect(p.allow_multi_select), - mHasInventoryConnection(false), + mViewsInitialized(false), mStartFolderString(p.start_folder), mBuildDefaultHierarchy(true), mInvFVBridgeBuilder(NULL) @@ -151,11 +151,9 @@ BOOL LLInventoryPanel::postBuild() mInventory->addObserver(mInventoryObserver); // build view of inventory if we need default full hierarchy and inventory ready, otherwise wait for modelChanged() callback - if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mHasInventoryConnection) + if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mViewsInitialized) { - generateViews(); - mHasInventoryConnection = true; - defaultOpenInventory(); + initializeViews(); } if (mSortOrderSetting != INHERIT_SORT_ORDER) @@ -258,11 +256,9 @@ void LLInventoryPanel::modelChanged(U32 mask) bool handled = false; // inventory just initialized, do complete build - if ((mask & LLInventoryObserver::ADD) && mInventory->isInventoryUsable() && gInventory.getChangedIDs().empty() && !mHasInventoryConnection) + if ((mask & LLInventoryObserver::ADD) && mInventory->isInventoryUsable() && gInventory.getChangedIDs().empty() && !mViewsInitialized) { - generateViews(); - mHasInventoryConnection = true; - defaultOpenInventory(); + initializeViews(); return; } @@ -372,11 +368,10 @@ void LLInventoryPanel::modelChanged(U32 mask) } -void LLInventoryPanel::generateViews() +void LLInventoryPanel::initializeViews() { - - // Blow away the entire previous UI tree. - mFolders->getRoot()->destroyView(); + if (!gInventory.isInventoryUsable()) + return; // Determine the root folder in case specified, and // build the views starting with that folder. @@ -392,6 +387,9 @@ void LLInventoryPanel::generateViews() } llinfos << this << " Generating views for start folder " << mStartFolderString << llendl; rebuildViewsFor(mStartFolderID); + + mViewsInitialized = true; + defaultOpenInventory(); } void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) @@ -426,10 +424,6 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) return; } - if (objectp->getName() == "My Inventory") - { - llinfos << this << " Adding MyInventory for start folder " << mStartFolderString << llendl; - } if (objectp->getType() <= LLAssetType::AT_NONE || objectp->getType() >= LLAssetType::AT_COUNT) { |