summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-12-03 21:32:03 -0500
committerLoren Shih <seraph@lindenlab.com>2009-12-03 21:32:03 -0500
commit71cd24b4799f8bc0bed2665cca103c39fec3a965 (patch)
treeb9bec2842abe285c83a21d95ff581578505d18bb /indra/newview/llpanelmaininventory.cpp
parent0f2f846a12936991f0434d5aac50c850d76ce2a4 (diff)
EXT-3124 : Add lookup for finding all linked items to an item
Added ability to filter by UUID. Work in progress. --HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 74c1420cf3..3fd83bd784 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -966,6 +966,17 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
preview_texture->openToSave();
}
}
+ if (command_name == "find_links")
+ {
+ LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
+ if (!current_item)
+ {
+ return;
+ }
+
+ const LLUUID& item_id = current_item->getListener()->getUUID();
+ mActivePanel->getFilter()->setFilterUUID(item_id);
+ }
}
BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
@@ -1001,6 +1012,18 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
}
return FALSE;
}
+ if (command_name == "find_links")
+ {
+ LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
+ if (!current_item) return FALSE;
+ const LLUUID& item_id = current_item->getListener()->getUUID();
+ LLInventoryObject *obj = gInventory.getObject(item_id);
+ if (obj && !obj->getIsLinkType() && LLAssetType::lookupCanLink(obj->getType()))
+ {
+ return TRUE;
+ }
+ return FALSE;
+ }
return TRUE;
}