From 10d92237adca8bffc82c887dbd37b988602b2d59 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 15 Sep 2011 16:39:46 -0700 Subject: * Re-enabling outbox --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a36aa3dedf..5482b07ce5 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -71,7 +71,7 @@ #include "llwearablelist.h" // Marketplace outbox current disabled -#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 0 // keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_PANEL +#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 // keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_PANEL typedef std::pair two_uuids_t; typedef std::list two_uuids_list_t; -- cgit v1.2.3 From 591891306366e683416b187207fa2b94bdc263a8 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 5 Dec 2011 13:37:37 -0800 Subject: First pass at connecting to the new marketplace API --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0eaa0a4627..017dabe2ad 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -71,7 +71,7 @@ #include "llwearablelist.h" // Marketplace outbox current disabled -#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 // keep in sync with ENABLE_INVENTORY_DISPLAY_OUTBOX, ENABLE_MERCHANT_OUTBOX_PANEL +#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 // keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL typedef std::pair two_uuids_t; typedef std::list two_uuids_list_t; -- cgit v1.2.3 From a7b04c9dd44274b3548402de2f4a9b8bc20e3e50 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 9 Dec 2011 10:31:16 -0800 Subject: * Removed old inventory window outbox. * Added centered progress indicator for outbox. --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 017dabe2ad..33b9af7a78 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -71,7 +71,7 @@ #include "llwearablelist.h" // Marketplace outbox current disabled -#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 // keep in sync with ENABLE_MERCHANT_OUTBOX_PANEL +#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 typedef std::pair two_uuids_t; typedef std::list two_uuids_list_t; -- cgit v1.2.3 From 9fcdec3e34d689ccfb74fb4905fa975f5819270a Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 13 Dec 2011 11:15:01 -0800 Subject: EXP-1679 FIX -- Collapse links that are dragged to the outbox * Links are automatically tracked back to their source when dragged to the outbox * Worn items are now allowed into the outbox --- indra/newview/llinventorybridge.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 33b9af7a78..3f12e8b1d3 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -72,6 +72,7 @@ // Marketplace outbox current disabled #define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 +#define BLOCK_WORN_ITEMS_IN_OUTBOX 0 typedef std::pair two_uuids_t; typedef std::list two_uuids_list_t; @@ -1101,6 +1102,8 @@ BOOL LLInvFVBridge::canListOnMarketplace() const BOOL LLInvFVBridge::canListOnMarketplaceNow() const { #if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU + +#if BLOCK_WORN_ITEMS_IN_OUTBOX if (get_is_item_worn(mUUID)) { return FALSE; @@ -1112,6 +1115,7 @@ BOOL LLInvFVBridge::canListOnMarketplaceNow() const { return FALSE; } +#endif // BLOCK_WORN_ITEMS_IN_OUTBOX return TRUE; #else @@ -1787,19 +1791,32 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_msg) { - bool worn = get_is_item_worn(inv_item->getUUID()); + // Collapse links directly to items/folders + LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *) inv_item; + LLViewerInventoryItem * linked_item = viewer_inv_item->getLinkedItem(); + if (linked_item != NULL) + { + inv_item = linked_item; + } + bool allow_transfer = inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); if (!allow_transfer) { tooltip_msg = LLTrans::getString("TooltipOutboxNoTransfer"); + return false; } - else if(worn) + +#if BLOCK_WORN_ITEMS_IN_OUTBOX + bool worn = get_is_item_worn(inv_item->getUUID()); + if (worn) { tooltip_msg = LLTrans::getString("TooltipOutboxWorn"); + return false; } - - return !worn && allow_transfer; +#endif + + return true; } -- cgit v1.2.3 From 2f14bed8b2610f53c28881a9e2e19fd7a0be51fa Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 13 Dec 2011 11:40:36 -0800 Subject: EXP-1714 FIX -- Add rename option to context menu on outbox folders --- indra/newview/llinventorybridge.cpp | 95 ++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 48 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3f12e8b1d3..aabe851f79 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -617,7 +617,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } } - // Don't allow items to be pasted directly into the COF or the inbox + // Don't allow items to be pasted directly into the COF or the inbox/outbox if (!isCOFFolder() && !isInboxFolder() && !isOutboxFolder()) { items.push_back(std::string("Paste")); @@ -2892,6 +2892,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else if(isOutboxFolder()) { + mItems.push_back(std::string("Rename")); mItems.push_back(std::string("Delete")); } else if(isAgentInventory()) // do not allow creating in library @@ -3741,29 +3742,29 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) menuentry_vec_t items; menuentry_vec_t disabled_items; - if(isItemInTrash()) - { - addTrashContextMenuOptions(items, disabled_items); - } - else if(isOutboxFolder()) + if (isOutboxFolder()) { items.push_back(std::string("Delete")); } else { - items.push_back(std::string("Share")); - if (!canShare()) + if (isItemInTrash()) { - disabled_items.push_back(std::string("Share")); - } - items.push_back(std::string("Sound Open")); - items.push_back(std::string("Properties")); + addTrashContextMenuOptions(items, disabled_items); + } + else + { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } + items.push_back(std::string("Sound Open")); + items.push_back(std::string("Properties")); - getClipboardEntries(true, items, disabled_items, flags); - } + getClipboardEntries(true, items, disabled_items, flags); + } - if (!isOutboxFolder()) - { items.push_back(std::string("Sound Separator")); items.push_back(std::string("Sound Play")); } @@ -3799,29 +3800,29 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) menuentry_vec_t disabled_items; lldebugs << "LLLandmarkBridge::buildContextMenu()" << llendl; - if(isItemInTrash()) - { - addTrashContextMenuOptions(items, disabled_items); - } - else if(isOutboxFolder()) + if(isOutboxFolder()) { items.push_back(std::string("Delete")); } else { - items.push_back(std::string("Share")); - if (!canShare()) + if(isItemInTrash()) { - disabled_items.push_back(std::string("Share")); - } - items.push_back(std::string("Landmark Open")); - items.push_back(std::string("Properties")); + addTrashContextMenuOptions(items, disabled_items); + } + else + { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } + items.push_back(std::string("Landmark Open")); + items.push_back(std::string("Properties")); - getClipboardEntries(true, items, disabled_items, flags); - } + getClipboardEntries(true, items, disabled_items, flags); + } - if (!isOutboxFolder()) - { items.push_back(std::string("Landmark Separator")); items.push_back(std::string("About Landmark")); } @@ -4354,36 +4355,35 @@ void LLAnimationBridge::buildContextMenu(LLMenuGL& menu, U32 flags) menuentry_vec_t disabled_items; lldebugs << "LLAnimationBridge::buildContextMenu()" << llendl; - if(isItemInTrash()) - { - addTrashContextMenuOptions(items, disabled_items); - } - else if(isOutboxFolder()) + if(isOutboxFolder()) { items.push_back(std::string("Delete")); } else { - items.push_back(std::string("Share")); - if (!canShare()) + if(isItemInTrash()) { - disabled_items.push_back(std::string("Share")); - } - items.push_back(std::string("Animation Open")); - items.push_back(std::string("Properties")); + addTrashContextMenuOptions(items, disabled_items); + } + else + { + items.push_back(std::string("Share")); + if (!canShare()) + { + disabled_items.push_back(std::string("Share")); + } + items.push_back(std::string("Animation Open")); + items.push_back(std::string("Properties")); - getClipboardEntries(true, items, disabled_items, flags); - } + getClipboardEntries(true, items, disabled_items, flags); + } - if (!isOutboxFolder()) - { items.push_back(std::string("Animation Separator")); items.push_back(std::string("Animation Play")); items.push_back(std::string("Animation Audition")); } hide_context_entries(menu, items, disabled_items); - } // virtual @@ -5377,7 +5377,6 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) getClipboardEntries(true, items, disabled_items, flags); } - hide_context_entries(menu, items, disabled_items); } -- cgit v1.2.3 From a96271e3c2958a95040a1348934bd3f056f374ab Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 13 Dec 2011 13:09:53 -0800 Subject: EXP-1716 FIX -- Merchant outbox drag and drop always creates new folder * Items dragged to child folder now appear under that folder rather than in new separate top-level folder. --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index aabe851f79..3d20b99c9b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3461,7 +3461,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } else if (move_is_into_outbox && !move_is_from_outbox) { - copy_item_to_outbox(inv_item, outbox_id, LLUUID::null); + copy_item_to_outbox(inv_item, mUUID, LLUUID::null); } // NORMAL or TRASH folder // (move the item, restamp if into trash) -- cgit v1.2.3 From d7fabfee19e536dd8df356fd4531437ccb3630d5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 13 Dec 2011 13:56:41 -0800 Subject: EXP-1715 FIX -- Merchant outbox drag and drop has offset between mouse position and selected folder EXP-1717 FIX -- Drag and drop within the outbox can result in an item created at the top level of the outbox Folders are now created for items dragged around within the merchant outbox if their drop target is the top level outbox inventory panel itself. --- indra/newview/llinventorybridge.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3d20b99c9b..4bc846faeb 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3463,6 +3463,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { copy_item_to_outbox(inv_item, mUUID, LLUUID::null); } + else if (move_is_into_outbox && move_is_from_outbox) + { + move_item_within_outbox(inv_item, mUUID); + } // NORMAL or TRASH folder // (move the item, restamp if into trash) else -- cgit v1.2.3 From 399f8dd1913530488744046794a74d6c7e61ffa3 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 14 Dec 2011 14:37:38 -0800 Subject: EXP-1723 -- Improved drag and drop behavior for outbox floater. --- indra/newview/llinventorybridge.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4bc846faeb..d6b520d75e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1820,14 +1820,6 @@ static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_m } - -void LLFolderBridge::dropFolderToOutbox(LLInventoryCategory* inv_cat) -{ - copy_folder_to_outbox(inv_cat, getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false), inv_cat->getUUID()); -} - - - int get_folder_levels(LLInventoryCategory* inv_cat) { LLInventoryModel::cat_array_t* cats; @@ -2046,7 +2038,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else if (move_is_into_outbox && !move_is_from_outbox) { - dropFolderToOutbox(inv_cat); + copy_folder_to_outbox(inv_cat, mUUID, inv_cat->getUUID()); } else { -- cgit v1.2.3 From 2e564abcd682c348de3a2d3a50ef58df545c143b Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 15 Dec 2011 14:26:42 -0800 Subject: EXP-1730 FIX EXP-1731 FIX EXP-1735 FIX EXP-1736 FIX EXP-1737 FIX EXP-1738 FIX EXP-1739 FIX * Users can no longer drag and drop items to the outbox from in world, notecards or the library. * Drag and drop now blocks the creation of hierarchies that are too deep, too many folders or contain too many items. * Settings now exist to specify drag and drop limitations to the outbox, named: InventoryOutboxMaxFolderDepth (4) InventoryOutboxMaxFolderCount (20) InventoryOutboxMaxItemCount (200) --- indra/newview/llinventorybridge.cpp | 208 ++++++++++++++++++++++++++---------- 1 file changed, 150 insertions(+), 58 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d6b520d75e..26e7dab270 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1815,7 +1815,7 @@ static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_m return false; } #endif - + return true; } @@ -1874,28 +1874,28 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (!isAgentAvatarValid()) return FALSE; if (!isAgentInventory()) return FALSE; // cannot drag categories into library + const LLUUID &cat_id = inv_cat->getUUID(); + const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); + const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + + const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); + const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); + const BOOL move_is_from_outbox = model->isObjectDescendentOf(cat_id, outbox_id); // check to make sure source is agent inventory, and is represented there. LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); - const BOOL is_agent_inventory = (model->getCategory(inv_cat->getUUID()) != NULL) + const BOOL is_agent_inventory = (model->getCategory(cat_id) != NULL) && (LLToolDragAndDrop::SOURCE_AGENT == source); - const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); - const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); - BOOL accept = FALSE; if (is_agent_inventory) { - const LLUUID &cat_id = inv_cat->getUUID(); const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false); const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); - const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); const BOOL move_is_into_outfit = getCategory() && (getCategory()->getPreferredType() == LLFolderType::FT_OUTFIT); const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); - const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); - const BOOL move_is_from_outbox = model->isObjectDescendentOf(inv_cat->getUUID(), outbox_id); //-------------------------------------------------------------------------------- // Determine if folder can be moved. @@ -1950,24 +1950,58 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } if (move_is_into_outbox) { - for (S32 i=0; i < descendent_items.count(); ++i) + int nested_folder_levels = (get_folder_path_length(outbox_id, mUUID) - 1) + get_folder_levels(inv_cat); + + if (nested_folder_levels >= gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) { - LLInventoryItem* item = descendent_items[i]; - if (!can_move_to_outbox(item, tooltip_msg)) - { - is_movable = FALSE; - break; - } + tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels"); + is_movable = FALSE; } + else + { + const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); + + int existing_item_count = 0; + int existing_folder_count = 0; + + if (master_folder != NULL) + { + LLInventoryModel::cat_array_t existing_categories; + LLInventoryModel::item_array_t existing_items; - int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat); + gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); + + existing_item_count = existing_items.count(); + existing_folder_count = existing_categories.count(); + } - if (nested_folder_levels > 4) - { - tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels"); - is_movable = FALSE; + const int nested_folder_count = existing_folder_count + descendent_categories.count(); + const int nested_item_count = existing_item_count + descendent_items.count(); + + if (nested_folder_count >= gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) + { + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyFolders"); + is_movable = FALSE; + } + else if (nested_item_count >= gSavedSettings.getU32("InventoryOutboxMaxItemCount")) + { + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects"); + is_movable = FALSE; + } + + if (is_movable == TRUE); + { + for (S32 i=0; i < descendent_items.count(); ++i) + { + LLInventoryItem* item = descendent_items[i]; + if (!can_move_to_outbox(item, tooltip_msg)) + { + is_movable = FALSE; + break; + } + } + } } - } // @@ -2008,7 +2042,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // Recursively create links in target outfit. LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; - gInventory.collectDescendents(inv_cat->getUUID(), cats, items, LLInventoryModel::EXCLUDE_TRASH); + gInventory.collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); LLAppearanceMgr::instance().linkAll(mUUID,items,NULL); } } @@ -2026,7 +2060,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const std::string empty_description = ""; link_inventory_item( gAgent.getID(), - inv_cat->getUUID(), + cat_id, mUUID, inv_cat->getName(), empty_description, @@ -2038,13 +2072,13 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else if (move_is_into_outbox && !move_is_from_outbox) { - copy_folder_to_outbox(inv_cat, mUUID, inv_cat->getUUID()); + copy_folder_to_outbox(inv_cat, mUUID, cat_id); } else { - if (gInventory.isObjectDescendentOf(inv_cat->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) + if (gInventory.isObjectDescendentOf(cat_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) { - set_dad_inbox_object(inv_cat->getUUID()); + set_dad_inbox_object(cat_id); } // Reparent the folder and restamp children if it's moving @@ -2059,15 +2093,28 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else if (LLToolDragAndDrop::SOURCE_WORLD == source) { - // content category has same ID as object itself - LLUUID object_id = inv_cat->getUUID(); - LLUUID category_id = mUUID; - accept = move_inv_category_world_to_agent(object_id, category_id, drop); + if (move_is_into_outbox) + { + tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + accept = FALSE; + } + else + { + accept = move_inv_category_world_to_agent(cat_id, mUUID, drop); + } } else if (LLToolDragAndDrop::SOURCE_LIBRARY == source) { - // Accept folders that contain complete outfits. - accept = move_is_into_current_outfit && LLAppearanceMgr::instance().getCanMakeFolderIntoOutfit(inv_cat->getUUID()); + if (move_is_into_outbox) + { + tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNoTransferLibrary"); + accept = FALSE; + } + else + { + // Accept folders that contain complete outfits. + accept = move_is_into_current_outfit && LLAppearanceMgr::instance().getCanMakeFolderIntoOutfit(cat_id); + } if (accept && drop) { @@ -3317,8 +3364,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { LLInventoryModel* model = getInventoryModel(); - if(!model || !inv_item) return FALSE; - if(!isAgentInventory()) return FALSE; // cannot drag into library + if (!model || !inv_item) return FALSE; + if (!isAgentInventory()) return FALSE; // cannot drag into library if (!isAgentAvatarValid()) return FALSE; const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); @@ -3386,10 +3433,14 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, accept = TRUE; if (!is_movable) + { accept = FALSE; - if ((mUUID == inv_item->getParentUUID()) && !move_is_into_favorites) + } + else if ((mUUID == inv_item->getParentUUID()) && !move_is_into_favorites) + { accept = FALSE; - if (move_is_into_current_outfit || move_is_into_outfit) + } + else if (move_is_into_current_outfit || move_is_into_outfit) { accept = can_move_to_outfit(inv_item, move_is_into_current_outfit); } @@ -3400,9 +3451,32 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, else if (move_is_into_outbox) { accept = can_move_to_outbox(inv_item, tooltip_msg); + + if (accept) + { + const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); + + int existing_item_count = 0; + + if (master_folder != NULL) + { + LLInventoryModel::cat_array_t existing_categories; + LLInventoryModel::item_array_t existing_items; + + gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); + + existing_item_count = existing_items.count(); + } + + if (existing_item_count >= gSavedSettings.getU32("InventoryOutboxMaxItemCount")) + { + tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects"); + accept = FALSE; + } + } } - if(accept && drop) + if (accept && drop) { if (inv_item->getType() == LLAssetType::AT_GESTURE && LLGestureMgr::instance().isGestureActive(inv_item->getUUID()) && move_is_into_trash) @@ -3451,13 +3525,16 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { dropToOutfit(inv_item, move_is_into_current_outfit); } - else if (move_is_into_outbox && !move_is_from_outbox) + else if (move_is_into_outbox) { - copy_item_to_outbox(inv_item, mUUID, LLUUID::null); - } - else if (move_is_into_outbox && move_is_from_outbox) - { - move_item_within_outbox(inv_item, mUUID); + if (move_is_from_outbox) + { + move_item_within_outbox(inv_item, mUUID); + } + else + { + copy_item_to_outbox(inv_item, mUUID, LLUUID::null); + } } // NORMAL or TRASH folder // (move the item, restamp if into trash) @@ -3478,7 +3555,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // //-------------------------------------------------------------------------------- - } } else if (LLToolDragAndDrop::SOURCE_WORLD == source) @@ -3487,7 +3563,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // anonymous objects, it would be possible to bypass // permissions. object = gObjectList.findObject(inv_item->getParentUUID()); - if(!object) + if (!object) { llinfos << "Object not found for drop." << llendl; return FALSE; @@ -3497,10 +3573,9 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // move/copy this item. LLPermissions perm(inv_item->getPermissions()); BOOL is_move = FALSE; - if((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()) + if ((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()) && perm.allowTransferTo(gAgent.getID()))) // || gAgent.isGodlike()) - { accept = TRUE; } @@ -3516,7 +3591,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // Don't allow placing an original item into Current Outfit or an outfit folder // because they must contain only links to wearable items. // *TODO: Probably we should create a link to an item if it was dragged to outfit or COF. - if(move_is_into_current_outfit || move_is_into_outfit) + if (move_is_into_current_outfit || move_is_into_outfit) { accept = FALSE; } @@ -3527,8 +3602,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = FALSE; } - - if(drop && accept) + else if (move_is_into_outbox) + { + tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + accept = FALSE; + } + + if (accept && drop) { LLMoveInv* move_inv = new LLMoveInv; move_inv->mObjectID = inv_item->getParentUUID(); @@ -3550,15 +3630,22 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLNotifications::instance().forceResponse(params, 0); } } - } else if(LLToolDragAndDrop::SOURCE_NOTECARD == source) { - // Don't allow placing an original item from a notecard to Current Outfit or an outfit folder - // because they must contain only links to wearable items. - accept = !(move_is_into_current_outfit || move_is_into_outfit); - - if(accept && drop) + if (move_is_into_outbox) + { + tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + accept = FALSE; + } + else + { + // Don't allow placing an original item from a notecard to Current Outfit or an outfit folder + // because they must contain only links to wearable items. + accept = !(move_is_into_current_outfit || move_is_into_outfit); + } + + if (accept && drop) { copy_inventory_from_notecard(mUUID, // Drop to the chosen destination folder LLToolDragAndDrop::getInstance()->getObjectID(), @@ -3573,7 +3660,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = TRUE; - if (move_is_into_current_outfit || move_is_into_outfit) + if (move_is_into_outbox) + { + tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + accept = FALSE; + } + else if (move_is_into_current_outfit || move_is_into_outfit) { accept = can_move_to_outfit(inv_item, move_is_into_current_outfit); } -- cgit v1.2.3 From b6af1b47f15992b60ddb4c718f03ae6d2040cc19 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 15 Dec 2011 15:09:02 -0800 Subject: Windows build fix and fixes for off-by-1 errors in limitations --- indra/newview/llinventorybridge.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 26e7dab270..64b5a9deba 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1950,9 +1950,9 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } if (move_is_into_outbox) { - int nested_folder_levels = (get_folder_path_length(outbox_id, mUUID) - 1) + get_folder_levels(inv_cat); + int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat); - if (nested_folder_levels >= gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) + if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) { tooltip_msg = LLTrans::getString("TooltipOutboxFolderLevels"); is_movable = FALSE; @@ -1962,7 +1962,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); int existing_item_count = 0; - int existing_folder_count = 0; + int existing_folder_count = 1; // +1 for this folder being dragged now if (master_folder != NULL) { @@ -1971,25 +1971,25 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); - existing_item_count = existing_items.count(); - existing_folder_count = existing_categories.count(); + existing_item_count += existing_items.count(); + existing_folder_count += existing_categories.count(); } const int nested_folder_count = existing_folder_count + descendent_categories.count(); const int nested_item_count = existing_item_count + descendent_items.count(); - if (nested_folder_count >= gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) + if (nested_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) { tooltip_msg = LLTrans::getString("TooltipOutboxTooManyFolders"); is_movable = FALSE; } - else if (nested_item_count >= gSavedSettings.getU32("InventoryOutboxMaxItemCount")) + else if (nested_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) { tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects"); is_movable = FALSE; } - if (is_movable == TRUE); + if (is_movable == TRUE) { for (S32 i=0; i < descendent_items.count(); ++i) { @@ -3456,7 +3456,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); - int existing_item_count = 0; + int existing_item_count = 1; // +1 for this item being dragged now if (master_folder != NULL) { @@ -3465,10 +3465,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); - existing_item_count = existing_items.count(); + existing_item_count += existing_items.count(); } - if (existing_item_count >= gSavedSettings.getU32("InventoryOutboxMaxItemCount")) + if (existing_item_count > gSavedSettings.getU32("InventoryOutboxMaxItemCount")) { tooltip_msg = LLTrans::getString("TooltipOutboxTooManyObjects"); accept = FALSE; -- cgit v1.2.3 From f1edfc73efa526735b2a80d47e2381a2b46295df Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 15 Dec 2011 16:21:35 -0800 Subject: EXP-1726 FIX -- Rename option present in context menu when selecting multiple folders in Outbox --- indra/newview/llinventorybridge.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 64b5a9deba..adf1d6254d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2933,10 +2933,15 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { mItems.push_back(std::string("Rename")); mItems.push_back(std::string("Delete")); + + if ((flags & FIRST_SELECTED_ITEM) == 0) + { + mDisabledItems.push_back(std::string("Rename")); + } } else if(isAgentInventory()) // do not allow creating in library { - LLViewerInventoryCategory *cat = getCategory(); + LLViewerInventoryCategory *cat = getCategory(); // BAP removed protected check to re-enable standard ops in untyped folders. // Not sure what the right thing is to do here. if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) -- cgit v1.2.3 From 16778677868620874b8b042f6c62712c9d28f2fb Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 16 Dec 2011 10:43:57 -0800 Subject: EXP-1738 FIX EXP-1739 FIX * Initial pass to block drag and drop of multiple items when resultant outbox folder would contain too many items or folders. --- indra/newview/llinventorybridge.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index adf1d6254d..ff980955e0 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -60,6 +60,7 @@ #include "llpreviewtexture.h" #include "llselectmgr.h" #include "llsidepanelappearance.h" +#include "lltooldraganddrop.h" #include "lltrans.h" #include "llviewerassettype.h" #include "llviewerfoldertype.h" @@ -1962,7 +1963,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); int existing_item_count = 0; - int existing_folder_count = 1; // +1 for this folder being dragged now + int existing_folder_count = LLToolDragAndDrop::instance().getCargoIDsCount(); if (master_folder != NULL) { @@ -3461,7 +3462,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); - int existing_item_count = 1; // +1 for this item being dragged now + int existing_item_count = LLToolDragAndDrop::instance().getCargoIDsCount(); if (master_folder != NULL) { -- cgit v1.2.3 From 5b6fe3a8388ae8f3b0e49899a1ff4a0b5aca35fd Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 16 Dec 2011 16:35:21 -0800 Subject: EXP-1730 FIX -- Library items can be dragged and dropped to Outbox floater and folders are not created for items * Updated to proper tooltip string --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ff980955e0..3f12067048 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2108,7 +2108,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, { if (move_is_into_outbox) { - tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNoTransferLibrary"); + tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; } else -- cgit v1.2.3 From ac01fb0e0378476fd572ba24151d73840f119519 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 19 Dec 2011 13:55:53 -0800 Subject: EXP-1683 FIX -- Add main inventory context menu option Copy To Outbox * The logic to determine whether or not the "Copy to Merchant Outbox" item is available is now tied to drag and drop functionality. --- indra/newview/llinventorybridge.cpp | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3f12067048..d8e0529501 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1102,26 +1102,33 @@ BOOL LLInvFVBridge::canListOnMarketplace() const BOOL LLInvFVBridge::canListOnMarketplaceNow() const { + BOOL can_list = FALSE; + #if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU -#if BLOCK_WORN_ITEMS_IN_OUTBOX - if (get_is_item_worn(mUUID)) - { - return FALSE; - } + const LLInventoryObject* obj = getInventoryObject(); - // Loop through all items worn by avatar and check to see if they are descendants - // of the item we are trying to list on the marketplace - if (get_is_parent_to_worn_item(mUUID)) + if (obj) { - return FALSE; + // Get outbox id + const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + LLFolderViewItem * outbox_itemp = mRoot->getItemByID(outbox_id); + + if (outbox_itemp) + { + MASK mask = 0x0; + BOOL drop = FALSE; + EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType()); + void * cargo_data = (void *) obj; + std::string tooltip_msg; + + can_list = outbox_itemp->getListener()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg); + } } -#endif // BLOCK_WORN_ITEMS_IN_OUTBOX - return TRUE; -#else - return FALSE; #endif + + return can_list; } -- cgit v1.2.3 From a0929f39caba9c2b7be8184f217c8e2a811857eb Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 19 Dec 2011 13:58:36 -0800 Subject: EXP-1170 FIX -- Right click context menu to Copy to Outbox shown if user is not a merchant * The context menu option is no longer shown if the user does not have an outbox. --- indra/newview/llinventorybridge.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d8e0529501..7665ad6e88 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1087,6 +1087,12 @@ BOOL LLInvFVBridge::canListOnMarketplace() const { return FALSE; } + + const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + if (outbox_id.isNull()) + { + return FALSE; + } LLViewerInventoryItem * item = model->getItem(mUUID); if (item && !item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) -- cgit v1.2.3 From 6c26fdea4d62f723c3bdbec9ded032e6d77301b8 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 19 Dec 2011 16:46:26 -0800 Subject: EXP-1741 FIX -- Learn more link goes to page not found from Outbox for user that is not a merchant an Agni EXP-1746 FIX -- Update Outbox messaging EXP-1748 FIX -- Close down on messaging with Spinner MKT-3403 support -- viewer tooltips updated to match errors in marketplace * Copy has been updated to match the design per Leo and Brooke * Marketplace URL's have also been updated * The outbox floater now reports a status string in the existing folder count control --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 7665ad6e88..4e26f09978 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -73,7 +73,7 @@ // Marketplace outbox current disabled #define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 -#define BLOCK_WORN_ITEMS_IN_OUTBOX 0 +#define BLOCK_WORN_ITEMS_IN_OUTBOX 1 typedef std::pair two_uuids_t; typedef std::list two_uuids_list_t; -- cgit v1.2.3 From 11e192d9a72274d24e2a50799904c7a64ab33e27 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 20 Dec 2011 11:43:02 -0800 Subject: EXP-1738 FIX -- Disable drag and drop to folders in the outbox that would create a hierarchy that contains too many folders EXP-1743 FIX -- Tooltip errors given when dragging and dropping folders onto themselves in Merchant Outbox * Top level folder now reflected in folder count for total folders * Earlier rejections now honored in drag and drop code so outbox-specific tooltips only show up when appropriate --- indra/newview/llinventorybridge.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4e26f09978..2ff6563a09 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1918,9 +1918,9 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL is_movable = TRUE; if (LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType())) is_movable = FALSE; - if (move_is_into_outfit) + else if (move_is_into_outfit) is_movable = FALSE; - if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE)) + else if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE)) is_movable = FALSE; LLInventoryModel::cat_array_t descendent_categories; LLInventoryModel::item_array_t descendent_items; @@ -1935,7 +1935,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, break; } } - if (move_is_into_trash) + if (is_movable && move_is_into_trash) { for (S32 i=0; i < descendent_items.count(); ++i) { @@ -1947,7 +1947,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - if (move_is_into_landmarks) + if (is_movable && move_is_into_landmarks) { for (S32 i=0; i < descendent_items.count(); ++i) { @@ -1962,7 +1962,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } - if (move_is_into_outbox) + if (is_movable && move_is_into_outbox) { int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat); @@ -1976,7 +1976,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); int existing_item_count = 0; - int existing_folder_count = LLToolDragAndDrop::instance().getCargoIDsCount(); + int existing_folder_count = 1 + LLToolDragAndDrop::instance().getCargoIDsCount(); // +1 for master folder if (master_folder != NULL) { -- cgit v1.2.3 From 2a3b7f295fa82d5d4826cfd912fd07ebbe5f9c21 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 20 Dec 2011 14:41:30 -0800 Subject: EXP-1755 FIX -- Can move items to Merchant Outbox during Outbox synch using Copy to Merchant Outbox context menu * "Copy to Merchant Outbox" context menu option no longer available when marketplace import is in progress. --- indra/newview/llinventorybridge.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 2ff6563a09..96c527859c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -53,6 +53,7 @@ #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" #include "llinventorypanel.h" +#include "llmarketplacefunctions.h" #include "llnotifications.h" #include "llnotificationsutil.h" #include "llpreviewanim.h" @@ -1132,6 +1133,15 @@ BOOL LLInvFVBridge::canListOnMarketplaceNow() const } } + // Do not allow listing while import is in progress + if (LLMarketplaceInventoryImporter::instanceExists()) + { + if (LLMarketplaceInventoryImporter::instance().isImportInProgress()) + { + can_list = FALSE; + } + } + #endif return can_list; -- cgit v1.2.3 From 912833bafa9a59734432787158e36b66ee9586aa Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 4 Jan 2012 14:04:32 -0800 Subject: EXP-1738 FIX -- Disable drag and drop to folders in the outbox that would create a hierarchy that contains too many folders * Updated drag and drop to correctly handle moving to and from outbox as opposed to within the outbox when dealing with folder and item count limitations related to depth and total folder count. --- indra/newview/llinventorybridge.cpp | 101 ++++++++++++++++++++++++++++-------- 1 file changed, 78 insertions(+), 23 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 96c527859c..c94deed5e2 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1926,23 +1926,47 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // BOOL is_movable = TRUE; - if (LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType())) + + if (is_movable && (mUUID == cat_id)) + { + is_movable = FALSE; + tooltip_msg = LLTrans::getString("TooltipDragOntoSelf"); + } + if (is_movable && (model->isObjectDescendentOf(mUUID, cat_id))) + { + is_movable = FALSE; + tooltip_msg = LLTrans::getString("TooltipDragOntoOwnChild"); + } + if (is_movable && LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType())) + { is_movable = FALSE; - else if (move_is_into_outfit) + // tooltip? + } + if (is_movable && move_is_into_outfit) + { is_movable = FALSE; - else if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE)) + // tooltip? + } + if (is_movable && (mUUID == model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE))) + { is_movable = FALSE; + // tooltip? + } + LLInventoryModel::cat_array_t descendent_categories; LLInventoryModel::item_array_t descendent_items; - gInventory.collectDescendents(cat_id, descendent_categories, descendent_items, FALSE); - for (S32 i=0; i < descendent_categories.count(); ++i) + if (is_movable) { - LLInventoryCategory* category = descendent_categories[i]; - if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) + model->collectDescendents(cat_id, descendent_categories, descendent_items, FALSE); + for (S32 i=0; i < descendent_categories.count(); ++i) { - // Can't move "special folders" (e.g. Textures Folder). - is_movable = FALSE; - break; + LLInventoryCategory* category = descendent_categories[i]; + if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) + { + // Can't move "special folders" (e.g. Textures Folder). + is_movable = FALSE; + break; + } } } if (is_movable && move_is_into_trash) @@ -1974,7 +1998,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } if (is_movable && move_is_into_outbox) { - int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat); + const int nested_folder_levels = get_folder_path_length(outbox_id, mUUID) + get_folder_levels(inv_cat); if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) { @@ -1983,23 +2007,56 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else { - const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); - + int dragged_folder_count = descendent_categories.count(); int existing_item_count = 0; - int existing_folder_count = 1 + LLToolDragAndDrop::instance().getCargoIDsCount(); // +1 for master folder + int existing_folder_count = 0; + + const LLViewerInventoryCategory * master_folder = model->getFirstDescendantOf(outbox_id, mUUID); if (master_folder != NULL) { + if (model->isObjectDescendentOf(cat_id, master_folder->getUUID())) + { + // Don't use count because we're already inside the same category anyway + dragged_folder_count = 0; + } + else + { + existing_folder_count = 1; // Include the master folder in the count! + + // If we're in the drop operation as opposed to the drag without drop, we are doing a + // single category at a time so don't block based on the total amount of cargo data items + if (drop) + { + dragged_folder_count += 1; + } + else + { + // NOTE: The cargo id's count is a total of categories AND items but we err on the side of + // prevention rather than letting too many folders into the hierarchy of the outbox, + // when we're dragging the item to a new parent + dragged_folder_count += LLToolDragAndDrop::instance().getCargoIDsCount(); + } + } + + // Tally the total number of categories and items inside the master folder + LLInventoryModel::cat_array_t existing_categories; LLInventoryModel::item_array_t existing_items; - gInventory.collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); + model->collectDescendents(master_folder->getUUID(), existing_categories, existing_items, FALSE); - existing_item_count += existing_items.count(); existing_folder_count += existing_categories.count(); + existing_item_count += existing_items.count(); + } + else + { + // Assume a single category is being dragged to the outbox since we evaluate one at a time + // when not putting them under a parent item. + dragged_folder_count += 1; } - const int nested_folder_count = existing_folder_count + descendent_categories.count(); + const int nested_folder_count = existing_folder_count + dragged_folder_count; const int nested_item_count = existing_item_count + descendent_items.count(); if (nested_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount")) @@ -2031,10 +2088,8 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // //-------------------------------------------------------------------------------- - accept = is_movable - && (mUUID != cat_id) // Can't move a folder into itself - && (mUUID != inv_cat->getParentUUID()) // Avoid moves that would change nothing - && !(model->isObjectDescendentOf(mUUID, cat_id)); // Avoid circularity + accept = is_movable; + if (accept && drop) { // Look for any gestures and deactivate them @@ -2066,7 +2121,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // Recursively create links in target outfit. LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; - gInventory.collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); + model->collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH); LLAppearanceMgr::instance().linkAll(mUUID,items,NULL); } } @@ -2100,7 +2155,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else { - if (gInventory.isObjectDescendentOf(cat_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) + if (model->isObjectDescendentOf(cat_id, model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) { set_dad_inbox_object(cat_id); } -- cgit v1.2.3 From 26998a5e387edca7d89159673c3dc8cd1a8d7539 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 5 Jan 2012 12:42:58 -0800 Subject: EXP-1753 FIX -- Open Merchant Outbox floater when user selects copy to Merchant Outbox context menu option in Inventory * Modified "copy to merchant outbox" and "move to merchant outbox" context menu actions to also open the merchant outbox floater * Changed context menu behavior to always preserve disabled menu items on multiselect rather than occasionally ignoring it --- indra/newview/llinventorybridge.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index c94deed5e2..3b6dad7f5c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -465,14 +465,13 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const void hide_context_entries(LLMenuGL& menu, const menuentry_vec_t &entries_to_show, - const menuentry_vec_t &disabled_entries, - BOOL append) // If append is TRUE, then new enabled entries + const menuentry_vec_t &disabled_entries) // If append is TRUE, then new enabled entries { const LLView::child_list_t *list = menu.getChildList(); // For removing double separators or leading separator. Start at true so that // if the first element is a separator, it will not be shown. - BOOL is_previous_entry_separator = TRUE; + bool is_previous_entry_separator = true; for (LLView::child_list_t::const_iterator itor = list->begin(); itor != list->end(); @@ -496,6 +495,7 @@ void hide_context_entries(LLMenuGL& menu, if (*itor2 == name) { found = true; + break; } } @@ -503,9 +503,8 @@ void hide_context_entries(LLMenuGL& menu, // between two separators). if (found) { - const BOOL is_entry_separator = (dynamic_cast(menu_item) != NULL); - if (is_entry_separator && is_previous_entry_separator) - found = false; + const bool is_entry_separator = (dynamic_cast(menu_item) != NULL); + found = !(is_entry_separator && is_previous_entry_separator); is_previous_entry_separator = is_entry_separator; } @@ -523,15 +522,13 @@ void hide_context_entries(LLMenuGL& menu, // A bit of a hack so we can remember that some UI element explicitly set this to be visible // so that some other UI element from multi-select doesn't later set this invisible. menu_item->pushVisible(TRUE); - if (append) - { - menu_item->setEnabled(TRUE); - } + for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2) { if (*itor2 == name) { menu_item->setEnabled(FALSE); + break; } } } @@ -2946,7 +2943,7 @@ void LLFolderBridge::folderOptionsMenu() LLMenuGL* menup = dynamic_cast(mMenu.get()); if (menup) { - hide_context_entries(*menup, mItems, mDisabledItems, TRUE); + hide_context_entries(*menup, mItems, mDisabledItems); // Reposition the menu, in case we're adding items to an existing menu. menup->needsArrange(); @@ -3025,11 +3022,14 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // Not sure what the right thing is to do here. if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) { - if (!isInboxFolder() && !isOutboxFolder()) // don't allow creation in inbox + if (!isInboxFolder() && !isOutboxFolder()) // don't allow creation in inbox or outbox { // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) + { mItems.push_back(std::string("New Folder")); + } + mItems.push_back(std::string("New Script")); mItems.push_back(std::string("New Note")); mItems.push_back(std::string("New Gesture")); -- cgit v1.2.3 From 60df5e51dc977e28507b3446d649eac67556c050 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 6 Jan 2012 13:01:17 -0800 Subject: EXP-1220 GROUNDWORK -- Create context menu entry to allow import of selected item(s) * Added a context menu for "Send to Marketplace" but disabled the code to show it until we decide to move forward with this feature. * Made some progress unifying the context menu in the outbox for different types of items. (mesh, audio, etc.) --- indra/newview/llinventorybridge.cpp | 77 +++++++++++++++++++++++++++++++------ 1 file changed, 65 insertions(+), 12 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3b6dad7f5c..70553ca676 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -74,6 +74,7 @@ // Marketplace outbox current disabled #define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1 +#define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 0 #define BLOCK_WORN_ITEMS_IN_OUTBOX 1 typedef std::pair two_uuids_t; @@ -130,6 +131,11 @@ bool isMarketplaceCopyAction(const std::string& action) return (("copy_to_outbox" == action) || ("move_to_outbox" == action)); } +bool isMarketplaceSendAction(const std::string& action) +{ + return ("send_to_marketplace" == action); +} + // +=================================================+ // | LLInvFVBridge | // +=================================================+ @@ -657,7 +663,7 @@ void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else if(isOutboxFolder()) { - items.push_back(std::string("Delete")); + addOutboxContextMenuOptions(flags, items, disabled_items); } else { @@ -734,6 +740,32 @@ void LLInvFVBridge::addOpenRightClickMenuOption(menuentry_vec_t &items) items.push_back(std::string("Open")); } +void LLInvFVBridge::addOutboxContextMenuOptions(U32 flags, + menuentry_vec_t &items, + menuentry_vec_t &disabled_items) +{ + items.push_back(std::string("Rename")); + items.push_back(std::string("Delete")); + + if ((flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Rename")); + } + +#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU + if (isOutboxFolderDirectParent()) + { + items.push_back(std::string("Marketplace Separator")); + items.push_back(std::string("Marketplace Send")); + + if ((flags & FIRST_SELECTED_ITEM) == 0) + { + disabled_items.push_back(std::string("Marketplace Send")); + } + } +#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU +} + // *TODO: remove this BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const { @@ -854,6 +886,22 @@ BOOL LLInvFVBridge::isOutboxFolder() const return gInventory.isObjectDescendentOf(mUUID, outbox_id); } +BOOL LLInvFVBridge::isOutboxFolderDirectParent() const +{ + BOOL outbox_is_parent = FALSE; + + const LLInventoryCategory *cat = gInventory.getCategory(mUUID); + + if (cat) + { + const LLUUID outbox_id = getOutboxFolder(); + + outbox_is_parent = (outbox_id.notNull() && (outbox_id == cat->getParentUUID())); + } + + return outbox_is_parent; +} + const LLUUID LLInvFVBridge::getOutboxFolder() const { const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false); @@ -2585,6 +2633,17 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false); copy_folder_to_outbox(cat, outbox_id, cat->getUUID()); } +#if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU + else if (isMarketplaceSendAction(action)) + { + llinfos << "Send to marketplace action!" << llendl; + + LLInventoryCategory * cat = gInventory.getCategory(mUUID); + if (!cat) return; + + send_to_marketplace(cat); + } +#endif // ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU } void LLFolderBridge::openItem() @@ -3007,13 +3066,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else if(isOutboxFolder()) { - mItems.push_back(std::string("Rename")); - mItems.push_back(std::string("Delete")); - - if ((flags & FIRST_SELECTED_ITEM) == 0) - { - mDisabledItems.push_back(std::string("Rename")); - } + addOutboxContextMenuOptions(flags, mItems, mDisabledItems); } else if(isAgentInventory()) // do not allow creating in library { @@ -3840,7 +3893,7 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else if(isOutboxFolder()) { - items.push_back(std::string("Delete")); + addOutboxContextMenuOptions(flags, items, disabled_items); } else { @@ -3916,7 +3969,7 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (isOutboxFolder()) { - items.push_back(std::string("Delete")); + addOutboxContextMenuOptions(flags, items, disabled_items); } else { @@ -3974,7 +4027,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) lldebugs << "LLLandmarkBridge::buildContextMenu()" << llendl; if(isOutboxFolder()) { - items.push_back(std::string("Delete")); + addOutboxContextMenuOptions(flags, items, disabled_items); } else { @@ -5540,7 +5593,7 @@ void LLMeshBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else if(isOutboxFolder()) { - items.push_back(std::string("Delete")); + addOutboxContextMenuOptions(flags, items, disabled_items); } else { -- cgit v1.2.3 From 542c31d547a7a42cd81c2a535805d30b164e31e4 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 11 Jan 2012 13:37:43 -0800 Subject: EXP-1788 FIX -- Outbox drag and drop restrictions can be bypassed if inventory not fully loaded * The "Copy to Outbox" option is now disabled when the item is in the loading state. --- indra/newview/llinventorybridge.cpp | 118 ++++++++++++++++++++++-------------- 1 file changed, 71 insertions(+), 47 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 8abb6d66ad..e75ef20c6a 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1088,108 +1088,132 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) } } -BOOL LLInvFVBridge::canShare() const +bool LLInvFVBridge::canShare() const { - if (!isAgentInventory()) return FALSE; + bool can_share = false; - const LLInventoryModel* model = getInventoryModel(); - if (!model) return FALSE; - - const LLViewerInventoryItem *item = model->getItem(mUUID); - if (item) + if (isAgentInventory()) { - if (!LLInventoryCollectFunctor::itemTransferCommonlyAllowed(item)) - return FALSE; - return (BOOL)LLGiveInventory::isInventoryGiveAcceptable(item); + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLViewerInventoryItem *item = model->getItem(mUUID); + if (item) + { + if (LLInventoryCollectFunctor::itemTransferCommonlyAllowed(item)) + { + can_share = LLGiveInventory::isInventoryGiveAcceptable(item); + } + } + else + { + // Categories can be given. + can_share = (model->getCategory(mUUID) != NULL); + } + } } - // Categories can be given. - if (model->getCategory(mUUID)) return TRUE; - - return FALSE; + return can_share; } -BOOL LLInvFVBridge::canListOnMarketplace() const +bool LLInvFVBridge::canListOnMarketplace() const { #if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU + LLInventoryModel * model = getInventoryModel(); + const LLViewerInventoryCategory * cat = model->getCategory(mUUID); if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { - return FALSE; + return false; } if (!isAgentInventory()) { - return FALSE; + return false; } if (getOutboxFolder().isNull()) { - return FALSE; + return false; } if (isInboxFolder() || isOutboxFolder()) { - return FALSE; + return false; } const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); if (outbox_id.isNull()) { - return FALSE; + return false; } LLViewerInventoryItem * item = model->getItem(mUUID); if (item && !item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) { - return FALSE; + return false; } - return TRUE; + return true; + #else - return FALSE; + return false; #endif } -BOOL LLInvFVBridge::canListOnMarketplaceNow() const +bool LLInvFVBridge::canListOnMarketplaceNow() const { - BOOL can_list = FALSE; - #if ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU + + bool can_list = true; + // Do not allow listing while import is in progress + if (LLMarketplaceInventoryImporter::instanceExists()) + { + can_list = !LLMarketplaceInventoryImporter::instance().isImportInProgress(); + } + const LLInventoryObject* obj = getInventoryObject(); - if (obj) + if (obj && can_list) { - // Get outbox id - const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); - LLFolderViewItem * outbox_itemp = mRoot->getItemByID(outbox_id); + const LLUUID& object_id = obj->getLinkedUUID(); + can_list = object_id.notNull(); - if (outbox_itemp) + if (can_list) { - MASK mask = 0x0; - BOOL drop = FALSE; - EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType()); - void * cargo_data = (void *) obj; - std::string tooltip_msg; - - can_list = outbox_itemp->getListener()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg); + LLFolderViewFolder * object_folderp = mRoot->getFolderByID(object_id); + if (object_folderp) + { + can_list = !object_folderp->isLoading(); + } } - } - - // Do not allow listing while import is in progress - if (LLMarketplaceInventoryImporter::instanceExists()) - { - if (LLMarketplaceInventoryImporter::instance().isImportInProgress()) + + if (can_list) { - can_list = FALSE; + // Get outbox id + const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + LLFolderViewItem * outbox_itemp = mRoot->getItemByID(outbox_id); + + if (outbox_itemp) + { + MASK mask = 0x0; + BOOL drop = FALSE; + EDragAndDropType cargo_type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType()); + void * cargo_data = (void *) obj; + std::string tooltip_msg; + + can_list = outbox_itemp->getListener()->dragOrDrop(mask, drop, cargo_type, cargo_data, tooltip_msg); + } } } + + return can_list; +#else + return false; #endif - - return can_list; } -- cgit v1.2.3 From 6452154b19c6592efaf27e07bbee3bc6bcd3a415 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 11 Jan 2012 16:53:08 -0800 Subject: Correcting logic back to way it was, to make sure invalid objects can not be copied to the outbox --- indra/newview/llinventorybridge.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e75ef20c6a..1d7406883c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1175,8 +1175,9 @@ bool LLInvFVBridge::canListOnMarketplaceNow() const } const LLInventoryObject* obj = getInventoryObject(); + can_list &= (obj != NULL); - if (obj && can_list) + if (can_list) { const LLUUID& object_id = obj->getLinkedUUID(); can_list = object_id.notNull(); -- cgit v1.2.3 From ba41aea4b2813ac96cad2bae7c82da6e5eefd63a Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 12 Jan 2012 17:01:23 -0800 Subject: EXP-1795 FIX -- Update warning dialog for dragging and dropping no-copy items to Merchant Outbox * Any drag and drop or copy operation to the merchant outbox that contains one or more no-copy items now brings up a single modal dialog prompting the user to move the no-copy items to the outbox or to leave them all behind. --- indra/newview/llinventorybridge.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1d7406883c..11e22d5226 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1323,7 +1323,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) if (!itemp) return; const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false); - copy_item_to_outbox(itemp, outbox_id, LLUUID::null); + copy_item_to_outbox(itemp, outbox_id, LLUUID::null, LLToolDragAndDrop::getOperationId()); } } @@ -2221,7 +2221,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else if (move_is_into_outbox && !move_is_from_outbox) { - copy_folder_to_outbox(inv_cat, mUUID, cat_id); + copy_folder_to_outbox(inv_cat, mUUID, cat_id, LLToolDragAndDrop::getOperationId()); } else { @@ -2655,7 +2655,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) if (!cat) return; const LLUUID outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false); - copy_folder_to_outbox(cat, outbox_id, cat->getUUID()); + copy_folder_to_outbox(cat, outbox_id, cat->getUUID(), LLToolDragAndDrop::getOperationId()); } #if ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU else if (isMarketplaceSendAction(action)) @@ -3694,7 +3694,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } else { - copy_item_to_outbox(inv_item, mUUID, LLUUID::null); + copy_item_to_outbox(inv_item, mUUID, LLUUID::null, LLToolDragAndDrop::getOperationId()); } } // NORMAL or TRASH folder -- cgit v1.2.3 From 6b919e324e55ebcac0e2d33ca44a05fae9ac1d42 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 13 Jan 2012 16:36:57 -0800 Subject: EXP-1803 FIX -- Notify the user when a folder is automatically created for them in the outbox * New confirmation dialog lets them know when a folder was automatically created to contain an item dragged/copied to the outbox. --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 11e22d5226..270ef4fddc 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3690,7 +3690,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { if (move_is_from_outbox) { - move_item_within_outbox(inv_item, mUUID); + move_item_within_outbox(inv_item, mUUID, LLToolDragAndDrop::getOperationId()); } else { -- cgit v1.2.3 From 5e5105bd223f5180bbca634ba2c393be2ef3d13d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 13 Jan 2012 18:37:50 -0800 Subject: EXP-1770 WIP Drag and drop visual selection can be off across hierarchies added throttling to fetchInventoryItem queries --- indra/newview/llinventorybridge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index eaf9b53eb9..5916ed60a4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1234,7 +1234,7 @@ void LLItemBridge::selectItem() LLViewerInventoryItem* item = static_cast(getItem()); if(item && !item->isFinished()) { - item->fetchFromServer(); + LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false); } } -- cgit v1.2.3 From 577479a3e53ef152da191e3a004aeb34f0815658 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 17 Jan 2012 09:36:14 -0800 Subject: EXP-1803 CLEAN-UP -- Modified code to use the "unique" tag on the notification. --- indra/newview/llinventorybridge.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 270ef4fddc..1a4fd17d61 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2244,7 +2244,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, { if (move_is_into_outbox) { - tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; } else @@ -2256,7 +2256,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, { if (move_is_into_outbox) { - tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; } else @@ -3765,7 +3765,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, } else if (move_is_into_outbox) { - tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; } @@ -3796,7 +3796,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { if (move_is_into_outbox) { - tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; } else @@ -3823,7 +3823,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (move_is_into_outbox) { - tooltip_msg = tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); + tooltip_msg = LLTrans::getString("TooltipOutboxNotInInventory"); accept = FALSE; } else if (move_is_into_current_outfit || move_is_into_outfit) -- cgit v1.2.3 From 3a313469c9be4e71384314ebecb2de7434752c02 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 17 Jan 2012 11:44:40 -0800 Subject: EXP-1799 FIX -- Replace and Add to Outfit options appear as grayed out in Inventory * Updated context menu code to enable visible items that aren't explicitly disabled. --- indra/newview/llinventorybridge.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1a4fd17d61..c97d756a31 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -529,14 +529,17 @@ void hide_context_entries(LLMenuGL& menu, // so that some other UI element from multi-select doesn't later set this invisible. menu_item->pushVisible(TRUE); + BOOL enabled = TRUE; for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2) { if (*itor2 == name) { - menu_item->setEnabled(FALSE); + enabled = FALSE; break; } } + + menu_item->setEnabled(enabled); } } } -- cgit v1.2.3 From accf83394513c82e98fffa15bc0131ee25f63f00 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 17 Jan 2012 13:07:57 -0800 Subject: EXP-1805 FIX -- Block calling cards from being added to Merchant Outbox EXP-1810 PROGRESS -- Cannot resize Received items panel in Inventory window * Updated "copy to merchant outbox" context menu and drag and drop code to block calling cards. * Changed user_resize to true on the "Received Items" panel and the main inventory panel --- indra/newview/llinventorybridge.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 2d5e4938c6..3929183be2 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1153,9 +1153,17 @@ bool LLInvFVBridge::canListOnMarketplace() const } LLViewerInventoryItem * item = model->getItem(mUUID); - if (item && !item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) + if (item) { - return false; + if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) + { + return false; + } + + if (LLAssetType::AT_CALLINGCARD == item->getType()) + { + return false; + } } return true; @@ -1897,7 +1905,6 @@ static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_m } bool allow_transfer = inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); - if (!allow_transfer) { tooltip_msg = LLTrans::getString("TooltipOutboxNoTransfer"); @@ -1913,6 +1920,13 @@ static BOOL can_move_to_outbox(LLInventoryItem* inv_item, std::string& tooltip_m } #endif + bool calling_card = (LLAssetType::AT_CALLINGCARD == inv_item->getType()); + if (calling_card) + { + tooltip_msg = LLTrans::getString("TooltipOutboxCallingCard"); + return false; + } + return true; } -- cgit v1.2.3 From 216ac700431af0ab7ee45ec5fef03c928f235063 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 19 Jan 2012 15:24:29 -0800 Subject: EXP-1829 FIX -- Selecting a valid item last allows other selected invalid items to be copied to Outbox with context menu option * Updated context menu default enabled state to use the last state rather than TRUE. Once per frame, the states are all reset to TRUE so this has the effect of AND'ing together successive buildContextMenu functions rather than ignoring previous states. --- indra/newview/llinventorybridge.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3929183be2..12322b2921 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -471,7 +471,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const void hide_context_entries(LLMenuGL& menu, const menuentry_vec_t &entries_to_show, - const menuentry_vec_t &disabled_entries) // If append is TRUE, then new enabled entries + const menuentry_vec_t &disabled_entries) { const LLView::child_list_t *list = menu.getChildList(); @@ -493,7 +493,6 @@ void hide_context_entries(LLMenuGL& menu, hide_context_entries(*branchp->getBranch(), entries_to_show, disabled_entries); } - bool found = false; menuentry_vec_t::const_iterator itor2; for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2) @@ -529,7 +528,7 @@ void hide_context_entries(LLMenuGL& menu, // so that some other UI element from multi-select doesn't later set this invisible. menu_item->pushVisible(TRUE); - BOOL enabled = TRUE; + BOOL enabled = menu_item->getEnabled(); for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2) { if (*itor2 == name) -- cgit v1.2.3 From a73013f7081db15aae93cc82feb895139b1847db Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 20 Jan 2012 13:41:43 -0800 Subject: EXP-1799 FIX -- Replace and Add to Outfit options appear as grayed out in Inventory * Modified build context menu code to not disable items that are invisible so secondary background fetch can coalesce menu options with proper state. * Removed "Move to Merchant Outbox" context menu option. --- indra/newview/llinventorybridge.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 12322b2921..97e61f4c99 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -519,7 +519,6 @@ void hide_context_entries(LLMenuGL& menu, { menu_item->setVisible(FALSE); } - menu_item->setEnabled(FALSE); } else { @@ -528,14 +527,10 @@ void hide_context_entries(LLMenuGL& menu, // so that some other UI element from multi-select doesn't later set this invisible. menu_item->pushVisible(TRUE); - BOOL enabled = menu_item->getEnabled(); - for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2) + bool enabled = (menu_item->getEnabled() == TRUE); + for (itor2 = disabled_entries.begin(); enabled && (itor2 != disabled_entries.end()); ++itor2) { - if (*itor2 == name) - { - enabled = FALSE; - break; - } + enabled &= (*itor2 != name); } menu_item->setEnabled(enabled); @@ -613,12 +608,10 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, copyable = inv_item->getPermissions().allowCopyBy(gAgent.getID()); } - const std::string merchant_action = ((copyable == true) ? "Merchant Copy" : "Merchant Move"); - items.push_back(merchant_action); - + items.push_back(std::string("Merchant Copy")); if (!canListOnMarketplaceNow()) { - disabled_items.push_back(merchant_action); + disabled_items.push_back(std::string("Merchant Copy")); } } } -- cgit v1.2.3 From c8a2f6515a47c625d97802bd9f7bd833be65fe2c Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 20 Jan 2012 16:10:32 -0800 Subject: EXP-1799 FIX -- Replace and Add to Outfit options appear as grayed out in Inventory * Refactored LLFolderBridge::buildContextMenu fetch to clear and rebuild basic context menu options after the fetch rather than trying to merge the two. --- indra/newview/llinventorybridge.cpp | 86 +++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 33 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 97e61f4c99..472be8cf5c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -519,6 +519,8 @@ void hide_context_entries(LLMenuGL& menu, { menu_item->setVisible(FALSE); } + + menu_item->setEnabled(FALSE); } else { @@ -601,13 +603,6 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, { items.push_back(std::string("Marketplace Separator")); - bool copyable = true; - LLViewerInventoryItem* inv_item = gInventory.getItem(mUUID); - if (inv_item) - { - copyable = inv_item->getPermissions().allowCopyBy(gAgent.getID()); - } - items.push_back(std::string("Merchant Copy")); if (!canListOnMarketplaceNow()) { @@ -1138,12 +1133,6 @@ bool LLInvFVBridge::canListOnMarketplace() const return false; } - const LLUUID & outbox_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); - if (outbox_id.isNull()) - { - return false; - } - LLViewerInventoryItem * item = model->getItem(mUUID); if (item) { @@ -2415,7 +2404,6 @@ public: delete this; } - protected: LLUUID mCatID; bool mCopyItems; @@ -2945,12 +2933,38 @@ void LLFolderBridge::staticFolderOptionsMenu() LLFolderBridge* selfp = sSelf.get(); if (selfp) { - selfp->folderOptionsMenu(); + selfp->folderOptionsMenuAfterFetch(); } } -void LLFolderBridge::folderOptionsMenu() +void LLFolderBridge::folderOptionsMenuAfterFetch() { + const U32 flags = mContextMenuFlags; + + mItems.clear(); + mDisabledItems.clear(); + mContextMenuFlags = 0x0; + + LLMenuGL* menup = dynamic_cast(mMenu.get()); + if (!menup) return; + + // Reset the menu + { + const LLView::child_list_t *list = menup->getChildList(); + + LLView::child_list_t::const_iterator menu_itor; + for (menu_itor = list->begin(); menu_itor != list->end(); ++menu_itor) + { + (*menu_itor)->setVisible(FALSE); + (*menu_itor)->pushVisible(TRUE); + (*menu_itor)->setEnabled(TRUE); + } + } + + // Build basic menu back up + buildContextMenuBaseOptions(*menup, flags); + + // Build folder specific options back up LLInventoryModel* model = getInventoryModel(); if(!model) return; @@ -3032,15 +3046,12 @@ void LLFolderBridge::folderOptionsMenu() } mItems.push_back(std::string("Outfit Separator")); } - LLMenuGL* menup = dynamic_cast(mMenu.get()); - if (menup) - { - hide_context_entries(*menup, mItems, mDisabledItems); - // Reposition the menu, in case we're adding items to an existing menu. - menup->needsArrange(); - menup->arrangeAndClear(); - } + hide_context_entries(*menup, mItems, mDisabledItems); + + // Reposition the menu, in case we're adding items to an existing menu. + menup->needsArrange(); + menup->arrangeAndClear(); } BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type) @@ -3055,17 +3066,11 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv return ((item_array.count() > 0) ? TRUE : FALSE ); } -// Flags unused -void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +void LLFolderBridge::buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags) { - mItems.clear(); - mDisabledItems.clear(); - - lldebugs << "LLFolderBridge::buildContextMenu()" << llendl; - -// menuentry_vec_t disabled_items; LLInventoryModel* model = getInventoryModel(); - if(!model) return; + llassert(model != NULL); + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); const LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); @@ -3186,6 +3191,21 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mDisabledItems.push_back(std::string("Share")); } } +} + +// Flags unused +void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + mItems.clear(); + mDisabledItems.clear(); + mContextMenuFlags = flags; + + lldebugs << "LLFolderBridge::buildContextMenu()" << llendl; + + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + + buildContextMenuBaseOptions(menu, flags); hide_context_entries(menu, mItems, mDisabledItems); -- cgit v1.2.3 From 039cd701c4fa1dcc32bc63f57aab5a5f995f7498 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 20 Jan 2012 16:36:25 -0800 Subject: * Modified so "Copy" context menu option is not available for "no copy" items. --- indra/newview/llinventorybridge.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 472be8cf5c..bce3511c80 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1654,11 +1654,7 @@ BOOL LLItemBridge::isItemCopyable() const return FALSE; } - // All items can be copied in god mode since you can - // at least paste-as-link the item, though you - // still may not be able paste the item. - return TRUE; - // return (item->getPermissions().allowCopyBy(gAgent.getID())); + return item->getPermissions().allowCopyBy(gAgent.getID()) || gSavedSettings.getBOOL("InventoryLinking"); } return FALSE; } @@ -1771,12 +1767,8 @@ BOOL LLFolderBridge::isUpToDate() const BOOL LLFolderBridge::isItemCopyable() const { - if (gSavedSettings.getBOOL("InventoryLinking")) - { - // Can copy folders to paste-as-link, but not for straight paste. - return TRUE; - } - return FALSE; + // Can copy folders to paste-as-link, but not for straight paste. + return gSavedSettings.getBOOL("InventoryLinking"); } BOOL LLFolderBridge::copyToClipboard() const -- cgit v1.2.3 From e2d4309ba56b103bbcd215b09c9d877ceb71dc38 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 23 Jan 2012 11:45:47 -0800 Subject: EXP-1799 FIX -- Replace and Add to Outfit options and Copy to Merchant Outbox options can appear in invalid state when a valid folder is last selection EXP-1834 FIX -- Right click context menus on Folders in Merchant Outbox and Library folders can show all inventory options including admin options EXP-1835 FIX -- Right clicking on a folder and selecting New Folder creates folder under My Inventory not within selected folder * Updated folder context menu building to build full options in one step or trigger a load which will rebuild top-level context menu for all selected items when complete. Previous code had an implicit assumption that the selected folder was the only selection after background fetch. --- indra/newview/llinventorybridge.cpp | 257 ++++++++++++++++-------------------- 1 file changed, 113 insertions(+), 144 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index bce3511c80..9e21e2fceb 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2923,127 +2923,11 @@ void LLFolderBridge::pasteLinkFromClipboard() void LLFolderBridge::staticFolderOptionsMenu() { LLFolderBridge* selfp = sSelf.get(); - if (selfp) - { - selfp->folderOptionsMenuAfterFetch(); - } -} - -void LLFolderBridge::folderOptionsMenuAfterFetch() -{ - const U32 flags = mContextMenuFlags; - - mItems.clear(); - mDisabledItems.clear(); - mContextMenuFlags = 0x0; - - LLMenuGL* menup = dynamic_cast(mMenu.get()); - if (!menup) return; - - // Reset the menu - { - const LLView::child_list_t *list = menup->getChildList(); - - LLView::child_list_t::const_iterator menu_itor; - for (menu_itor = list->begin(); menu_itor != list->end(); ++menu_itor) - { - (*menu_itor)->setVisible(FALSE); - (*menu_itor)->pushVisible(TRUE); - (*menu_itor)->setEnabled(TRUE); - } - } - - // Build basic menu back up - buildContextMenuBaseOptions(*menup, flags); - - // Build folder specific options back up - LLInventoryModel* model = getInventoryModel(); - if(!model) return; - - const LLInventoryCategory* category = model->getCategory(mUUID); - if(!category) return; - - const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); - if (trash_id == mUUID) return; - if (isItemInTrash()) return; - if (!isAgentInventory()) return; - if (isOutboxFolder()) return; - - LLFolderType::EType type = category->getPreferredType(); - const bool is_system_folder = LLFolderType::lookupIsProtectedType(type); - // BAP change once we're no longer treating regular categories as ensembles. - const bool is_ensemble = (type == LLFolderType::FT_NONE || - LLFolderType::lookupIsEnsembleType(type)); - - // Only enable calling-card related options for non-system folders. - if (!is_system_folder) - { - LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); - if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) - { - mItems.push_back(std::string("Calling Card Separator")); - mItems.push_back(std::string("Conference Chat Folder")); - mItems.push_back(std::string("IM All Contacts In Folder")); - } - } - - if (!isItemRemovable()) - { - mDisabledItems.push_back(std::string("Delete")); - } -#ifndef LL_RELEASE_FOR_DOWNLOAD - if (LLFolderType::lookupIsProtectedType(type)) + if (selfp && selfp->mRoot) { - mItems.push_back(std::string("Delete System Folder")); + selfp->mRoot->updateMenu(); } -#endif - - // wearables related functionality for folders. - //is_wearable - LLFindWearables is_wearable; - LLIsType is_object( LLAssetType::AT_OBJECT ); - LLIsType is_gesture( LLAssetType::AT_GESTURE ); - - if (mWearables || - checkFolderForContentsOfType(model, is_wearable) || - checkFolderForContentsOfType(model, is_object) || - checkFolderForContentsOfType(model, is_gesture) ) - { - mItems.push_back(std::string("Folder Wearables Separator")); - - // Only enable add/replace outfit for non-system folders. - if (!is_system_folder) - { - // Adding an outfit onto another (versus replacing) doesn't make sense. - if (type != LLFolderType::FT_OUTFIT) - { - mItems.push_back(std::string("Add To Outfit")); - } - - mItems.push_back(std::string("Replace Outfit")); - } - if (is_ensemble) - { - mItems.push_back(std::string("Wear As Ensemble")); - } - mItems.push_back(std::string("Remove From Outfit")); - if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID)) - { - mDisabledItems.push_back(std::string("Remove From Outfit")); - } - if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) - { - mDisabledItems.push_back(std::string("Replace Outfit")); - } - mItems.push_back(std::string("Outfit Separator")); - } - - hide_context_entries(*menup, mItems, mDisabledItems); - - // Reposition the menu, in case we're adding items to an existing menu. - menup->needsArrange(); - menup->arrangeAndClear(); } BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type) @@ -3058,7 +2942,7 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv return ((item_array.count() > 0) ? TRUE : FALSE ); } -void LLFolderBridge::buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags) +void LLFolderBridge::buildContextMenuBaseOptions(U32 flags) { LLInventoryModel* model = getInventoryModel(); llassert(model != NULL); @@ -3079,10 +2963,6 @@ void LLFolderBridge::buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags) mDisabledItems.push_back(std::string("New Body Parts")); } - // clear out old menu and folder pointers - mMenu.markDead(); - sSelf.markDead(); - if(trash_id == mUUID) { // This is the trash. @@ -3185,45 +3065,134 @@ void LLFolderBridge::buildContextMenuBaseOptions(LLMenuGL& menu, U32 flags) } } +void LLFolderBridge::buildContextMenuFolderOptions(U32 flags) +{ + // Build folder specific options back up + LLInventoryModel* model = getInventoryModel(); + if(!model) return; + + const LLInventoryCategory* category = model->getCategory(mUUID); + if(!category) return; + + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + if (trash_id == mUUID) return; + if (isItemInTrash()) return; + if (!isAgentInventory()) return; + if (isOutboxFolder()) return; + + LLFolderType::EType type = category->getPreferredType(); + const bool is_system_folder = LLFolderType::lookupIsProtectedType(type); + // BAP change once we're no longer treating regular categories as ensembles. + const bool is_ensemble = (type == LLFolderType::FT_NONE || + LLFolderType::lookupIsEnsembleType(type)); + + // Only enable calling-card related options for non-system folders. + if (!is_system_folder) + { + LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); + if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) + { + mItems.push_back(std::string("Calling Card Separator")); + mItems.push_back(std::string("Conference Chat Folder")); + mItems.push_back(std::string("IM All Contacts In Folder")); + } + } + + if (!isItemRemovable()) + { + mDisabledItems.push_back(std::string("Delete")); + } + +#ifndef LL_RELEASE_FOR_DOWNLOAD + if (LLFolderType::lookupIsProtectedType(type)) + { + mItems.push_back(std::string("Delete System Folder")); + } +#endif + + // wearables related functionality for folders. + //is_wearable + LLFindWearables is_wearable; + LLIsType is_object( LLAssetType::AT_OBJECT ); + LLIsType is_gesture( LLAssetType::AT_GESTURE ); + + if (mWearables || + checkFolderForContentsOfType(model, is_wearable) || + checkFolderForContentsOfType(model, is_object) || + checkFolderForContentsOfType(model, is_gesture) ) + { + mItems.push_back(std::string("Folder Wearables Separator")); + + // Only enable add/replace outfit for non-system folders. + if (!is_system_folder) + { + // Adding an outfit onto another (versus replacing) doesn't make sense. + if (type != LLFolderType::FT_OUTFIT) + { + mItems.push_back(std::string("Add To Outfit")); + } + + mItems.push_back(std::string("Replace Outfit")); + } + if (is_ensemble) + { + mItems.push_back(std::string("Wear As Ensemble")); + } + mItems.push_back(std::string("Remove From Outfit")); + if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID)) + { + mDisabledItems.push_back(std::string("Remove From Outfit")); + } + if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID)) + { + mDisabledItems.push_back(std::string("Replace Outfit")); + } + mItems.push_back(std::string("Outfit Separator")); + } +} + // Flags unused void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { + sSelf.markDead(); + mItems.clear(); mDisabledItems.clear(); - mContextMenuFlags = flags; lldebugs << "LLFolderBridge::buildContextMenu()" << llendl; LLInventoryModel* model = getInventoryModel(); if(!model) return; - buildContextMenuBaseOptions(menu, flags); - - hide_context_entries(menu, mItems, mDisabledItems); + buildContextMenuBaseOptions(flags); // Add menu items that are dependent on the contents of the folder. - uuid_vec_t folders; - LLViewerInventoryCategory* category = (LLViewerInventoryCategory*)model->getCategory(mUUID); + LLViewerInventoryCategory* category = (LLViewerInventoryCategory *) model->getCategory(mUUID); if (category) { + uuid_vec_t folders; folders.push_back(category->getUUID()); - } - mMenu = menu.getHandle(); - sSelf = getHandle(); - LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE); - fetch->startFetch(); - inc_busy_count(); - if(fetch->isFinished()) - { - // everything is already here - call done. - fetch->done(); - } - else - { - // it's all on its way - add an observer, and the inventory will call done for us when everything is here. - gInventory.addObserver(fetch); + sSelf = getHandle(); + LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE); + fetch->startFetch(); + inc_busy_count(); + if (fetch->isFinished()) + { + buildContextMenuFolderOptions(flags); + } + else + { + // it's all on its way - add an observer, and the inventory will call done for us when everything is here. + gInventory.addObserver(fetch); + } } + + hide_context_entries(menu, mItems, mDisabledItems); + + // Reposition the menu, in case we're adding items to an existing menu. + menu.needsArrange(); + menu.arrangeAndClear(); } BOOL LLFolderBridge::hasChildren() const -- cgit v1.2.3 From ea6cbc7b6b1de051a9bb1c311c4399a2b4d42cb3 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 23 Jan 2012 15:55:36 -0800 Subject: Reverting background fetch on an item to the old fetFromServer call to fix regression bug in inventory late loading --- indra/newview/llinventorybridge.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 9e21e2fceb..c0065a94e6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1324,7 +1324,8 @@ void LLItemBridge::selectItem() LLViewerInventoryItem* item = static_cast(getItem()); if(item && !item->isFinished()) { - LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false); + item->fetchFromServer(); + //LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false); } } -- cgit v1.2.3