diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index d8afd20e58..3ac14bfd45 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -724,8 +724,8 @@ LLPanel* LLSideTray::openChildPanel(LLSideTrayTab* tab, const std::string& panel if ( (pTabBtn) && (!pTabBtn->getEnabled()) ) return NULL; - // NOTE: - "panel_name" is a name of a panel *inside* of the tab, not the name of the tab that's being switched to - if ( (mValidateSignal) && (!(*mValidateSignal)(tab, LLSD(tab_name))) ) + // NOTE: "panel_name" is a name of a panel *inside* of the tab, not the name of the tab that's being switched to + if ( (mValidateSignal) && (!(*mValidateSignal)(tab, LLSD(panel_name))) ) return NULL; // [/RLVa:KB] @@ -790,11 +790,15 @@ bool LLSideTray::selectTabByName(const std::string& name, bool keep_prev_visible if (new_tab == mActiveTab) return false; -// [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.2.2c) | Added: RLVa-1.2.2c +// [RLVa:KB] - Checked: 2011-05-26 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a // Don't switch to a tab if its tab button is disabled const LLButton* pTabBtn = getButtonFromName(new_tab->getName()); if ( (pTabBtn) && (!pTabBtn->getEnabled()) ) return false; + + // Fire the validation signal to see if anyone objects to this tab being selected + if ( (mValidateSignal) && (!(*mValidateSignal)(new_tab, LLSD())) ) + return false; // [/RLVa:KB] //deselect old tab diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index 0123d356d5..566e91c38a 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -273,11 +273,20 @@ void RlvUIEnabler::onToggleShowInv(bool fQuitting) (*itFloater)->closeFloater(); } - // Filter out (or stop filtering) newly spawned old style inventory floaters + // + // Filter (or stop filtering) opening the inventory sidebar tab and spawning old style inventory floaters + // + RLV_ASSERT_DBG( (fEnable) || (!m_ConnSidePanelInventory.connected()) ); if (!fEnable) + { + m_ConnSidePanelInventory = pSideTray->setValidateCallback(boost::bind(&RlvUIEnabler::canOpenSidebarTab, this, RLV_BHVR_SHOWINV, "sidebar_inventory", _1, _2)); addGenericFloaterFilter("inventory"); + } else + { + m_ConnSidePanelInventory.disconnect(); removeGenericFloaterFilter("inventory"); + } } // Checked: 2010-04-22 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f @@ -527,6 +536,13 @@ bool RlvUIEnabler::filterFloaterViewXXX(const std::string& strName, const LLSD&) return true; } +// Checked: 2010-03-01 (RLVa-1.4.0a) | Added: RLVa-1.2.0a +bool RlvUIEnabler::canOpenSidebarTab(ERlvBehaviour eBhvrFilter, const std::string& strNameFilter, LLUICtrl* pCtrl, const LLSD& sdParam) +{ + // NOTE: pCtrl->getName() is the name of the sidebar tab and sdParam is the name of the child panel being activated (can be omitted) + return (!gRlvHandler.hasBehaviour(eBhvrFilter)) || (strNameFilter != pCtrl->getName()); +} + // ============================================================================ // Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f diff --git a/indra/newview/rlvui.h b/indra/newview/rlvui.h index 2e88de23c5..c21c3c245f 100644 --- a/indra/newview/rlvui.h +++ b/indra/newview/rlvui.h @@ -60,20 +60,23 @@ protected: void onToggleViewXXX(); // viewnote, viewscript, viewtexture void onUpdateLoginLastLocation(); // tploc and unsit - /* - * Floater validation callbacks + /* + * Floater and sidebar validation callbacks */ protected: void addGenericFloaterFilter(const std::string& strFloaterName); void removeGenericFloaterFilter(const std::string& strFloaterName); + bool filterFloaterGeneric(const std::string&, const LLSD&); boost::signals2::connection m_ConnFloaterGeneric; - bool filterFloaterShowLoc(const std::string&, const LLSD& ); boost::signals2::connection m_ConnFloaterShowLoc; // showloc bool filterFloaterViewXXX(const std::string&, const LLSD&); boost::signals2::connection m_ConnFloaterViewXXX; // viewnote, viewscript, viewtexture + bool canOpenSidebarTab(ERlvBehaviour, const std::string&, LLUICtrl*, const LLSD&); + boost::signals2::connection m_ConnSidePanelInventory; // showinv + /* * Helper functions */