diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c024304f26db51b5aacd01a6c5e19e95dc2d8dab..f246b6b529474d644fb6dd91fce6c79ce1ce1561 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -787,7 +787,7 @@ void LLInvFVBridge::changeItemParent(LLInventoryModel* model, const LLUUID& new_parent_id, BOOL restamp) { - if(item->getParentUUID() != new_parent_id) + if (item->getParentUUID() != new_parent_id) { LLInventoryModel::update_list_t update; LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1); @@ -3002,7 +3002,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLViewerObject* object = NULL; if(LLToolDragAndDrop::SOURCE_AGENT == source) { - BOOL is_movable = TRUE; switch( inv_item->getActualType() ) { @@ -3014,11 +3013,18 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); - BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); + const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); const LLUUID current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); - BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); - BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); + const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); + const BOOL move_is_outof_current_outfit = LLAppearanceManager::instance().getIsInCOF(inv_item->getUUID()); + // Can't explicitly drag things out of the COF. + if (move_is_outof_current_outfit) + { + is_movable = FALSE; + } + if(is_movable && move_is_into_trash) { is_movable = inv_item->getIsLinkType() || !get_is_item_worn(inv_item->getUUID()); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index a6d63e58f5c018d2f2195060adc50fc8351fc735..467255d1a7d467ba148b388e91e6594a0ac636d5 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 ccff795a51920db3f29329a79a1a495982a0db47..f312b588b934a55ddc938d08e2b136f0008c4760 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 @@ class LLInventoryPanel : public LLPanel {} }; + //-------------------------------------------------------------------- + // Initialization + //-------------------------------------------------------------------- protected: LLInventoryPanel(const Params&); friend class LLUICtrlFactory; - public: virtual ~LLInventoryPanel(); +public: LLInventoryModel* getModel() { return mInventory; } BOOL postBuild(); @@ -186,6 +192,16 @@ class LLInventoryPanel : public LLPanel */ 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") //-------------------------------------------------------------------- diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 3fd5309947593211ba68b1ec39d88765d73072a5..73880563d7d286e5e8e8595da6bca18965bac0b9 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