Add "Move to Lost And Found" option for displaced inventory

Inspired by the work of Kitty Barnett
Fixes Issue 1337: Corrupted Inventory
Fixes Issue 1625: Unattainable inventory is Outside of My Inventoy and no options to move back to My Inventory
Fixes Issue 1580: Deleted folders showing outside of inventory folder.
This commit is contained in:
Inusaito Sayori
2014-08-19 19:52:24 -04:00
parent 435ab2ce77
commit 6f6988a487
2 changed files with 19 additions and 0 deletions

View File

@@ -2851,6 +2851,14 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
restoreItem();
return;
}
// <singu> Move displaced inventory to lost and found
else if ("move_to_lost_and_found" == action)
{
gInventory.changeCategoryParent(getCategory(), gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND), TRUE);
gInventory.addChangedMask(LLInventoryObserver::REBUILD, mUUID);
gInventory.notifyObservers();
}
// </singu>
#ifdef DELETE_SYSTEM_FOLDERS
else if ("delete_system_folder" == action)
{
@@ -3365,6 +3373,14 @@ void LLFolderBridge::buildContextMenuBaseOptions(U32 flags)
mWearables=TRUE;
}
}
// <singu> Move displaced inventory to lost and found
else if (!isAgentInventory())
{
const LLUUID& library(gInventory.getLibraryRootFolderID());
if (library == mUUID || gInventory.isObjectDescendentOf(mUUID, library))
mItems.push_back(std::string("Move to Lost And Found"));
}
// </singu>
// Preemptively disable system folder removal if more than one item selected.
if ((flags & FIRST_SELECTED_ITEM) == 0)

View File

@@ -227,6 +227,9 @@
name="Delete" width="128">
<on_click filter="" function="Inventory.DoToSelected" userdata="delete" />
</menu_item_call>
<menu_item_call label="Move to Lost And Found" mouse_opaque="true" name="Move to Lost And Found">
<on_click function="Inventory.DoToSelected" userdata="move_to_lost_and_found" />
</menu_item_call>
<menu_item_call label="Delete System Folder" mouse_opaque="true" name="Delete System Folder">
<on_click function="Inventory.DoToSelected" userdata="delete_system_folder" />
</menu_item_call>