summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r--indra/newview/llinventorypanel.cpp39
1 files changed, 35 insertions, 4 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index fb010fa858..0dd37b6161 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -48,6 +48,7 @@
#include "llsidepanelinventory.h"
#include "llstartup.h"
#include "lltrans.h"
+#include "llviewerassettype.h"
#include "llviewerattachmenu.h"
#include "llviewerfoldertype.h"
#include "llvoavatarself.h"
@@ -1762,11 +1763,17 @@ public:
void initFromParams(const Params& p);
protected:
- LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) { mAcceptsDragAndDrop = false; }
+ LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) {}
friend class LLUICtrlFactory;
public:
~LLAssetFilteredInventoryPanel() {}
+ /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ EAcceptance* accept,
+ std::string& tooltip_msg) override;
+
protected:
/*virtual*/ LLFolderViewItem* buildNewViews(const LLUUID& id) override;
/*virtual*/ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override;
@@ -1781,12 +1788,33 @@ void LLAssetFilteredInventoryPanel::initFromParams(const Params& p)
mAssetType = LLAssetType::lookup(p.filter_asset_type.getValue());
LLInventoryPanel::initFromParams(p);
U64 filter_cats = getFilter().getFilterCategoryTypes();
- filter_cats &= ~(1ULL << LLFolderType::FT_TRASH);
filter_cats &= ~(1ULL << LLFolderType::FT_MARKETPLACE_LISTINGS);
getFilter().setFilterCategoryTypes(filter_cats);
getFilter().setFilterNoMarketplaceFolder();
}
+BOOL LLAssetFilteredInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+ EDragAndDropType cargo_type,
+ void* cargo_data,
+ EAcceptance* accept,
+ std::string& tooltip_msg)
+{
+ BOOL result = FALSE;
+
+ if (mAcceptsDragAndDrop)
+ {
+ EDragAndDropType allow_type = LLViewerAssetType::lookupDragAndDropType(mAssetType);
+ // Don't allow DAD_CATEGORY here since it can contain other items besides required assets
+ // We should see everything we drop!
+ if (allow_type == cargo_type)
+ {
+ result = LLInventoryPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+ }
+ }
+
+ return result;
+}
+
LLFolderViewItem* LLAssetFilteredInventoryPanel::buildNewViews(const LLUUID& id)
{
LLInventoryObject const* objectp = gInventory.getObject(id);
@@ -1806,12 +1834,15 @@ LLFolderViewItem* LLAssetFilteredInventoryPanel::buildNewViews(const LLUUID& id)
void LLAssetFilteredInventoryPanel::itemChanged(const LLUUID& id, U32 mask, const LLInventoryObject* model_item)
{
- if (!model_item)
+ if (!model_item && !getItemByID(id))
{
+ // remove operation, but item is not in panel already
return;
}
- if (model_item->getType() != mAssetType && model_item->getType() != LLAssetType::AT_CATEGORY)
+ if (model_item
+ && model_item->getType() != mAssetType
+ && model_item->getType() != LLAssetType::AT_CATEGORY)
{
return;
}