diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2009-12-04 16:14:49 +0200 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2009-12-04 16:14:49 +0200 |
commit | 5fac7f1d35336890d99333500da26c56643e5dc7 (patch) | |
tree | 4c20d799552195d0827ad76a978cfaafc0c3025d /indra/newview/llinventorybridge.cpp | |
parent | 63cebc3ae05c952d538d17e392ebeb98c2e86cfb (diff) | |
parent | 25b6b5929e4a74023150d729c85b54ae2726c21d (diff) |
Merge from default branch.
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ac6aa307f2..5bfad0695c 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" @@ -125,8 +124,8 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "Inv_Animation", "Inv_Gesture", - "inv_item_linkitem.tga", - "inv_item_linkfolder.tga" + "Inv_LinkItem", + "Inv_LinkFolder" }; // +=================================================+ @@ -516,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")); } @@ -666,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(); @@ -856,9 +869,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); @@ -1055,7 +1065,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); @@ -2941,9 +2951,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<LLInventoryPanel*>(mInventoryPanel.get()); if (active_panel && (panel != active_panel)) { @@ -4091,7 +4101,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")); @@ -4490,16 +4500,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")); } @@ -4519,7 +4533,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")); @@ -5091,7 +5105,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); } @@ -5103,6 +5117,9 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) std::vector<std::string> items; std::vector<std::string> 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")); @@ -5115,6 +5132,7 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Properties")); items.push_back(std::string("Delete")); if (!isItemRemovable()) { |