diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index b9b6ea7444a1f6e18c51697c5213e0f4a7cbf013..1d8dfbbafa8f8cfbb8275084b9e4d88efc6c90a6 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -89,7 +89,8 @@ LLFolderViewItem::Params::Params()
 	selection_image("selection_image"),
 	item_height("item_height"),
 	item_top_pad("item_top_pad"),
-	creation_date()
+	creation_date(),
+	allow_open("allow_open", true)
 {}
 
 // Default constructor
@@ -112,7 +113,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
 	mLabel(p.name),
 	mRoot(p.root),
 	mViewModelItem(p.listener),
-	mIsMouseOverTitle(false)
+	mIsMouseOverTitle(false),
+	mAllowOpen(p.allow_open)
 {
 	if (mViewModelItem)
 	{
@@ -404,7 +406,10 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags)
 
 void LLFolderViewItem::openItem( void )
 {
-	getViewModelItem()->openItem();
+	if (mAllowOpen)
+	{
+		getViewModelItem()->openItem();
+	}
 }
 
 void LLFolderViewItem::rename(const std::string& new_name)
@@ -517,7 +522,7 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
 
 BOOL LLFolderViewItem::handleDoubleClick( S32 x, S32 y, MASK mask )
 {
-	getViewModelItem()->openItem();
+	openItem();
 	return TRUE;
 }
 
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index 50d3e0580e5071c1302e447a5871ab4a6a745209..df007dd15d9d70479eef8d259b910c4bb0dde484 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -61,6 +61,7 @@ class LLFolderViewItem : public LLView
 													item_top_pad;
 
 		Optional<time_t>							creation_date;
+		Optional<bool>								allow_open;
 
 		Params();
 	};
@@ -92,14 +93,11 @@ class LLFolderViewItem : public LLView
 	bool						mLabelWidthDirty;
 	LLFolderViewFolder*			mParentFolder;
 	LLFolderViewModelItem*		mViewModelItem;
-	BOOL						mIsCurSelection;
-	BOOL						mSelectPending;
 	LLFontGL::StyleFlags		mLabelStyle;
 	std::string					mLabelSuffix;
 	LLUIImagePtr				mIcon;
 	LLUIImagePtr				mIconOpen;
 	LLUIImagePtr				mIconOverlay;
-	BOOL						mHasVisibleChildren;
 	S32							mIndentation;
 	S32							mItemHeight;
 	S32							mDragStartX,
@@ -109,8 +107,12 @@ class LLFolderViewItem : public LLView
 	//std::string::size_type		mStringMatchOffset;
 	F32							mControlLabelRotation;
 	LLFolderView*				mRoot;
-	BOOL						mDragAndDropTarget;
+	bool						mHasVisibleChildren;
+	bool						mIsCurSelection;
+	bool						mDragAndDropTarget;
 	bool						mIsMouseOverTitle;
+	bool						mAllowOpen;
+	bool						mSelectPending;
 
 	// this is an internal method used for adding items to folders. A
 	// no-op at this level, but reimplemented in derived classes.
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index f64f33bc5e71fdbf042d508cf41bf6586ea1e4f1..91a6b3259c81b7e0874283614fc7e20a2a52b086 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -304,9 +304,4 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st
 	//LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &get_empty_param_block<T>);
 }
 
-//static 
-const std::string* LLUICtrlFactory::getWidgetName(const std::type_info* widget_type)
-{
-	return LLWidgetNameRegistry::instance().getValue(widget_type);
-}
 
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index b441cb0c9d7be2b33614d1c04a5f00460c7d7f4a..9f18be237173b4a165852d3da3e28f40bdb94eb0 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -105,7 +105,7 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
 		ParamDefaults()
 		{
 			// look up template file for this param block...
-			const std::string* param_block_tag = getWidgetName(&typeid(PARAM_BLOCK));
+			const std::string* param_block_tag = LLWidgetNameRegistry::instance().getValue(&typeid(PARAM_BLOCK));
 			if (param_block_tag)
 			{	// ...and if it exists, back fill values using the most specific template first
 				PARAM_BLOCK params;
@@ -139,7 +139,6 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
 	template<typename T>
 	static const typename T::Params& getDefaultParams()
 	{
-		//#pragma message("Generating ParamDefaults")
 		return ParamDefaults<typename T::Params, 0>::instance().get();
 	}
 
@@ -303,8 +302,6 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
 	}
 
 
-	static const std::string* getWidgetName(const std::type_info* widget_type);
-
 	// this exists to get around dependency on llview
 	static void setCtrlParent(LLView* view, LLView* parent, S32 tab_group);
 
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index b71f13a45003bc454b3044146f3afeca25d34f5b..626fb8caa54e84bebaec8d2a7a4bd3a03244794c 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -383,7 +383,6 @@ set(viewer_SOURCE_FILES
     llpanelmaininventory.cpp
     llpanelmarketplaceinbox.cpp
     llpanelmarketplaceinboxinventory.cpp
-    llpanelmarketplaceoutboxinventory.cpp
     llpanelmediasettingsgeneral.cpp
     llpanelmediasettingspermissions.cpp
     llpanelmediasettingssecurity.cpp
@@ -942,7 +941,6 @@ set(viewer_HEADER_FILES
     llpanelmaininventory.h
     llpanelmarketplaceinbox.h
     llpanelmarketplaceinboxinventory.h
-    llpanelmarketplaceoutboxinventory.h
     llpanelmediasettingsgeneral.h
     llpanelmediasettingspermissions.h
     llpanelmediasettingssecurity.h
diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp
index e2417cdddb3528d17d68897dae5e8f547744e366..e31e39dca2ed8c6d79cce5a425964fa505aafd28 100644
--- a/indra/newview/llagentwearablesfetch.cpp
+++ b/indra/newview/llagentwearablesfetch.cpp
@@ -342,7 +342,7 @@ void LLLibraryOutfitsFetch::folderDone()
 	}
 
 	mClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING);
-	mLibraryClothingID = gInventory.findCategoryUUIDForType(LLFolderType::FT_CLOTHING, false, true);
+	mLibraryClothingID = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_CLOTHING, false);
 
 	// If Library->Clothing->Initial Outfits exists, use that.
 	LLNameCategoryCollector matchFolderFunctor("Initial Outfits");
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 6d67e098a615d48556304671f1777eb6687c867c..510abf198a590db1acb27f6a47690898273c7f7f 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2330,7 +2330,7 @@ void LLAppearanceMgr::copyLibraryGestures()
 
 	// Copy gestures
 	LLUUID lib_gesture_cat_id =
