diff options
author | Robert Knop <prospero@lindenlab.com> | 2008-12-04 22:36:34 +0000 |
---|---|---|
committer | Robert Knop <prospero@lindenlab.com> | 2008-12-04 22:36:34 +0000 |
commit | 189599b6ff0c4e6b81e761fbc990c057189359f2 (patch) | |
tree | 1e9e0e91bae9bb1ee53e57ac91cdbbfc9f6dba95 /indra/newview/llinventorybridge.cpp | |
parent | fd46865a502036b9e4414e7ec4950faf551b1f14 (diff) |
Merging from server/server-1.25 back to trunk.
svn merge -r99446:104838 svn+ssh://svn.lindenlab.com/svn/linden/branches/server/server-1.25
Conflicts resolved by Prospero, except for one scary conflict in
SendConfirmationEmail.php which was resolved by jarv.
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d3671239bb..a4b80ed7c1 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -755,6 +755,10 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model, model->deleteObject(mUUID); model->notifyObservers(); } + else if ("restoreToWorld" == action) + { + restoreToWorld(); + } else if ("restore" == action) { restoreItem(); @@ -811,6 +815,47 @@ void LLItemBridge::restoreItem() } } +void LLItemBridge::restoreToWorld() +{ + LLViewerInventoryItem* itemp = (LLViewerInventoryItem*)getItem(); + if (itemp) + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessage("RezRestoreToWorld"); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlockFast(_PREHASH_InventoryData); + itemp->packMessage(msg); + msg->sendReliable(gAgent.getRegion()->getHost()); + } + + //Similar functionality to the drag and drop rez logic + BOOL remove_from_inventory = FALSE; + + //remove local inventory copy, sim will deal with permissions and removing the item + //from the actual inventory if its a no-copy etc + if(!itemp->getPermissions().allowCopyBy(gAgent.getID())) + { + remove_from_inventory = TRUE; + } + + // Check if it's in the trash. (again similar to the normal rez logic) + LLUUID trash_id; + trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); + if(gInventory.isObjectDescendentOf(itemp->getUUID(), trash_id)) + { + remove_from_inventory = TRUE; + } + + if(remove_from_inventory) + { + gInventory.deleteObject(itemp->getUUID()); + gInventory.notifyObservers(); + } +} + LLUIImagePtr LLItemBridge::getIcon() const { return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]); @@ -3375,6 +3420,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Object Wear")); items.push_back(std::string("Attach To")); items.push_back(std::string("Attach To HUD")); + items.push_back(std::string("Restore to Last Position")); LLMenuGL* attach_menu = menu.getChildMenuByName("Attach To", TRUE); LLMenuGL* attach_hud_menu = menu.getChildMenuByName("Attach To HUD", TRUE); @@ -4363,7 +4409,6 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Wearable Wear")); items.push_back(std::string("Wearable Edit")); - if ((flags & FIRST_SELECTED_ITEM) == 0) { disabled_items.push_back(std::string("Wearable Edit")); |