diff options
author | Merov Linden <merov@lindenlab.com> | 2014-05-22 14:26:44 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-05-22 14:26:44 -0700 |
commit | aa518ce8f112a7717d025cf7bdf710635999c6a2 (patch) | |
tree | 6e80126bbf3d3c2aae528f35d046c3560d7ac069 /indra/newview | |
parent | 78e13085eb0d95d98e2602779b34952bf4495e2f (diff) |
DD-103 : Use the same logic than Drag and Drop for Paste operations. Prompt with dialog instead of tooltip though.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3715865a69..07b4eee90d 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3443,22 +3443,20 @@ void LLFolderBridge::pasteFromClipboard() LLDynamicArray<LLUUID> objects; LLClipboard::instance().pasteFromClipboard(objects); - if (move_is_into_outbox) + // Use "dragOrDrop" to go through the same accept logic + if (move_is_into_outbox || move_is_into_marketplacelistings) { - LLFolderViewItem * outbox_itemp = mInventoryPanel.get()->getItemByID(mUUID); + LLFolderViewFolder* outbox_itemp = (move_is_into_outbox ? mInventoryPanel.get()->getFolderByID(outbox_id) : mInventoryPanel.get()->getFolderByID(marketplacelistings_id)); if (outbox_itemp) { LLToolDragAndDrop::instance().setCargoCount(objects.size()); - BOOL can_list = TRUE; - - for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin(); - (iter != objects.end()) && (can_list == TRUE); - ++iter) + std::string error_msg; + for (LLDynamicArray<LLUUID>::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { const LLUUID& item_id = (*iter); - LLInventoryItem *item = model->getItem(item_id); + LLInventoryObject *item = model->getObject(item_id); if (item) { @@ -3466,17 +3464,20 @@ void LLFolderBridge::pasteFromClipboard() BOOL drop = FALSE; EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(item->getActualType()); void * cargo_data = (void *) item; - std::string tooltip_msg; - - can_list = outbox_itemp->getViewModelItem()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg); + if (!outbox_itemp->getViewModelItem()->dragOrDrop(mask, drop, cargo_type, cargo_data, error_msg)) + { + break; + } } } LLToolDragAndDrop::instance().resetCargoCount(); - if (can_list == FALSE) + if (!error_msg.empty()) { - // Notify user of failure somehow -- play error sound? modal dialog? + LLSD subs; + subs["[ERROR_CODE]"] = error_msg; + LLNotificationsUtil::add("MerchantPasteFailed", subs); return; } } |