-		gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE,false,true);
+		gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_GESTURE,false);
 	if (lib_gesture_cat_id.isNull())
 	{
 		llwarns << "Unable to copy gestures, source category not found" << llendl;
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 04a55b261ccdaa1e6e67980b3c402c6895edf0e2..e4ed97892e19292ad2af3ca69fac7edd7085371d 100644
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -174,9 +174,8 @@ void LLFloaterOutbox::onOpen(const LLSD& key)
 	if (mOutboxId.isNull())
 	{
 		const bool do_not_create_folder = false;
-		const bool do_not_find_in_library = false;
 		
-		const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library);
+		const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder);
 		
 		if (outbox_id.isNull())
 		{
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 9f1d4bdec967706c0c6ac73aa3cab73935e23745..14616ca7ab37e3408025cff8f6db87b887d2ba38 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -955,7 +955,7 @@ BOOL LLInvFVBridge::isCOFFolder() const
 
 BOOL LLInvFVBridge::isInboxFolder() const
 {
-	const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false);
+	const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false);
 	
 	if (inbox_id.isNull())
 	{
@@ -995,7 +995,7 @@ BOOL LLInvFVBridge::isOutboxFolderDirectParent() const
 
 const LLUUID LLInvFVBridge::getOutboxFolder() const
 {
-	const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+	const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
 
 	return outbox_id;
 }
@@ -1330,7 +1330,7 @@ LLToolDragAndDrop::ESource LLInvFVBridge::getDragSource() const
 // +=================================================+
 // |        InventoryFVBridgeBuilder                 |
 // +=================================================+
-LLInvFVBridge* LLInventoryFVBridgeBuilder::createBridge(LLAssetType::EType asset_type,
+LLInvFVBridge* LLInventoryFolderViewModelBuilder::createBridge(LLAssetType::EType asset_type,
 														LLAssetType::EType actual_asset_type,
 														LLInventoryType::EType inv_type,
 														LLInventoryPanel* inventory,
@@ -1438,7 +1438,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
 		LLInventoryItem* itemp = model->getItem(mUUID);
 		if (!itemp) return;
 
-		const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+		const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
 		copy_item_to_outbox(itemp, outbox_id, LLUUID::null, LLToolDragAndDrop::getOperationId());
 	}
 }
@@ -2469,7 +2469,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
 			}
 			else
 			{
-				if (model->isObjectDescendentOf(cat_id, model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
+				if (model->isObjectDescendentOf(cat_id, model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false)))
 				{
 					set_dad_inbox_object(cat_id);
 				}
@@ -2909,7 +2909,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
 		LLInventoryCategory * cat = gInventory.getCategory(mUUID);
 		if (!cat) return;
 
-		const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+		const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
 		copy_folder_to_outbox(cat, outbox_id, cat->getUUID(), LLToolDragAndDrop::getOperationId());
 	}
 #if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU
@@ -4068,7 +4068,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
 			else
 			{
 				// set up observer to select item once drag and drop from inbox is complete 
-				if (gInventory.isObjectDescendentOf(inv_item->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false)))
+				if (gInventory.isObjectDescendentOf(inv_item->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false)))
 				{
 					set_dad_inbox_object(inv_item->getUUID());
 				}
