From e1cd91de4e9f3847f185d8b2ffc5ba3a545340fb Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Tue, 24 Nov 2009 12:49:36 -0500
Subject: [PATCH] For EXT-2571: Right click context menu for Outfits

--HG--
branch : avatar-pipeline
---
 indra/newview/llinventorybridge.cpp | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index db079de593d..628db462818 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -62,6 +62,7 @@
 #include "llviewerwindow.h"
 #include "llvoavatarself.h"
 #include "llwearablelist.h"
+#include "llpaneloutfitsinventory.h"
 
 using namespace LLOldEvents;
 
@@ -2340,6 +2341,15 @@ void LLFolderBridge::staticFolderOptionsMenu()
 	sSelf->folderOptionsMenu();
 }
 
+bool isInOutfitsSidePanel(LLPanel *panel)
+{
+	LLInventoryPanel *my_panel = dynamic_cast<LLInventoryPanel*>(panel);
+	LLPanelOutfitsInventory *outfit_panel =
+		dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory"));
+	LLInventoryPanel *outfit_inv_panel = outfit_panel ? outfit_panel->getActivePanel(): NULL;
+	return (my_panel && (my_panel == outfit_inv_panel));
+}
+
 void LLFolderBridge::folderOptionsMenu()
 {
 	std::vector<std::string> disabled_items;
@@ -2353,11 +2363,17 @@ 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();
+	}
+
 	// Only enable calling-card related options for non-default folders.
-	if (!is_default_folder)
+	if (!is_sidepanel && !is_default_folder)
 	{
 		LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD);
 		if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard))
-- 
GitLab