summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llinventorybridge.cpp58
-rw-r--r--indra/newview/llinventorybridge.h2
-rw-r--r--indra/newview/llinventoryfilter.cpp7
-rw-r--r--indra/newview/llinventoryfilter.h2
-rw-r--r--indra/newview/llinventorypanel.cpp22
-rw-r--r--indra/newview/llpanelmaininventory.cpp23
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml13
7 files changed, 88 insertions, 39 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 5bfad0695c..96e64051a2 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -512,37 +512,44 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
std::vector<std::string> &disabled_items, U32 flags)
{
const LLInventoryObject *obj = getInventoryObject();
- if (obj && obj->getIsLinkType())
- {
- items.push_back(std::string("Find Original"));
- if (isLinkedObjectMissing())
- {
- disabled_items.push_back(std::string("Find Original"));
- }
- }
- else
+ if (obj)
{
- items.push_back(std::string("Rename"));
- if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0)
- {
- disabled_items.push_back(std::string("Rename"));
- }
-
- if (show_asset_id)
+ if (obj->getIsLinkType())
{
- items.push_back(std::string("Copy Asset UUID"));
- if ( (! ( isItemPermissive() || gAgent.isGodlike() ) )
- || (flags & FIRST_SELECTED_ITEM) == 0)
+ items.push_back(std::string("Find Original"));
+ if (isLinkedObjectMissing())
{
- disabled_items.push_back(std::string("Copy Asset UUID"));
+ disabled_items.push_back(std::string("Find Original"));
}
}
- items.push_back(std::string("Copy Separator"));
-
- items.push_back(std::string("Copy"));
- if (!isItemCopyable())
+ else
{
- disabled_items.push_back(std::string("Copy"));
+ if (LLAssetType::lookupCanLink(obj->getType()))
+ {
+ items.push_back(std::string("Find Links"));
+ }
+ items.push_back(std::string("Rename"));
+ if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0)
+ {
+ disabled_items.push_back(std::string("Rename"));
+ }
+
+ if (show_asset_id)
+ {
+ items.push_back(std::string("Copy Asset UUID"));
+ if ( (! ( isItemPermissive() || gAgent.isGodlike() ) )
+ || (flags & FIRST_SELECTED_ITEM) == 0)
+ {
+ disabled_items.push_back(std::string("Copy Asset UUID"));
+ }
+ }
+ items.push_back(std::string("Copy Separator"));
+
+ items.push_back(std::string("Copy"));
+ if (!isItemCopyable())
+ {
+ disabled_items.push_back(std::string("Copy"));
+ }
}
}
@@ -931,6 +938,7 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model,
{
gotoItem(folder);
}
+
if ("open" == action)
{
openItem();
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 67dfc5b6f9..63be9dcdb8 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -154,7 +154,6 @@ public:
virtual std::string getLabelSuffix() const { return LLStringUtil::null; }
virtual void openItem() {}
virtual void closeItem() {}
- virtual void gotoItem(LLFolderView *folder) {} // for links
virtual void previewItem() {openItem();}
virtual void showProperties();
virtual BOOL isItemRenameable() const { return TRUE; }
@@ -241,7 +240,6 @@ public:
virtual void restoreItem();
virtual void restoreToWorld();
virtual void gotoItem(LLFolderView *folder);
-
virtual LLUIImagePtr getIcon() const;
virtual const std::string& getDisplayName() const;
virtual std::string getLabelSuffix() const;
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 3664d7d117..e5851bb624 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -232,6 +232,13 @@ void LLInventoryFilter::setFilterTypes(U64 types, EFilterType filter_type)
mFilterOps.mFilterType = filter_type;
}
+void LLInventoryFilter::setFilterUUID(const LLUUID& object_id)
+{
+ mFilterOps.mFilterUUID = object_id;
+ mFilterOps.mFilterType = FILTERTYPE_UUID;
+ setModified(FILTER_RESTART);
+}
+
void LLInventoryFilter::setFilterSubString(const std::string& string)
{
if (mFilterSubString != string)
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 20a4a15028..47407eb86c 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -86,6 +86,8 @@ public:
U32 getFilterTypes() const;
BOOL isFilterWith(LLInventoryType::EType t) const;
+ void setFilterUUID(const LLUUID &object_id);
+
void setFilterSubString(const std::string& string);
const std::string& getFilterSubString(BOOL trim = FALSE) const;
BOOL hasFilterString() const;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 53b78ad438..932c72f4cb 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -169,7 +169,7 @@ BOOL LLInventoryPanel::postBuild()
{
setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER));
}
- mFolders->setSortOrder(mFolders->getFilter()->getSortOrder());
+ mFolders->setSortOrder(getFilter()->getSortOrder());
return TRUE;
}
@@ -209,23 +209,23 @@ LLInventoryFilter* LLInventoryPanel::getFilter()
void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type)
{
- mFolders->getFilter()->setFilterTypes(types, filter_type);
+ getFilter()->setFilterTypes(types, filter_type);
}
void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask)
{
- mFolders->getFilter()->setFilterPermissions(filter_perm_mask);
+ getFilter()->setFilterPermissions(filter_perm_mask);
}
void LLInventoryPanel::setFilterSubString(const std::string& string)
{
- mFolders->getFilter()->setFilterSubString(string);
+ getFilter()->setFilterSubString(string);
}
void LLInventoryPanel::setSortOrder(U32 order)
{
- mFolders->getFilter()->setSortOrder(order);
- if (mFolders->getFilter()->isModified())
+ getFilter()->setSortOrder(order);
+ if (getFilter()->isModified())
{
mFolders->setSortOrder(order);
// try to keep selection onscreen, even if it wasn't to start with
@@ -235,22 +235,22 @@ void LLInventoryPanel::setSortOrder(U32 order)
void LLInventoryPanel::setSinceLogoff(BOOL sl)
{
- mFolders->getFilter()->setDateRangeLastLogoff(sl);
+ getFilter()->setDateRangeLastLogoff(sl);
}
void LLInventoryPanel::setHoursAgo(U32 hours)
{
- mFolders->getFilter()->setHoursAgo(hours);
+ getFilter()->setHoursAgo(hours);
}
void LLInventoryPanel::setShowFolderState(LLInventoryFilter::EFolderShow show)
{
- mFolders->getFilter()->setShowFolderState(show);
+ getFilter()->setShowFolderState(show);
}
LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState()
{
- return mFolders->getFilter()->getShowFolderState();
+ return getFilter()->getShowFolderState();
}
void LLInventoryPanel::modelChanged(U32 mask)
@@ -845,7 +845,7 @@ bool LLInventoryPanel::attachObject(const LLSD& userdata)
BOOL LLInventoryPanel::getSinceLogoff()
{
- return mFolders->getFilter()->isSinceLogoff();
+ return getFilter()->isSinceLogoff();
}
// DEBUG ONLY
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;
}
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
index 435a3e6d34..7a3e91d5a1 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
@@ -76,7 +76,7 @@
function="Inventory.GearDefault.Custom.Action"
parameter="empty_lostnfound" />
</menu_item_call>
- <menu_item_call
+ <menu_item_call
label="Save Texture As"
layout="topleft"
name="Save Texture As">
@@ -87,4 +87,15 @@
function="Inventory.GearDefault.Enable"
parameter="save_texture" />
</menu_item_call>
+ <menu_item_call
+ label="Find All Links"
+ layout="topleft"
+ name="Find All Links">
+ <on_click
+ function="Inventory.GearDefault.Custom.Action"
+ parameter="find_links" />
+ <on_enable
+ function="Inventory.GearDefault.Enable"
+ parameter="find_links" />
+ </menu_item_call>
</menu>