@@ -6487,7 +6487,7 @@ LLInvFVBridge* LLRecentInventoryBridgeBuilder::createBridge(
 	}
 	else
 	{
-		new_listener = LLInventoryFVBridgeBuilder::createBridge(asset_type,
+		new_listener = LLInventoryFolderViewModelBuilder::createBridge(asset_type,
 																actual_asset_type,
 																inv_type,
 																inventory,
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 9997d1720f0a218f8c85bb65acc6e97b501afe8f..fc0b15acad880d9f1ce59a4cf6c272c40d1446ea 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -185,15 +185,15 @@ class LLInvFVBridge : public LLFolderViewModelItemInventory
 };
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLInvFVBridgeBuilder
+// Class LLInventoryFolderViewModelBuilder
 //
-// This class intended to build Folder View Bridge via LLInvFVBridge::createBridge.
-// It can be overridden with another way of creation necessary Inventory-Folder-View-Bridge.
+// This class intended to build Folder View Model via LLInvFVBridge::createBridge.
+// It can be overridden with another way of creation necessary Inventory Folder View Models.
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLInventoryFVBridgeBuilder
+class LLInventoryFolderViewModelBuilder
 {
 public:
- 	virtual ~LLInventoryFVBridgeBuilder() {}
+ 	virtual ~LLInventoryFolderViewModelBuilder() {}
 	virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type,
 										LLAssetType::EType actual_asset_type,
 										LLInventoryType::EType inv_type,
@@ -637,7 +637,7 @@ class LLRecentItemsFolderBridge : public LLFolderBridge
 };
 
 // Bridge builder to create Inventory-Folder-View-Bridge for Recent Inventory Panel
-class LLRecentInventoryBridgeBuilder : public LLInventoryFVBridgeBuilder
+class LLRecentInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder
 {
 public:
 	// Overrides FolderBridge for Recent Inventory Panel.
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 5cb7f53bfa5c7c096a5e3888de338d619700b40e..0673970d89c5a06a928ad5318bf3716e4cc13ad7 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -373,13 +373,12 @@ void LLInventoryModel::unlockDirectDescendentArrays(const LLUUID& cat_id)
 // specifies 'type' as what it defaults to containing. The category is
 // not necessarily only for that type. *NOTE: This will create a new
 // inventory category on the fly if one does not exist.
-const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, 
-													   bool create_folder, 
-													   bool find_in_library)
+const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder/*, 
+					  bool find_in_library*/)
 {
 	LLUUID rv = LLUUID::null;
 	
-	const LLUUID &root_id = (find_in_library) ? gInventory.getLibraryRootFolderID() : gInventory.getRootFolderID();
+	const LLUUID &root_id = /*(find_in_library) ? gInventory.getLibraryRootFolderID() :*/ gInventory.getRootFolderID();
 	if(LLFolderType::FT_ROOT_INVENTORY == preferred_type)
 	{
 		rv = root_id;
@@ -402,7 +401,44 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe
 		}
 	}
 	
-	if(rv.isNull() && isInventoryUsable() && (create_folder && !find_in_library))
+	if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/))
+	{
+		if(root_id.notNull())
+		{
+			return createNewCategory(root_id, preferred_type, LLStringUtil::null);
+		}
+	}
+	return rv;
+}
+
+const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder)
+{
+	LLUUID rv = LLUUID::null;
+
+	const LLUUID &root_id = gInventory.getLibraryRootFolderID();
+	if(LLFolderType::FT_ROOT_INVENTORY == preferred_type)
+	{
+		rv = root_id;
+	}
+	else if (root_id.notNull())
+	{
+		cat_array_t* cats = NULL;
+		cats = get_ptr_in_map(mParentChildCategoryTree, root_id);
+		if(cats)
+		{
+			S32 count = cats->count();
+			for(S32 i = 0; i < count; ++i)
+			{
+				if(cats->get(i)->getPreferredType() == preferred_type)
+				{
+					rv = cats->get(i)->getUUID();
+					break;
+				}
+			}
+		}
+	}
+
+	if(rv.isNull() && isInventoryUsable() && (create_folder && true/*!find_in_library*/))
 	{
 		if(root_id.notNull())
 		{
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 3613bc49173c488566f2075611fa02cc17a660cf..503de627a0b8689e562b5d36fb7463c98405f85e 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -231,11 +231,12 @@ class LLInventoryModel
 	// Returns the uuid of the category that specifies 'type' as what it 
 	// defaults to containing. The category is not necessarily only for that type. 
 	//    NOTE: If create_folder is true, this will create a new inventory category 
-	//    on the fly if one does not exist. *NOTE: if find_in_library is true it 
-	//    will search in the user's library folder instead of "My Inventory"
+	//    on the fly if one does not exist. 
 	const LLUUID findCategoryUUIDForType(LLFolderType::EType preferred_type, 
-										 bool create_folder = true, 
-										 bool find_in_library = false);
+										 bool create_folder = true);
+	//    will search in the user's library folder instead of "My Inventory"
+	const LLUUID findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, 
+												bool create_folder = true);
 	
 	// Get whatever special folder this object is a child of, if any.
 	const LLViewerInventoryCategory *getFirstNondefaultParent(const LLUUID& obj_id) const;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index be1cd2510da42fe5e5969b259f7cb319e35ee284..e9b128e8367e4012384404e8a23e1fbdb5029bb0 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -55,7 +55,7 @@ static LLDefaultChildRegistry::Register<LLInventoryPanel> r("inventory_panel");
 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;
+static const LLInventoryFolderViewModelBuilder INVENTORY_BRIDGE_BUILDER;
 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // Class LLInventoryPanelObserver
@@ -140,7 +140,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
 {
 	mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER;
 
-	// contex menu callbacks
+	// context menu callbacks
 	mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLInventoryPanel::doToSelected, this, _2));
 	mCommitCallbackRegistrar.add("Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH));
 	mCommitCallbackRegistrar.add("Inventory.EmptyLostAndFound", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyLostAndFound", LLFolderType::FT_LOST_AND_FOUND));
@@ -151,71 +151,60 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
 
 }
 
-void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
-{
-	// Determine the root folder in case specified, and
-	// build the views starting with that folder.
-	
-	std::string start_folder_name(params.start_folder());
-	
-	const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(start_folder_name);
-
-	LLUUID root_id;
-
-	if ("LIBRARY" == params.start_folder())
-	{
-		root_id = gInventory.getLibraryRootFolderID();
-	}
-	else
-	{
-		root_id = (preferred_type != LLFolderType::FT_NONE)
-				? 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();
-	}
-	
-	LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
-																	LLAssetType::AT_CATEGORY,
-																	LLInventoryType::IT_CATEGORY,
-																	this,
-																	&mInventoryViewModel,
-																	NULL,
-																	root_id);
-	
-	mFolderRoot = createFolderView(new_listener, params.use_label_suffix());
-	addItemID(root_id, mFolderRoot);
-}
 
 void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
 {
+	// save off copy of params
+	mParams = params;
 	// Clear up the root view
 	// Note: This needs to be done *before* we build the new folder view 
-	LLFolderViewItem* root_view = getItemByID(gInventory.getRootFolderID());
-	if (root_view)
+	LLUUID root_id = getRootFolderID();
+	if (mFolderRoot)
 	{
-		removeItemID(static_cast<LLFolderViewModelItemInventory*>(root_view->getViewModelItem())->getUUID());
-		root_view->destroyView();
+		removeItemID(root_id);
+		mFolderRoot->destroyView();
+		mFolderRoot = NULL;
 	}
 
 	LLMemType mt(LLMemType::MTYPE_INVENTORY_POST_BUILD);
-
-	mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves
 	
-	buildFolderView(params);
-
+	mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves
+	{
+		// Determine the root folder in case specified, and
+		// build the views starting with that folder.
+
+
+		LLFolderView::Params p(mParams.folder_view);
+		p.name = getName();
+		p.title = getLabel();
+		p.rect = LLRect(0, 0, getRect().getWidth(), 0);
+		p.parent_panel = this;
+		p.tool_tip = p.name;
+		p.listener = mInvFVBridgeBuilder->createBridge(	LLAssetType::AT_CATEGORY,
+														LLAssetType::AT_CATEGORY,
+														LLInventoryType::IT_CATEGORY,
+														this,
+														&mInventoryViewModel,
+														NULL,
+														root_id);
+		p.view_model = &mInventoryViewModel;
+		p.use_label_suffix = mParams.use_label_suffix;
+		p.allow_multiselect = mAllowMultiSelect;
+		p.show_empty_message = mShowEmptyMessage;
+		p.show_item_link_overlays = mShowItemLinkOverlays;
+		p.root = NULL;
+
+		mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p);
+		
+		addItemID(root_id, mFolderRoot);
+	} 	
 	mCommitCallbackRegistrar.popScope();
-	
 	mFolderRoot->setCallbackRegistrar(&mCommitCallbackRegistrar);
 	
 	// Scroller
 	LLRect scroller_view_rect = getRect();
 	scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom);
-	LLScrollContainer::Params scroller_params(params.scroll());
+	LLScrollContainer::Params scroller_params(mParams.scroll());
 	scroller_params.rect(scroller_view_rect);
 	mScroller = LLUICtrlFactory::create<LLFolderViewScrollContainer>(scroller_params);
 	addChild(mScroller);
@@ -263,7 +252,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
 	mClipboardState = LLClipboard::instance().getGeneration();
 	
 	// Initialize base class params.
-	LLPanel::initFromParams(params);
+	LLPanel::initFromParams(mParams);
 }
 
 LLInventoryPanel::~LLInventoryPanel()
