summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorybridge.cpp16
-rw-r--r--indra/newview/llinventorypanel.cpp24
-rw-r--r--indra/newview/llinventorypanel.h18
-rw-r--r--indra/newview/llsidepanelinventory.cpp10
4 files changed, 61 insertions, 7 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index c024304f26..f246b6b529 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 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