From 4916305ce1ea60c969c12d8dc8e573f3ee933c3f Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 1 Dec 2009 18:57:15 -0500 Subject: EXT-3029 : Missing icons for broken item link / broken folder link EXT-3024 : Broken links don't show up in inventory Mocked up some link icons for broken links. These need to be polished up. Broken links now have an IT_ (instead of being IT_NONE) so that they're filtered correctly and thus can show up in inventory. --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a44ce07d76..ebb33ef454 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -125,8 +125,8 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "Inv_Animation", "Inv_Gesture", - "inv_item_linkitem.tga", - "inv_item_linkfolder.tga" + "Inv_LinkItem", + "Inv_LinkFolder" }; // +=================================================+ @@ -856,9 +856,6 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, new_listener = new LLFolderBridge(inventory, uuid); break; case LLAssetType::AT_LINK: - // Only should happen for broken links. - new_listener = new LLLinkItemBridge(inventory, uuid); - break; case LLAssetType::AT_LINK_FOLDER: // Only should happen for broken links. new_listener = new LLLinkItemBridge(inventory, uuid); @@ -5081,7 +5078,7 @@ LLUIImagePtr LLLinkItemBridge::getIcon() const { if (LLViewerInventoryItem *item = getItem()) { - return get_item_icon(item->getActualType(), LLInventoryType::IT_NONE, 0, FALSE); + return get_item_icon(item->getActualType(), item->getInventoryType(), 0, FALSE); } return get_item_icon(LLAssetType::AT_LINK, LLInventoryType::IT_NONE, 0, FALSE); } -- cgit v1.2.3 From 8fdd2e0b28121ead88da55c2be760a5f62b6d112 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 1 Dec 2009 21:12:34 -0500 Subject: EXT-3028 : "Find Original" does nothing if floater inventory isn't open Changed logic for getActiveInventory so that it considers InventorySP. Removed getActiveInventory and replaced with getActiveInventoryPanel since that follows its current usage. This currently contains a bug because the InventorySP always thinks it's open. --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ebb33ef454..9e5a831555 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -38,7 +38,6 @@ #include "llappearancemgr.h" #include "llavataractions.h" #include "llfloatercustomize.h" -#include "llfloaterinventory.h" #include "llfloateropenobject.h" #include "llfloaterreg.h" #include "llfloaterworldmap.h" @@ -1052,7 +1051,7 @@ void LLItemBridge::gotoItem(LLFolderView *folder) LLInventoryObject *obj = getInventoryObject(); if (obj && obj->getIsLinkType()) { - LLInventoryPanel* active_panel = LLFloaterInventory::getActiveInventory()->getPanel(); + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); if (active_panel) { active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); @@ -2928,9 +2927,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // everything in the active window so that we don't follow // the selection to its new location (which is very // annoying). - if (LLFloaterInventory::getActiveInventory()) + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); + if (active_panel) { - LLInventoryPanel* active_panel = LLFloaterInventory::getActiveInventory()->getPanel(); LLInventoryPanel* panel = dynamic_cast(mInventoryPanel.get()); if (active_panel && (panel != active_panel)) { -- cgit v1.2.3 From c09b2bd9c927ae294a54299928f9bff624476144 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 2 Dec 2009 14:16:07 -0500 Subject: EXT-3057 : Refine the context options that exist for broken links EXT-2950 : Trying to waer a link or to "Find Original" of a link silently fails when original is deleted Missing links are now handled correctly in the right-click context menu. --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 38 +++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 9e5a831555..a6d47fc835 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -515,7 +515,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, if (obj && obj->getIsLinkType()) { items.push_back(std::string("Find Original")); - if (LLAssetType::lookupIsLinkType(obj->getType())) + if (isLinkedObjectMissing()) { disabled_items.push_back(std::string("Find Original")); } @@ -665,6 +665,20 @@ BOOL LLInvFVBridge::isLinkedObjectInTrash() const return FALSE; } +BOOL LLInvFVBridge::isLinkedObjectMissing() const +{ + const LLInventoryObject *obj = getInventoryObject(); + if (!obj) + { + return TRUE; + } + if (obj->getIsLinkType() && LLAssetType::lookupIsLinkType(obj->getType())) + { + return TRUE; + } + return FALSE; +} + BOOL LLInvFVBridge::isAgentInventory() const { const LLInventoryModel* model = getInventoryModel(); @@ -4077,7 +4091,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Detach From Yourself")); } else - if( !isInTrash() && !isLinkedObjectInTrash() ) + if( !isInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing()) { items.push_back(std::string("Attach Separator")); items.push_back(std::string("Object Wear")); @@ -4476,16 +4490,20 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { // FWIW, it looks like SUPPRESS_OPEN_ITEM is not set anywhere - BOOL no_open = ((flags & SUPPRESS_OPEN_ITEM) == SUPPRESS_OPEN_ITEM); + BOOL can_open = ((flags & SUPPRESS_OPEN_ITEM) != SUPPRESS_OPEN_ITEM); // If we have clothing, don't add "Open" as it's the same action as "Wear" SL-18976 LLViewerInventoryItem* item = getItem(); - if( !no_open && item ) + if (can_open && item) { - no_open = (item->getType() == LLAssetType::AT_CLOTHING) || - (item->getType() == LLAssetType::AT_BODYPART); + can_open = (item->getType() != LLAssetType::AT_CLOTHING) && + (item->getType() != LLAssetType::AT_BODYPART); } - if (!no_open) + if (isLinkedObjectMissing()) + { + can_open = FALSE; + } + if (can_open) { items.push_back(std::string("Open")); } @@ -4505,7 +4523,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) disabled_items.push_back(std::string("Wearable Edit")); } // Don't allow items to be worn if their baseobj is in the trash. - if (isLinkedObjectInTrash()) + if (isLinkedObjectInTrash() || isLinkedObjectMissing()) { disabled_items.push_back(std::string("Wearable Wear")); disabled_items.push_back(std::string("Wearable Add")); @@ -5089,6 +5107,9 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) std::vector items; std::vector disabled_items; + items.push_back(std::string("Find Original")); + disabled_items.push_back(std::string("Find Original")); + if(isInTrash()) { items.push_back(std::string("Purge Item")); @@ -5101,6 +5122,7 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Properties")); items.push_back(std::string("Delete")); if (!isItemRemovable()) { -- cgit v1.2.3