@@ -562,7 +551,40 @@ LLFolderView* LLInventoryPanel::getRootFolder()
 
 LLUUID LLInventoryPanel::getRootFolderID()
 {
-	return static_cast<LLFolderViewModelItemInventory*>(mFolderRoot->getViewModelItem())->getUUID();
+	if (mFolderRoot && mFolderRoot->getViewModelItem())
+	{
+		return static_cast<LLFolderViewModelItemInventory*>(mFolderRoot->getViewModelItem())->getUUID();
+
+	}
+	else
+	{
+		LLUUID root_id;
+		if (mParams.start_folder.id.isChosen())
+		{
+			root_id = mParams.start_folder.id;
+		}
+		else
+		{
+			const LLFolderType::EType preferred_type = mParams.start_folder.type.isChosen() 
+				? mParams.start_folder.type
+				: LLViewerFolderType::lookupTypeFromNewCategoryName(mParams.start_folder.name);
+
+			if ("LIBRARY" == mParams.start_folder.name())
+			{
+				root_id = gInventory.getLibraryRootFolderID();
+			}
+			else if (preferred_type != LLFolderType::FT_NONE)
+			{
+				root_id = gInventory.findCategoryUUIDForType(preferred_type, false);
+				if (root_id.isNull())
+				{
+					llwarns << "Could not find folder of type " << preferred_type << llendl;
+					root_id.generateNewID();
+				}
+			}
+		}
+		return root_id;
+	}
 }
 
 
@@ -612,7 +634,16 @@ void LLInventoryPanel::initializeViews()
 {
 	if (!gInventory.isInventoryUsable()) return;
 
-	buildNewViews(gInventory.getRootFolderID());
+	LLUUID root_id = getRootFolderID();
+	if (root_id.notNull())
+	{
+		buildNewViews(getRootFolderID());
+	}
+	else
+	{
+		buildNewViews(gInventory.getRootFolderID());
+		buildNewViews(gInventory.getLibraryRootFolderID());
+	}
 
 	gIdleCallbacks.addFunction(idle, this);
 
@@ -639,34 +670,10 @@ void LLInventoryPanel::initializeViews()
 	}
 }
 
-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.view_model = &mInventoryViewModel;
-	p.use_label_suffix = useLabelSuffix;
-	p.allow_multiselect = mAllowMultiSelect;
-	p.show_empty_message = mShowEmptyMessage;
-	p.show_item_link_overlays = mShowItemLinkOverlays;
-	p.root = NULL;
-
-	return LLUICtrlFactory::create<LLFolderView>(p);
-}
 
 LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge)
 {
-	LLFolderViewFolder::Params params;
+	LLFolderViewFolder::Params params(mParams.folder);
 
 	params.name = bridge->getDisplayName();
 	params.root = mFolderRoot;
@@ -678,7 +685,7 @@ LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * br
 
 LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
 {
-	LLFolderViewItem::Params params;
+	LLFolderViewItem::Params params(mParams.item);
 	
 	params.name = bridge->getDisplayName();
 	params.creation_date = bridge->getCreationDate();
@@ -1329,3 +1336,34 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params)
 	mInvFVBridgeBuilder = &RECENT_ITEMS_BUILDER;
 }
 
+namespace LLInitParam
+{
+	void TypeValues<LLFolderType::EType>::declareValues()
+	{
+		declare(LLFolderType::lookup(LLFolderType::FT_TEXTURE)          , LLFolderType::FT_TEXTURE);
+		declare(LLFolderType::lookup(LLFolderType::FT_SOUND)            , LLFolderType::FT_SOUND);
+		declare(LLFolderType::lookup(LLFolderType::FT_CALLINGCARD)      , LLFolderType::FT_CALLINGCARD);
+		declare(LLFolderType::lookup(LLFolderType::FT_LANDMARK)         , LLFolderType::FT_LANDMARK);
+		declare(LLFolderType::lookup(LLFolderType::FT_CLOTHING)         , LLFolderType::FT_CLOTHING);
+		declare(LLFolderType::lookup(LLFolderType::FT_OBJECT)           , LLFolderType::FT_OBJECT);
+		declare(LLFolderType::lookup(LLFolderType::FT_NOTECARD)         , LLFolderType::FT_NOTECARD);
+		declare(LLFolderType::lookup(LLFolderType::FT_ROOT_INVENTORY)   , LLFolderType::FT_ROOT_INVENTORY);
+		declare(LLFolderType::lookup(LLFolderType::FT_LSL_TEXT)         , LLFolderType::FT_LSL_TEXT);
+		declare(LLFolderType::lookup(LLFolderType::FT_BODYPART)         , LLFolderType::FT_BODYPART);
+		declare(LLFolderType::lookup(LLFolderType::FT_TRASH)            , LLFolderType::FT_TRASH);
+		declare(LLFolderType::lookup(LLFolderType::FT_SNAPSHOT_CATEGORY), LLFolderType::FT_SNAPSHOT_CATEGORY);
+		declare(LLFolderType::lookup(LLFolderType::FT_LOST_AND_FOUND)   , LLFolderType::FT_LOST_AND_FOUND);
+		declare(LLFolderType::lookup(LLFolderType::FT_ANIMATION)        , LLFolderType::FT_ANIMATION);
+		declare(LLFolderType::lookup(LLFolderType::FT_GESTURE)          , LLFolderType::FT_GESTURE);
+		declare(LLFolderType::lookup(LLFolderType::FT_FAVORITE)         , LLFolderType::FT_FAVORITE);
+		declare(LLFolderType::lookup(LLFolderType::FT_ENSEMBLE_START)   , LLFolderType::FT_ENSEMBLE_START);
+		declare(LLFolderType::lookup(LLFolderType::FT_ENSEMBLE_END)     , LLFolderType::FT_ENSEMBLE_END);
+		declare(LLFolderType::lookup(LLFolderType::FT_CURRENT_OUTFIT)   , LLFolderType::FT_CURRENT_OUTFIT);
+		declare(LLFolderType::lookup(LLFolderType::FT_OUTFIT)           , LLFolderType::FT_OUTFIT);
+		declare(LLFolderType::lookup(LLFolderType::FT_MY_OUTFITS)       , LLFolderType::FT_MY_OUTFITS);
+		declare(LLFolderType::lookup(LLFolderType::FT_MESH )            , LLFolderType::FT_MESH );
+		declare(LLFolderType::lookup(LLFolderType::FT_INBOX)            , LLFolderType::FT_INBOX);
+		declare(LLFolderType::lookup(LLFolderType::FT_OUTBOX)           , LLFolderType::FT_OUTBOX);
+		declare(LLFolderType::lookup(LLFolderType::FT_BASIC_ROOT)       , LLFolderType::FT_BASIC_ROOT);
+	}
+}
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 910325cdbc33bfaa7a1d1a9e1aa8dae75ebad725..b66b53f642df44fc23aeb4f34ea39457125086a2 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -41,10 +41,19 @@
 #include <set>
 
 class LLInvFVBridge;
