From d0d5a6a15cf3c573c89ce590030c7a150b19dd05 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 18 Dec 2014 22:16:44 -0800 Subject: DD-286 : Made stock folders in inventory do checking on paste and drop. Also prevent creation of items in stock folders --- indra/newview/llinventorybridge.cpp | 26 +++++++++++++++++++++- .../newview/skins/default/xui/en/notifications.xml | 13 +++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ae3e7c3db0..9c0c30c167 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3406,11 +3406,11 @@ void LLFolderBridge::perform_pasteFromClipboard() std::vector objects; LLClipboard::instance().pasteFromClipboard(objects); + LLViewerInventoryCategory * dest_folder = getCategory(); if (move_is_into_outbox || move_is_into_marketplacelistings) { std::string error_msg; const LLViewerInventoryCategory * master_folder = (move_is_into_outbox ? model->getFirstDescendantOf(outbox_id, mUUID) : model->getFirstDescendantOf(marketplacelistings_id, mUUID)); - LLViewerInventoryCategory * dest_folder = getCategory(); for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) { const LLUUID& item_id = (*iter); @@ -3434,6 +3434,25 @@ void LLFolderBridge::perform_pasteFromClipboard() return; } } + else + { + // Check that all items can be moved into that folder : for the moment, only stock folder mismatch is checked + for (std::vector::const_iterator iter = objects.begin(); iter != objects.end(); ++iter) + { + const LLUUID& item_id = (*iter); + LLInventoryItem *item = model->getItem(item_id); + LLInventoryCategory *cat = model->getCategory(item_id); + + if ((item && !dest_folder->acceptItem(item)) || (cat && (dest_folder->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK))) + { + std::string error_msg = LLTrans::getString("TooltipOutboxMixedStock"); + LLSD subs; + subs["[ERROR_CODE]"] = error_msg; + LLNotificationsUtil::add("StockPasteFailed", subs); + return; + } + } + } const LLUUID parent_id(mUUID); @@ -3675,6 +3694,11 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) { disabled_items.push_back(std::string("New Folder")); + disabled_items.push_back(std::string("New Script")); + disabled_items.push_back(std::string("New Note")); + disabled_items.push_back(std::string("New Gesture")); + disabled_items.push_back(std::string("New Clothes")); + disabled_items.push_back(std::string("New Body Parts")); } if (marketplace_listings_id == mUUID) { diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 06aafe45e4..cce166a8bd 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -303,6 +303,19 @@ Initialization with the Marketplace failed because of a system or network error. yestext="OK"/> + + Copy or move to Stock Folder failed with error : + + '[ERROR_CODE]' + + + +