diff options
| -rw-r--r-- | indra/newview/llinventorypanel.cpp | 24 | ||||
| -rw-r--r-- | indra/newview/llinventorypanel.h | 18 | ||||
| -rw-r--r-- | indra/newview/llsidepanelinventory.cpp | 10 | 
3 files changed, 50 insertions, 2 deletions
| diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index a6d63e58f5..467255d1a7 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -522,6 +522,11 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)  				{  					folderp->setHidden(TRUE);  				} +				const LLViewerInventoryCategory *cat = dynamic_cast<LLViewerInventoryCategory *>(objectp); +				if (cat && getIsHiddenFolderType(cat->getPreferredType())) +				{ +					folderp->setHidden(TRUE); +				}  			}  		}  		else  @@ -553,6 +558,12 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)  		if (itemp)  		{  			itemp->addToFolder(parent_folder, mFolders); + +			// Don't add children of hidden folders unless this is the panel's root folder. +			if (itemp->getHidden() && (id != mStartFolderID)) +			{ +				return; +			}  		}  	} @@ -954,3 +965,16 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)  	return NULL;  } + +void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type) +{ +	if (!getIsHiddenFolderType(folder_type)) +	{ +		mHiddenFolderTypes.push_back(folder_type); +	} +} + +BOOL LLInventoryPanel::getIsHiddenFolderType(LLFolderType::EType folder_type) const +{ +	return (std::find(mHiddenFolderTypes.begin(), mHiddenFolderTypes.end(), folder_type) != mHiddenFolderTypes.end()); +} diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index ccff795a51..f312b588b9 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -61,6 +61,9 @@ class LLTabContainer;  class LLInventoryPanel : public LLPanel  { +	//-------------------------------------------------------------------- +	// Data +	//--------------------------------------------------------------------  public:  	static const std::string DEFAULT_SORT_ORDER;  	static const std::string RECENTITEMS_SORT_ORDER; @@ -97,13 +100,16 @@ public:  		{}  	}; +	//-------------------------------------------------------------------- +	// Initialization +	//--------------------------------------------------------------------  protected:  	LLInventoryPanel(const Params&);  	friend class LLUICtrlFactory; -  public:  	virtual ~LLInventoryPanel(); +public:  	LLInventoryModel* getModel() { return mInventory; }  	BOOL postBuild(); @@ -187,6 +193,16 @@ protected:  	const LLInventoryFVBridgeBuilder* mInvFVBridgeBuilder;  	//-------------------------------------------------------------------- +	// Hidden folders +	//-------------------------------------------------------------------- +public: +	void addHideFolderType(LLFolderType::EType folder_type); +protected: +	BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; +private: +	std::vector<LLFolderType::EType> mHiddenFolderTypes; + +	//--------------------------------------------------------------------  	// Initialization routines for building up the UI ("views")  	//--------------------------------------------------------------------  public: diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 3fd5309947..73880563d7 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -62,7 +62,7 @@ BOOL LLSidepanelInventory::postBuild()  	// UI elements from inventory panel  	{  		mInventoryPanel = getChild<LLPanel>("sidepanel__inventory_panel"); -		 +  		mInfoBtn = mInventoryPanel->getChild<LLButton>("info_btn");  		mInfoBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onInfoButtonClicked, this)); @@ -83,6 +83,14 @@ BOOL LLSidepanelInventory::postBuild()  		mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");  		mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); + +		/*  +		   EXT-4846 : "Can we suppress the "Landmarks" and "My Favorites" folder since they have their own Task Panel?" +		   Deferring this until 2.1. +		LLInventoryPanel *my_inventory_panel = mPanelMainInventory->getChild<LLInventoryPanel>("All Items"); +		my_inventory_panel->addHideFolderType(LLFolderType::FT_LANDMARK); +		my_inventory_panel->addHideFolderType(LLFolderType::FT_FAVORITE); +		*/  	}  	// UI elements from item panel | 