-class LLInventoryFVBridgeBuilder;
+class LLInventoryFolderViewModelBuilder;
 class LLInvPanelComplObserver;
 class LLFolderViewModelInventory;
 
+namespace LLInitParam
+{
+	template<>
+	struct TypeValues<LLFolderType::EType> : public TypeValuesHelper<LLFolderType::EType>
+	{
+		static void declareValues();
+	};
+}
+
 class LLInventoryPanel : public LLPanel
 {
 	//--------------------------------------------------------------------
@@ -64,6 +73,19 @@ class LLInventoryPanel : public LLPanel
 		{}
 	};
 
+	struct StartFolder : public LLInitParam::ChoiceBlock<StartFolder>
+	{
+		Alternative<std::string>			name;
+		Alternative<LLUUID>					id;
+		Alternative<LLFolderType::EType>	type;
+
+		StartFolder()
+		:	name("name"), 
+			id("id"),
+			type("type")
+		{}
+	};
+
 	struct Params 
 	:	public LLInitParam::Block<Params, LLPanel::Params>
 	{
@@ -72,11 +94,14 @@ class LLInventoryPanel : public LLPanel
 		Optional<bool>						allow_multi_select;
 		Optional<bool>						show_item_link_overlays;
 		Optional<Filter>					filter;
-		Optional<std::string>               start_folder;
+		Optional<StartFolder>               start_folder;
 		Optional<bool>						use_label_suffix;
 		Optional<bool>						show_empty_message;
 		Optional<LLScrollContainer::Params>	scroll;
 		Optional<bool>						accepts_drag_and_drop;
+		Optional<LLFolderView::Params>		folder_view;
+		Optional<LLFolderViewFolder::Params> folder;
+		Optional<LLFolderViewItem::Params>	 item;
 
 		Params()
 		:	sort_order_setting("sort_order_setting"),
@@ -88,7 +113,10 @@ class LLInventoryPanel : public LLPanel
 			use_label_suffix("use_label_suffix", true),
 			show_empty_message("show_empty_message", true),
 			scroll("scroll"),
-			accepts_drag_and_drop("accepts_drag_and_drop")
+			accepts_drag_and_drop("accepts_drag_and_drop"),
+			folder_view("folder_view"),
+			folder("folder"),
+			item("item")
 		{}
 	};
 
@@ -98,6 +126,7 @@ class LLInventoryPanel : public LLPanel
 protected:
 	LLInventoryPanel(const Params&);
 	void initFromParams(const Params&);
+
 	friend class LLUICtrlFactory;
 public:
 	virtual ~LLInventoryPanel();
@@ -187,29 +216,30 @@ class LLInventoryPanel : public LLPanel
 	void openStartFolderOrMyInventory(); // open the first level of inventory
 	void onItemsCompletion();			// called when selected items are complete
 
-        LLUUID						mSelectThisID;	
+    LLUUID						mSelectThisID;	
 	LLInventoryModel*			mInventory;
 	LLInventoryObserver*		mInventoryObserver;
 	LLInvPanelComplObserver*	mCompletionObserver;
-	BOOL						mAcceptsDragAndDrop;
-	BOOL 						mAllowMultiSelect;
-	BOOL 						mShowItemLinkOverlays; // Shows link graphic over inventory item icons
-	BOOL						mShowEmptyMessage;
+	bool						mAcceptsDragAndDrop;
+	bool 						mAllowMultiSelect;
+	bool 						mShowItemLinkOverlays; // Shows link graphic over inventory item icons
+	bool						mShowEmptyMessage;
 
 	LLFolderView*				mFolderRoot;
 	LLScrollContainer*			mScroller;
 
 	LLFolderViewModelInventory	mInventoryViewModel;
+	Params						mParams;	// stored copy of parameter block
 
 	std::map<LLUUID, LLFolderViewItem*> mItemMap;
 	/**
-	 * Pointer to LLInventoryFVBridgeBuilder.
+	 * Pointer to LLInventoryFolderViewModelBuilder.
 	 *
 	 * It is set in LLInventoryPanel's constructor and can be overridden in derived classes with 
 	 * another implementation.
 	 * Take into account it will not be deleted by LLInventoryPanel itself.
 	 */
-	const LLInventoryFVBridgeBuilder* mInvFVBridgeBuilder;
+	const LLInventoryFolderViewModelBuilder* mInvFVBridgeBuilder;
 
 
 	//--------------------------------------------------------------------
@@ -239,19 +269,14 @@ class LLInventoryPanel : public LLPanel
 	// Builds the UI.  Call this once the inventory is usable.
 	void 				initializeViews();
 
-	virtual void		buildFolderView(const LLInventoryPanel::Params& params);
 	LLFolderViewItem*	buildNewViews(const LLUUID& id);
 	BOOL				getIsHiddenFolderType(LLFolderType::EType folder_type) const;
 	
-	virtual LLFolderView*		createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix);
 	virtual LLFolderViewFolder*	createFolderViewFolder(LLInvFVBridge * bridge);
 	virtual LLFolderViewItem*	createFolderViewItem(LLInvFVBridge * bridge);
 private:
