summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-23 17:46:30 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-23 17:46:30 -0500
commit2b54c8a084a3f387d6f15b9d4f61d8cb68b434e0 (patch)
treebaea4cdf1fb4e1b1d10795225ce460ae1111acb0 /indra/newview/llinventorypanel.cpp
parentfc1860bcc6bab4b538692662db2da4be1def5af4 (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.cpp28
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)
{