Skip to content
Snippets Groups Projects
Commit 7e193287 authored by Loren Shih's avatar Loren Shih
Browse files

EXT-4846 : [NUX] Inventory Side Panel - Can we suppress the "Landmarks" and...

EXT-4846 : [NUX] Inventory Side Panel - Can we suppress the "Landmarks" and "My FavoriteS" folder since they have their own Task Panel?

Adding simple infrastructure for supporting ability to hide folder types from inventory panels, but NOT exercising this code.  This will be deferred for 2.1.
Also did some very superficial header file cleanup for LLInventoryPanel.
parent 295843ee
Branches
Tags
No related merge requests found
...@@ -522,6 +522,11 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) ...@@ -522,6 +522,11 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)
{ {
folderp->setHidden(TRUE); folderp->setHidden(TRUE);
} }
const LLViewerInventoryCategory *cat = dynamic_cast<LLViewerInventoryCategory *>(objectp);
if (cat && getIsHiddenFolderType(cat->getPreferredType()))
{
folderp->setHidden(TRUE);
}
} }
} }
else else
...@@ -553,6 +558,12 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) ...@@ -553,6 +558,12 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id)
if (itemp) if (itemp)
{ {
itemp->addToFolder(parent_folder, mFolders); 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) ...@@ -954,3 +965,16 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)
return NULL; 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());
}
...@@ -61,6 +61,9 @@ class LLTabContainer; ...@@ -61,6 +61,9 @@ class LLTabContainer;
class LLInventoryPanel : public LLPanel class LLInventoryPanel : public LLPanel
{ {
//--------------------------------------------------------------------
// Data
//--------------------------------------------------------------------
public: public:
static const std::string DEFAULT_SORT_ORDER; static const std::string DEFAULT_SORT_ORDER;
static const std::string RECENTITEMS_SORT_ORDER; static const std::string RECENTITEMS_SORT_ORDER;
...@@ -97,13 +100,16 @@ class LLInventoryPanel : public LLPanel ...@@ -97,13 +100,16 @@ class LLInventoryPanel : public LLPanel
{} {}
}; };
//--------------------------------------------------------------------
// Initialization
//--------------------------------------------------------------------
protected: protected:
LLInventoryPanel(const Params&); LLInventoryPanel(const Params&);
friend class LLUICtrlFactory; friend class LLUICtrlFactory;
public: public:
virtual ~LLInventoryPanel(); virtual ~LLInventoryPanel();
public:
LLInventoryModel* getModel() { return mInventory; } LLInventoryModel* getModel() { return mInventory; }
BOOL postBuild(); BOOL postBuild();
...@@ -186,6 +192,16 @@ class LLInventoryPanel : public LLPanel ...@@ -186,6 +192,16 @@ class LLInventoryPanel : public LLPanel
*/ */
const LLInventoryFVBridgeBuilder* mInvFVBridgeBuilder; 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") // Initialization routines for building up the UI ("views")
//-------------------------------------------------------------------- //--------------------------------------------------------------------
......
...@@ -83,6 +83,14 @@ BOOL LLSidepanelInventory::postBuild() ...@@ -83,6 +83,14 @@ BOOL LLSidepanelInventory::postBuild()
mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); 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 // UI elements from item panel
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment