From e23d51700733e98f966c540602038686cba98d4e Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 3 Dec 2009 14:06:08 -0500 Subject: EXT-2410 : Accepting an offered notecard should open the inventorySP Added logic to choose the side panel if it's open, or open the side panel if no other inventory panels are open. --HG-- branch : avatar-pipeline --- indra/newview/llsidetray.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'indra/newview/llsidetray.cpp') diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index ee62d689b5..43a3d10634 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -159,6 +159,7 @@ public: void onOpen (const LLSD& key); + LLPanel *getPanel(); private: std::string mTabTitle; std::string mImage; @@ -230,11 +231,17 @@ void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) void LLSideTrayTab::onOpen (const LLSD& key) { - LLPanel* panel = dynamic_cast(mMainPanel); + LLPanel *panel = getPanel(); if(panel) panel->onOpen(key); } +LLPanel* LLSideTrayTab::getPanel() +{ + LLPanel* panel = dynamic_cast(mMainPanel); + return panel; +} + LLSideTrayTab* LLSideTrayTab::createInstance () { LLSideTrayTab::Params tab_params; @@ -684,6 +691,23 @@ LLPanel* LLSideTray::getPanel (const std::string& panel_name) return NULL; } +LLPanel* LLSideTray::getActivePanel() +{ + if (mActiveTab) + { + return mActiveTab->getPanel(); + } + return NULL; +} + +bool LLSideTray::isPanelActive(const std::string& panel_name) +{ + LLPanel *panel = getActivePanel(); + if (!panel) return false; + return (panel->getName() == panel_name); +} + + // *TODO: Eliminate magic constants. static const S32 fake_offset = 132; static const S32 fake_top_offset = 18; -- cgit v1.2.3