summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-12-02 14:16:07 -0500
committerLoren Shih <seraph@lindenlab.com>2009-12-02 14:16:07 -0500
commitc09b2bd9c927ae294a54299928f9bff624476144 (patch)
tree4434fe6b7ec3868e355d5145f4259de9daa01236
parentd629be01cb3136fb136b36c54b284446d8ab7599 (diff)
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
-rw-r--r--indra/newview/llinventorybridge.cpp38
-rw-r--r--indra/newview/llinventorybridge.h1
2 files changed, 31 insertions, 8 deletions
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<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"));
@@ -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())
{
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 6a284e0550..cd5d2dda1c 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -191,6 +191,7 @@ protected:
BOOL isInTrash() const;
BOOL isLinkedObjectInTrash() const; // Is this obj or its baseobj in the trash?
+ BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory?
BOOL isAgentInventory() const; // false if lost or in the inventory library
BOOL isCOFFolder() const; // true if COF or descendent of.