From 3e80fa3dbc943de9b784fedc202ba38cf238f46d Mon Sep 17 00:00:00 2001 From: David Parks Date: Mon, 2 Nov 2009 19:55:37 +0000 Subject: Sync up with render-pipeline-7 ignore-dead-branch --- indra/newview/llinventorybridge.cpp | 94 ++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ca9ebf8dc1..028505456b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -154,7 +154,9 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "Inv_Gesture", "inv_item_linkitem.tga", - "inv_item_linkfolder.tga" + "inv_item_linkfolder.tga", + + "inv_item_mesh.tga" }; @@ -891,6 +893,14 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, // Only should happen for broken links. new_listener = new LLLinkItemBridge(inventory, uuid); break; + case LLAssetType::AT_MESH: + if(!(inv_type == LLInventoryType::IT_MESH)) + { + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + } + new_listener = new LLMeshBridge(inventory, uuid); + break; + default: llinfos << "Unhandled asset type (llassetstorage.h): " << (S32)asset_type << llendl; @@ -2189,6 +2199,9 @@ LLUIImagePtr LLFolderBridge::getIcon(LLAssetType::EType preferred_type) { // we only have one folder image now return LLUI::getUIImage("Inv_FolderClosed"); + /*case LLAssetType::AT_MESH: + control = "inv_folder_mesh.tga"; + break;*/ } BOOL LLFolderBridge::renameItem(const std::string& new_name) @@ -2558,6 +2571,7 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_ANIMATION: case DAD_GESTURE: case DAD_LINK: + case DAD_MESH: accept = dragItemIntoFolder((LLInventoryItem*)cargo_data, drop); break; @@ -3457,6 +3471,7 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: + case DAD_MESH: { LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data; const LLPermissions& perm = inv_item->getPermissions(); @@ -4713,6 +4728,65 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, delete on_remove_struct; } + +// +=================================================+ +// | LLMeshBridge | +// +=================================================+ + +LLUIImagePtr LLMeshBridge::getIcon() const +{ + return get_item_icon(LLAssetType::AT_MESH, LLInventoryType::IT_MESH, 0, FALSE); +} + +void LLMeshBridge::openItem() +{ + LLViewerInventoryItem* item = getItem(); + + if (item) + { + // open mesh + } +} + +void LLMeshBridge::previewItem() +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + // preview mesh + } +} + + +void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLMeshBridge::buildContextMenu()" << llendl; + std::vector items; + std::vector disabled_items; + + if(isInTrash()) + { + items.push_back(std::string("Purge Item")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Purge Item")); + } + + items.push_back(std::string("Restore Item")); + } + else + { + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + } + + + hideContextEntries(menu, items, disabled_items); +} + + + LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_type, const LLUUID& uuid,LLInventoryModel* model) { @@ -4761,6 +4835,12 @@ LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_ break; + case LLAssetType::AT_MESH: + action = new LLMeshBridgeAction(uuid,model); + break; + + + default: break; } @@ -4998,6 +5078,18 @@ void LLWearableBridgeAction::doIt() LLInvFVBridgeAction::doIt(); } +//virtual +void LLMeshBridgeAction::doIt() +{ + LLViewerInventoryItem* item = getItem(); + if(item) + { + // do it + } + + LLInvFVBridgeAction::doIt(); +} + // +=================================================+ // | LLLinkItemBridge | // +=================================================+ -- cgit v1.2.3 From 7a7eced4a619d98d808abba3f0bf951bcf4cd95a Mon Sep 17 00:00:00 2001 From: Palmer Date: Tue, 8 Dec 2009 16:06:18 -0800 Subject: Fix of last merge borkasaur. Left off a comma on defining the mesh array. Also switched our mesh icon code to sync with viewer 2 and cleared out extra notification --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 59bfc77723..93cfbddc92 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -125,9 +125,9 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "Inv_Gesture", "Inv_LinkItem", - "Inv_LinkFolder" + "Inv_LinkFolder", - "inv_item_mesh.tga" + "Inv_Mesh" }; // +=================================================+ -- cgit v1.2.3 From 62f0f426532808755f6d97f34fd2d8c9e5d2fa6a Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 5 Feb 2010 09:12:13 +0000 Subject: repair meshfu for inventory API change --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6aecc4af4d..366fb091e4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5046,7 +5046,7 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) std::vector items; std::vector disabled_items; - if(isInTrash()) + if(isItemInTrash()) { items.push_back(std::string("Purge Item")); if (!isItemRemovable()) -- cgit v1.2.3 From 1de148608699e85a893e9e4e4ebf6e9c851d8f58 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 6 Apr 2010 15:12:22 +0100 Subject: more fixing from the viewer-trunk merge --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 182629d2da..5c0898407e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -997,7 +997,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, { llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; } - new_listener = new LLMeshBridge(inventory, uuid); + new_listener = new LLMeshBridge(inventory, root, uuid); break; default: -- cgit v1.2.3 From 5de3e21a38f81559626cdca8a9e5b9e06f955063 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 6 Apr 2010 15:33:35 +0100 Subject: another conflict fix from viewer-trunk merge --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5c0898407e..2e690493cd 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -995,7 +995,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, case LLAssetType::AT_MESH: if(!(inv_type == LLInventoryType::IT_MESH)) { - llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << safe_inv_type_lookup(inv_type) << " on uuid " << uuid << llendl; + llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl; } new_listener = new LLMeshBridge(inventory, root, uuid); break; -- cgit v1.2.3 From c1b49a2142f04bde232d65038ac88765423fc7ad Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 6 Apr 2010 15:34:56 +0100 Subject: yet more conflict fixing from viewer-trunk merge --- indra/newview/llinventorybridge.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 2e690493cd..7c156561b9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5107,7 +5107,6 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti return; } LLItemBridge::performAction(model,action); - items.push_back(std::string("Restore Item")); } void LLLinkFolderBridge::gotoItem() { @@ -5125,9 +5124,6 @@ void LLLinkFolderBridge::gotoItem() mRoot->scrollToShowSelection(); } } - - - hide_context_entries(menu, items, disabled_items); } const LLUUID &LLLinkFolderBridge::getFolderID() const { @@ -5138,12 +5134,6 @@ const LLUUID &LLLinkFolderBridge::getFolderID() const const LLUUID& cat_uuid = cat->getUUID(); return cat_uuid; } - case LLAssetType::AT_MESH: - action = new LLMeshBridgeAction(uuid,model); - break; - - - } return LLUUID::null; } -- cgit v1.2.3 From cbf1ae105a980a439cff39026f9e2c05d4f13859 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 6 Apr 2010 15:45:54 +0100 Subject: sigghhhh, yet more conflict resolution from the viewer-trunk merge. actually builds now. let's see if it runs and works. --- indra/newview/llinventorybridge.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 7c156561b9..83248e9991 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5389,20 +5389,9 @@ public: LLNotificationsUtil::add("CannotWearInfoNotComplete"); } } - LLInvFVBridgeAction::doIt(); -} - -//virtual -void LLMeshBridgeAction::doIt() -{ - LLViewerInventoryItem* item = getItem(); - if(item) - { - // do it - } - LLInvFVBridgeAction::doIt(); } + virtual ~LLWearableBridgeAction(){} protected: LLWearableBridgeAction(const LLUUID& id,LLInventoryModel* model) : LLInvFVBridgeAction(id,model) {} -- cgit v1.2.3 From 564a8433404ea97e5424fc12089958a2d753747f Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 25 May 2010 13:27:17 +0100 Subject: VWR-13743 FIXED Change Request: Change double click action for inventory wearables DEV-33391 FIXED Change Request: Change double click action for inventory wearables Pulled this from the AvP backlog and implemented it, as it's a pain point from Ben's usability findings. And people loooove this in 3rd party viewers. --- indra/newview/llinventorybridge.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ea43670da0..10cc6fae32 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3400,7 +3400,7 @@ openSoundPreview((void*)this); //send_uuid_sound_trigger(item->getAssetUUID(), 1.0); } */ - } +} void LLSoundBridge::previewItem() { @@ -4187,21 +4187,9 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) void LLObjectBridge::openItem() { - LLViewerInventoryItem* item = getItem(); - - if (item) - { - LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); - } - - LLSD key; - key["id"] = mUUID; - LLSideTray::getInstance()->showPanel("sidepanel_inventory", key); - - // Disable old properties floater; this is replaced by the sidepanel. - /* - LLFloaterReg::showInstance("properties", mUUID); - */ + // object double-click action is to wear/unwear object + performAction(getInventoryModel(), + get_is_item_worn(mUUID) ? "detach" : "attach"); } LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const -- cgit v1.2.3 From 22102e41cbf4ce9e1c0d069f111849466e297520 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 8 Jun 2010 14:55:19 -0500 Subject: Merge cleanup. --- indra/newview/llinventorybridge.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 8fdb965cf2..78789eb9ce 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -109,7 +109,6 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response); void teleport_via_landmark(const LLUUID& asset_id); - "Inv_Mesh", // +=================================================+ // | LLInvFVBridge | // +=================================================+ @@ -918,7 +917,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, // Only should happen for broken links. new_listener = new LLLinkItemBridge(inventory, root, uuid); break; - case LLAssetType::AT_MESH: + case LLAssetType::AT_MESH: if(!(inv_type == LLInventoryType::IT_MESH)) { llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl; -- cgit v1.2.3 From fbe9f07f178cb4b868ff87a5fd370d8ad392d810 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 8 Jun 2010 17:34:38 -0500 Subject: Merge fix. --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 78789eb9ce..97d51a9d90 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4849,7 +4849,7 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLUIImagePtr LLMeshBridge::getIcon() const { - return get_item_icon(LLAssetType::AT_MESH, LLInventoryType::IT_MESH, 0, FALSE); + return LLInventoryIcon::getIcon(LLAssetType::AT_MESH, LLInventoryType::IT_MESH, 0, FALSE); } void LLMeshBridge::openItem() -- cgit v1.2.3 From f9b13d8f8510b1f7f02fcf92685471461b79858e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 10 Jun 2010 00:45:48 -0500 Subject: Add "LL_MESH_ENABLED" preprocessor flag for toggling mesh code. Couple of merge fixes. --- indra/newview/llinventorybridge.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 78789eb9ce..3999a8ee88 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -917,6 +917,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, // Only should happen for broken links. new_listener = new LLLinkItemBridge(inventory, root, uuid); break; +#if LL_MESH_ENABLED case LLAssetType::AT_MESH: if(!(inv_type == LLInventoryType::IT_MESH)) { @@ -924,6 +925,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, } new_listener = new LLMeshBridge(inventory, root, uuid); break; +#endif default: llinfos << "Unhandled asset type (llassetstorage.h): " @@ -2765,7 +2767,9 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_ANIMATION: case DAD_GESTURE: case DAD_LINK: +#if LL_MESH_ENABLED case DAD_MESH: +#endif accept = dragItemIntoFolder((LLInventoryItem*)cargo_data, drop); break; @@ -3635,7 +3639,9 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: - case DAD_MESH: +#if LL_MESH_ENABLED + case DAD_MESH: +#endif { LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data; const LLPermissions& perm = inv_item->getPermissions(); @@ -4843,6 +4849,7 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } +#if LL_MESH_ENABLED // +=================================================+ // | LLMeshBridge | // +=================================================+ @@ -4899,6 +4906,7 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } +#endif // +=================================================+ // | LLLinkBridge | -- cgit v1.2.3 From 5f9f6dcdec0de015e3c9a88afad6f4761c3c6527 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 6 Aug 2010 17:14:01 +0300 Subject: EXT-8577 WIP Context menu items for multi-attachments. Done: - 1. Dropped the obsolete "MultipleAttachments" setting. - 2. Added an "Add" item to the following attachment-related context menus: * My Appearance (ex-My Outfits) context menu. * Edit Outfit -> Add More context menu. * Object in-world context menu. * Inventory context menu. * Object inspector gear menu. - 3. Modified "Attach To / Attach To HUD" to perform the "add" instead of "replace" action. TODO: - Ability to attach multiple objects at once from the Add More panel (bulk attach). - Make sure there's no memleak when you click Wear/Attach in the in-world object context menu and the callback isn't invoked (because e.g. avatar fails to get close enough to the object). Issues: 0. I'm not sure whether LLAgentWearables::userAttachMultipleAttachments() should replace attachments or add them. Assumed the former. 1. I couldn't verify that adding objects from the object inspector menu works because I either could wear an object or see its inspector, not both. 2. > 1. Right-click on an object in your inventory and select "Wear". > VERIFY: Attaches the object and replaces whatever's there; asks for > confirmation before replacing an existing object. I think this is impossible to implement because we don't know in advance what point the object will be attached to, so we can't display a confirmation dialog. Reviewed by Seraph at https://codereview.productengine.com/secondlife/r/843/ --HG-- branch : product-engine --- indra/newview/llinventorybridge.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 38f3521b2d..7e710ce8e1 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3936,7 +3936,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) item = (LLViewerInventoryItem*)gInventory.getItem(object_id); if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID())) { - rez_attachment(item, NULL); + rez_attachment(item, NULL, true); // Replace if "Wear"ing. } else if(item && item->isFinished()) { @@ -3952,6 +3952,10 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) } gFocusMgr.setKeyboardFocus(NULL); } + else if ("wear_add" == action) + { + LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding. + } else if (isRemoveAction(action)) { LLInventoryItem* item = gInventory.getItem(mUUID); @@ -3998,7 +4002,7 @@ std::string LLObjectBridge::getLabelSuffix() const } } -void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment) +void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace) { LLSD payload; payload["item_id"] = item->getLinkedUUID(); // Wear the base object in case this is a link. @@ -4017,9 +4021,14 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } + if (!replace) + { + attach_pt |= ATTACHMENT_ADD; + } + payload["attachment_point"] = attach_pt; - if (!gSavedSettings.getBOOL("MultipleAttachments") && + if (replace && (attachment && attachment->getNumObjects() > 0)) { LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez); @@ -4048,8 +4057,6 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon if (itemp) { U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); - if (gSavedSettings.getBOOL("MultipleAttachments")) - attachment_pt |= ATTACHMENT_ADD; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv); @@ -4106,6 +4113,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Wearable And Object Wear")); + items.push_back(std::string("Wearable Add")); items.push_back(std::string("Attach To")); items.push_back(std::string("Attach To HUD")); // commented out for DEV-32347 @@ -4114,6 +4122,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (!gAgentAvatarp->canAttachMoreObjects()) { disabled_items.push_back(std::string("Wearable And Object Wear")); + disabled_items.push_back(std::string("Wearable Add")); disabled_items.push_back(std::string("Attach To")); disabled_items.push_back(std::string("Attach To HUD")); } -- cgit v1.2.3 From 20bdbd487e9c64ce553ad68d467b1100342fe6a1 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Mon, 9 Aug 2010 21:14:07 +0300 Subject: EXT-8628 FIXED Crash in LLVOAvatarSelf::getAttachedPointName(). The crash was reproducible only on startup. Apparently, gAgentAvatarp was not valid at that point. Worked around by checking gAgentAvatarp for being valid. I didn't investigate what the root cause of the problem was (probably the new multi-attachments implementation), I just needed my viewer to work. Reviewed by Seraph at https://codereview.productengine.com/secondlife/r/847/ --HG-- branch : product-engine --- indra/newview/llinventorybridge.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 7e710ce8e1..53622f7188 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3989,6 +3989,11 @@ std::string LLObjectBridge::getLabelSuffix() const { if (get_is_item_worn(mUUID)) { + if (!isAgentAvatarValid()) + { + return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); + } + std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID); // e.g. "(worn on ...)" / "(attached to ...)" -- cgit v1.2.3 From 845317cb360cf095a37d2da11c4f26759b330c60 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 12 Aug 2010 15:56:51 +0300 Subject: EXT-8628 FIXED Crash in LLVOAvatarSelf::getAttachedPointName(). The crash was reproducible only on startup. Apparently, gAgentAvatarp was not valid at that point. Worked around by checking gAgentAvatarp for being valid. I didn't investigate what the root cause of the problem was (probably the new multi-attachments implementation), I just needed my viewer to work. Reviewed by Seraph at https://codereview.productengine.com/secondlife/r/847/. --HG-- branch : product-engine --- indra/newview/llinventorybridge.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 53622f7188..9bbc6514b4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3936,7 +3936,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) item = (LLViewerInventoryItem*)gInventory.getItem(object_id); if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID())) { - rez_attachment(item, NULL, true); // Replace if "Wear"ing. + rez_attachment(item, NULL); } else if(item && item->isFinished()) { @@ -3952,10 +3952,6 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) } gFocusMgr.setKeyboardFocus(NULL); } - else if ("wear_add" == action) - { - LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding. - } else if (isRemoveAction(action)) { LLInventoryItem* item = gInventory.getItem(mUUID); @@ -4007,7 +4003,7 @@ std::string LLObjectBridge::getLabelSuffix() const } } -void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace) +void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment) { LLSD payload; payload["item_id"] = item->getLinkedUUID(); // Wear the base object in case this is a link. @@ -4026,14 +4022,9 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } - if (!replace) - { - attach_pt |= ATTACHMENT_ADD; - } - payload["attachment_point"] = attach_pt; - if (replace && + if (!gSavedSettings.getBOOL("MultipleAttachments") && (attachment && attachment->getNumObjects() > 0)) { LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez); @@ -4062,6 +4053,8 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon if (itemp) { U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); + if (gSavedSettings.getBOOL("MultipleAttachments")) + attachment_pt |= ATTACHMENT_ADD; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv); @@ -4118,7 +4111,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Wearable And Object Wear")); - items.push_back(std::string("Wearable Add")); items.push_back(std::string("Attach To")); items.push_back(std::string("Attach To HUD")); // commented out for DEV-32347 @@ -4127,7 +4119,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (!gAgentAvatarp->canAttachMoreObjects()) { disabled_items.push_back(std::string("Wearable And Object Wear")); - disabled_items.push_back(std::string("Wearable Add")); disabled_items.push_back(std::string("Attach To")); disabled_items.push_back(std::string("Attach To HUD")); } -- cgit v1.2.3 From 2f77724a48b51a97091a0e27f20767cfb14e78e5 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 13 Aug 2010 11:12:51 -0400 Subject: EXT-8650 Can wear multiple copies of no-copy item via object links * EXT-8688 Automatically detach same object is detected * EXT-8689 Cleanup detachAttachmentIntoInventory code When an object arrives as an attachment, if it's already attached then it's automatically detached. --- indra/newview/llinventorybridge.cpp | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 9bbc6514b4..66bf325f04 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3957,18 +3957,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) LLInventoryItem* item = gInventory.getItem(mUUID); if(item) { - gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); - gMessageSystem->nextBlockFast(_PREHASH_ObjectData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID()); - gMessageSystem->sendReliable( gAgent.getRegion()->getHost()); - - // this object might have been selected, so let the selection manager know it's gone now - LLViewerObject *found_obj = gObjectList.findObject(item->getLinkedUUID()); - if (found_obj) - { - LLSelectMgr::getInstance()->remove(found_obj); - } + LLVOAvatarSelf::detachAttachmentIntoInventory(item->getLinkedUUID()); } } else LLItemBridge::performAction(model, action); @@ -4321,19 +4310,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ LLViewerInventoryItem *obj_item = obj_item_array.get(i); if (get_is_item_worn(obj_item->getUUID())) { - gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv); - gMessageSystem->nextBlockFast(_PREHASH_ObjectData ); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_ItemID, obj_item->getLinkedUUID() ); - - gMessageSystem->sendReliable( gAgent.getRegion()->getHost() ); - - // this object might have been selected, so let the selection manager know it's gone now - LLViewerObject *found_obj = gObjectList.findObject( obj_item->getLinkedUUID()); - if (found_obj) - { - LLSelectMgr::getInstance()->remove(found_obj); - } + LLVOAvatarSelf::detachAttachmentIntoInventory(obj_item->getLinkedUUID()); } } } -- cgit v1.2.3 From 6b53458b8477e542ddc5cc1f9fb41cc4a98819b1 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 13 Aug 2010 18:13:37 +0300 Subject: EXT-8662 FIXED Crash on renaming incomplete inventory items. I couldn't reproduce this problem, but from what I've seen in the crash reporter, this is a very old bug affecting viewers 1.2x and 2.x. When user tries to rename an incomplete inventory item, viewer crashes. The fix is to disallow renaming incomplete items. Reviewed by Seraph at https://codereview.productengine.com/secondlife/r/857/ --HG-- branch : product-engine --- indra/newview/llinventorybridge.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 9bbc6514b4..4e1274645f 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1270,6 +1270,12 @@ BOOL LLItemBridge::isItemRenameable() const { return FALSE; } + + if (!item->isFinished()) // EXT-8662 + { + return FALSE; + } + return (item->getPermissions().allowModifyBy(gAgent.getID())); } return FALSE; -- cgit v1.2.3 From 9dcea327605870637e4a45823a1cd3540ef98d69 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 13 Aug 2010 14:33:30 -0400 Subject: DEV-52580 FIX --- indra/newview/llinventorybridge.cpp | 43 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 53622f7188..531d4c3ee9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3936,7 +3936,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) item = (LLViewerInventoryItem*)gInventory.getItem(object_id); if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID())) { - rez_attachment(item, NULL, true); // Replace if "Wear"ing. + rez_attachment(item, NULL); } else if(item && item->isFinished()) { @@ -3952,10 +3952,6 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) } gFocusMgr.setKeyboardFocus(NULL); } - else if ("wear_add" == action) - { - LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding. - } else if (isRemoveAction(action)) { LLInventoryItem* item = gInventory.getItem(mUUID); @@ -3989,11 +3985,6 @@ std::string LLObjectBridge::getLabelSuffix() const { if (get_is_item_worn(mUUID)) { - if (!isAgentAvatarValid()) - { - return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); - } - std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID); // e.g. "(worn on ...)" / "(attached to ...)" @@ -4007,10 +3998,19 @@ std::string LLObjectBridge::getLabelSuffix() const } } -void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment, bool replace) +void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attachment) { - LLSD payload; - payload["item_id"] = item->getLinkedUUID(); // Wear the base object in case this is a link. + const LLUUID& item_id = item->getLinkedUUID(); + + // Check for duplicate request. + if (isAgentAvatarValid() && + (gAgentAvatarp->attachmentWasRequested(item_id) || + gAgentAvatarp->isWearingAttachment(item_id))) + { + llwarns << "duplicate attachment request, ignoring" << llendl; + return; + } + gAgentAvatarp->addAttachmentRequest(item_id); S32 attach_pt = 0; if (isAgentAvatarValid() && attachment) @@ -4026,14 +4026,11 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach } } - if (!replace) - { - attach_pt |= ATTACHMENT_ADD; - } - + LLSD payload; + payload["item_id"] = item_id; // Wear the base object in case this is a link. payload["attachment_point"] = attach_pt; - if (replace && + if (!gSavedSettings.getBOOL("MultipleAttachments") && (attachment && attachment->getNumObjects() > 0)) { LLNotificationsUtil::add("ReplaceAttachment", LLSD(), payload, confirm_replace_attachment_rez); @@ -4057,11 +4054,15 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0/*YES*/) { - LLViewerInventoryItem* itemp = gInventory.getItem(notification["payload"]["item_id"].asUUID()); + LLUUID item_id = notification["payload"]["item_id"].asUUID(); + LLViewerInventoryItem* itemp = gInventory.getItem(item_id); if (itemp) { U8 attachment_pt = notification["payload"]["attachment_point"].asInteger(); + + if (gSavedSettings.getBOOL("MultipleAttachments")) + attachment_pt |= ATTACHMENT_ADD; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_RezSingleAttachmentFromInv); @@ -4118,7 +4119,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Wearable And Object Wear")); - items.push_back(std::string("Wearable Add")); items.push_back(std::string("Attach To")); items.push_back(std::string("Attach To HUD")); // commented out for DEV-32347 @@ -4127,7 +4127,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (!gAgentAvatarp->canAttachMoreObjects()) { disabled_items.push_back(std::string("Wearable And Object Wear")); - disabled_items.push_back(std::string("Wearable Add")); disabled_items.push_back(std::string("Attach To")); disabled_items.push_back(std::string("Attach To HUD")); } -- cgit v1.2.3 From 90e3d83a5cb35e98a02a3017dd79ebc272bbfe85 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 21 Sep 2010 13:26:52 -0400 Subject: Fix for build failures - disabling tcmalloc for now --- indra/newview/llinventorybridge.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/llinventorybridge.cpp (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp old mode 100644 new mode 100755 -- cgit v1.2.3 From cf09d6c58a741263cddcf338c2f79836873475b1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 22 Sep 2010 03:04:21 -0500 Subject: Remove LL_MESH_ENABLED macros (fixes drag and drop). Add mesh stitching type back into tools floater. --- indra/newview/llinventorybridge.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b03947f54d..eb23ab95dd 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -920,7 +920,6 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, // Only should happen for broken links. new_listener = new LLLinkItemBridge(inventory, root, uuid); break; -#if LL_MESH_ENABLED case LLAssetType::AT_MESH: if(!(inv_type == LLInventoryType::IT_MESH)) { @@ -928,7 +927,6 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, } new_listener = new LLMeshBridge(inventory, root, uuid); break; -#endif default: llinfos << "Unhandled asset type (llassetstorage.h): " @@ -2690,9 +2688,7 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_ANIMATION: case DAD_GESTURE: case DAD_LINK: -#if LL_MESH_ENABLED case DAD_MESH: -#endif accept = dragItemIntoFolder((LLInventoryItem*)cargo_data, drop); break; @@ -3602,9 +3598,7 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: -#if LL_MESH_ENABLED case DAD_MESH: -#endif { LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data; const LLPermissions& perm = inv_item->getPermissions(); @@ -4793,7 +4787,6 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -#if LL_MESH_ENABLED // +=================================================+ // | LLMeshBridge | // +=================================================+ @@ -4850,7 +4843,6 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) hide_context_entries(menu, items, disabled_items); } -#endif // +=================================================+ // | LLLinkBridge | -- cgit v1.2.3 From a5619d16f74863168f45b04b37cc6383e1a92263 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 13 Oct 2010 07:24:37 -0400 Subject: correct licenses (fix problem with license change merge) --- indra/newview/llinventorybridge.cpp | 42 ++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5618cc81c1..e3a9e86561 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2,31 +2,25 @@ * @file llinventorybridge.cpp * @brief Implementation of the Inventory-Folder-View-Bridge classes. * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 83eb22f736464b34ef9871028426011c99a57e17 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 4 Jan 2011 18:41:36 -0500 Subject: SH-739 Meshes can no longer be moved into subfolders of the "Meshes" folder Did this ever work? The code for handling drag&drop is broken completely for meshes; you can't drag them anywhere in inventory. Also did some formatting/cleanup of related code. --- indra/newview/llinventorybridge.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0f021aba89..968d1202c1 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2736,12 +2736,13 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, case DAD_CALLINGCARD: case DAD_LANDMARK: case DAD_SCRIPT: + case DAD_CLOTHING: case DAD_OBJECT: case DAD_NOTECARD: - case DAD_CLOTHING: case DAD_BODYPART: case DAD_ANIMATION: case DAD_GESTURE: + case DAD_MESH: accept = dragItemIntoFolder(inv_item, drop); break; case DAD_LINK: @@ -2771,7 +2772,11 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, accept = dragCategoryIntoFolder((LLInventoryCategory*)cargo_data, drop); } break; + case DAD_ROOT_CATEGORY: + case DAD_NONE: + break; default: + llwarns << "Unhandled cargo type for drag&drop " << cargo_type << llendl; break; } return accept; -- cgit v1.2.3