-	BOOL				mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild()
-	BOOL				mViewsInitialized; // Views have been generated
-	// UUID of category from which hierarchy should be built.  Set with the 
-	// "start_folder" xml property.  Default is LLUUID::null that means total Inventory hierarchy. 
-	LLUUID				mStartFolderID;
+	bool				mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild()
+	bool				mViewsInitialized; // Views have been generated
 };
 
 #endif // LL_LLINVENTORYPANEL_H
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 4bbab52e5a28b3f354a17876dc91ab1a4ca31b5a..1a4f3708ac5a9c8d05d378ef1edf82ba8c44471a 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -177,7 +177,7 @@ void LLLandmarksPanelObserver::changed(U32 mask)
 	if (!mIsLibraryLandmarksOpen && library)
 	{
 		// Search for "Landmarks" folder in the Library and open it once on start up. See EXT-4827.
-		const LLUUID &landmarks_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false, true);
+		const LLUUID &landmarks_cat = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
 		if (landmarks_cat.notNull())
 		{
 			LLOpenFolderByID opener(landmarks_cat);
@@ -306,8 +306,7 @@ bool LLLandmarksPanel::isSingleItemSelected()
 
 	if (mCurrentSelectedList != NULL)
 	{
-		LLPlacesFolderView* root_view =
-				static_cast<LLPlacesFolderView*>(mCurrentSelectedList->getRootFolder());
+		LLFolderView* root_view = mCurrentSelectedList->getRootFolder();
 
 		if (root_view->getSelectedCount() == 1)
 		{
@@ -588,7 +587,7 @@ void LLLandmarksPanel::initLibraryInventoryPanel()
 	initLandmarksPanel(mLibraryInventoryPanel);
 
 	// We want to fetch only "Landmarks" category from the library.
-	const LLUUID &landmarks_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false, true);
+	const LLUUID &landmarks_cat = gInventory.findLibraryCategoryUUIDForType(LLFolderType::FT_LANDMARK, false);
 	if (landmarks_cat.notNull())
 	{
 		LLInventoryModelBackgroundFetch::instance().start(landmarks_cat);
@@ -918,8 +917,9 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
 {
 	std::string command_name = userdata.asString();
 
-	LLPlacesFolderView* root_folder_view = mCurrentSelectedList ?
-		static_cast<LLPlacesFolderView*>(mCurrentSelectedList->getRootFolder()) : NULL;
+	LLFolderView* root_folder_view = mCurrentSelectedList 
+		? mCurrentSelectedList->getRootFolder() 
+		: NULL;
 
 	if ("collapse_all" == command_name)
 	{
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp
index 6e5a52229784aee3381afe2fa5fb95882ce052b1..8ad39299997a5e282bba60a829a6b2f7edf66343 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.cpp
+++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp
@@ -54,69 +54,11 @@ static LLDefaultChildRegistry::Register<LLInboxFolderViewItem> r3("inbox_folder_
 //
 
 LLInboxInventoryPanel::LLInboxInventoryPanel(const LLInboxInventoryPanel::Params& p)
-	: LLInventoryPanel(p)
-{
-}
+:	LLInventoryPanel(p)
+{}
 
 LLInboxInventoryPanel::~LLInboxInventoryPanel()
-{
-}
-
-// virtual
-void LLInboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
-{
-	// Determine the root folder in case specified, and
-	// build the views starting with that folder.
-	
-	LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false);
-	
-	// leslie -- temporary HACK to work around sim not creating inbox with proper system folder type
-	if (root_id.isNull())
-	{
-		std::string start_folder_name(params.start_folder());
-		
-		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() == start_folder_name)
-				{
-					root_id = cat->getUUID();
-					break;
-				}
-			}
-		}
-		
-		if (root_id == LLUUID::null)
-		{
-			llwarns << "No category found that matches inbox inventory panel start_folder: " << start_folder_name << llendl;
-		}
-	}
-	// leslie -- end temporary HACK
-	
-	if (root_id == LLUUID::null)
-	{
-		llwarns << "Inbox inventory panel has no root folder!" << llendl;
-		root_id = LLUUID::generateNewID();
-	}
-	
-	LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
-																	LLAssetType::AT_CATEGORY,
-																	LLInventoryType::IT_CATEGORY,
-																	this,
-																	&mInventoryViewModel,
-																	NULL,
-																	root_id);
-	
-	mFolderRoot = createFolderView(new_listener, params.use_label_suffix());
-}
+{}
 
 LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge)
 {
@@ -149,9 +91,9 @@ LLFolderViewItem * LLInboxInventoryPanel::createFolderViewItem(LLInvFVBridge * b
 //
 
 LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p)
-	: LLFolderViewFolder(p)
-	, LLBadgeOwner(getHandle())
-	, mFresh(false)
+:	LLFolderViewFolder(p),
+	LLBadgeOwner(getHandle()),
+	mFresh(false)
 {
 #if SUPPORTING_FRESH_ITEM_COUNT
 	initBadgeParams(p.new_badge());
diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h
index 209f3a40986f33cdb4156cd7e0effa2b130a5802..d8b8a2fe6302d20c28f74b6d62cb1e209748def6 100644
--- a/indra/newview/llpanelmarketplaceinboxinventory.h
+++ b/indra/newview/llpanelmarketplaceinboxinventory.h
@@ -46,9 +46,6 @@ class LLInboxInventoryPanel : public LLInventoryPanel
 	LLInboxInventoryPanel(const Params& p);
 	~LLInboxInventoryPanel();
 
-	// virtual
-	void buildFolderView(const LLInventoryPanel::Params& params);
-
 	// virtual
 	LLFolderViewFolder * createFolderViewFolder(LLInvFVBridge * bridge);
 	LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);
@@ -63,9 +60,8 @@ class LLInboxFolderViewFolder : public LLFolderViewFolder, public LLBadgeOwner
 		Optional<LLBadge::Params>	new_badge;
 		
 		Params()
-		: new_badge("new_badge")
-		{
-		}
+		:	new_badge("new_badge")
+		{}
 	};
 	
 	LLInboxFolderViewFolder(const Params& p);
@@ -93,9 +89,8 @@ class LLInboxFolderViewItem : public LLFolderViewItem, public LLBadgeOwner
 		Optional<LLBadge::Params>	new_badge;
 
 		Params()
-			: new_badge("new_badge")
-		{
-		}
+		:	new_badge("new_badge")
+		{}
 	};
 
 	LLInboxFolderViewItem(const Params& p);
diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.cpp b/indra/newview/llpanelmarketplaceoutboxinventory.cpp
deleted file mode 100644
index 2885dd62660e02a9300abdbc3cb11a3e9d35853e..0000000000000000000000000000000000000000
--- a/indra/newview/llpanelmarketplaceoutboxinventory.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/** 
- * @file llpanelmarketplaceoutboxinventory.cpp
- * @brief LLOutboxInventoryPanel  class definition
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llpanelmarketplaceoutboxinventory.h"
-
-#include "llfolderviewitem.h"
-#include "llfolderviewmodel.h"
-#include "llinventorybridge.h"
-#include "llinventoryfunctions.h"
-#include "llpanellandmarks.h"
-#include "llplacesinventorybridge.h"
-#include "lltrans.h"
-#include "llviewerfoldertype.h"
-
-
-//
-// statics
-//
-
-static LLDefaultChildRegistry::Register<LLOutboxInventoryPanel> r1("outbox_inventory_panel");
-static LLDefaultChildRegistry::Register<LLOutboxFolderViewFolder> r2("outbox_folder_view_folder");
-
-
-//
-// LLOutboxInventoryPanel Implementation
-//
-
-LLOutboxInventoryPanel::LLOutboxInventoryPanel(const LLOutboxInventoryPanel::Params& p)
-	: LLInventoryPanel(p)
-{
-}
-
-LLOutboxInventoryPanel::~LLOutboxInventoryPanel()
-{
-}
-
-// virtual
-void LLOutboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
-{
-	// Determine the root folder in case specified, and
-	// build the views starting with that folder.
-	
-	LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
-	
-	if (root_id == LLUUID::null)
-	{
-		llwarns << "Outbox inventory panel has no root folder!" << llendl;
-		root_id = LLUUID::generateNewID();
-	}
-	
-	LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY,
-																	LLAssetType::AT_CATEGORY,
-																	LLInventoryType::IT_CATEGORY,
-																	this,
-																	&mInventoryViewModel,
-																	NULL,
-																	root_id);
-	
-	mFolderRoot = createFolderView(new_listener, params.use_label_suffix());
-}
-
-LLFolderViewFolder * LLOutboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge)
-{
-	LLOutboxFolderViewFolder::Params params;
-	
-	params.name = bridge->getDisplayName();
-	params.root = mFolderRoot;
-	params.listener = bridge;
-	params.tool_tip = params.name;
-	
-	return LLUICtrlFactory::create<LLOutboxFolderViewFolder>(params);
-}
-
-LLFolderViewItem * LLOutboxInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge)
-{
-	LLFolderViewItem::Params params;
-
-	params.name = bridge->getDisplayName();
-	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<LLOutboxFolderViewItem>(params);
-}
-
-//
-// LLOutboxFolderViewFolder Implementation
-//
-
-LLOutboxFolderViewFolder::LLOutboxFolderViewFolder(const Params& p)
-	: LLFolderViewFolder(p)
-{
-}
-
-//
-// LLOutboxFolderViewItem Implementation
-//
-
-LLOutboxFolderViewItem::LLOutboxFolderViewItem(const Params& p)
-	: LLFolderViewItem(p)
-{
-}
-
-BOOL LLOutboxFolderViewItem::handleDoubleClick(S32 x, S32 y, MASK mask)
-{
-	return TRUE;
-}
-
-void LLOutboxFolderViewItem::openItem()
-{
-	// Intentionally do nothing to block attaching items from the outbox
-}
-
-// eof
diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.h b/indra/newview/llpanelmarketplaceoutboxinventory.h
deleted file mode 100644
index a6c522b7c235401e411655856e1fa7a05a0c67e6..0000000000000000000000000000000000000000
--- a/indra/newview/llpanelmarketplaceoutboxinventory.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/** 
- * @file llpanelmarketplaceoutboxinventory.h
- * @brief LLOutboxInventoryPanel class declaration
- *
- * $LicenseInfo:firstyear=2009&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_OUTBOXINVENTORYPANEL_H
-#define LL_OUTBOXINVENTORYPANEL_H
-
-
-#include "llinventorypanel.h"
-#include "llfolderviewitem.h"
-
-
-class LLOutboxInventoryPanel : public LLInventoryPanel
-{
-public:
-	struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
-	{
-		Params() {}
-	};
-	
-	LLOutboxInventoryPanel(const Params& p);
-	~LLOutboxInventoryPanel();
-
-	// virtual
-	void buildFolderView(const LLInventoryPanel::Params& params);
-
-	// virtual
-	LLFolderViewFolder *	createFolderViewFolder(LLInvFVBridge * bridge);
-	LLFolderViewItem *		createFolderViewItem(LLInvFVBridge * bridge);
-};
-
-
-class LLOutboxFolderViewFolder : public LLFolderViewFolder
-{
-public:
-	struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
-	{
-		Params() {}
-	};
-	
-	LLOutboxFolderViewFolder(const Params& p);
-};
-
-
-class LLOutboxFolderViewItem : public LLFolderViewItem
-{
-public:
-	LLOutboxFolderViewItem(const Params& p);
-
-	// virtual
-	BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
-	void openItem();
-};
-
-
-#endif //LL_OUTBOXINVENTORYPANEL_H
diff --git a/indra/newview/llplacesinventorybridge.cpp b/indra/newview/llplacesinventorybridge.cpp
index 1a5f64e295b3a83ba918764397120960f36f66f3..ebd9604c5b3155f0f471d904fd3022cf06cfab03 100644
--- a/indra/newview/llplacesinventorybridge.cpp
+++ b/indra/newview/llplacesinventorybridge.cpp
@@ -170,7 +170,7 @@ LLInvFVBridge* LLPlacesInventoryBridgeBuilder::createBridge(
 		if (actual_asset_type == LLAssetType::AT_LINK_FOLDER)
 		{
 			// *TODO: Create a link folder handler instead if it is necessary
-			new_listener = LLInventoryFVBridgeBuilder::createBridge(
+			new_listener = LLInventoryFolderViewModelBuilder::createBridge(
 				asset_type,
 				actual_asset_type,
 				inv_type,
@@ -184,7 +184,7 @@ LLInvFVBridge* LLPlacesInventoryBridgeBuilder::createBridge(
 		new_listener = new LLPlacesFolderBridge(inv_type, inventory, root, uuid);
 		break;
 	default:
-		new_listener = LLInventoryFVBridgeBuilder::createBridge(
+		new_listener = LLInventoryFolderViewModelBuilder::createBridge(
 			asset_type,
 			actual_asset_type,
 			inv_type,
diff --git a/indra/newview/llplacesinventorybridge.h b/indra/newview/llplacesinventorybridge.h
index 791502990bfbd69a7a4c3aa0ec9c32c012dd3014..07d18d03c57042fa492467ffab97be3cdd6916f6 100644
--- a/indra/newview/llplacesinventorybridge.h
+++ b/indra/newview/llplacesinventorybridge.h
@@ -82,7 +82,7 @@ class LLPlacesFolderBridge : public LLFolderBridge
  *
  * It builds Bridges for Landmarks and Folders in Places Landmarks Panel
  */
-class LLPlacesInventoryBridgeBuilder : public LLInventoryFVBridgeBuilder
+class LLPlacesInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder
 {
 public:
 	/*virtual*/ LLInvFVBridge* createBridge(LLAssetType::EType asset_type,
diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp
index c46681f5567641f31fd5135aef0e9a738eace3cc..db3f245389320a81030e002e7bbe51fdbc58a783 100644
--- a/indra/newview/llplacesinventorypanel.cpp
+++ b/indra/newview/llplacesinventorypanel.cpp
@@ -58,11 +58,6 @@ LLPlacesInventoryPanel::~LLPlacesInventoryPanel()
 	delete mSavedFolderState;
 }
 
-void LLPlacesInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params)
-{
-	LLInventoryPanel::buildFolderView(params);
-}
-
 // save current folder open state
 void LLPlacesInventoryPanel::saveFolderState()
 {
diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h
index f647e7f970e5dc90f9f33b0c8bb00362f6e46f34..1544b51aed4b23711796b2fb8311a3b3ca72116d 100644
--- a/indra/newview/llplacesinventorypanel.h
+++ b/indra/newview/llplacesinventorypanel.h
@@ -46,8 +46,6 @@ class LLPlacesInventoryPanel : public LLInventoryPanel
 	LLPlacesInventoryPanel(const Params& p);
 	~LLPlacesInventoryPanel();
 
-	/*virtual*/ void buildFolderView(const LLInventoryPanel::Params& params);
-
 	void saveFolderState();
 	void restoreFolderState();
 
@@ -57,7 +55,7 @@ class LLPlacesInventoryPanel : public LLInventoryPanel
 	LLSaveFolderState*			mSavedFolderState;
 };
 
