From 73962e2134035855def0177db171d8eddaa193cb Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Thu, 16 Dec 2010 00:50:03 +0200 Subject: STORM-771 FIXED Pasting wearable items from clipboard to Current Outfit or an outfit folder now creates links to these items. --- indra/newview/llinventorybridge.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5ba87423c7..ab0acbae50 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -104,6 +104,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*); bool confirm_attachment_rez(const LLSD& notification, const LLSD& response); void teleport_via_landmark(const LLUUID& asset_id); +static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit); // +=================================================+ // | LLInvFVBridge | @@ -2341,6 +2342,10 @@ void LLFolderBridge::pasteFromClipboard() LLInventoryModel* model = getInventoryModel(); if(model && isClipboardPasteable()) { + const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); + const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); + const LLUUID parent_id(mUUID); LLDynamicArray objects; @@ -2353,7 +2358,14 @@ void LLFolderBridge::pasteFromClipboard() LLInventoryItem *item = model->getItem(item_id); if (item) { - if(LLInventoryClipboard::instance().isCutMode()) + if (move_is_into_current_outfit || move_is_into_outfit) + { + if (can_move_to_outfit(item, move_is_into_current_outfit)) + { + dropToOutfit(item, move_is_into_current_outfit); + } + } + else if(LLInventoryClipboard::instance().isCutMode()) { // move_inventory_item() is not enough, //we have to update inventory locally too @@ -2381,9 +2393,13 @@ void LLFolderBridge::pasteFromClipboard() void LLFolderBridge::pasteLinkFromClipboard() { - const LLInventoryModel* model = getInventoryModel(); + LLInventoryModel* model = getInventoryModel(); if(model) { + const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); + const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); + const LLUUID parent_id(mUUID); LLDynamicArray objects; @@ -2393,7 +2409,15 @@ void LLFolderBridge::pasteLinkFromClipboard() ++iter) { const LLUUID &object_id = (*iter); - if (LLInventoryCategory *cat = model->getCategory(object_id)) + if (move_is_into_current_outfit || move_is_into_outfit) + { + LLInventoryItem *item = model->getItem(object_id); + if (item && can_move_to_outfit(item, move_is_into_current_outfit)) + { + dropToOutfit(item, move_is_into_current_outfit); + } + } + else if (LLInventoryCategory *cat = model->getCategory(object_id)) { const std::string empty_description = ""; link_inventory_item( -- cgit v1.2.3 From 971eb7f198371febbf7458f0df7359ef5f8c70b9 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 23 Dec 2010 15:56:15 -0500 Subject: STORM-737 Inventory/Recent: Gray out "New Folder" in "+" menu and enable all menu items except "New Folder" when right clicking an item. --- indra/newview/llinventorybridge.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 5ba87423c7..a28ef4e5eb 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5320,11 +5320,6 @@ void LLRecentItemsFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) menuentry_vec_t disabled_items, items = getMenuItems(); - items.erase(std::remove(items.begin(), items.end(), std::string("New Body Parts")), items.end()); - items.erase(std::remove(items.begin(), items.end(), std::string("New Clothes")), items.end()); - items.erase(std::remove(items.begin(), items.end(), std::string("New Note")), items.end()); - items.erase(std::remove(items.begin(), items.end(), std::string("New Gesture")), items.end()); - items.erase(std::remove(items.begin(), items.end(), std::string("New Script")), items.end()); items.erase(std::remove(items.begin(), items.end(), std::string("New Folder")), items.end()); hide_context_entries(menu, items, disabled_items); -- cgit v1.2.3