From 209a660f08c9278166b94750cbb2c3e2a2ee15a9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 7 Dec 2009 17:56:34 -0500 Subject: For EXT-2858: Determine gear menu / right-click menu choices for AppearanceSP --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4c28d5e2df..28b982d386 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2455,6 +2455,8 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back(std::string("Wear As Ensemble")); } mItems.push_back(std::string("Remove From Outfit")); + if (is_sidepanel) + mItems.push_back(std::string("Outfit Separator")); } hide_context_entries(*mMenu, mItems, disabled_items); -- cgit v1.2.3 From d4b888d47840d57b071dd2cf6dea492c4230e4b4 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 8 Dec 2009 17:31:02 -0500 Subject: EXT-3133: Viewer crashes after deleting a Trash folder from the My Inventory accordion Put in a quick fix so that folders can't be made reparented to their own children. --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 78 +++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 37 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 28b982d386..ea47013781 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -714,20 +714,20 @@ BOOL LLInvFVBridge::isItemPermissive() const // static void LLInvFVBridge::changeItemParent(LLInventoryModel* model, LLViewerInventoryItem* item, - const LLUUID& new_parent, + const LLUUID& new_parent_id, BOOL restamp) { - if(item->getParentUUID() != new_parent) + if(item->getParentUUID() != new_parent_id) { LLInventoryModel::update_list_t update; LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1); update.push_back(old_folder); - LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1); update.push_back(new_folder); gInventory.accountForUpdate(update); LLPointer new_item = new LLViewerInventoryItem(item); - new_item->setParent(new_parent); + new_item->setParent(new_parent_id); new_item->updateParentOnServer(restamp); model->updateItem(new_item); model->notifyObservers(); @@ -737,24 +737,27 @@ void LLInvFVBridge::changeItemParent(LLInventoryModel* model, // static void LLInvFVBridge::changeCategoryParent(LLInventoryModel* model, LLViewerInventoryCategory* cat, - const LLUUID& new_parent, + const LLUUID& new_parent_id, BOOL restamp) { - if(cat->getParentUUID() != new_parent) + // Can't move a folder into a child of itself. + if (model->isObjectDescendentOf(new_parent_id, cat->getUUID())) { - LLInventoryModel::update_list_t update; - LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1); - update.push_back(old_folder); - LLInventoryModel::LLCategoryUpdate new_folder(new_parent, 1); - update.push_back(new_folder); - gInventory.accountForUpdate(update); - - LLPointer new_cat = new LLViewerInventoryCategory(cat); - new_cat->setParent(new_parent); - new_cat->updateParentOnServer(restamp); - model->updateCategory(new_cat); - model->notifyObservers(); + return; } + + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1); + update.push_back(new_folder); + model->accountForUpdate(update); + + LLPointer new_cat = new LLViewerInventoryCategory(cat); + new_cat->setParent(new_parent_id); + new_cat->updateParentOnServer(restamp); + model->updateCategory(new_cat); + model->notifyObservers(); } @@ -2243,11 +2246,6 @@ BOOL LLFolderBridge::removeItem() LLNotification::Params params("ConfirmDeleteProtectedCategory"); params.payload(payload).substitutions(args).functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2)); - //params.functor.function(boost::bind(&LLFolderBridge::removeItemResponse, this, _1, _2)); - /* - LLNotification::Params params("ChangeLindenEstate"); - params.functor.function(boost::bind(&LLPanelEstateInfo::callbackChangeLindenEstate, this, _1, _2)); - */ if (LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { LLNotifications::instance().add(params); @@ -2278,14 +2276,16 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re LLInventoryModel::item_array_t descendent_items; gInventory.collectDescendents( mUUID, descendent_categories, descendent_items, FALSE ); - S32 i; - for (i = 0; i < descendent_items.count(); i++) + for (LLInventoryModel::item_array_t::const_iterator iter = descendent_items.begin(); + iter != descendent_items.end(); + ++iter) { - LLInventoryItem* item = descendent_items[i]; + const LLInventoryItem* item = (*iter); + const LLUUID& item_id = item->getUUID(); if (item->getType() == LLAssetType::AT_GESTURE - && LLGestureManager::instance().isGestureActive(item->getUUID())) + && LLGestureManager::instance().isGestureActive(item_id)) { - LLGestureManager::instance().deactivateGesture(item->getUUID()); + LLGestureManager::instance().deactivateGesture(item_id); } } @@ -2306,14 +2306,16 @@ void LLFolderBridge::pasteFromClipboard() LLInventoryModel* model = getInventoryModel(); if(model && isClipboardPasteable()) { - LLInventoryItem* item = NULL; + const LLUUID parent_id(mUUID); + LLDynamicArray objects; LLInventoryClipboard::instance().retrieve(objects); - S32 count = objects.count(); - const LLUUID parent_id(mUUID); - for(S32 i = 0; i < count; i++) + for (LLDynamicArray::const_iterator iter = objects.begin(); + iter != objects.end(); + ++iter) { - item = model->getItem(objects.get(i)); + const LLUUID& item_id = (*iter); + LLInventoryItem *item = model->getItem(item_id); if (item) { if(LLInventoryClipboard::instance().isCutMode()) @@ -2342,13 +2344,15 @@ void LLFolderBridge::pasteLinkFromClipboard() const LLInventoryModel* model = getInventoryModel(); if(model) { + const LLUUID parent_id(mUUID); + LLDynamicArray objects; LLInventoryClipboard::instance().retrieve(objects); - S32 count = objects.count(); - LLUUID parent_id(mUUID); - for(S32 i = 0; i < count; i++) + for (LLDynamicArray::const_iterator iter = objects.begin(); + iter != objects.end(); + ++iter) { - const LLUUID &object_id = objects.get(i); + const LLUUID &object_id = (*iter); #if SUPPORT_ENSEMBLES if (LLInventoryCategory *cat = model->getCategory(object_id)) { -- cgit v1.2.3 From 019fc578550fd93eb404dd1ddab2b629bd0688fe Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 9 Dec 2009 11:34:44 -0500 Subject: fix for linux build breakage, a LLPointer was being implicitly cast wrong approved by Seraph --HG-- branch : avatar-pipeline --- 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 ea47013781..3746e9cfeb 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2280,7 +2280,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re iter != descendent_items.end(); ++iter) { - const LLInventoryItem* item = (*iter); + const LLViewerInventoryItem* item = (*iter); const LLUUID& item_id = item->getUUID(); if (item->getType() == LLAssetType::AT_GESTURE && LLGestureManager::instance().isGestureActive(item_id)) -- cgit v1.2.3 From 522463108b61a740f64908242d347da5a3cccf62 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 9 Dec 2009 19:12:05 -0500 Subject: For EXT-2858: Determine gear menu / right-click menu choices for AppearanceSP --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ea47013781..d9a5f1837f 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -67,6 +67,8 @@ using namespace LLOldEvents; +bool isInOutfitsSidePanel(LLPanel *panel); + // Helpers // bug in busy count inc/dec right now, logic is complex... do we really need it? void inc_busy_count() @@ -566,8 +568,15 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } items.push_back(std::string("Paste Separator")); + + if (obj && obj->getIsLinkType()) + { + items.push_back(std::string("Remove")); + } + items.push_back(std::string("Delete")); - if (!isItemRemovable()) + const bool is_sidepanel = isInOutfitsSidePanel(mInventoryPanel.get()); + if ((obj && obj->getIsLinkType() && is_sidepanel) || !isItemRemovable()) { disabled_items.push_back(std::string("Delete")); } -- cgit v1.2.3 From ca56ac217900e1fbbc56b04bd52704117b2d348c Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 10 Dec 2009 15:11:02 -0500 Subject: EXT-3329 : Able to delete system folder is confusing - disable from non-god mode --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3746e9cfeb..1aad8fbb3a 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1408,13 +1408,14 @@ BOOL LLFolderBridge::isItemRemovable() { return FALSE; } + // Allow protected types to be removed, but issue a warning. - /* - if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) + // Restrict to god mode so users don't inadvertently mess up their inventory. + if(LLFolderType::lookupIsProtectedType(category->getPreferredType()) && + !gAgent.isGodlike()) { return FALSE; } - */ LLInventoryPanel* panel = dynamic_cast(mInventoryPanel.get()); LLFolderViewFolder* folderp = dynamic_cast(panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL); -- cgit v1.2.3 From 6af53dd7e2e8c344847dd6936181c545db8e8778 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 10 Dec 2009 15:31:08 -0500 Subject: For EXT-2858: Determine gear menu / right-click menu choices for AppearanceSP --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4e2acf9907..ba72489bd6 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -67,8 +67,6 @@ using namespace LLOldEvents; -bool isInOutfitsSidePanel(LLPanel *panel); - // Helpers // bug in busy count inc/dec right now, logic is complex... do we really need it? void inc_busy_count() @@ -571,11 +569,11 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, if (obj && obj->getIsLinkType()) { - items.push_back(std::string("Remove")); + items.push_back(std::string("Remove Link")); } items.push_back(std::string("Delete")); - const bool is_sidepanel = isInOutfitsSidePanel(mInventoryPanel.get()); + const bool is_sidepanel = isInOutfitsSidePanel(); if ((obj && obj->getIsLinkType() && is_sidepanel) || !isItemRemovable()) { disabled_items.push_back(std::string("Delete")); @@ -922,6 +920,16 @@ void LLInvFVBridge::purgeItem(LLInventoryModel *model, const LLUUID &uuid) } } +bool LLInvFVBridge::isInOutfitsSidePanel() const +{ + LLInventoryPanel *my_panel = dynamic_cast(mInventoryPanel.get()); + LLPanelOutfitsInventory *outfit_panel = + dynamic_cast(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); + if (!outfit_panel) + return false; + return outfit_panel->isAccordionPanel(my_panel); +} + // +=================================================+ // | InventoryFVBridgeBuilder | // +=================================================+ @@ -2395,21 +2403,10 @@ void LLFolderBridge::staticFolderOptionsMenu() sSelf->folderOptionsMenu(); } -bool isInOutfitsSidePanel(LLPanel *panel) -{ - LLInventoryPanel *my_panel = dynamic_cast(panel); - LLPanelOutfitsInventory *outfit_panel = - dynamic_cast(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); - if (!outfit_panel) - return false; - return outfit_panel->isAccordionPanel(my_panel); - - //LLInventoryPanel *outfit_inv_panel = outfit_panel ? outfit_panel->getActivePanel(): NULL; - //return (my_panel && (my_panel == outfit_inv_panel)); -} - void LLFolderBridge::folderOptionsMenu() { + const bool is_sidepanel = isInOutfitsSidePanel(); + std::vector disabled_items; LLInventoryModel* model = getInventoryModel(); @@ -2421,13 +2418,11 @@ void LLFolderBridge::folderOptionsMenu() // BAP change once we're no longer treating regular categories as ensembles. const bool is_ensemble = category && (type == LLFolderType::FT_NONE || LLFolderType::lookupIsEnsembleType(type)); - const bool is_sidepanel = isInOutfitsSidePanel(mInventoryPanel.get()); // calling card related functionality for folders. if (is_sidepanel) { - mItems.clear(); mItems.push_back("Rename"); mItems.push_back("Delete"); } -- cgit v1.2.3 From 9db47b1d4bc9c24adf23f862c729464d9422e6a3 Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Thu, 10 Dec 2009 16:07:54 -0500 Subject: Fix for EXT-3368 - "Save Texture" functionality was no longer respecting perms --- indra/newview/llinventorybridge.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3746e9cfeb..52ebefabea 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3150,6 +3150,22 @@ void LLTextureBridge::openItem() } } +bool LLTextureBridge::canSaveTexture(void) +{ + const LLInventoryModel* model = getInventoryModel(); + if(!model) + { + return false; + } + + const LLViewerInventoryItem *item = model->getItem(mUUID); + if (item) + { + return item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); + } + return false; +} + void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { lldebugs << "LLTextureBridge::buildContextMenu()" << llendl; @@ -3174,6 +3190,10 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Texture Separator")); items.push_back(std::string("Save As")); + if (!canSaveTexture()) + { + disabled_items.push_back(std::string("Save As")); + } } hide_context_entries(menu, items, disabled_items); } -- cgit v1.2.3 From e7ef47e8258a1a1fa1ccca467f8a20ab9eccfb68 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 10 Dec 2009 18:19:23 -0500 Subject: For EXT-2858: Determine gear menu / right-click menu choices for AppearanceSP --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 48 ++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 14 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ba72489bd6..2e781e59a7 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2405,8 +2405,6 @@ void LLFolderBridge::staticFolderOptionsMenu() void LLFolderBridge::folderOptionsMenu() { - const bool is_sidepanel = isInOutfitsSidePanel(); - std::vector disabled_items; LLInventoryModel* model = getInventoryModel(); @@ -2421,6 +2419,7 @@ void LLFolderBridge::folderOptionsMenu() // calling card related functionality for folders. + const bool is_sidepanel = isInOutfitsSidePanel(); if (is_sidepanel) { mItems.push_back("Rename"); @@ -2492,14 +2491,13 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mDisabledItems.clear(); lldebugs << "LLFolderBridge::buildContextMenu()" << llendl; + // std::vector disabled_items; LLInventoryModel* model = getInventoryModel(); if(!model) return; const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); const LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); - mItems.clear(); //adding code to clear out member Items (which means Items should not have other data here at this point) - mDisabledItems.clear(); //adding code to clear out disabled members from previous if (lost_and_found_id == mUUID) { // This is the lost+found folder. @@ -2528,7 +2526,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) 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 /*&& + if (!isCOFFolder() && cat && cat->getPreferredType()!=LLFolderType::FT_OUTFIT /*&& LLAssetType::lookupIsProtectedCategoryType(cat->getPreferredType())*/) { // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. @@ -3780,10 +3778,15 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Open")); - items.push_back(std::string("Properties")); + bool is_sidepanel = isInOutfitsSidePanel(); - getClipboardEntries(true, items, disabled_items, flags); + if (!is_sidepanel) + { + items.push_back(std::string("Open")); + items.push_back(std::string("Properties")); + + getClipboardEntries(true, items, disabled_items, flags); + } items.push_back(std::string("Gesture Separator")); if (LLGestureManager::instance().isGestureActive(getUUID())) @@ -4105,13 +4108,21 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - items.push_back(std::string("Properties")); + bool is_sidepanel = isInOutfitsSidePanel(); - LLInventoryItem *item = getItem(); - getClipboardEntries(true, items, disabled_items, flags); + if (!is_sidepanel) + { + items.push_back(std::string("Properties")); + } + + if (!is_sidepanel) + { + getClipboardEntries(true, items, disabled_items, flags); + } LLObjectBridge::sContextMenuItemID = mUUID; + LLInventoryItem *item = getItem(); if(item) { LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); @@ -4537,14 +4548,23 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { can_open = FALSE; } - if (can_open) + + bool is_sidepanel = isInOutfitsSidePanel(); + + if (can_open && !is_sidepanel) { items.push_back(std::string("Open")); } - items.push_back(std::string("Properties")); + if (!is_sidepanel) + { + items.push_back(std::string("Properties")); + } - getClipboardEntries(true, items, disabled_items, flags); + if (!is_sidepanel) + { + getClipboardEntries(true, items, disabled_items, flags); + } items.push_back(std::string("Wearable Separator")); -- cgit v1.2.3 From b131314dba9e50b260e30ebd3f3bbeb626563a9c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 10 Dec 2009 18:39:44 -0500 Subject: Fix for r. click Edit on a link to wearable --HG-- branch : avatar-pipeline --- 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 2e781e59a7..56d3745309 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4768,7 +4768,8 @@ void LLWearableBridge::onEditOnAvatar(void* user_data) void LLWearableBridge::editOnAvatar() { - const LLWearable* wearable = gAgentWearables.getWearableFromItemID(mUUID); + LLUUID linked_id = gInventory.getLinkedItemID(mUUID); + const LLWearable* wearable = gAgentWearables.getWearableFromItemID(linked_id); if( wearable ) { // Set the tab to the right wearable. -- cgit v1.2.3 From 264446a5ce3739ab186b9fbdfc81847590404c86 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 10 Dec 2009 19:35:58 -0500 Subject: For EXT-2858: Determine gear menu / right-click menu choices for AppearanceSP --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 68 +++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 15 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 56d3745309..0ec019c4f9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -506,12 +506,57 @@ void hide_context_entries(LLMenuGL& menu, } } +bool isWornLink(LLUUID link_id) +{ + LLViewerInventoryItem *link = gInventory.getItem(link_id); + if (!link) + return false; + LLViewerInventoryItem *item = link->getLinkedItem(); + if (!item) + return false; + + switch(item->getType()) + { + case LLAssetType::AT_OBJECT: + { + LLVOAvatarSelf* my_avatar = gAgent.getAvatarObject(); + if(my_avatar && my_avatar->isWearingAttachment(item->getUUID())) + return true; + } + break; + + case LLAssetType::AT_BODYPART: + case LLAssetType::AT_CLOTHING: + if(gAgentWearables.isWearingItem(item->getUUID())) + return true; + break; + + case LLAssetType::AT_GESTURE: + if (LLGestureManager::instance().isGestureActive(item->getUUID())) + return true; + break; + } + return false; +} + // Helper for commonly-used entries void LLInvFVBridge::getClipboardEntries(bool show_asset_id, std::vector &items, std::vector &disabled_items, U32 flags) { const LLInventoryObject *obj = getInventoryObject(); + + bool is_sidepanel = isInOutfitsSidePanel(); + if (is_sidepanel) + { + // Sidepanel includes restricted menu. + if (obj && obj->getIsLinkType() && !isWornLink(mUUID)) + { + items.push_back(std::string("Remove Link")); + } + return; + } + if (obj) { if (obj->getIsLinkType()) @@ -567,14 +612,13 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, items.push_back(std::string("Paste Separator")); - if (obj && obj->getIsLinkType()) + if (obj && obj->getIsLinkType() && !isWornLink(mUUID)) { items.push_back(std::string("Remove Link")); } items.push_back(std::string("Delete")); - const bool is_sidepanel = isInOutfitsSidePanel(); - if ((obj && obj->getIsLinkType() && is_sidepanel) || !isItemRemovable()) + if (!isItemRemovable()) { disabled_items.push_back(std::string("Delete")); } @@ -3784,10 +3828,10 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("Open")); items.push_back(std::string("Properties")); - - getClipboardEntries(true, items, disabled_items, flags); } + getClipboardEntries(true, items, disabled_items, flags); + items.push_back(std::string("Gesture Separator")); if (LLGestureManager::instance().isGestureActive(getUUID())) { @@ -4115,10 +4159,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Properties")); } - if (!is_sidepanel) - { - getClipboardEntries(true, items, disabled_items, flags); - } + getClipboardEntries(true, items, disabled_items, flags); LLObjectBridge::sContextMenuItemID = mUUID; @@ -4561,15 +4602,10 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Properties")); } - if (!is_sidepanel) - { - getClipboardEntries(true, items, disabled_items, flags); - } + getClipboardEntries(true, items, disabled_items, flags); items.push_back(std::string("Wearable Separator")); - items.push_back(std::string("Wearable Wear")); - items.push_back(std::string("Wearable Add")); items.push_back(std::string("Wearable Edit")); if ((flags & FIRST_SELECTED_ITEM) == 0) @@ -4599,6 +4635,8 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { + items.push_back(std::string("Wearable Wear")); + items.push_back(std::string("Wearable Add")); disabled_items.push_back(std::string("Take Off")); } break; -- cgit v1.2.3 From 1f3a55470919bf451f9c45b454d9bbf815a3e88a Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Fri, 11 Dec 2009 14:16:46 -0500 Subject: Minor gcc compile fix --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 1ff6f00cc5..26a8a707b8 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -535,6 +535,8 @@ bool isWornLink(LLUUID link_id) if (LLGestureManager::instance().isGestureActive(item->getUUID())) return true; break; + default: + break; } return false; } -- cgit v1.2.3 From ae8c1d1ea87b524797b2986f853745c0a124246c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 11 Dec 2009 18:49:29 -0500 Subject: For EXT-3264: Missing separators in inventory context menus - restore --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorybridge.cpp') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0ec019c4f9..4abe93322a 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2506,8 +2506,8 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back(std::string("Wear As Ensemble")); } mItems.push_back(std::string("Remove From Outfit")); - if (is_sidepanel) - mItems.push_back(std::string("Outfit Separator")); + + mItems.push_back(std::string("Outfit Separator")); } hide_context_entries(*mMenu, mItems, disabled_items); -- cgit v1.2.3