From f01a8c4d78a037f42b99f2b0ebccf1fb9fa9eb32 Mon Sep 17 00:00:00 2001
From: Kitty Barnett <none@none>
Date: Tue, 24 Aug 2010 18:17:06 +0200
Subject: [PATCH] - fixed : @showinv=n doesn't disable the "My Outfits" panel
 under the "Appearance" sidebar tab anymore     -> SL-2.1 changed the "My
 Outfits" panel from LLInventoryPanel to LLOutfitsList

--HG--
branch : RLVa
---
 indra/newview/llpaneloutfitsinventory.cpp | 13 +++----------
 indra/newview/llpaneloutfitsinventory.h   | 11 ++++++-----
 indra/newview/rlvui.cpp                   | 20 ++++++++++----------
 3 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 7baeffab66..c6a7bd88a0 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -42,16 +42,9 @@
 #include "llsidepanelappearance.h"
 #include "llsidetray.h"
 #include "llviewerfoldertype.h"
-// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f)
-#include "rlvhandler.h"
-// [/RLVa:KB]
-
-//static const std::string OUTFITS_TAB_NAME = "outfitslist_tab";
-//static const std::string COF_TAB_NAME = "cof_tab";
-// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
-const std::string OUTFITS_TAB_NAME = "outfitslist_tab";
-const std::string COF_TAB_NAME = "cof_tab";
-// [/RLVa:KB]
+
+static const std::string OUTFITS_TAB_NAME = "outfitslist_tab";
+static const std::string COF_TAB_NAME = "cof_tab";
 
 static LLRegisterPanelClassWrapper<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory");
 
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index 48eb729350..a6443c4dca 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -39,11 +39,6 @@ class LLSidepanelAppearance;
 class LLTabContainer;
 class LLSaveOutfitComboBtn;
 
-// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
-extern const std::string OUTFITS_TAB_NAME;
-extern const std::string COF_TAB_NAME;
-// [/RLVa:KB]
-
 class LLPanelOutfitsInventory : public LLPanel
 {
 	LOG_CLASS(LLPanelOutfitsInventory);
@@ -61,6 +56,12 @@ public:
 
 	static LLSidepanelAppearance* getAppearanceSP();
 
+// [RLVa:KB] - Checked: 2010-08-24 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
+	LLTabContainer* getAppearanceTabs()		{ return mAppearanceTabs; }
+	LLOutfitsList*  getMyOutfitsPanel()		{ return mMyOutfitsPanel; }
+	LLPanelWearing* getCurrentOutfitPanel()	{ return mCurrentOutfitPanel; }
+// [/RLVa:KB]
+
 	static LLPanelOutfitsInventory* findInstance();
 
 protected:
diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp
index 1100ef60e5..def9beb412 100644
--- a/indra/newview/rlvui.cpp
+++ b/indra/newview/rlvui.cpp
@@ -24,9 +24,11 @@
 #include "llmoveview.h"					// Movement panel (contains "Stand" and "Stop Flying" buttons)
 #include "llnavigationbar.h"			// Navigation bar
 #include "llnotificationsutil.h"
+#include "lloutfitslist.h"				// "My Outfits" sidebar panel
 #include "llpaneloutfitsinventory.h"	// "My Appearance" sidebar panel
 #include "llpanelpeople.h"				// "People" sidebar panel
 #include "llpanelprofile.h"				// "Profile" sidebar panel
+#include "llpanelwearing.h"				// "Current Outfit" sidebar panel
 #include "llparcel.h"
 #include "llsidetray.h"
 #include "llsidetraypanelcontainer.h"
@@ -166,7 +168,7 @@ void RlvUIEnabler::onToggleSetEnv()
 	}
 }
 
-// Checked: 2010-03-01 (RLVa-1.2.0b) | Added: RLVa-1.2.0a
+// Checked: 2010-08-24 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a
 void RlvUIEnabler::onToggleShowInv()
 {
 	bool fEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV);
@@ -204,22 +206,20 @@ void RlvUIEnabler::onToggleShowInv()
 	//
 	// Enable/disable the "My Outfits" panel on the "My Appearance" sidebar tab
 	//
-	LLPanelOutfitsInventory* pAppearancePanel =
-		dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory"));
-	RLV_ASSERT(pAppearancePanel);
+	LLPanelOutfitsInventory* pAppearancePanel = LLPanelOutfitsInventory::findInstance();
 	if (pAppearancePanel)
 	{
-		LLTabContainer* pAppearanceTabs = pAppearancePanel->getChild<LLTabContainer>("appearance_tabs");
-		LLInventoryPanel* pOutfitsPanel = pAppearancePanel->getChild<LLInventoryPanel>(OUTFITS_TAB_NAME);
-		RLV_ASSERT( (pAppearanceTabs) && (pOutfitsPanel) );
-		if ( (pAppearanceTabs) && (pOutfitsPanel) )
+		LLTabContainer* pAppearanceTabs = pAppearancePanel->getAppearanceTabs();
+		LLOutfitsList* pMyOutfitsPanel = pAppearancePanel->getMyOutfitsPanel();
+		if ( (pAppearanceTabs) && (pMyOutfitsPanel) )
 		{
-			S32 idxTab = pAppearanceTabs->getIndexForPanel(pOutfitsPanel);
+			S32 idxTab = pAppearanceTabs->getIndexForPanel(pMyOutfitsPanel);
+			RLV_ASSERT(-1 != idxTab);
 			pAppearanceTabs->enableTabButton(idxTab, fEnable);
 
 			// When disabling, switch to the COF tab if "My Outfits" is currently active
 			if ( (!fEnable) && (pAppearanceTabs->getCurrentPanelIndex() == idxTab) )
-				pAppearanceTabs->selectTabByName(COF_TAB_NAME);
+				pAppearanceTabs->selectTabPanel(pAppearancePanel->getCurrentOutfitPanel());
 		}
 	}
 
-- 
GitLab