- internal : revert backing out the sidetray validation signal in changeset 43746f48573c

-> fallback which would have caught the bug fixed in the previous changeset (not technically needed but could help with TPVs that mangle the sidebar in different ways)

--HG--
branch : RLVa
meow-7.2.2
Kitty Barnett 2011-05-26 23:50:00 +02:00
parent 74183043c2
commit edef7c480d
3 changed files with 30 additions and 7 deletions

View File

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

View File

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

View File

@ -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
*/