-
+//TODO RN: this class is currently unused, make sure that behavior remains
 class LLPlacesFolderView : public LLFolderView
 {
 public:
@@ -77,8 +75,6 @@ class LLPlacesFolderView : public LLFolderView
 		mParentLandmarksPanel = panel;
 	}
 
-	S32 getSelectedCount() { return (S32)mSelectedItems.size(); }
-
 private:
 	/**
 	 * holds pointer to landmark panel. This pointer is used in @c LLPlacesFolderView::handleRightMouseDown
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 47bd620fc6bd4b3f6ce14ae96964be2de5d2a4bc..acb232c77f57291c5f966d14b5903c4136aeb9ee 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -260,9 +260,8 @@ void LLSidepanelInventory::updateInbox()
 	//
 
 	const bool do_not_create_folder = false;
-	const bool do_not_find_in_library = false;
 
-	const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library);
+	const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder);
 	
 	// Set up observer to listen for creation of inbox if at least one of them doesn't exist
 	if (inbox_id.isNull())
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 2680e4451b41e827bbfb47fcf00544e45d27f06d..94c97158a8e0c8ea8dcce6c5ce53f543984c33a4 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -812,7 +812,7 @@ void LLToolDragAndDrop::dragOrDrop( S32 x, S32 y, MASK mask, BOOL drop,
 	if (!handled)
 	{
 		// Disallow drag and drop to 3D from the outbox
-		const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false);
+		const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);
 		if (outbox_id.notNull())
 		{
 			for (S32 item_index = 0; item_index < (S32)mCargoIDs.size(); item_index++)
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 7c744f3c3ff7207c2edf273c3a69f52f241bfbdf..9268e5a869ea1b06cf5ce6a8aa71de71d7876f5e 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -5318,7 +5318,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
 				// crazy cast so that we can overwrite the fade value
 				// even though gcc enforces sets as const
 				// (fade value doesn't affect sort so this is safe)
-				Light* farthest_light = ((Light*) (&(*(mNearbyLights.rbegin()))));
+				Light* farthest_light = (const_cast<Light*>(&(*(mNearbyLights.rbegin()))));
 				if (light->dist < farthest_light->dist)
 				{
 					if (farthest_light->fade >= 0.f)
diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
index 413e22e444947a07363ecee76dc00e83f82627c0..48d38d50e09b65af43c2aaeb50c5323c90e2091c 100644
--- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml
@@ -2,7 +2,7 @@
 <inbox_inventory_panel
     accepts_drag_and_drop="false"
     name="inventory_inbox"
-    start_folder="Received Items"
+    start_folder.name="Received Items"
     follows="all" layout="topleft"
     top="0" left="0" height="165" width="308"
     top_pad="0"
diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml
index 2a5933e3e93bbc9f5ebe13b07809b2d47beb17a5..39805637a094c8d23e6ff6f25053e68a1c966846 100644
--- a/indra/newview/skins/default/xui/en/panel_landmarks.xml
+++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml
@@ -35,7 +35,7 @@
              left="0"
              mouse_opaque="true"
              name="favorites_list"
-             start_folder="Favorites"
+             start_folder.name="Favorites"
              width="307"/>
         </accordion_tab>
         <accordion_tab
@@ -51,7 +51,7 @@
              left="0"
              mouse_opaque="true"
              name="landmarks_list"
-             start_folder="Landmarks"
+             start_folder.name="Landmarks"
              width="307"/>
         </accordion_tab>
         <accordion_tab
@@ -67,7 +67,7 @@
              left="0"
              mouse_opaque="true"
              name="my_inventory_list"
-             start_folder="My Inventory"
+             start_folder.name="My Inventory"
              width="307"/>
           </accordion_tab>
           <accordion_tab
@@ -83,7 +83,7 @@
              left="0"
              mouse_opaque="true"
              name="library_list"
-             start_folder="LIBRARY"
+             start_folder.name="LIBRARY"
              width="313"/>
         </accordion_tab>
     </accordion>
diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
index a3d39e55af53a20a6c95ccff9fd9ac8b65d10c8e..203febbf18fd70f819ca326061cc8060723a395f 100644
--- a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<outbox_inventory_panel
+<inventory_panel
     name="inventory_outbox"
-    start_folder="Outbox"
+    start_folder.name="Outbox"
+    show_empty_message="false"
+    show_load_status="false"
+    start_folder.type="outbox"
     follows="all" layout="topleft"
     top="0" left="0" height="165" width="308"
     top_pad="0"
@@ -12,6 +15,11 @@
     bevel_style="none"
     show_item_link_overlays="true"
     tool_tip="Drag and drop items here to prepare them for sale on your storefront"
-    >
-    <scroll reserve_scroll_corner="false" />
-</outbox_inventory_panel>
+    scroll.reserve_scroll_corner="false">
+      <folder folder_arrow_image="Folder_Arrow"
+              folder_indentation="8"
+              item_height="20"
+              item_top_pad="4"
+              selection_image="Rounded_Square"/>
+      <item allow_open="false"/>
+</inventory_panel>
diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml
index 830c27bdac83f47af3727942ac17d96a60c3e87f..d5b10e7f51b42f8f2750606bc4bf9cd67463ca28 100644
--- a/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml
@@ -1,2 +1,3 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<inbox_inventory_panel show_load_status="false" />
+<inbox_inventory_panel show_load_status="false"
+                       start_folder.type="inbox"/>
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
deleted file mode 100644
index d19c47f54f3ce17525c2bc9d3b5d1a10d9e0165f..0000000000000000000000000000000000000000
--- a/indra/newview/skins/default/xui/en/widgets/outbox_folder_view_folder.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<outbox_folder_view_folder
-  folder_arrow_image="Folder_Arrow"
-  folder_indentation="8"
-  item_height="20" 
-  item_top_pad="4"
-  selection_image="Rounded_Square"
-  >
-</outbox_folder_view_folder>
diff --git a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
deleted file mode 100644
index 3964569da24a9346996145189a6437926b1bf7d0..0000000000000000000000000000000000000000
--- a/indra/newview/skins/default/xui/en/widgets/outbox_inventory_panel.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<outbox_inventory_panel show_empty_message="false" show_load_status="false" />