diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-11-04 11:26:50 -0700 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-11-04 11:26:50 -0700 |
commit | 94678c2f7fbab0676ebf5c664e2d4cb8643b535f (patch) | |
tree | 5d832cf28fcb4fb5ee4bb23e6e4845644da8b0c4 | |
parent | 5d2d22322527bf303d24c15fde15025c045b7654 (diff) |
EXP-1541 update -- Route inventory items sent in a Notecard to correct locations rather than auto-sorting by asset type
* New code specifies explicit destination for "copy from notecard" or null, indicating the sim should determine the placement.
Reviewed by Stone.
-rw-r--r-- | indra/newview/llfavoritesbar.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llpreview.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.h | 5 | ||||
-rw-r--r-- | indra/newview/llviewertexteditor.cpp | 19 |
6 files changed, 49 insertions, 15 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index f577ef7fd0..4f2fd47488 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -599,7 +599,11 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con if (tool_dad->getSource() == LLToolDragAndDrop::SOURCE_NOTECARD) { viewer_item->setType(LLAssetType::AT_LANDMARK); - copy_inventory_from_notecard(tool_dad->getObjectID(), tool_dad->getSourceID(), viewer_item.get(), gInventoryCallbacks.registerCB(cb)); + copy_inventory_from_notecard(favorites_id, + tool_dad->getObjectID(), + tool_dad->getSourceID(), + viewer_item.get(), + gInventoryCallbacks.registerCB(cb)); } else { diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0e27bd81be..9188603b7a 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3544,10 +3544,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // because they must contain only links to wearable items. accept = !(move_is_into_current_outfit || move_is_into_outfit); - if(drop) + if(accept && drop) { - copy_inventory_from_notecard(LLToolDragAndDrop::getInstance()->getObjectID(), - LLToolDragAndDrop::getInstance()->getSourceID(), inv_item); + copy_inventory_from_notecard(mUUID, // Drop to the chosen destination folder + LLToolDragAndDrop::getInstance()->getObjectID(), + LLToolDragAndDrop::getInstance()->getSourceID(), + inv_item); } } else if(LLToolDragAndDrop::SOURCE_LIBRARY == source) diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 119fc95cf0..18626e3273 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -363,8 +363,10 @@ void LLPreview::onBtnCopyToInv(void* userdata) // Copy to inventory if (self->mNotecardInventoryID.notNull()) { - copy_inventory_from_notecard(self->mNotecardObjectID, - self->mNotecardInventoryID, item); + copy_inventory_from_notecard(LLUUID::null, + self->mNotecardObjectID, + self->mNotecardInventoryID, + item); } else { diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 519d4fe7f8..163581ea7f 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1209,7 +1209,23 @@ void move_inventory_item( gAgent.sendReliableMessage(); } -void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecard_inv_id, const LLInventoryItem *src, U32 callback_id) +const LLUUID get_folder_by_itemtype(const LLInventoryItem *src) +{ + LLUUID retval = LLUUID::null; + + if (src) + { + retval = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType())); + } + + return retval; +} + +void copy_inventory_from_notecard(const LLUUID& destination_id, + const LLUUID& object_id, + const LLUUID& notecard_inv_id, + const LLInventoryItem *src, + U32 callback_id) { if (NULL == src) { @@ -1255,7 +1271,7 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar body["notecard-id"] = notecard_inv_id; body["object-id"] = object_id; body["item-id"] = src->getUUID(); - body["folder-id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType())); + body["folder-id"] = destination_id; body["callback-id"] = (LLSD::Integer)callback_id; request["message"] = "CopyInventoryFromNotecard"; diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 41542a4e0f..7822ef4da6 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -363,7 +363,10 @@ void move_inventory_item( const std::string& new_name, LLPointer<LLInventoryCallback> cb); -void copy_inventory_from_notecard(const LLUUID& object_id, +const LLUUID get_folder_by_itemtype(const LLInventoryItem *src); + +void copy_inventory_from_notecard(const LLUUID& destination_id, + const LLUUID& object_id, const LLUUID& notecard_inv_id, const LLInventoryItem *src, U32 callback_id = 0); diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 0a9fae68a6..b41ed00f17 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -88,12 +88,12 @@ public: { LLVector3d global_pos; landmark->getGlobalPos(global_pos); - LLViewerInventoryItem* agent_lanmark = + LLViewerInventoryItem* agent_landmark = LLLandmarkActions::findLandmarkForGlobalPos(global_pos); - if (agent_lanmark) + if (agent_landmark) { - showInfo(agent_lanmark->getUUID()); + showInfo(agent_landmark->getUUID()); } else { @@ -104,8 +104,13 @@ public: } else { + LLInventoryItem* item = item_ptr.get(); LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied(); - copy_inventory_from_notecard(object_id, notecard_inventory_id, item_ptr.get(), gInventoryCallbacks.registerCB(cb)); + copy_inventory_from_notecard(get_folder_by_itemtype(item), + object_id, + notecard_inventory_id, + item, + gInventoryCallbacks.registerCB(cb)); } } } @@ -1266,9 +1271,11 @@ bool LLViewerTextEditor::importStream(std::istream& str) void LLViewerTextEditor::copyInventory(const LLInventoryItem* item, U32 callback_id) { - copy_inventory_from_notecard(mObjectID, + copy_inventory_from_notecard(LLUUID::null, // Don't specify a destination -- let the sim do that + mObjectID, mNotecardInventoryID, - item, callback_id); + item, + callback_id); } bool LLViewerTextEditor::hasEmbeddedInventory() |