summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2018-08-11 09:02:16 -0400
committerNat Goodspeed <nat@lindenlab.com>2018-08-11 09:02:16 -0400
commitf6735af9315ed91a0d28804252c1351c9d4b379f (patch)
tree1b1fc36446fd12164f28a0d9b62bd2e89fd1601c /indra/newview/llinventorybridge.cpp
parent00839eb6350627c6272dea242b85ea24544cea33 (diff)
parent470e4b5afc7f0fd516eca9d61b95ff770adf3978 (diff)
Automated merge with ssh://bitbucket.org/nat_linden/viewer-no-popup
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 90a000c196..e4b6c3b554 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1406,7 +1406,9 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type,
}
new_listener = new LLMeshBridge(inventory, root, uuid);
break;
-
+ case LLAssetType::AT_UNKNOWN:
+ new_listener = new LLUnknownItemBridge(inventory, root, uuid);
+ break;
case LLAssetType::AT_IMAGE_TGA:
case LLAssetType::AT_IMAGE_JPEG:
//LL_WARNS() << LLAssetType::lookup(asset_type) << " asset type is unhandled for uuid " << uuid << LL_ENDL;
@@ -6949,6 +6951,21 @@ const LLUUID &LLLinkFolderBridge::getFolderID() const
return LLUUID::null;
}
+void LLUnknownItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
+{
+ menuentry_vec_t items;
+ menuentry_vec_t disabled_items;
+ items.push_back(std::string("Properties"));
+ items.push_back(std::string("Rename"));
+ hide_context_entries(menu, items, disabled_items);
+}
+
+LLUIImagePtr LLUnknownItemBridge::getIcon() const
+{
+ return LLInventoryIcon::getIcon(LLAssetType::AT_UNKNOWN, mInvType);
+}
+
+
/********************************************************************************
**
** BRIDGE ACTIONS
@@ -7310,7 +7327,7 @@ void LLFolderViewGroupedItemBridge::groupFilterContextMenu(folder_view_item_dequ
menuentry_vec_t disabled_items;
if (get_selection_item_uuids(selected_items, ids))
{
- if (!LLAppearanceMgr::instance().canAddWearables(ids))
+ if (!LLAppearanceMgr::instance().canAddWearables(ids) && canWearSelected(ids))
{
disabled_items.push_back(std::string("Wearable Add"));
}
@@ -7318,4 +7335,17 @@ void LLFolderViewGroupedItemBridge::groupFilterContextMenu(folder_view_item_dequ
disable_context_entries_if_present(menu, disabled_items);
}
+bool LLFolderViewGroupedItemBridge::canWearSelected(uuid_vec_t item_ids)
+{
+ for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it)
+ {
+ LLViewerInventoryItem* item = gInventory.getItem(*it);
+ LLAssetType::EType asset_type = item->getType();
+ if (!item || (asset_type >= LLAssetType::AT_COUNT) || (asset_type <= LLAssetType::AT_NONE))
+ {
+ return false;
+ }
+ }
+ return true;
+}
// EOF