summaryrefslogtreecommitdiff
path: root/indra/newview/llplacesinventorypanel.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2011-07-07 13:34:13 -0700
committerRichard Linden <none@none>2011-07-07 13:34:13 -0700
commit88a90aabcb5bdede24bb451d443239e1e116c4ea (patch)
tree9399a4aefc1a9017986e1c29f9c9077d6e3c74c7 /indra/newview/llplacesinventorypanel.cpp
parent66dcc72870b19c6ada65a643ca33c779c9c9989b (diff)
parent8f7579e4e46bb8da9fece3125ae31c3bb885be96 (diff)
Automated merge with http://hg.secondlife.com/viewer-development
Diffstat (limited to 'indra/newview/llplacesinventorypanel.cpp')
-rw-r--r--indra/newview/llplacesinventorypanel.cpp85
1 files changed, 29 insertions, 56 deletions
diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp
index 29e262199e..f7823f4fe8 100644
--- a/indra/newview/llplacesinventorypanel.cpp
+++ b/indra/newview/llplacesinventorypanel.cpp
@@ -35,6 +35,7 @@
#include "llinventoryfunctions.h"
#include "llpanellandmarks.h"
#include "llplacesinventorybridge.h"
+#include "llviewerfoldertype.h"
static LLDefaultChildRegistry::Register<LLPlacesInventoryPanel> r("places_inventory_panel");
@@ -56,72 +57,44 @@ LLPlacesInventoryPanel::~LLPlacesInventoryPanel()
delete mSavedFolderState;
}
-BOOL LLPlacesInventoryPanel::postBuild()
+void LLPlacesInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
{
- LLInventoryPanel::postBuild();
+ // 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);
- // clear Contents();
- {
- mFolderRoot->destroyView();
- mFolderRoot->getParent()->removeChild(mFolderRoot);
- mFolderRoot->die();
-
- if( mScroller )
- {
- removeChild( mScroller );
- mScroller->die();
- mScroller = NULL;
- }
- mFolderRoot = NULL;
- }
-
-
- mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves
+ LLUUID root_id;
- // create root folder
+ if ("LIBRARY" == params.start_folder())
{
- LLRect folder_rect(0,
- 0,
- getRect().getWidth(),
- 0);
- LLPlacesFolderView::Params p;
- p.name = getName();
- p.title = getLabel();
- p.rect = folder_rect;
- p.parent_panel = this;
- mFolderRoot = (LLFolderView*)LLUICtrlFactory::create<LLPlacesFolderView>(p);
- mFolderRoot->setAllowMultiSelect(mAllowMultiSelect);
+ root_id = gInventory.getLibraryRootFolderID();
}
-
- mCommitCallbackRegistrar.popScope();
-
- mFolderRoot->setCallbackRegistrar(&mCommitCallbackRegistrar);
-
- // scroller
+ else
{
- 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<LLScrollContainer>(p);
+ root_id = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null);
}
- addChild(mScroller);
- mScroller->addChild(mFolderRoot);
-
- mFolderRoot->setScrollContainer(mScroller);
- mFolderRoot->addChild(mFolderRoot->mStatusTextBox);
-
- // cut subitems
- mFolderRoot->setUseEllipses(true);
-
- return TRUE;
+ LLRect folder_rect(0,
+ 0,
+ getRect().getWidth(),
+ 0);
+ LLPlacesFolderView::Params p;
+ p.name = getName();
+ p.title = getLabel();
+ p.rect = folder_rect;
+ p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
+ LLAssetType::AT_CATEGORY,
+ LLInventoryType::IT_CATEGORY,
+ this,
+ NULL,
+ root_id);
+ p.parent_panel = this;
+ p.allow_multiselect = mAllowMultiSelect;
+ p.use_ellipses = true; // truncate inventory item text so remove horizontal scroller
+ mFolderRoot = (LLFolderView*)LLUICtrlFactory::create<LLPlacesFolderView>(p);
}
+
// save current folder open state
void LLPlacesInventoryPanel::saveFolderState()
{