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 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